Grub configuration for liveCD

1.9k views Asked by At

I need to create my custom linux liveCD. I used this perfect guide to do this.

In few words: I took linux Mint liveCD, mount it, unpack filesysetm.squashfs, edit it with chroot and pack everything back to iso. I faced with a problem when tried customize grub settings. For example, I want to set GRUB_TIMEOUT to zero. I can edit grub config file, but i can't run update-grub.

voronwe@sul $  sudo chroot edit
sul #  mount -t proc none /proc
sul #  mount -t sysfs none /sys
sul #  mount -t devpts none /dev/pts
sul #  export HOME=/root
sul #  export LC_ALL=C
sul #  update-grub
/usr/sbin/grub-probe: error: cannot find a device for / (is /dev mounted?).

And i can't mount boot:

sul # mount boot
mount: can't find boot in /etc/fstab or /etc/mtab
sul # cat /etc/fstab
# UNCONFIGURED FSTAB FOR BASE SYSTEM
sul # cat /etc/mtab 
binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,noexec,nosuid,nodev 0 0
none /proc proc rw 0 0
none /sys sysfs rw 0 0
none /dev/pts devpts rw 0 0

So, do anyone know how can grub configuration be update on liveCD?

1

There are 1 answers

0
voronwe On

I found the way. There is a file isolinux/isolinux.cfg in the folder, where filesystem.squashfs was unpacked. I delete almost everything to get clear system boot. Minimal necessary settings in this file are:

default livelinux
timeout 0

label livelinux
  kernel /casper/vmlinuz
  append  file=/cdrom/preseed/linuxmint.seed boot=casper initrd=/casper/initrd.lz quiet splash --

Were "timeout" is a GRUB_TIMEOUT * 10. So if you want to wait 1 second in boot menu you should write

timeout 10