From: Michael Prokop Date: Sun, 13 May 2012 16:02:57 +0000 (+0200) Subject: VM feature: improve sed command line to replace root=... kernel option X-Git-Tag: v0.51~7 X-Git-Url: https://git.grml.org/?p=grml-debootstrap.git;a=commitdiff_plain;h=0452dadf9b0b523a54d186acfbc9c202b6d7cf85 VM feature: improve sed command line to replace root=... kernel option Quoting bugreport: | [...] I found an issue which renders | every preconfigured BOOTPARAMS for vmfiles useless. | | Near the end of grml-debootstrap the grub config is changed to boot in | virtual environments. Unfortunately the whole line is replaced to | root=/dev/sda1 and each parameter that was previously set is gone by | then. | | See attached a diff that just replaces the root device string. Thanks: Conny Seidel for bugreport + patch --- diff --git a/grml-debootstrap b/grml-debootstrap index a30deb9..2a6c683 100755 --- a/grml-debootstrap +++ b/grml-debootstrap @@ -1031,7 +1031,7 @@ finalize_vm() { einfo "Adjusting grub.cfg for successful boot sequence." # ugly but needed to boot grub acordingly sed -i "s;set root=.*;set root='(hd0,msdos1)';" "${MNTPOINT}"/boot/grub/grub.cfg - sed -i "s; root=/dev/.*; root=/dev/sda1;" "${MNTPOINT}"/boot/grub/grub.cfg + sed -i "s;root=[^ ]\+;root=/dev/sda1;" "${MNTPOINT}"/boot/grub/grub.cfg umount "${MNTPOINT}" kpartx -d "${ORIG_TARGET}" >/dev/null