WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: TC frugal on USB for (EFI) MacBook Air (no CD, no eth)  (Read 434 times)

Offline Twist

  • WikiUser
  • *
  • Posts: 31
Re: TC frugal on USB for (EFI) MacBook Air (no CD, no eth)
« Reply #15 on: January 07, 2020, 02:33:35 PM »
FWIW and future reference (and thanks to the contributions in this thread and elsewhere on the forum):

Steps to create a self contained tinycore linux USB drive for a Mac using just OS X as a starting point.
Why like this? Because it gets you going from scratch from a plain OS X machine. I.e. the setup steps do not depend on having linux or tinycore up already. You don't need a CD/DVD drive, and you don't need a USB-Ethernet dongle.

Worked for me with MacBook Air 13 (mi 2013) running 10.13.6 and TinyCorePure64-10.1 (Adapted from here)

1) wipe and prepare USB stick using terminal (Warning: change disk2 appropriately or wipe something you didn't intend to):
Code: (bash) [Select]
sudo diskutil partitionDisk disk2 2 GPT FAT32 EFI 64Mi Free\ Space Free R 2) On USB create a folder called EFI and one called installTC. Within the EFI folder create two folders named: boot and linux
3) download the TinyCorePure64-10.1.iso and mount it (double click)
4) from the [mounted ISO]/boot folder copy vmlinuz and corepure64.gz to the [usb]/EFI/linux folder
5) also copy the isofile itself to [usb]/installTC/
6) download STUBLOAD_release_x64.EFI and Kernelcmd_sample.txt from https://github.com/KNNSpeed/UEFI-Stub-Loader
7) place both in [usb]/EFI/boot
8 ) rename STUBLOAD_release_x64.EFI to BOOTx64.EFI and rename Kernelcmd_sample.txt to Kernelcmd.txt
9) edit Kernelcmd.txt with TextEdit. Make sure it is plain text, and saved with UTF16 encoding. You can also check the encoding from the terminal with `file Kernelcmd.txt`, check for UTF-16.
Contents of Kernelcmd.txt:
Code: (bash) [Select]
\EFI\linux\vmlinuz64
initrd=\EFI\linux\corepure64.gz blacklist=bcma,ssb,bc43

^ Make sure there's an empty 3rd line
line 1: path relative to the efi partition root to the kernel file
line 2: command line options to pass to the kernel (no start/end quote)
line 3: empty line. needed to signal end of command line options
Note: those last lines are not strictly needed. Also note that the blacklist=bcma,ssb,bc43 is needed on my macbook to get the wireless working later on. You may not need this.
10) from the repo download the tcz's needed to get wifi up (get the .tcz, tcz.md5.txt and .dep files for):
Code: (bash) [Select]
wl-modules-4.19.10-tinycore64 acl attr dbus elogind expat2 libcap libiw libnl ncursesw openssl readline wifi wireless_tools wireless-4.9.10-tinycore64 wpa_supplicant-dbus11) ... and place them in [usb]/installTC
12) The USB is now prepared. Boot into tinycore (hold alt and choose EFI USB icon)
13) get wifi (well, internet access really)
Code: (bash) [Select]
mount /dev/sdb1
tce-load -i /mnt/sdb1/installTC/wl-modules-4.19.10-tinycore64
tce-load -i /mnt/sdb1/installTC/wifi
sudo wifi.sh
14) let's get gdisk:
Code: (bash) [Select]
tce-load -iw gdisk
and then use gdisk to add second partition (default start and end will use remainder or disk)
15) use gdsik to label both parttions
16) reboot into tinycore (updated partition table)
17) mkfs.ext2 on new parttion
18) reboot once more (so /etc/fstab is up to date)
19) copy the needed files
Code: (bash) [Select]
mount /dev/sdb1
mount /dev/sdb2
mkdir /tmp/iso
sudo mount -o loop /mnt/sdb1/installTC/TinyCorePure64-10.1.iso /tmp/iso
sudo cp -R /tmp/iso/cde to /mnt/sdb2/tce
sudo rm /mnt/sdb2/copy2fs.flg
20) Capture the relevant UUIDs and Labels:
Code: (bash) [Select]
blkid /dev/sdb* > /mnt/sdb1/blkid.txt21) reboot into OSX
22) open blkid.txt from the EFI partition
Code: (bash) [Select]
/dev/sdb: PTUUID="9976057f-21bc-4818-88ea-4e8099cc8ed3" PTTYPE="gpt"
/dev/sdb1: LABEL="EFI" UUID="DC62-1C1C" TYPE="vfat" PARTLABEL="EFI" PARTUUID="02579055-5922-44e4-bab5-a6572541749e"
/dev/sdb2: UUID="33f90c68-592b-479f-a5e8-021a3bf132c7" TYPE="ext2" PARTLABEL="tc" PARTUUID="7f3a8150-5669-4423-b9dc-8df656011acd"
23) edit Kernelcmd.txt and adjust UUIDs as needed
Code: (bash) [Select]
\EFI\linux\vmlinuz64
initrd=\EFI\linux\corepure64.gz blacklist=bcma,ssb,bc43 waitusb=15:UUID=33f90c68-592b-479f-a5e8-021a3bf132c7 tce=UUID=33f90c68-592b-479f-a5e8-021a3bf132c7/tce opt=33f90c68-592b-479f-a5e8-021a3bf132c7

^ Make sure there's an empty 3rd line

That's it. You now have TCPure64 on a EFI bootable USB stick with working wifi. It should also boot straight into X on the next reboot.
 8)