From 6e295b41ff1514a7105b6dcb77ff20a21175ceb1 Mon Sep 17 00:00:00 2001 From: Robert Nelson Date: Wed, 18 Jan 2012 14:33:33 -0600 Subject: [PATCH] distro: maverick: when mount doesnt have /etc/mtab use /proc/mounts Signed-off-by: Robert Nelson --- scripts/debian-finish.sh | 13 ++++++++++--- scripts/ubuntu-finish.sh | 11 +++++++++-- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/scripts/debian-finish.sh b/scripts/debian-finish.sh index b62d2a7..7eb5961 100644 --- a/scripts/debian-finish.sh +++ b/scripts/debian-finish.sh @@ -1,16 +1,23 @@ #!/bin/bash #Find Target Partition and FileSystem -FINAL_PART=$(mount | grep /dev/ | grep -v devpts | grep " / " | awk '{print $1}') -FINAL_FSTYPE=$(mount | grep /dev/ | grep -v devpts | grep " / " | awk '{print $5}') +if [ -f /etc/mtab ] ; then + FINAL_PART=$(mount | grep /dev/ | grep -v devpts | grep " / " | awk '{print $1}') + FINAL_FSTYPE=$(mount | grep /dev/ | grep -v devpts | grep " / " | awk '{print $5}') +else + #Currently only Maverick, but log if something else does it.. + touch /boot/uboot/debug/no_mtab + FINAL_PART=$(cat /proc/mounts | grep /dev/ | grep -v devpts | grep " / " | awk '{print $1}') + FINAL_FSTYPE=$(cat /proc/mounts | grep /dev/ | grep -v devpts | grep " / " | awk '{print $3}') +fi #Cleanup: NetInstall Files rm -f /boot/uboot/uInitrd.net || true rm -f /boot/uboot/uImage.net || true #Cleanup: Initial Bootloader -rm -f /boot/uboot/uEnv.txt || true rm -f /boot/uboot/boot.scr || true +rm -f /boot/uboot/uEnv.txt || true #Next: are we using uEnv.txt or boot.scr boot files? if [ -f "/boot/uboot/cus/use_uenv" ]; then diff --git a/scripts/ubuntu-finish.sh b/scripts/ubuntu-finish.sh index 9ac5e7e..e5d3e7c 100644 --- a/scripts/ubuntu-finish.sh +++ b/scripts/ubuntu-finish.sh @@ -1,8 +1,15 @@ #!/bin/bash #Find Target Partition and FileSystem -FINAL_PART=$(mount | grep /dev/ | grep -v devpts | grep " / " | awk '{print $1}') -FINAL_FSTYPE=$(mount | grep /dev/ | grep -v devpts | grep " / " | awk '{print $5}') +if [ -f /etc/mtab ] ; then + FINAL_PART=$(mount | grep /dev/ | grep -v devpts | grep " / " | awk '{print $1}') + FINAL_FSTYPE=$(mount | grep /dev/ | grep -v devpts | grep " / " | awk '{print $5}') +else + #Currently only Maverick, but log if something else does it.. + touch /boot/uboot/debug/no_mtab + FINAL_PART=$(cat /proc/mounts | grep /dev/ | grep -v devpts | grep " / " | awk '{print $1}') + FINAL_FSTYPE=$(cat /proc/mounts | grep /dev/ | grep -v devpts | grep " / " | awk '{print $3}') +fi #Cleanup: NetInstall Files rm -f /boot/uboot/uInitrd.net || true