Basic issue is that /sbin/grubby does not update /etc/lilo.conf unless
you add the --lilo config option .. So if your boot loader was lilo,
koan ---replace-self will not work. The following patch basically adds
the --lilo if the grubby boot probe has "lilo" in it.
One issue I found even after applying this patch was that lilo doesnot
like long "append"s, my append was 223 characters .. I think the max is
200 characters.. This issue went away after I removed the syslog phrase
from the append.. From what I understand the newest koan doesnot add the
'syslog=...' phrase...
Partha
From a29bf2fcbfac9afe7c3d1268d8330c06679c4840 Mon Sep 17 00:00:00 2001
From: Partha Aji <paji(a)redhat.com>
Date: Fri, 27 Mar 2009 17:46:48 -0400
Subject: [PATCH] Patch to fix the koan rpm not updating the lilo.conf
---
koan/app.py | 19 ++++++++++++++-----
1 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/koan/app.py b/koan/app.py
index cf49737..7d69067 100755
--- a/koan/app.py
+++ b/koan/app.py
@@ -689,6 +689,7 @@ class Koan:
print "Kernel loaded; run 'kexec -e' to execute"
return self.net_install(after_download)
+
#---------------------------------------------------
def replace(self):
@@ -707,6 +708,12 @@ class Koan:
except OSError, (err, msg):
if err != errno.EEXIST:
raise
+
+ def get_boot_loader_info():
+ cmd = [ "/sbin/grubby", "--bootloader-probe" ]
+ probe_process = sub_process.Popen(cmd, stdout=sub_process.PIPE)
+ which_loader = probe_process.communicate()[0]
+ return probe_process.returncode, which_loader
def after_download(self, profile_data):
if not os.path.exists("/sbin/grubby"):
@@ -755,6 +762,11 @@ class Koan:
"--args", k_args,
"--copy-default"
]
+ boot_probe_ret_code, probe_output = get_boot_loader_info()
+ if boot_probe_ret_code == 0 \
+ and probe_output.find("lilo") > -1:
+ cmd.append("--lilo")
+
if self.add_reinstall_entry:
cmd.append("--title=Reinstall")
else:
@@ -788,11 +800,8 @@ class Koan:
else:
# if grubby --bootloader-probe returns lilo,
# apply lilo changes
- cmd = [ "/sbin/grubby", "--bootloader-probe" ]
- probe_process = sub_process.Popen(cmd, stdout=sub_process.PIPE)
- which_loader = probe_process.communicate()[0]
- if probe_process.returncode == 0 and \
- which_loader.find("lilo") != -1:
+ if boot_probe_ret_code == 0 and \
+ probe_output.find("lilo") != -1:
print "- applying lilo changes"
cmd = [ "/sbin/lilo" ]
sub_process.Popen(cmd, stdout=sub_process.PIPE).communicate()[0]
--
1.6.0.6