summaryrefslogtreecommitdiff
path: root/packages/altboot/files/altboot.func
diff options
context:
space:
mode:
Diffstat (limited to 'packages/altboot/files/altboot.func')
-rw-r--r--packages/altboot/files/altboot.func24
1 files changed, 12 insertions, 12 deletions
diff --git a/packages/altboot/files/altboot.func b/packages/altboot/files/altboot.func
index 6dfad21374..c6af50a008 100644
--- a/packages/altboot/files/altboot.func
+++ b/packages/altboot/files/altboot.func
@@ -65,7 +65,7 @@ pivot_realfs() {
test -z "$2" && RL="5" || RL="$2"
mkdir -p $1/media/ROM || die "mkdir -p $1/media/ROM failed"
- mount -o remount,ro /
+ mount -o remount,ro / >/dev/null 2>&1
do_pivot "$1" "$RL"
}
@@ -119,19 +119,17 @@ pivot_image() {
echo "Setting up loopback (/dev/loop0) for $IMAGE_NAME"
losetup /dev/loop0 $1/$IMAGE_PATH/$IMAGE_NAME || die "losetup /dev/loop0 $1/$IMAGE_PATH/$IMAGE_NAME failed!"
check_fs /dev/loop0 $IMAGE_TYPE
-
- losetup -d /dev/loop0
+
echo -e "\n* * * Booting rootfs image * * *\n"
-
# Busybox's "mount" doesn't seem to like "-o loop" for some reason
# It works on collie and b0rks on poodle.
if [ "$IMAGE_TYPE" = "" ]; then
IMAGE_TYPE="auto"
fi
# If mount fails it has the tendency to spew out a _lot_ of error messages.
- # We direct the output to /dev/null so the user can see which step actually failed.
- mount -o loop -t $IMAGE_TYPE $1/$IMAGE_PATH/$IMAGE_NAME /media/image >/dev/null 2>&1 || die "mount -t $IMAGE_TYPE /dev/loop0 /media/image failed!"
+ # We direct the output to /dev/null so the user can see which step actually failed.
+ mount /dev/loop0 -t $IMAGE_TYPE /media/image >/dev/null 2>&1 || die "mount -t $IMAGE_TYPE /dev/loop0 /media/image failed!"
mkdir -p /media/image/media/ROM || die "mkdir -p /media/image/media/ROM failed"
@@ -280,7 +278,7 @@ check_fs() {
elif [ -e /sbin/e2fsck ]; then
FSCK="/sbin/e2fsck"
fi
- FSCK="$FSCK -p"
+ test -n "$FSCK" && FSCK="$FSCK -p"
;;
vfat)
if [ -e /sbin/dosfsck ]; then
@@ -310,11 +308,11 @@ init_rootfs(){
fi
echo -n "Generating device files..." >/dev/tty0
- /etc/init.d/devices start && echo ok >/dev/tty0|| die "FAILED"
+ /etc/init.d/devices start && echo ok >/dev/tty0 || die "FAILED"
}
mount_sd(){
- if mount | grep -q "/media/card "
+ if mount | grep -q "/media/card"
then
echo "Note: /media/card is already mounted"
else
@@ -353,13 +351,15 @@ mount_cf(){
if mount | grep -q "/media/cf "
then
echo "Note: /media/cf is already mounted"
- else
- /etc/init.d/pcmcia start || die "/etc/init.d/pcmcia/start failed!"
+ else
+ /etc/init.d/pcmcia status | grep -q running || /etc/init.d/pcmcia start && echo "Note: cardmgr is already active"
echo ""
# Give the SD and CF mounting some time. This is a must for SD
sleep 2
+
+ mount | grep -q "/media/cf " || mount /media/cf
fi
}
@@ -369,7 +369,7 @@ mount_home(){
echo "Note: /home is already mounted"
else
- if ( grep -q "/home " /etc/fstab )
+ if ( cat /etc/fstab | grep -v "^#" | grep "/home " )
then
echo "Mounting /home"
home_fstab="`grep "/home " /etc/fstab`"