Tiny Core Linux Installation and Boot Menu Setup on Grub2-EFI
Tiny Core Linux is a wonderful tool to have as a backup system on a USB drive in case you ever need to do emergency repairs to your computer system. It can also be a very lightweight and elegant desktop system when installed to a hard drive. My goal was to install to a small partition on my hard drive, and boot from the grub installation installed from my Debian Buster installation on another partition.
I followed the excellent installation instructions on the Tiny Core website at: http://tinycorelinux.net/install.html
I booted back into by Debian system and ran # update-grub , but the prober failed to find my Tiny Core installation.
Fortunately, Grub2 provides a way to add custom menu items to the boot menu.
First, I needed the UUID of the root partition of my Tiny Core installation, so I opened a root terminal and ran # blkid The results included the partition I was interested in, which was: /dev/sda6: LABEL="tinycore" UUID="7a130a42-5c23-4148-80c9-c9a8e78f311c" TYPE="ext4" PARTUUID="c04ff9fd-76a7-4e19-be5f-588f230dd9f3"
I followed the excellent installation instructions on the Tiny Core website at: http://tinycorelinux.net/install.html
I booted back into by Debian system and ran # update-grub , but the prober failed to find my Tiny Core installation.
Fortunately, Grub2 provides a way to add custom menu items to the boot menu.
First, I needed the UUID of the root partition of my Tiny Core installation, so I opened a root terminal and ran # blkid The results included the partition I was interested in, which was: /dev/sda6: LABEL="tinycore" UUID="7a130a42-5c23-4148-80c9-c9a8e78f311c" TYPE="ext4" PARTUUID="c04ff9fd-76a7-4e19-be5f-588f230dd9f3"
Then, I need to know the locations of the kernel and initrd files. I can cheat a little because I know the files will be in the /tce/boot directory on the Tiny Core partition. So, I take a peek at that directory with the command # mkdir tmp && mount /dev/sda6 tmp && ls tmp/tce/boot/ && umount tmp && rmdir tmp
Which returns:
core.gz extlinux vmlinuz
In order to get Grub2 set up to boot Tiny Core, I edited the custom boot entry file. To do this, I opened a terminal and ran the following (as root): # nano /etc/grub.d/40_custom
Which returns:
core.gz extlinux vmlinuz
In order to get Grub2 set up to boot Tiny Core, I edited the custom boot entry file. To do this, I opened a terminal and ran the following (as root): # nano /etc/grub.d/40_custom
The file, 40_custom, looks like this before editing:
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
Without removing any text in the file, I added my entry at the bottom, adding the UUID for /dev/sda6 where appropriate. I am using vmlinuz for the linux line and core.gz for the initrd line. I didn't have any additional bootcodes I wished to pass, but those can be added to the end of the line that starts with "linux":
menuentry "Tiny Core on sda6" {
insmod part_gpt
insmod ext2
set root='hd0,gpt6'
search --no-floppy --fs-uuid --set 7a130a42-5c23-4148-80c9-c9a8e78f311c
linux /tce/boot/vmlinuz root=7a130a42-5c23-4148-80c9-c9a8e78f311c
initrd /tce/boot/core.gz
}
I hit ctrl+x to save the file, then ran # update-grub. I was a bit disappointed here because my entry did not show in the list of menu entries generated, but I rebooted anyway. At boot, the custom entry was at the bottom of my Grub2 menu list, and I was off and running with Tiny Core
Comments
Post a Comment