summaryrefslogtreecommitdiff
path: root/packages/altboot/files
diff options
context:
space:
mode:
authorMatthias Hentges <oe@hentges.net>2005-08-09 15:30:31 +0000
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>2005-08-09 15:30:31 +0000
commit7932f599f2e825c26e85a3ed5b713bc7c35b2ede (patch)
treef6a360059d75d70490c3a94278be4de32d94c709 /packages/altboot/files
parentf603ad225becb7149cfde643c3f868dd4db275db (diff)
altboot: Lots and lots of Spitz adjustments, courtesy of JustinP
Diffstat (limited to 'packages/altboot/files')
-rw-r--r--packages/altboot/files/altboot-menu/Advanced/80-copyrootfs1
-rw-r--r--packages/altboot/files/altboot.func55
-rw-r--r--packages/altboot/files/init.altboot4
-rw-r--r--packages/altboot/files/spitz/altboot-menu/00-Default9
-rw-r--r--packages/altboot/files/spitz/altboot-menu/10-noGui2
-rw-r--r--packages/altboot/files/spitz/altboot.cfg10
6 files changed, 64 insertions, 17 deletions
diff --git a/packages/altboot/files/altboot-menu/Advanced/80-copyrootfs b/packages/altboot/files/altboot-menu/Advanced/80-copyrootfs
index bac366303c..1949f20b48 100644
--- a/packages/altboot/files/altboot-menu/Advanced/80-copyrootfs
+++ b/packages/altboot/files/altboot-menu/Advanced/80-copyrootfs
@@ -1,7 +1,6 @@
# !/bin/sh
M_TITLE="Copy rootfs to SD/CF"
-exit 0
die() {
echo "ERROR: $1" >/dev/tty0
diff --git a/packages/altboot/files/altboot.func b/packages/altboot/files/altboot.func
index 260d0a977b..251368a577 100644
--- a/packages/altboot/files/altboot.func
+++ b/packages/altboot/files/altboot.func
@@ -139,22 +139,19 @@ pivot_image() {
mkdir -p /media/image || die "mkdir -p /media/image failed"
-
- if test "$FSCK_IMAGES" = yes
- then
- echo "Checking file system on [$IMAGE_NAME]"
- losetup /dev/loop0 $1/$IMAGE_PATH/$IMAGE_NAME || die "losetup /dev/loop0 $1/$IMAGE_PATH/$IMAGE_NAME failed!"
- fsck.ext3 -p /dev/loop0 || sleep 2
- losetup -d /dev/loop0
- fi
+ 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
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.
- losetup /dev/loop1 $1/$IMAGE_PATH/$IMAGE_NAME || die "losetup /dev/loop1 $1/$IMAGE_PATH/$IMAGE_NAME failed!"
- mount /dev/loop1 /media/image || die "mount /dev/loop1 /media/image failed!"
+ if [ "$IMAGE_TYPE" = "" ]; then
+ $IMAGE_TYPE = "auto"
+ fi
+ mount -t $IMAGE_TYPE /dev/loop0 /media/image || die "mount /dev/loop0 /media/image failed!"
mkdir -p /media/image/media/ROM || die "mkdir -p /media/image/media/ROM failed"
@@ -256,3 +253,41 @@ verify_master_pw() {
done
fi
}
+
+
+check_fs() {
+ if [ "$FSCK_IMAGES" = "yes" ]
+ then
+ FSCK=""
+ if [ "$2" = "" ]; then
+ FSTYPE="ext2"
+ else
+ FSTYPE="$2"
+ fi
+ case "$FSTYPE" in
+ ext2 | ext3)
+ if [ -e /sbin/fsck.ext3 ]; then
+ FSCK="/sbin/fsck.ext3"
+ elif [ -e /sbin/e3fsck ]; then
+ FSCK="/sbin/e3fsck"
+ elif [ -e /sbin/fsck.ext2 ]; then
+ FSCK="/sbin/fsck.ext2"
+ elif [ -e /sbin/e2fsck ]; then
+ FSCK="/sbin/e2fsck"
+ fi
+ FSCK="$FSCK -p"
+ ;;
+ vfat)
+ if [ -e /sbin/dosfsck ]; then
+ FSCK="/sbin/dosfsck -a"
+ fi
+ ;;
+ esac
+ if [ "$FSCK" = "" ]; then
+ echo "Could not find fsck for $FSTYPE!"
+ else
+ echo "Checking file system on $1"
+ $FSCK $1 || sleep 2
+ fi
+ fi
+}
diff --git a/packages/altboot/files/init.altboot b/packages/altboot/files/init.altboot
index 57560b8326..26b4639ccd 100644
--- a/packages/altboot/files/init.altboot
+++ b/packages/altboot/files/init.altboot
@@ -252,7 +252,9 @@ else
# Execute scripts in /etc/altboot.rc before doing anything else.
# Required for special situations, like booting spitz
- for file in `ls -1 /etc/altboot.rc/*.sh` >/dev/null 2>&1
+ RC_FILES=`ls /etc/altboot.rc | grep \\\\.sh$`
+
+ for file in $RC_FILES
do
. $file >/dev/tty1 2>&1 || echo "/etc/altboot.rc/$file failed!"
done
diff --git a/packages/altboot/files/spitz/altboot-menu/00-Default b/packages/altboot/files/spitz/altboot-menu/00-Default
index c18633a136..06ed038473 100644
--- a/packages/altboot/files/spitz/altboot-menu/00-Default
+++ b/packages/altboot/files/spitz/altboot-menu/00-Default
@@ -21,9 +21,14 @@ run_module() {
# Note: Redirecting STDIN & STDOUT is required, cardmg will die otherwise
cardmgr -o < /dev/tty0 > /dev/tty0 2>&1 || echo "cardmgr -o failed!"
+
+ check_fs $SPITZ_HDD_PART $SPITZ_HDD_TYPE
+ if [ "$SPITZ_HDD_TYPE" = "" ]; then
+ SPITZ_HDD_TYPE="auto"
+ fi
# I've seen busybox die a horrible death on "!"...
- if (mount -t auto $SPITZ_HDD_PART /media/hdd)
+ if (mount -t $SPITZ_HDD_TYPE $SPITZ_HDD_PART /media/hdd)
then
a=a
else
@@ -35,7 +40,7 @@ run_module() {
# with CF)
for n in 1 2 3 4 5
do
- mknod /dev/loop$n b 7 $n
+ ! test -e /dev/loop$n && mknod /dev/loop$n b 7 $n
done
# Check for /sbin/init and / or loop-images
diff --git a/packages/altboot/files/spitz/altboot-menu/10-noGui b/packages/altboot/files/spitz/altboot-menu/10-noGui
index 3f1ce81fd5..e4e8b0fe37 100644
--- a/packages/altboot/files/spitz/altboot-menu/10-noGui
+++ b/packages/altboot/files/spitz/altboot-menu/10-noGui
@@ -33,7 +33,7 @@ run_module() {
# with CF)
for n in 1 2 3 4 5
do
- mknod /dev/loop$n b 7 $n
+ ! test -e /dev/loop$n && mknod /dev/loop$n b 7 $n
done
# Check for /sbin/init and / or loop-images
diff --git a/packages/altboot/files/spitz/altboot.cfg b/packages/altboot/files/spitz/altboot.cfg
index 7ae0770086..2640d9279a 100644
--- a/packages/altboot/files/spitz/altboot.cfg
+++ b/packages/altboot/files/spitz/altboot.cfg
@@ -4,9 +4,10 @@
# the ROM. This is currently broken.
ENABLE_ALTBOOT="yes"
TIMEOUT="3"
-REAL_INIT="/sbin/init.sysvinit"
+REAL_INIT="/sbin/init"
SH_SHELL="/bin/sh"
IMAGE_PATH="boot-images"
+IMAGE_TYPE="ext3"
FSCK_IMAGES="yes"
SD_DEVICE="/dev/mmcda1"
SD_KERNEL_MODULE="/media/hdd/lib/modules/2.4.20/kernel/drivers/block/sharp_mmcsd_m.o"
@@ -14,8 +15,13 @@ INIT_RUNLEVEL="5"
NO_GUI_RL="2"
MASTER_PASSWORD=""
ASK_PW_ON_BOOT="no"
-SPITZ_HDD_PART="/dev/hda1"
SD_MOUNTPOINT="/media/card"
CF_MOUNTPOINT="/media/cf"
+HDD3_DEVICE="/dev/hda3"
+HDD3_MOUNTPOINT="/media/hdd3"
+HDD3_TYPE="vfat"
+
+SPITZ_HDD_PART="/dev/hda1"
+SPITZ_HDD_TYPE="ext3"