Commit 2337aa5a authored by Mike Hibler's avatar Mike Hibler

Force fsck of root FS just to be safe.

Also, clean up some nits.
parent f9e2f9e7
...@@ -196,8 +196,7 @@ find_disks() { ...@@ -196,8 +196,7 @@ find_disks() {
# #
# Wipe out the superblocks on any partitions by zeroing the first 16 sectors. # Wipe out the superblocks on any partitions by zeroing the first 16 sectors.
# This implementation doesn't suffer the limitations of the FreeBSD one in # This implementation doesn't suffer the limitations of the FreeBSD one in that:
# that:
# A) All partitions get zapped, even if not DOS MBR partitions # A) All partitions get zapped, even if not DOS MBR partitions
# B) We can zap the partition device since Linux isn't overprotective of # B) We can zap the partition device since Linux isn't overprotective of
# superblocks, unlike FreeBSD. # superblocks, unlike FreeBSD.
...@@ -231,6 +230,7 @@ loadone() { ...@@ -231,6 +230,7 @@ loadone() {
_NUM=$4 _NUM=$4
echo "Loading image #$_NUM" echo "Loading image #$_NUM"
echo " LOADINFO=\"$_LOADINFO\""
ADDR=`getvar ADDR "$_LOADINFO"`; ADDR=`getvar ADDR "$_LOADINFO"`;
SERVER=`getvar SERVER "$_LOADINFO" $BOSSIP`; SERVER=`getvar SERVER "$_LOADINFO" $BOSSIP`;
...@@ -239,7 +239,7 @@ loadone() { ...@@ -239,7 +239,7 @@ loadone() {
MBRVERS=`getvar MBRVERS "$_LOADINFO" 101`; MBRVERS=`getvar MBRVERS "$_LOADINFO" 101`;
PREPARE=`getvar PREPARE "$_LOADINFO" 0`; PREPARE=`getvar PREPARE "$_LOADINFO" 0`;
IMAGEID=`getvar IMAGEID "$_LOADINFO"`; IMAGEID=`getvar IMAGEID "$_LOADINFO"`;
KEEPALIVE=`getvar KEEPALIVE "$_LOADINFO" 0`; KEEPALIVE=`getvar KEEPALIVE "$_LOADINFO"`;
OSVERSION=`getvar OSVERSION "$_LOADINFO" 0`; OSVERSION=`getvar OSVERSION "$_LOADINFO" 0`;
# #
...@@ -495,12 +495,7 @@ fixone() { ...@@ -495,12 +495,7 @@ fixone() {
echo "`date`: Adjusting slice-related files on $_DISK slice $_PART" echo "`date`: Adjusting slice-related files on $_DISK slice $_PART"
export SLICEFIX_ACPI=`getvar ACPI "$iline" unknown`
export SLICEFIX_ASF=`getvar ASF "$iline" unknown`
export SLICEFIX_NOCLFLUSH=`getvar NOCLFLUSH "$iline" unknown`
export SLICEFIX_VGAONLY=`getvar VGAONLY "$iline" unknown`
export SLICEFIX_CONSOLE=`getvar CONSOLE "$iline" unknown` export SLICEFIX_CONSOLE=`getvar CONSOLE "$iline" unknown`
export SLICEFIX_BIOSDISK=`getvar BIOSDISK "$iline"`
export SLICEFIX_DOM0MEM=`getvar DOM0MEM "$iline" unknown` export SLICEFIX_DOM0MEM=`getvar DOM0MEM "$iline" unknown`
export SLICEFIX_TRIM=`getvar TRIM "$iline" 0` export SLICEFIX_TRIM=`getvar TRIM "$iline" 0`
......
...@@ -74,13 +74,6 @@ esac ...@@ -74,13 +74,6 @@ esac
# DOM0MEM is optional # DOM0MEM is optional
DOM0MEM=$SLICEFIX_DOM0MEM DOM0MEM=$SLICEFIX_DOM0MEM
if [ -r $ETCDIR/bossnode ]; then
bossnode=`cat $ETCDIR/bossnode`;
setboss=1
else
setboss=0
fi
# TRIM is optional # TRIM is optional
TRIM=${SLICEFIX_TRIM:-'0'} TRIM=${SLICEFIX_TRIM:-'0'}
case $TRIM in case $TRIM in
...@@ -95,6 +88,13 @@ esac ...@@ -95,6 +88,13 @@ esac
# XXX hack to determine the root FS partition # XXX hack to determine the root FS partition
RPART=$SLICEFIX_RPART RPART=$SLICEFIX_RPART
if [ -r $ETCDIR/bossnode ]; then
bossnode=`cat $ETCDIR/bossnode`;
setboss=1
else
setboss=0
fi
# Indicates the MFS has been properly localized and we can copy stuff # Indicates the MFS has been properly localized and we can copy stuff
# into the image. # into the image.
LOCALIZED1="/.localized" LOCALIZED1="/.localized"
...@@ -154,9 +154,7 @@ dolinux() { ...@@ -154,9 +154,7 @@ dolinux() {
RUUID=`dumpe2fs $rootdev 2>/dev/null | grep UUID: | \ RUUID=`dumpe2fs $rootdev 2>/dev/null | grep UUID: | \
sed -e 's/.*UUID: *\([^ ]*\).*/\1/'` sed -e 's/.*UUID: *\([^ ]*\).*/\1/'`
# #
# To be pedantic, we should do the following (generate a new # Generate a new UUID.
# UUID). Note that this will cause the root FS to be fsck'ed
# everytime (see needfsck below).
# #
if [ -n "$RUUID" ]; then if [ -n "$RUUID" ]; then
# generate/install a new random UUID with tune2fs # generate/install a new random UUID with tune2fs
...@@ -166,6 +164,15 @@ dolinux() { ...@@ -166,6 +164,15 @@ dolinux() {
sed -e 's/.*UUID: *\([^ ]*\).*/\1/'` sed -e 's/.*UUID: *\([^ ]*\).*/\1/'`
fi fi
#
# XXX we have had problems with unclean FSes.
# The situation gets much worse if we don't clean it up here.
#
fsck -y $rootdev || {
echo "Failed to fsck root filesystem $rootdev"
return 1
}
# #
# Attempt to mount filesystem # Attempt to mount filesystem
# #
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment