WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Howto: Install tinycore linux on a mac mini  (Read 28281 times)

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14798
Howto: Install tinycore linux on a mac mini
« on: August 30, 2011, 06:16:58 AM »
1. In the mac os, install rEFIt (http://refit.sourceforge.net/) to the mac hd main partition. Reboot and check that you now have the rEFIt menu on restart.

2. In the mac os, use the bootcamp advisor to create a partition for windows. In my case, I had to insert a windows boot dvd before before the process would start. After partitioning, the mac os tried to reboot and hung on restart - after cycling the power, the rEFIt menu came up.

3. Choose the rEFIt partition sync tool to sync the newly created windows partition between the mac gpt and mbr.

4. Insert a tinycore cd and reboot. Use the gparted extension to reformat the windows partition from fat32 to ext3 (I'm not sure rEFIt supports ext4). In my case, this was the 4th partition on the drive, sda4 - there are two hidden partitions that the mac os disk utility doesn't show you.

5. Reboot and use the rEFIt partition tool to sync the newly reformatted ext3 partition between gpt and mbr.

6. Reboot to the tiny core cd, use the grub-0.97-splash extension to install grub on the ext3 partition using the "set up grub" instructions here http://wiki.tinycorelinux.net/wiki:installing_tc_-_alternate_offline_guide?s[]=grub

7. copy tinycore.gz and bzImage from the tinycore cd to the ext3 partition.

8. Reboot and use the rEFIt menu to boot tc from the mac mini hd

Edit: for clarity this is on a DMI: Apple Inc. Macmini5,3
« Last Edit: October 22, 2011, 11:10:11 AM by Juanito »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14798
Re: Howto: Install tinycore linux on a mac mini
« Reply #1 on: October 22, 2011, 11:08:25 AM »
In case anybody finds it useful I got the headphones/line out sound working using the hda_analyser from here:

http://www.alsa-project.org/main/index.php/HDA_Analyzer

..highlighting codec-1:
Code: [Select]
GPIO: io=4, o=0, i=0, unsolicited=0, wake=0
  IO[0]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0
  IO[1]: enable=1, dir=1, wake=0, sticky=0, data=1, unsol=0
  IO[2]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0
  IO[3]: enable=1, dir=1, wake=0, sticky=0, data=0, unsol=0

..where IO[1] data=1 turns headphones/line-out on and IO[3] data=1 turns the internal speaker on

Now to figure out how to make this more accessible  ;)

hda_analyser screenshot added
« Last Edit: November 26, 2011, 09:13:22 AM by Juanito »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14798
Re: Howto: Install tinycore linux on a mac mini
« Reply #2 on: November 26, 2011, 09:19:17 AM »
As an aside, the macmini runs very nicely with micrcore64 and Xorg-7.6 in "confless" mode

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14798
Re: Howto: Install tinycore linux on a mac mini
« Reply #3 on: December 23, 2011, 10:34:49 AM »
I managed to get the wireless working using the instructions from here as a starting point:

http://www.ubuntubuzz.com/2011/10/macbook-pro-wireless-broadcom-bcm4331.html

The mac mini has this as a wireless device, that is somehow also a bluetooth device(?). Broadcom's own driver doesn't support it(?!) and I haven't managed to get ndiswrapper to work with it:
Code: [Select]
$ lspci
03:00.0 Network controller: Broadcom Corporation BCM4331 802.11a/b/g/n (rev 02)

Using compat-wireless-2011-12-18.tar.bz2, there's no need of the patches mentioned in the link above, here's how:
Code: [Select]
[Prepare kernel source]

$ make mrproper
[copy tinycore config]
$ make oldconfig
$ make prepare
$ make modules_prepare

copy Module.symvers [saved from a full kernel compile you did earlier]
$ make SUBDIRS=scripts/mod

$ cd /lib/modules/3.0.3-tinycore[64]
$ sudo ln -s /usr/src/linux-3.0.3 build

$ cd ../compat-wireless-2011-12-18
$ make
$ sudo make install

$ cd ../b43-fwcutter-015
$ make

$ export FIRMWARE_INSTALL_DIR="/usr/local/lib/firmware"
$ sudo ./b43-fwcutter -w "$FIRMWARE_INSTALL_DIR"  broadcom-wl-5.100.138/linux/wl_apsta.o

I then had to rmmod ssb and delete the bcma and ssb modules in the base in order to prevent the new b43 module from loading them instead of the new bcma and ssb modules compiled above.

After that load the firmware, modprobe the new b43 module and you're ready to go.

You should see something like this:
Code: [Select]
sudo modprobe b43

$ lsmod
Module                  Size  Used by    Tainted: P 
b43                   290816  0
mac80211              172032  1 b43
cfg80211              122880  2 b43,mac80211
bcma                   20480  1 b43
ssb                    36864  1 b43
pcmcia                 28672  2 b43,ssb
pcmcia_core            16384  1 pcmcia

$ dmesg
...
bcma-pci-bridge 0000:03:00.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
bcma-pci-bridge 0000:03:00.0: setting latency timer to 64
Core 0 found: ChipCommon (manuf 0x4BF, id 0x800, rev 0x25, class 0x0)
Core 1 found: IEEE 802.11 (manuf 0x4BF, id 0x812, rev 0x1D, class 0x0)
Core 2 found: PCIe (manuf 0x4BF, id 0x820, rev 0x13, class 0x0)
PMU resource config unknown for device 0x4331
Bus registered
cfg80211: Calling CRDA to update world regulatory domain
b43-phy0: Broadcom 4331 WLAN found (core revision 29)
ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
Broadcom 43xx driver loaded [ Features: PMNLS ]
b43-phy2: Loading firmware version 666.2 (2011-02-23 01:15:07)
wlan0: authenticate with c4:7d:4f:88:a9:b9 (try 1)
wlan0: authenticated
wlan0: associate with c4:7d:4f:88:a9:b9 (try 1)
wlan0: RX AssocResp from c4:7d:4f:88:a9:b9 (capab=0x431 status=0 aid=2)
wlan0: associated
wlan0: moving STA c4:7d:4f:88:a9:b9 to state 1
wlan0: moving STA c4:7d:4f:88:a9:b9 to state 2
wlan0: moving STA c4:7d:4f:88:a9:b9 to state 3

Offline netnomad

  • Hero Member
  • *****
  • Posts: 1026
Re: Howto: Install tinycore linux on a mac mini
« Reply #4 on: March 31, 2012, 01:39:13 PM »
hi Juanito,

did you find a way to boot tinycore on macs, f.e. mac mini or macbook pro, with a live-usbstick?
in the moment my configuration boots and works on all usual pcs,
so i would appreciate to extend his config with the ability to boot macs, too.
is there a way to use the same configuration for both platforms side by side?

thank you for every hint and help.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14798
Re: Howto: Install tinycore linux on a mac mini
« Reply #5 on: March 31, 2012, 01:58:12 PM »
I don't have a macbook pro, but as far as I know, you cannot boot a mac mini from usb stick

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: Howto: Install tinycore linux on a mac mini
« Reply #6 on: March 31, 2012, 02:39:53 PM »
Macs require EFI bootable usb sticks, they don't work with the normal MBR ones. Once you have it set up right, it will show up in the boot menu (hold alt after pressing the power button).
The only barriers that can stop you are the ones you create yourself.

Offline netnomad

  • Hero Member
  • *****
  • Posts: 1026
Re: Howto: Install tinycore linux on a mac mini
« Reply #7 on: April 01, 2012, 02:52:24 PM »
hi curaga,

it depends...
on a actual macbook pro i can use just my vfat-formated usbstick, to enter a working grub-menue-environment.
i just installed GRUB2EFI-Bootloader as described in the ubuntu-forums and here www.produnis.de/blog/?p=678,
started with a pressed ALT-key and entered the usual boot-menue with three items:
the main harddisk, something like a virtual recovery-volume and my usbstick that is named as an efi-boot-medium, although it's just a plain vfat-formated usbstick with a normal boot-sektor and syslinux as my usual bootloader.
when i choose the efi-boot-medium, i can enter the grub-menue of the GRUB2EFI-Bootloader.
after choosing my tinycore-boot-entry the kernel is loaded with the error message that the grafic-card is unknown.
then the initrd is loaded and afterwards the system stops with a frozen cursor.

on a 4years-old mac-mini the efi-boot-menue offers only the main-harddisk, no recovery medium and the plugged-in usbstick is ignored. probably an installed rEFIt could offer more boot-items.

here i show you my grub.conf of the GRUB2EFI-Bootloader:

grub.conf
## grub.cfg pxw 20090909 22:00

menuviewer="text"

timeout=20
default=0

set F1=ctrl-x

set color_normal=yellow/red

menuentry "reboot from grub.cfg fat usb " {
reboot
}
menuentry "use /grub2.cfg" {
 search --set -f /grub2.cfg
 configfile /grub2.cfg
}
menuentry "OSX" {
 search --set -f /usr/standalone/i386/boot.efi
 chainloader /usr/standalone/i386/boot.efi
}
menuentry "core-current iso" {
 fakebios
 fix_video
 search --set -f /iso/core-current.iso
 loopback iso /iso/core-current.iso
 linux (iso)/boot/vmlinuz from=/iso/core-current.iso ramdisk_size=6666 root=/dev/ram0 rw waitusb=5 protect restore=LABEL=tc tce=LABEL=tc/tce4 lst=onboot_fluxbox.lst vga=795  psmouse.proto=imps settime tz=CET-1CEST,M3.5.0,M10.5.0/3 laptop kmap=de mydata=core multivt
 initrd (iso)/boot/core.gz
}
menuentry "core-current loop" {
 fakebios
 fix_video
 search --set -f /iso/core-current.iso
 loopback loop /iso/core-current.iso
 linux (loop)/boot/vmlinuz iso-scan/filename=/iso/core-current.iso persistent video=efifb fbdev noefi waitusb=5 protect restore=LABEL=tc tce=LABEL=tc/tce4 lst=onboot_fluxbox.lst vga=795  psmouse.proto=imps settime tz=CET-1CEST,M3.5.0,M10.5.0/3 laptop kmap=de mydata=core multivt
 initrd (loop)/boot/core.gz
}
menuentry "CD" {
 appleloader CD
}
menuentry "MBR1" {
 appleloader HD
}
menuentry "REBOOT" {
 reboot
}

« Last Edit: April 01, 2012, 02:57:59 PM by netnomad »

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: Howto: Install tinycore linux on a mac mini
« Reply #8 on: April 02, 2012, 10:08:15 AM »
Without the bios emulation (boot camp), you need Xfbdev instead of Xvesa. Xorg may work too.
The only barriers that can stop you are the ones you create yourself.

Offline netnomad

  • Hero Member
  • *****
  • Posts: 1026
Re: Howto: Install tinycore linux on a mac mini
« Reply #9 on: April 02, 2012, 03:37:34 PM »
i guess my main problem is that the initrd isn't loaded proberly...

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Howto: Install tinycore linux on a mac mini
« Reply #10 on: May 11, 2012, 10:23:30 PM »
The harder Apple try to discourage or dare I say prevent anyone from booting Linux on their pc's. the harder we try to   foil them..

64 bit version of tc might boot easier from what I read
;)
« Last Edit: May 11, 2012, 10:25:22 PM by coreplayer2 »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14798
Re: Howto: Install tinycore linux on a mac mini
« Reply #11 on: May 26, 2012, 09:07:06 AM »
I don't have a macbook pro, but as far as I know, you cannot boot a mac mini from usb stick

Just discovered I was wrong - I left a tc usb stick inserted and on (re)boot I must have tabbed to the wrong rEFIt icon and it booted.

The usb stick was one of my standard extlinux ext2 boot ones and had not been modified in any way for mac.

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: Howto: Install tinycore linux on a mac mini
« Reply #12 on: May 26, 2012, 02:04:17 PM »
But rEFIt was installed..?  which can boot a fat partition?

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14798
Re: Howto: Install tinycore linux on a mac mini
« Reply #13 on: May 26, 2012, 02:28:08 PM »
rEFIt was not installed on the usb stick and the usb stick was formatted as a single ext2 partition. rEFIt is installed on an hfs+ partition (the second of the three partitions created by the mac os x installation).

Edit: and, for the purpose of clarity, I had not installed grub2-efi at the time I discovered rEFIt would boot tinycore from a usb stick.

One of the usb sticks I tried shows in rEFIt as a linux installation, the other as "legacy os" - perhaps this is connected with the version of syslinux used to set up the extlinux boot.
« Last Edit: May 27, 2012, 01:46:53 AM by Juanito »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14798
Re: Howto: Install tinycore linux on a mac mini
« Reply #14 on: June 02, 2012, 07:17:42 AM »
I gave grub-efi a try (via rEFIt) and it will boot tinycore, but the usb keyboard will not work.

Since the mac mini uses 64-bit efi, grub2 needs to be compiled like this:
Code: [Select]
$ ./configure --prefix=/usr/local --with-platform=efi --target=x86_64
..and then make grub-efi as follows:
Code: [Select]
$ x86_64-grub-mkimage -O x86_64-efi -d /usr/local/lib/x86_64-grub/x86_64-efi -o grub.efi -p "" part_gpt part_msdos hfsplus fat ext2 normal chain boot configfile linux multiboot pci lspci setpci usb_keyboard efi_gop ohci uhci usb video
To access the efi partition on the mac mini, I was obliged to borrow hfsprogs from debian in order to be able to mount the journalled hfs+ partition, then:
Code: [Select]
$ sudo mount -o force /dev/sda2
$ sudo mkdir /mnt/sda2/efi/grub
$ sudo cp grub.efi /mnt/sda2/efi/grub
$ sudo cp /usr/local/lib/x86_64-grub/x86_64-efi/*.mod /mnt/sda2/efi/grub
$ sudo cp /usr/local/lib/x86_64-grub/x86_64-efi/*.lst /mnt/sda2/efi/grub

..and then copied this grub.cfg to /mnt/sda2/efi/grub:
Code: [Select]
menuentry "core64" {
  search --file --no-floppy --set=root /boot/vmlinuz64
  fakebios
  fix_video
  setpci -s 00:1f.2 90.b=60 [suggestion from coreplayer2 to enable ahci mode for the hd]
  linux /boot/vmlinuz64 root=/dev/sda4 quiet noswap tce=sda4 tz=GMT-4 host=macminitc syslog blacklist=bcma blacklist=ssb blacklist=b43 text
  initrd /boot/core64.gz
}

..after all this, on reboot a new "3 coloured boxes" icon appears in rEFIt for grub2 and the mac mini boots but with a dead usb keyboard and the following error:
Code: [Select]
udevadm settle - timeout of 5 seconds reached, the event queue contains:
   /sys/bus/pci/drivers/sdhci-pci

The hd interface is very quick in ahci mode, I wonder if this might be the problem