Wednesday, April 15, 2020

How to create bootable DEBIAN PIXEL, STRETCH, BUSTER and Ubuntu 18.04 on one USB stick

This follows the previous post on "How to create bootable PIXEL USB stick for Mac


The Debian PIXEL is for x86 platforms. The PIXEL ISO, the latest is a 2.0GB download is here
https://downloads.raspberrypi.org/rpd_x86/images/rpd_x86-2017-06-23/2017-06-22-rpd-x86-jessie.iso

Raspberry Pi Desktop image Debian STRETCH latest is 2019-04-11-rpd-x86-stretch.iso (2.4G) is here
https://downloads.raspberrypi.org/rpd_x86/images/rpd_x86-2019-04-12/2019-04-11-rpd-x86-stretch.iso

The new RASPBERRY PI DESKTOP image Debian BUSTER 2020-02-12-rpd-x86-buster.iso (3.13GB) is here
https://downloads.raspberrypi.org/rpd_x86/images/rpd_x86-2020-02-14/2020-02-12-rpd-x86-buster.iso

And the first task is to create a USB stick for Mac/PC for three Debian OSs with persistent feature. Important: The Linux kernel might not be able to boot up for the modern MacBook Retina Display driver. You might need the original Ubuntu 18.04 image in later task for these MacBooks.

shell script    Select all
And here are the instructions to create EFI bootable USB stick on Mac # Running on Mac # list disk volumes diskutil list # assume format USB stick (128G) on /dev/disk1 with 2 partitions 16g and remaining 111g respectively # if for USB stick (64G) on /dev/disk1 with 2 partitions 8g and remaining 55g respectively # if for 32G USB stick, the 2 partition sizes can be divided into 4g and remaining 27g respectively sudo diskutil partitionDisk /dev/disk1 MBRFormat FAT32 LINUX 16g FAT32 PERSISTENCE 0b # for older Mac OSX 10.6, the partition type is "MS-DOS FAT32" # sudo diskutil partitionDisk /dev/disk1 MBRFormat "MS-DOS FAT32" LINUX 16g "MS-DOS FAT32" PERSISTENCE 0b # sudo diskutil partitionDisk /dev/disk1 MBRFormat "MS-DOS FAT32" LINUX 8g "MS-DOS FAT32" PERSISTENCE 0b mkdir -p /Volumes/LINUX/efi/boot # Download Enterprise-0.4.1.tar.gz to ~/Download # from https://github.com/SevenBits/Enterprise/releases cd ~/Downloads curl -OL https://github.com/SevenBits/Enterprise/releases/download/v0.4.1/Enterprise-0.4.1.tar.gz tar xzvf Enterprise-0.4.1.tar.gz Copy efi boot files to the USB stick cp ~/Downloads/Enterprise-0.4.1/*.efi /Volumes/LINUX/efi/boot/ Copy the jessie and buster iso to the USB stick cp ~/Downloads/2017-06-22-rpd-x86-jessie.iso /Volumes/LINUX/efi/boot/pixel.iso cp ~/Downloads/2019-04-11-rpd-x86-stretch.iso /Volumes/LINUX/efi/boot/stretch.iso cp ~/Downloads/2020-02-12-rpd-x86-buster.iso /Volumes/LINUX/efi/boot/buster.iso # create enterprise.cfg cat > /Volumes/LINUX/efi/boot/enterprise.cfg << EOF autoboot 0 entry Debian BUSTER non-persistence family Debian iso buster.iso initrd /live/initrd1.img kernel /live/vmlinuz1 findiso=/efi/boot/buster.iso boot=live config live-config quiet splash EOF # umount disk sudo diskutil unmountDisk disk1 # Reboot Mac and press Option key on restart and select EFI Boot for boot menu # Running on Debian PIXEL sudo fdisk -l #assume /dev/sdb is the USB stick sudo fdisk /dev/sdb # (d) (2) to delete partition 2 # and then (n) (p) (2) to recreate primary partition 2 for Linux in fdisk # (w) to write to partition table and quit fdisk # Reboot to let partition table effective # Running on Debian BUSTER # unmount /dev/sdb2 sudo umount /dev/sdb2 # format and label /dev/sdb2 sudo mkfs.ext4 -L persistence /dev/sdb2 # rename /dev/sdb2 if manually afterwards # sudo e2label /dev/sdb2 "persistence" # create persistence.conf sudo mkdir -p /mnt/persistence sudo mount -t ext4 /dev/sdb2 /mnt/persistence echo / union | sudo tee /mnt/persistence/persistence.conf #unmount /dev/sdb2 sudo umount /dev/sdb2 # Reboot # Running on Mac # recreate enterprise.cfg with persistence cat > /Volumes/LINUX/efi/boot/enterprise.cfg << EOF entry Debian BUSTER persistence family Debian iso buster.iso initrd /live/initrd1.img kernel /live/vmlinuz1 findiso=/efi/boot/buster.iso boot=live config live-config quiet splash persistence entry Debian STRETCH persistence family Debian iso stretch.iso initrd /live/initrd1.img kernel /live/vmlinuz1 findiso=/efi/boot/stretch.iso boot=live config live-config quiet splash persistence entry Debian PIXEL persistence family Debian iso pixel.iso initrd /live/initrd1.img kernel /live/vmlinuz1 findiso=/efi/boot/pixel.iso boot=live config live-config quiet splash persistence entry Debian BUSTER non-persistence family Debian iso buster.iso initrd /live/initrd1.img kernel /live/vmlinuz1 findiso=/efi/boot/buster.iso boot=live config live-config quiet splash EOF # umount disk sudo diskutil unmountDisk disk1 # Reboot and Running on Debian BUSTER to verify the persistence mounting df -h


For additional configuration and setting, or the Ubuntu images http://releases.ubuntu.com/16.04/ or http://releases.ubuntu.com/18.04/, and need to create a third partition casper-rw in Linux to enable persistence. please refer to the previous post.
For Ubuntu images, the related boot menu entries are as below, the non-persistent entry is used to setup the persistence and casper-rw partitions for the USB stick. The nomodeset is used when the video driver biit up failed with black screen. The Ubuntu 18.04 image should be more compatible with the modern Retina display
.
enterprise.cfg    Select all
entry Ubuntu 16.04.6 persistent family Ubuntu iso ubuntu-16.04.6.iso initrd /casper/initrd kernel /casper/vmlinuz findiso=/efi/boot/ubuntu-16.04.6.iso file=/cdrom/preseed/ubuntu.seed boot=casper persistent nomodeset --- entry Ubuntu 18.04.4 persistent family Ubuntu iso ubuntu-18.04.4.iso initrd /casper/initrd kernel /casper/vmlinuz findiso=/efi/boot/ubuntu-18.04.4.iso boot=casper persistent quiet splash --- entry Ubuntu 18.04.4 non-persistent family Ubuntu iso ubuntu-18.04.4.iso initrd /casper/initrd kernel /casper/vmlinuz findiso=/efi/boot/ubuntu-18.04.4.iso boot=casper quiet splash ---


No comments: