2018年12月12日 星期三

boot on squashfs

mksquashfs archive

when squashfs image file is placed on hdd, boot parameter should look like below
rd.live.squashimg=xxx.img
rd.writable.fsimg

rd.writable.fsimg -> copy image file to ram. need to work with rd.live.squashimg if filename of image is not squashfs.img
readonlyroot -> for fstab

rd.live.dir -> if folder structure is not /LiveOS

losetup -a to check loop device mount status

grub2 for uefi

shim
grub2-efi

yum (re)install shim grub2-efi --installroot=/
remove all files underneath / exclude everything underneath ./boot/efi/EFI

rename ./boot/efi/EFI/redhat to ./boot/efi/EFI/QCT
patch ./boot/efi/EFI/QCT/*.CSV

Generate grub.cfg

for UEFI
rm -rf /dev/shm/firmware/*
mkdir -p /dev/shm/firmware/efi
mount -o bind /dev/shm/firmware /sys/firmware
grub2-mkconfig -o ./boot/efi/EFI/QCT/grub.cfg
umount  /sys/firmware

for Legacy
rm -rf /dev/shm/firmware/*
mkdir -p /dev/shm/firmware/
mount -o bind /dev/shm/firmware /sys/firmware
grub2-mkconfig -o ./boot/grub2/grub.cfg
umount  /sys/firmware

customize menuentry
/etc/os-release