Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: macbook pro hd install (multiple os)

  1. #1
    Just burned his ISO
    Join Date
    Jul 2007
    Posts
    24

    Default macbook pro hd install (multiple os)

    i know i know, macs aren't real popular here, but i just bought my first mac a few months ago and now i love my macbook pro. and i got it cheap! my system is setup to triple boot osx, ubuntu, and bt4. some of what i setup could be done differently if you are only looking to dual boot or triple boot with a windows os, i'll note differences as i go.

    yes i also understand that i'm probably crazy for going through all this to get bt4 up and running the way i wanted. first, i did it because it was a great learning experience, and second, you'll never hear me claim i'm not crazy.

    hardware

    this howto was put together on the following laptop:
    Code:
    root@bt:~# dmidecode -s system-product-name
    MacBookPro4,1
    lspci output here:
    hxxp://backtrack.offensive-security.com/index.php/HCL:Laptops:MBP-2008-1-lspci

    if you have a different version of mac hardware some of it still may apply, but i wouldn't assume anything if i were you.

    partitioning

    there is a really good overview of the issues and limitations about partitioning your macbook pro to dual or triple boot and instead of duplicating that information i'll just send you there, come back when you are done though

    http://wiki.onmac.net/index.php/Trip...t_via_BootCamp

    i partitioned my disk using disk utility in osx, creating a layout that shows as 3 partitions (linux will see it as 4 in the MBR, the fourth being an EFI partition). osx has 100GB, ubuntu has 50GB, and bt4 has 35GB. relative sizes are of course up to you, i keep all my music on the osx partition because linux can read hfs+. if you are triple booting with windows it might make sense to have your NTFS partition the largest because you'll be able to write to it from osx and linux. you can just mark the partitions as FAT while in osx, they'll get reformatted anyway later.

    linux will eventually see the disk like this when we are done:
    /dev/sda
    /dev/sda1 - EFI
    /dev/sda2 - HFS+ (osx)
    /dev/sda3 - Ext3 (ubuntu)
    /dev/sda4 - Reiser

    boot loader

    Boot Camp cannot handle a triple boot system and i read that it is currently recommended to boot Linux through BIOS compatibility mode using LILO or GRUB, otherwise, the fully accelerated ATI and Intel graphics drivers will not work. so i chose to go with rEFIt as a boot loader and have been very happy with it. it will be required to get through this howto:

    http://refit.sourceforge.net/

    so you have rEFIt installed and your hard drive partitioned. i have found it is better to be safe than sorry when it comes to keeping the GPT and MBR in sync (you did read about paritioning your mac right?), so lets make sure they are. boot to rEFIt, there is an option called "partition tool" select it and press enter. it will check that the two are sync'ed and offer to do so if they are not, if it needs to sync choose "Y" and exit out.

    hd install

    boot to your bt4 beta dvd (rEFIt should pick it right up, no need to hold down the option key anymore). i followed the great howto here:

    http://forums.remote-exploit.org/sho...ght=hd+install

    with modifications because of the partitioning limitations due to triple booting the mac. each linux install in my setup can only have one partition, that means no swap or boot partition. supposedly a swap file should perform just as well as a swap partition in a 2.6 kernel, so if you are only dual booting its probably better to go with a boot partion and mount it read only.

    [SIZE="2"]step 1 /SIZE] you can skip, partitioning was done in osx

    step 2 format, mount, copy, chroot

    Code:
    mkreiserfs /dev/sda4
    mkdir /mnt/bt
    mount /dev/sda4 /mnt/bt
    cp --preserve -R \
    /{bin,dev,home,pentest,root,usr,boot,etc,lib,opt,sbin,var} /mnt/bt
    mkdir /mnt/bt/{mnt,tmp,proc,sys}
    chmod 1777 /mnt/bt/tmp/
    mount -t proc proc /mnt/bt/proc
    mount -o bind /dev /mnt/bt/dev/
    chroot /mnt/bt/ /bin/bash
    step 3 lilo config
    Code:
    lba32
    boot=/dev/sda
    root=/dev/sda4
    
    # bitmap=/boot/sarge.bmp
    # bmp-colors=1,,0,2,,0
    
    
    # bmp-table=120p,173p,1,15,17
    # bmp-timer=254p,432p,1,0,0
    # install=bmp
    # delay=20
    
    prompt
    timeout=50
    
    # map=/boot/map
    
    vga=0x317
    
    image=/boot/vmlinuz
            label="BT4"
            read-only
            initrd=/boot/splash.initrd
            append=quiet
    step 4 /etc/fstab
    Code:
    /dev/sda4 / reiserfs defaults 0 0 # AutoUpdate
    proc /proc proc defaults 0 0 # AutoUpdate
    sysfs /sys sysfs defaults 0 0 # AutoUpdate
    devpts /dev/pts devpts gid=5,mode=620 0 0 # AutoUpdate
    tmpfs /dev/shm tmpfs defaults 0 0 # AutoUpdate
    step 5 lilo installation

    to get rEFIt to properly boot to the new installation install lilo to the partition not the MBR

    Code:
    lilo -v -b /dev/sda4
    and reboot the computer. you will come back up to rEFIt. because the partition type has changed you need to resync the GPT and MBR, choose the rEFIt partition tool again and let it do its magic.

    now shut down your computer...

    note that i said "shut down" not reboot. this part sucks, it turns out that rEFIt can have issues booting to the new installation and will just freeze. the only way through this is to shut down and try to boot, shut down and try to boot, shut down and, you get the idea. eventually (it has taken anywhere between 2 and 5 tries for me) it will successfully boot into bt4.

    ok, we are done! well, not really, not even close, more to come...

  2. #2
    Just burned his ISO
    Join Date
    Jul 2007
    Posts
    24

    Default broadcom wireless woes

    it turns out that this laptop has a Broadcom card, to be specific it has:

    Code:
    root@bt:/# lspci -nn | grep Broadcom
    0b:00.0 Network controller [0280]: Broadcom Corporation BCM4328 802.11a/b/g/n [14e4:4328] (rev 05)
    the open source b43 driver does not yet support the 4328 so plan on buying a usb dongle if you want anything more than basic functionality. you could use ndiswrapper for this card, but performance will suffer and i've been told you wont be able to spoof your MAC address. the best alternative is to use the linux_sta driver as stated on the wireless HCL over in the wiki. so go download the driver source compile it and load up the module right, no, not quite...

    the card is detected out of the box in bt4 by the ssb driver:
    Code:
    root@bt:/# lspci -v | grep -A13 Broadcom
    0b:00.0 Network controller: Broadcom Corporation BCM4328 802.11a/b/g/n (rev 05)
            Subsystem: Apple Computer Inc. Device 008c
            Flags: bus master, fast devsel, latency 0, IRQ 16
            Memory at 97300000 (64-bit, non-prefetchable) [size=16K]
            Capabilities: [40] Power Management version 3
            Capabilities: [58] Vendor Specific Information <?>
            Capabilities: [e8] Message Signalled Interrupts: Mask- 64bit+ Queue=0/0 Enable-
            Capabilities: [d0] Express Endpoint, MSI 00
            Capabilities: [100] Advanced Error Reporting <?>
            Capabilities: [13c] Virtual Channel <?>
            Capabilities: [160] Device Serial Number 22-00-fc-ff-ff-41-92-44
            Capabilities: [16c] Power Budgeting <?>
            Kernel driver in use: b43_pci_bridge
    
    notice after the kernel driver in use there is no line listing the module in use. turns out the ssb driver is statically linked into the bt4 kernel. what this means is that even if you were to compile and load the sta driver it will not be able to drive the card because ssb has already claimed it. to solve this dilema we'll need to recompile the bt4 kernel so that ssb isn't linked...

    as a side note, if any bt4 devs are reading this, will you please make this change in bt4 final

    make a copy of the kernel source to work with

    Code:
    cp -R /usr/src/linux/ ~/src/linux/
    update the config to remove ssb from the kernel. the B44 driver being statically linked causes ssb to as well, configure it to load as a module instead. the sky2 driver is for the lan card, change it from a module to statically linked so it loads before the new module we'll be compiling (i had issues with it switchiing from eth1 to eth0 and breaking stuff). the ssb driver can now be loaded as a module (my laptop doesn't need it for anything anyway)
    Code:
    sed -i 's/CONFIG_B44=y/CONFIG_B44=m'/ ~/src/linux/.config
    sed -i 's/CONFIG_SKY2=m/CONFIG_SKY2=y'/ ~/src/linux/.config
    sed -i 's/CONFIG_SSB=y/CONFIG_SSB=m'/ ~/src/linux/.config
    compile the kernel. if you get prompted for new options in make oldconfig just select defaults.

    Code:
    cd ~/src/linux
    make oldconfig
    make
    install the kernel

    Code:
    mv /boot/vmlinuz /boot/vmlinuz-old
    cp ~/src/linux/arch/x86/boot/bzImage /boot/vmlinuz
    and update lilo.conf

    Code:
    lba32
    boot=/dev/sda
    root=/dev/sda4
    
    # bitmap=/boot/sarge.bmp
    # bmp-colors=1,,0,2,,0
    # bmp-table=120p,173p,1,15,17
    # bmp-timer=254p,432p,1,0,0
    # install=bmp
    
    # delay=20
    
    prompt
    timeout=50
    
    # map=/boot/map
    
    vga=0x317
    
    image=/boot/vmlinuz
            label="BT4"
            read-only
            initrd=/boot/splash.initrd
            append=quiet
    
    image=/boot/vmlinuz-old
            label="BT4 old"
            read-only
            initrd=/boot/splash.initrd
            append=quiet
    re-initialize lilo
    Code:
    lilo -v -b /dev/sda4
    reboot to make sure your new kernel is ok, if it isn't, you can choose to boot to the old one in the lilo menu

    take a look and see how your card looks now, it should be UNCLAIMED

    Code:
    lshw -C Network
    i'll post the output of this when i reimage tomorrow, for now trust me, it shows up as unclaimed

    now that the ssb driver is out of the way we can compile and setup the sta driver module
    Code:
    mkdir ~/src/hybrid_wl
    cd ~/src/hybrid_wl
    wget http://www.broadcom.com/docs/linux_sta/hybrid-portsrc-x86_32-v5_10_27_14.tar.gz
    tar -xzf hybrid-portsrc-x86_32-v5_10_27_14.tar.gz

    follow build instructions from the readme
    Code:
    make -C /lib/modules/`uname -r`/build M=`pwd` clean
    make -C /lib/modules/`uname -r`/build M=`pwd`
    before loading the new module we need to make sure other modules that conflict aren't loaded, none should be but might as well make sure

    Code:
    root@bt:~# rmmod b43 b43legacy bcm43xx
    ERROR: Module b43 does not exist in /proc/modules
    ERROR: Module b43legacy does not exist in /proc/modules
    ERROR: Module bcm43xx does not exist in /proc/modules
    now try loading to see if it works

    Code:
    root@bt:~# insmod ~/src/hybrid_wl/wl.ko
    at this point you should be able to see your card (as eth1)
    Code:
    root@bt:~# iwconfig
    lo        no wireless extensions.
    
    eth0      no wireless extensions.
    
    eth1      IEEE 802.11abgn  ESSID:"blah"  Nickname:""
              Mode:Managed  Frequency:2.462 GHz  Access Point: 01:43:13:10:20:03
              Bit Rate=48 Mb/s   Tx-Power:32 dBm
              Retry min limit:7   RTS thr:off   Fragment thr:off
              Power Managementmode:All packets received
              Link Quality=4/5  Signal level=-66 dBm  Noise level=-90 dBm
              Rx invalid nwid:0  Rx invalid crypt:540  Rx invalid frag:0
              Tx excessive retries:101  Invalid misc:0   Missed beacon:0
    
    pan0      no wireless extensions.
    and if you haven't already

    Code:
    /etc/init.d/NetworkManager start
    and go configure up your connection.

    if all that worked you still need to set things up so they happen automatically on reboot

    make sure ssb doesn't load before wl (in my case i dont need it at all, if you do for an external card you'll have to google for the script that makes sure wl loads before ssb)

    Code:
    root@bt:~# echo blacklist b43 | tee -a /etc/modprobe.d/blacklist
    root@bt:~# echo blacklist b43legacy | tee -a /etc/modprobe.d/blacklist
    move the module to a better home
    Code:
    root@bt:~/src/hybrid_wl# cp wl.ko /lib/modules/2.6.28.1/net/
    root@bt:~# depmod -a
    root@bt:~# rmmod wl
    root@bt:~# modprobe wl
    root@bt:~# echo wl | tee -a /etc/modules
    you should now be able to reboot have wireless come up automatically.

    next up: sound, keyboard stuff, backlights, and maybe more

  3. #3
    Just burned his ISO
    Join Date
    Jul 2007
    Posts
    21

    Default

    What did you do about right clicking?


    It has honestly been one of my biggest pet peeves. I have a macbook and have ran BT on it for awhile. Tried several different things, but none are that convenient. And not being able to highlight and paste becomes a pain in the A$$.

  4. #4
    Jenkem Addict imported_wyze's Avatar
    Join Date
    Jul 2007
    Posts
    1,543

    Default

    Quote Originally Posted by drivintin View Post
    What did you do about right clicking?


    It has honestly been one of my biggest pet peeves. I have a macbook and have ran BT on it for awhile. Tried several different things, but none are that convenient. And not being able to highlight and paste becomes a pain in the A$$.
    Uh.. use a PC mouse??? 0o
    dd if=/dev/swc666 of=/dev/wyze

  5. #5
    My life is this forum Barry's Avatar
    Join Date
    Jan 2010
    Posts
    3,817

    Default

    Quote Originally Posted by wyze View Post
    Uh.. use a PC mouse??? 0o
    You could probably use a mighty mouse, it right clicks out of the box in windows.

    Or, you could try this.

    http://ubuntuforums.org/showthread.php?t=981474
    Of course, if you really wanted to have some fun, go to Wal-Mart late at night and ask the greeter if they could help you find trashbags, roll of carpet, rope, quicklime, clorox and a shovel. See if they give you any strange looks. --Streaker69

  6. #6
    Just burned his ISO
    Join Date
    Jul 2007
    Posts
    24

    Default

    Quote Originally Posted by drivintin View Post
    What did you do about right clicking?


    It has honestly been one of my biggest pet peeves. I have a macbook and have ran BT on it for awhile. Tried several different things, but none are that convenient. And not being able to highlight and paste becomes a pain in the A$$.
    umm, to right click on my macbook pro i use the touchpad, hold two fingers down and click the button. i'm putting together part three for this now which enables tap to click, then all you need to do is tap the touchpad with two fingers :P

  7. #7
    Just burned his ISO
    Join Date
    Jul 2007
    Posts
    21

    Default

    Actually I managed to answer my own question last night. I don't know if this is new, or much more likely, i just hadn't found it before. But either way i got the multitouch functions working. So you can do the two finger scroll, and two finger tap for middle, and actually three finger tap for right button.

    I am going to post what i found because the website seems to be down, and i am not sure if the page is coming back.

    taken from hxxp://ubuntuforums.org/showthread.php?t=389198

    The following works on a 2.6.18 kernel, and most likely a 2.6.17 kernel patched with the latest Mactel patches.

    By default, the generic X mouse driver (mouse) is used. This won’t let you use cool features like two-finger scrolling, two/three-finger taps (right/triple click respectively), etc. So, you need to use the synaptics driver, but this isn’t trivial to do. The appletouch kernel module needs to be loaded before the usbhid module, otherwise the usbhid mode will act as the driver for the trackpad (it is USB after all). To do this, I blacklist both drivers, and load them manually in the order I want. (Please do let me know if there is a better way of ordering the modules):

    /etc/modprobe.d/appletouch: (create)

    blacklist appletouch
    blacklist usbhid

    /etc/modules: (append)

    # appletouch should load before usbhid so it claims the trackpad
    appletouch
    usbhid

    Then the xorg.conf. There's an elaborate Gentoo wiki Synaptics Touchpad (http://gentoo-wiki.com/HARDWARE_Synaptics_Touchpad)with an explanation of alll possible tweaks. This is my current xorg.conf (mouse & trackpad-section):
    Section "InputDevice"
    Identifier "Configured Mouse"
    Driver "mouse"
    # Option "CorePointer"
    Option "Device" "/dev/input/mice"
    Option "Protocol" "ImPS/2"
    Option "ZAxisMapping" "4 5"
    Option "Emulate3Buttons" "true"
    EndSection

    Section "InputDevice"
    Identifier "Synaptics Touchpad"
    Driver "synaptics"
    Option "CorePointer"
    Option "SendCoreEvents" "true"
    Option "Device" "/dev/psaux"
    Option "Protocol" "auto-dev"
    Option "LeftEdge" "100"
    Option "RightEdge" "1120"
    Option "TopEdge" "50"
    Option "BottomEdge" "310"
    Option "FingerLow" "20"
    Option "FingerHigh" "30"
    Option "MaxTapTime" "150"
    Option "MaxTapMove" "220"
    Option "MaxDoubleTapTime" "180"
    Option "VertScrollDelta" "25"
    Option "HorizScrollDelta" "30"
    Option "VertTwoFingerScroll" "true"
    Option "HorizTwoFingerScroll" "true"
    # Option "FastTaps" "true"
    Option "TapButton2" "2"
    Option "TapButton3" "3"
    Option "MinSpeed" "0.79"
    Option "MaxSpeed" "0.88"
    Option "AccelFactor" "0.015"
    Option "SHMConfig" "on"
    EndSection

    Everything works, two-finger tap (emulates middle mouse button), three-finger tab (right mouse click/open context menu), double-tap but... I'm experiencing a "two-finger" issue. When I place one finger on the trackpad (e.g. bottom-left), keep it there and subsequently place another one (e.g. top-right) the pointer will move across the entire screen. Releasing the second finger will move the pointer back again. This is not so welcome side-effect when two-finger scrolling. Any ideas what might be causing this?
    And there is also the straight setup on the driver at hxxp://www.popies.net/atp/

    Section "InputDevice"
    Identifier "Synaptics Touchpad"
    Driver "synaptics"
    Option "SendCoreEvents" "true"
    Option "Device" "/dev/input/mice"
    Option "Protocol" "auto-dev"
    Option "LeftEdge" "0"
    Option "RightEdge" "850"
    Option "TopEdge" "0"
    Option "BottomEdge" "645"
    Option "MinSpeed" "0.4"
    Option "MaxSpeed" "1"
    Option "AccelFactor" "0.02"
    Option "FingerLow" "55"
    Option "FingerHigh" "60"
    Option "MaxTapMove" "20"
    Option "MaxTapTime" "100"
    Option "HorizScrollDelta" "0"
    Option "VertScrollDelta" "30"
    Option "SHMConfig" "on"
    EndSection

    Section "ServerLayout"
    ...
    InputDevice "Mouse"
    InputDevice "Synaptics Touchpad"
    ...
    EndSection
    Worked like a charm for me. And the appletouch driver is already compiled with the kernel as a module. So you just need to load it like the first quote says.

  8. #8
    Just burned his ISO
    Join Date
    Jul 2007
    Posts
    24

    Default

    just so people aren't confused reading this thread, synaptics is enabled and loaded out of the box with bt4, the only thing you'll have to do is tweak some of the settings for it to enable two finger horizontal scroll, tap to click, etc.

    i've set mine up for two fingers to right click and three to middle click (i dont middle click often)

    the preferred way to update all these settings in bt4 is to configure HAL, not to use and xorg.conf. i'll post details later on how to do so. i'll also have details on how to get keyboard backlights and all the function keys working in bt4

  9. #9
    Just burned his ISO
    Join Date
    Apr 2009
    Posts
    1

    Default

    Hi, I've installed BackTrack 4 on my MacBook3,1. I followed your how-to and I've installed the linux_sta driver for the Airport Extreme - Broadcom 4328 based card (after recompiling the kernel as you wrote). Now with an 'iwconfig' command I can see the card, and it is in up state. I've started NetworkManager and configured up the connection with the details of my wlan and AP: essid, wpa2 key, ip address, gateway, dns. But NetworkManager shows always "state: disconnected". Any idea?

  10. #10
    Just burned his ISO
    Join Date
    Apr 2009
    Posts
    1

    Default

    Thnx...worked like a charm on my macbook (early 2009) unibody.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •