Bug#223679: lilo-installer: Sets do_bootloader=no in kernel-img.conf
I tried to create a patch for Bug#223679.
This isn't cool, but at least works :-)
I'd like to commit if anyone don't make objection.
Thanks,
--
Kenshi Muto
kmuto@debian.org
Index: base-installer/debian/kernel-installer.postinst
===================================================================
RCS file: /cvsroot/d-i/debian-installer/tools/base-installer/debian/kernel-installer.postinst,v
retrieving revision 1.39
diff -u -r1.39 kernel-installer.postinst
--- base-installer/debian/kernel-installer.postinst 16 Dec 2003 18:17:48 -0000 1.39
+++ base-installer/debian/kernel-installer.postinst 19 Dec 2003 12:57:11 -0000
@@ -273,6 +273,11 @@
info "Setting do_initrd='$do_initrd'."
info "Setting link_in_boot='$link_in_boot'."
+if [ -f /target/etc/kernel-img.conf ]; then
+ # Backup old kernel-img.conf
+ mv /target/etc/kernel-img.conf /target/etc/kernel-img.conf.$$
+fi
+
cat > /target/etc/kernel-img.conf <<EOF
# Do not create symbolic links in /
do_symlinks = yes
@@ -306,6 +311,10 @@
db_input critical kernel-installer/no-kernel || [ $? -eq 30 ]
db_go
db_progress STOP
+ if [ -f /target/etc/kernel-img.conf.$$ ]; then
+ # Revert old kernel-img.conf
+ mv /target/etc/kernel-img.conf.$$ /target/etc/kernel-img.conf
+ fi
exit 1
fi
kernel="$RET"
@@ -326,7 +335,16 @@
db_input critical kernel-installer/failed-install || [ $? -eq 30 ]
db_go
db_progress STOP
+ if [ -f /target/etc/kernel-img.conf.$$ ]; then
+ # Revert old kernel-img.conf
+ mv /target/etc/kernel-img.conf.$$ /target/etc/kernel-img.conf
+ fi
exit 1
+fi
+
+if [ -f /target/etc/kernel-img.conf.$$ ]; then
+ # Revert old kernel-img.conf
+ mv /target/etc/kernel-img.conf.$$ /target/etc/kernel-img.conf
fi
db_progress STEP 1
Index: grub-installer/debian/postinst
===================================================================
RCS file: /cvsroot/d-i/debian-installer/tools/grub-installer/debian/postinst,v
retrieving revision 1.25
diff -u -r1.25 postinst
--- grub-installer/debian/postinst 3 Oct 2003 11:08:14 -0000 1.25
+++ grub-installer/debian/postinst 19 Dec 2003 12:57:12 -0000
@@ -105,11 +105,14 @@
db_progress STEP 1
db_progress INFO grub-installer/progress/step_update_etc
-(
- echo "postinst_hook = /sbin/update-grub"
- echo "postrm_hook = /sbin/update-grub"
- echo "do_bootloader = no"
-) >> /target/etc/kernel-img.conf
+sed -e 's/do_bootloader = yes/do_bootloader = no/' < /target/etc/kernel-img.conf > /target/etc/kernel-img.conf.$$
+if [ -z "`grep update-grub /target/etc/kernel-img.conf.$$`" ]; then
+ (
+ echo "postinst_hook = /sbin/update-grub"
+ echo "postrm_hook = /sbin/update-grub"
+ ) >> /target/etc/kernel-img.conf.$$
+fi
+mv /target/etc/kernel-img.conf.$$ /target/etc/kernel-img.conf
db_progress STEP 1
db_progress STOP
Index: lilo-installer/debian/lilo-installer.postinst
===================================================================
RCS file: /cvsroot/d-i/debian-installer/tools/lilo-installer/debian/lilo-installer.postinst,v
retrieving revision 1.18
diff -u -r1.18 lilo-installer.postinst
--- lilo-installer/debian/lilo-installer.postinst 13 Oct 2003 20:59:29 -0000 1.18
+++ lilo-installer/debian/lilo-installer.postinst 19 Dec 2003 12:57:12 -0000
@@ -98,3 +98,6 @@
db_go || true
exit 1
fi
+
+sed -e 's/do_bootloader = no/do_bootloader = yes/' -e 's/postinst_hook = \/sbin\/update-grub//' -e 's/postrm_hook = \/sbin\/update-grub//' < /target/etc/kernel-img.conf > /target/etc/kernel-img.conf.$$
+mv /target/etc/kernel-img.conf.$$ /target/etc/kernel-img.conf
Reply to: