[Ovirt-devel] [PATCH node] update method used to determine boot partition for install

Joey Boggs jboggs at redhat.com
Fri Jul 31 15:12:00 UTC 2009


This will facilitate the switch to readonly rootfs. The current method will not work when symlinking /etc/mtab to /proc/mounts as the udev label /BOOT is used rather than /dev/sda1 or similar. The same output is generated and has been verified to install correctly.

---
 scripts/ovirt-config-boot |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/scripts/ovirt-config-boot b/scripts/ovirt-config-boot
index 5e7b9f0..d5c6abb 100755
--- a/scripts/ovirt-config-boot
+++ b/scripts/ovirt-config-boot
@@ -31,12 +31,12 @@ ovirt_boot_setup() {
     log "installing the image."
     mount_boot
     # check that /boot mounted ok and find partition number for GRUB
-    eval $(mount|awk '$3 == "/boot" {
-        print "disk=" substr($1,1,length($1)-1);
-        print "disk2=" substr($1,1,length($1)-2);
-        partN=substr($1,length($1),1); partN--;
-        print "partN=" partN;
-    }')
+    eval $(readlink -f /dev/disk/by-label/BOOT|awk {'
+    print "disk=" substr($1,1,length($1)-1);
+    print "disk2=" substr($1,1,length($1)-2);
+    partN=substr($1,length($1),1); partN--;
+    print "partN=" partN;
+    '})
     rc=$?
     if [ $rc -ne 0 -o $partN -lt 0 ]; then
       log "boot partition not available."
-- 
1.5.5.6




More information about the ovirt-devel mailing list