Split extlinux installation into a new function
authorPatrick McCarty <patrick.mccarty@linux.intel.com>
Thu, 1 Aug 2013 19:43:06 +0000 (12:43 -0700)
committerPatrick McCarty <patrick.mccarty@linux.intel.com>
Mon, 5 Aug 2013 17:00:53 +0000 (10:00 -0700)
The extlinux install should only be done for MBR, so split this logic
out into a new function.

Also, use $INSTALLERFW_KERNEL_OPTS in the extlinux.conf instead of the
hardcoded options.

Change-Id: I2669ebcd9d3327ca18a1d6d102b6ee07d274eeaa

scripts/system-installer

index f881f8d..ad3525a 100644 (file)
@@ -208,20 +208,7 @@ function mount_device {
     mount ${TARGET_DEV}${partnum} ${TGTMNT}/${mountpoint}
 }
 
-function install_os {
-    rsync  -WaAHXSh --exclude='/dev/' --exclude='/lost+found/' --exclude='/media/*' --exclude='/sys/' --exclude='/proc/' --exclude="/tmp/" --exclude="/run/"  $SRCOSMNT/ $TGTMNT
-
-    mkdir ${TGTMNT}/dev/
-    chmod 0755 ${TGTMNT}/dev
-
-    rm ${TGTMNT}/etc/fstab
-
-    if [[ $FILESYSTEM = "btrfs" ]]; then
-        ROOTFLAGS="rootflags=subvol=tizen"
-    else
-        ROOTFLAGS=""
-    fi
-
+function install_extlinux {
     mkdir -p ${TGTMNT}/boot/extlinux
     cat > ${TGTMNT}/boot/extlinux/extlinux.conf << EOF
 default vesamenu.c32
@@ -244,7 +231,7 @@ menu clear
 label tizen
   menu label Boot Tizen
   kernel ../vmlinuz
-  append root=${ROOTFS} rw vga=current splash=silent quiet ${ROOTFLAGS}
+  append root=${ROOTFS} ${INSTALLERFW_KERNEL_OPTS} ${ROOTFLAGS}
 menu default
 EOF
 
@@ -252,6 +239,25 @@ EOF
 
     cat /usr/share/syslinux/mbr.bin > ${TARGET_DEV}
     /sbin/extlinux -i  ${TGTMNT}/boot/extlinux
+}
+
+function install_os {
+    rsync  -WaAHXSh --exclude='/dev/' --exclude='/lost+found/' --exclude='/media/*' --exclude='/sys/' --exclude='/proc/' --exclude="/tmp/" --exclude="/run/"  $SRCOSMNT/ $TGTMNT
+
+    mkdir ${TGTMNT}/dev/
+    chmod 0755 ${TGTMNT}/dev
+
+    rm ${TGTMNT}/etc/fstab
+
+    if [[ $FILESYSTEM = "btrfs" ]]; then
+        ROOTFLAGS="rootflags=subvol=tizen"
+    else
+        ROOTFLAGS=""
+    fi
+
+    if [ "$INSTALLERFW_PTABLE_FORMAT" = "msdos" ]; then
+        install_extlinux
+    fi
 
     if [[ $FILESYSTEM = "btrfs" ]]; then
         sed -i 's|SUBVOLUME="/"|SUBVOLUME="'${TGTMNT}'"|' /etc/snapper/configs/root