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() {
#
# 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
# that:
# This implementation doesn't suffer the limitations of the FreeBSD one in that:
# A) All partitions get zapped, even if not DOS MBR partitions
# B) We can zap the partition device since Linux isn't overprotective of
# superblocks, unlike FreeBSD.
......@@ -231,6 +230,7 @@ loadone() {
_NUM=$4
echo "Loading image #$_NUM"
echo " LOADINFO=\"$_LOADINFO\""
ADDR=`getvar ADDR "$_LOADINFO"`;
SERVER=`getvar SERVER "$_LOADINFO" $BOSSIP`;
......@@ -239,7 +239,7 @@ loadone() {
MBRVERS=`getvar MBRVERS "$_LOADINFO" 101`;
PREPARE=`getvar PREPARE "$_LOADINFO" 0`;
IMAGEID=`getvar IMAGEID "$_LOADINFO"`;
KEEPALIVE=`getvar KEEPALIVE "$_LOADINFO" 0`;
KEEPALIVE=`getvar KEEPALIVE "$_LOADINFO"`;
OSVERSION=`getvar OSVERSION "$_LOADINFO" 0`;
#
......@@ -495,12 +495,7 @@ fixone() {
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_BIOSDISK=`getvar BIOSDISK "$iline"`
export SLICEFIX_DOM0MEM=`getvar DOM0MEM "$iline" unknown`
export SLICEFIX_TRIM=`getvar TRIM "$iline" 0`
......
......@@ -74,13 +74,6 @@ esac
# DOM0MEM is optional
DOM0MEM=$SLICEFIX_DOM0MEM
if [ -r $ETCDIR/bossnode ]; then
bossnode=`cat $ETCDIR/bossnode`;
setboss=1
else
setboss=0
fi
# TRIM is optional
TRIM=${SLICEFIX_TRIM:-'0'}
case $TRIM in
......@@ -95,6 +88,13 @@ esac
# XXX hack to determine the root FS partition
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
# into the image.
LOCALIZED1="/.localized"
......@@ -154,9 +154,7 @@ dolinux() {
RUUID=`dumpe2fs $rootdev 2>/dev/null | grep UUID: | \
sed -e 's/.*UUID: *\([^ ]*\).*/\1/'`
#
# To be pedantic, we should do the following (generate a new
# UUID). Note that this will cause the root FS to be fsck'ed
# everytime (see needfsck below).
# Generate a new UUID.
#
if [ -n "$RUUID" ]; then
# generate/install a new random UUID with tune2fs
......@@ -166,6 +164,15 @@ dolinux() {
sed -e 's/.*UUID: *\([^ ]*\).*/\1/'`
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
#
......
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