I want to set up Grub menu entry to boot into chrooted system (installed chrooted debootstrap to avoid touching existing system too much).
Currently I do the following to attain it:
Install linux-image and friends inside chrooted environment
Manually remaster initramfs to chroot into the system instead of usual behaviour:
rootmnt=$rootmnt/root/squeeze
...
#exec run-init ${rootmnt} ${init} "$@" <${rootmnt}/dev/console >${rootmnt}/dev/console
exec chroot ${rootmnt} ${init} "$@" <${rootmnt}/dev/console >${rootmnt}/dev/console
3.. Add entry to /boot/grub.cfg:
menuentry 'Chrooted debian Squeeze' {
...
linux /root/squeeze/boot/vmlinuz root=... rw
initrd /root/squeeze/boot/initrd-chroot
}
It works but not easy to set up and needs manual hacking every time initrd should be changed. How to do it better?
