summaryrefslogtreecommitdiff
path: root/packages/altboot/files/spitz
diff options
context:
space:
mode:
authorMatthias Hentges <oe@hentges.net>2005-08-04 18:07:53 +0000
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>2005-08-04 18:07:53 +0000
commit1ccca3990804fa39ec648c415c1a24756fab83c8 (patch)
tree08c0acce82c0adae3ccea22ae5573f129f2cb0dc /packages/altboot/files/spitz
parent019903803d5b8d1fead525d1f0d197b1786c1b8c (diff)
altboot: Sources are now managed by OE's mt database.
Diffstat (limited to 'packages/altboot/files/spitz')
-rw-r--r--packages/altboot/files/spitz/.mtn2git_empty0
-rw-r--r--packages/altboot/files/spitz/altboot-menu/.mtn2git_empty0
-rw-r--r--packages/altboot/files/spitz/altboot-menu/00-Default49
-rw-r--r--packages/altboot/files/spitz/altboot-menu/10-noGui47
-rw-r--r--packages/altboot/files/spitz/altboot-menu/15-bootSD64
-rw-r--r--packages/altboot/files/spitz/altboot-menu/20-bootCF49
-rw-r--r--packages/altboot/files/spitz/altboot-menu/99-ownScripts-example81
-rw-r--r--packages/altboot/files/spitz/altboot-menu/Advanced/.mtn2git_empty0
-rw-r--r--packages/altboot/files/spitz/altboot-menu/Advanced/40-bootNFS97
-rw-r--r--packages/altboot/files/spitz/altboot-menu/Advanced/55-bin-sh23
-rw-r--r--packages/altboot/files/spitz/altboot.cfg21
11 files changed, 431 insertions, 0 deletions
diff --git a/packages/altboot/files/spitz/.mtn2git_empty b/packages/altboot/files/spitz/.mtn2git_empty
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/packages/altboot/files/spitz/.mtn2git_empty
diff --git a/packages/altboot/files/spitz/altboot-menu/.mtn2git_empty b/packages/altboot/files/spitz/altboot-menu/.mtn2git_empty
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/packages/altboot/files/spitz/altboot-menu/.mtn2git_empty
diff --git a/packages/altboot/files/spitz/altboot-menu/00-Default b/packages/altboot/files/spitz/altboot-menu/00-Default
new file mode 100644
index 0000000000..c18633a136
--- /dev/null
+++ b/packages/altboot/files/spitz/altboot-menu/00-Default
@@ -0,0 +1,49 @@
+# !/bin/sh
+M_TITLE="Normal Boot"
+
+# Note for Spitz: The HDD has already been mounted in /media/hdd from
+# /etc/altboot.rc/00-Default.sh
+
+die() {
+ echo "ERROR: $1" >/dev/tty0
+ exec $SH_SHELL </dev/tty0 >/dev/tty0 2>&1
+}
+
+run_module() {
+
+ test -e /etc/altboot.func && . /etc/altboot.func || die "ERROR: /etc/altboot.func not found. Check your installation!"
+
+ test -z "$SPITZ_HDD_PART" && SPITZ_HDD_PART="/dev/hda1"
+ echo "Spitz: Mounting [$SPITZ_HDD_PART] as /media/hdd"
+ mount -t proc proc /proc || echo "Mounting /proc failed!"
+
+ mount -o remount,rw /
+
+ # Note: Redirecting STDIN & STDOUT is required, cardmg will die otherwise
+ cardmgr -o < /dev/tty0 > /dev/tty0 2>&1 || echo "cardmgr -o failed!"
+
+ # I've seen busybox die a horrible death on "!"...
+ if (mount -t auto $SPITZ_HDD_PART /media/hdd)
+ then
+ a=a
+ else
+ echo "ERROR: mount -t ext3 $SPITZ_HDD_PART /media/hdd failed!"
+ exec $SH_SHELL </dev/tty0 >/dev/tty0 2>&1
+ fi
+
+ # There are no device files on Spitz yet, requires HDD (bad for testing
+ # with CF)
+ for n in 1 2 3 4 5
+ do
+ mknod /dev/loop$n b 7 $n
+ done
+
+ # Check for /sbin/init and / or loop-images
+ check_target "/media/hdd" 5
+}
+
+case "$1" in
+title) echo "$M_TITLE";;
+run) run_module;;
+esac
+
diff --git a/packages/altboot/files/spitz/altboot-menu/10-noGui b/packages/altboot/files/spitz/altboot-menu/10-noGui
new file mode 100644
index 0000000000..3f1ce81fd5
--- /dev/null
+++ b/packages/altboot/files/spitz/altboot-menu/10-noGui
@@ -0,0 +1,47 @@
+# !/bin/sh
+M_TITLE="Don't launch GUI"
+
+
+die() {
+ echo "ERROR: $1" >/dev/tty0
+ exec $SH_SHELL </dev/tty0 >/dev/tty0 2>&1
+}
+
+run_module() {
+
+ test -e /etc/altboot.func && . /etc/altboot.func || die "ERROR: /etc/altboot.func not found. Check your installation!"
+
+ test -z "$SPITZ_HDD_PART" && SPITZ_HDD_PART="/dev/hda1"
+ echo "Spitz: Mounting [$SPITZ_HDD_PART] as /media/hdd"
+ mount -t proc proc /proc || echo "Mounting /proc failed!"
+
+ mount -o remount,rw /
+
+ # Note: Redirecting STDIN & STDOUT is required, cardmg will die otherwise
+ cardmgr -o < /dev/tty0 > /dev/tty0 2>&1 || echo "cardmgr -o failed!"
+
+ # I've seen busybox die a horrible death on "!"...
+ if (mount -t auto $SPITZ_HDD_PART /media/hdd)
+ then
+ a=a
+ else
+ echo "ERROR: mount -t ext3 $SPITZ_HDD_PART /media/hdd failed!"
+ exec $SH_SHELL </dev/tty0 >/dev/tty0 2>&1
+ fi
+
+ # There are no device files on Spitz yet, requires HDD (bad for testing
+ # with CF)
+ for n in 1 2 3 4 5
+ do
+ mknod /dev/loop$n b 7 $n
+ done
+
+ # Check for /sbin/init and / or loop-images
+ check_target "/media/hdd" 2
+}
+
+case "$1" in
+title) echo "$M_TITLE";;
+run) run_module;;
+esac
+
diff --git a/packages/altboot/files/spitz/altboot-menu/15-bootSD b/packages/altboot/files/spitz/altboot-menu/15-bootSD
new file mode 100644
index 0000000000..d22316033c
--- /dev/null
+++ b/packages/altboot/files/spitz/altboot-menu/15-bootSD
@@ -0,0 +1,64 @@
+# !/bin/sh
+#
+# Copyright Matthias Hentges (c) 2005
+#
+# License: GPL (see http://www.gnu.org/licenses/gpl.txt for a copy of the GPL)
+
+
+M_TITLE="Boot SD card"
+
+die() {
+ echo "ERROR: $1" >/dev/tty0
+ exec $SH_SHELL </dev/tty0 >/dev/tty0 2>&1
+}
+
+# This function is activated by init.altboot by calling this script with the "run" option
+run_module() {
+
+ test -e /etc/altboot.func && . /etc/altboot.func || die "ERROR: /etc/altboot.func not found. Check your installation!"
+
+ echo -n "Mounting rootfs rw..." >/dev/tty0
+ mount -o remount,rw / >/dev/tty0 2>&1 && echo ok >/dev/tty0|| die "mount -o remount,rw / failed"
+
+ test -z "$SPITZ_HDD_PART" && SPITZ_HDD_PART="/dev/hda1"
+ mount -t proc proc /proc || echo "Mounting /proc failed!"
+
+ # Note: Redirecting STDIN & STDOUT is required, cardmg will die otherwise
+ cardmgr -o < /dev/tty0 > /dev/tty0 2>&1 || echo "cardmgr -o failed!"
+
+ # I've seen busybox die a horrible death on "!"...
+ if (mount -t auto $SPITZ_HDD_PART /media/hdd)
+ then
+ a=a
+ else
+ echo "ERROR: mount -t auto $SPITZ_HDD_PART /media/hdd failed!"
+ exec $SH_SHELL </dev/tty0 >/dev/tty0 2>&1
+ fi
+
+# echo -n "Generating device files..." >/dev/tty0
+# /etc/init.d/devices start && echo ok >/dev/tty0|| die "FAILED"
+
+# FIXME: generate device-files
+
+ echo -n "Loading SD kernel module..."
+ /sbin/insmod $SD_KERNEL_MODULE >/dev/null 2>&1 && echo ok || die "insmod failed"
+
+ echo -n "Mounting $SD_MOUNTPOINT..." >/dev/tty0
+ /bin/mount -t auto -o defaults,noatime $SD_DEVICE $SD_MOUNTPOINT >/dev/null 2>&1 && echo ok >/dev/tty0|| die "/bin/mount -t auto -o defaults,noatime $SD_DEVICE $SD_MOUNTPOINT failed"
+
+ echo ""
+
+ # Give the SD and CF mounting some time. This is a must for SD
+ sleep 2
+
+ # Check for a real fs and loop-images.
+ check_target "$SD_MOUNTPOINT" >/dev/tty0
+
+}
+
+
+case "$1" in
+title) echo "$M_TITLE";;
+run) run_module "$2";;
+esac
+
diff --git a/packages/altboot/files/spitz/altboot-menu/20-bootCF b/packages/altboot/files/spitz/altboot-menu/20-bootCF
new file mode 100644
index 0000000000..3f19b4ee48
--- /dev/null
+++ b/packages/altboot/files/spitz/altboot-menu/20-bootCF
@@ -0,0 +1,49 @@
+# !/bin/sh
+#
+# Copyright Matthias Hentges (c) 2005
+#
+# License: GPL (see http://www.gnu.org/licenses/gpl.txt for a copy of the GPL)
+
+# FXIME: boot CF on spitz (hdb??)
+exit 0
+
+M_TITLE="Boot CF card"
+
+die() {
+ echo "ERROR: $1" >/dev/tty0
+ exec $SH_SHELL </dev/tty0 >/dev/tty0 2>&1
+}
+
+# This function is activated by init.altboot by calling this script with the "run" option
+run_module() {
+
+ test -e /etc/altboot.func && . /etc/altboot.func || die "ERROR: /etc/altboot.func not found. Check your installation!"
+
+ echo -n "Mounting rootfs rw..." >/dev/tty0
+ mount -o remount,rw / >/dev/tty0 2>&1 && echo ok >/dev/tty0|| die "mount -o remount,rw / failed"
+
+ echo -n "Generating device files..." >/dev/tty0
+ /etc/init.d/devices start && echo ok >/dev/tty0|| die "FAILED"
+
+
+ echo -n "Mounting /proc..." >/dev/tty0
+ mount /proc >/dev/tty0 2>&1 && echo ok >/dev/tty0|| die "mount /proc failed!"
+
+ /etc/init.d/pcmcia start || die "/etc/init.d/pcmcia/start failed!"
+
+ echo ""
+
+ # Give the SD and CF mounting some time. This is a must for SD
+ sleep 2
+
+ # Check for a real fs and loop-images.
+ check_target "$CF_MOUNTPOINT"
+
+}
+
+
+case "$1" in
+title) echo "$M_TITLE";;
+run) run_module "$2";;
+esac
+
diff --git a/packages/altboot/files/spitz/altboot-menu/99-ownScripts-example b/packages/altboot/files/spitz/altboot-menu/99-ownScripts-example
new file mode 100644
index 0000000000..61c0645176
--- /dev/null
+++ b/packages/altboot/files/spitz/altboot-menu/99-ownScripts-example
@@ -0,0 +1,81 @@
+# !/bin/sh
+#
+# Copyright Matthias Hentges (c) 2005
+#
+# License: GPL (see http://www.gnu.org/licenses/gpl.txt for a copy of the GPL)
+
+
+# This file will teach you how to implement your own scripts while using existing altboot
+# code.
+
+# /sbin/init.altboot searches /etc/altboot-menu for scripts. It will only list scripts which
+# return a title when run with the "title" parameter.
+# Script which do not return a title will never be shown in the boot menu!
+#
+M_TITLE="altboot sample"
+
+# We can use that to deactivate certain scripts:
+exit 0
+
+# The "title" parameter is implemented at the end of this script so it will never be reached
+# and the script will simply be ignored by altboot.
+
+
+# The die() function aborts the boot if something goes wrong and sets STDIN / STDERR / STDOUT
+# correctly.
+die() {
+ echo "ERROR: $1" >/dev/tty0
+ exec $SH_SHELL </dev/tty0 >/dev/tty0 2>&1
+}
+
+# This function is activated by init.altboot by calling this script with the "run" option
+run_module() {
+
+ # altboot.func contains re-useable code. If you intend to use check_target (see below)
+ # you must keep this line. If not, delete it.
+ test -e /etc/altboot.func && . /etc/altboot.func || die "ERROR: /etc/altboot.func not found. Check your installation!"
+
+
+ # The only thing you'll have to do is get your medium mounted.
+ # The following lines mount a SD card on 2.4-series kernels on a Zaurus
+
+ ##########################################
+
+
+ echo -n "Mounting rootfs rw..." >/dev/tty0
+ mount -o remount,rw / >/dev/tty0 2>&1 && echo ok >/dev/tty0|| die "mount -o remount,rw / failed"
+
+ echo -n "Generating device files..." >/dev/tty0
+ /etc/init.d/devices start && echo ok >/dev/tty0|| die "FAILED"
+
+
+ echo -n "Loading SD kernel module..."
+ /sbin/insmod $SD_KERNEL_MODULE >/dev/null 2>&1 && echo ok || die "insmod failed"
+
+ echo -n "Mounting $SD_MOUNTPOINT..." >/dev/tty0
+ /bin/mount -t auto -o defaults,noatime $SD_DEVICE $SD_MOUNTPOINT >/dev/null 2>&1 && echo ok >/dev/tty0|| die "/bin/mount -t auto -o defaults,noatime $SD_DEVICE $SD_MOUNTPOINT failed"
+
+ echo ""
+
+ # Give the SD and CF mounting some time. This is a must for SD
+ sleep 2
+ ##########################################
+
+ # Once the medium (be it a CF or SD card, or even a NFS drive) is mounted somewhere,
+ # just call check_target with the mountpoint as parameter.
+ # check_target searches the medium for a real filesystem and loop-images and
+ # asks the user what to boot if there are several choices.
+
+ # Check for a real fs and loop-images.
+ check_target "$SD_MOUNTPOINT" >/dev/tty0
+
+ # Done :)
+
+}
+
+
+case "$1" in
+title) echo "$M_TITLE";;
+run) run_module "$2";;
+esac
+
diff --git a/packages/altboot/files/spitz/altboot-menu/Advanced/.mtn2git_empty b/packages/altboot/files/spitz/altboot-menu/Advanced/.mtn2git_empty
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/packages/altboot/files/spitz/altboot-menu/Advanced/.mtn2git_empty
diff --git a/packages/altboot/files/spitz/altboot-menu/Advanced/40-bootNFS b/packages/altboot/files/spitz/altboot-menu/Advanced/40-bootNFS
new file mode 100644
index 0000000000..6cac410019
--- /dev/null
+++ b/packages/altboot/files/spitz/altboot-menu/Advanced/40-bootNFS
@@ -0,0 +1,97 @@
+# !/bin/sh
+#
+# Copyright Matthias Hentges (c) 2005
+#
+# License: GPL (see http://www.gnu.org/licenses/gpl.txt for a copy of the GPL)
+
+# FIXME: Make this work
+
+M_TITLE="Boot from NFS"
+
+die() {
+ echo "ERROR: $1" >/dev/tty0
+ exec $SH_SHELL </dev/tty0 >/dev/tty0 2>&1
+}
+
+# This function is activated by init.altboot by calling this script with the "run" option
+run_module() {
+
+ test -e /etc/altboot.func && . /etc/altboot.func || die "ERROR: /etc/altboot.func not found. Check your installation!"
+
+ echo -n "Mounting rootfs rw..." >/dev/tty0
+ mount -o remount,rw / >/dev/tty0 2>&1 && echo ok >/dev/tty0|| die "mount -o remount,rw / failed"
+
+ echo -n "Generating device files..." >/dev/tty0
+ /etc/init.d/devices start && echo ok >/dev/tty0|| die "FAILED"
+
+ echo -n "Mounting /proc..." >/dev/tty0
+ mount /proc >/dev/tty0 2>&1 && echo ok >/dev/tty0 || echo failed
+
+ # Needed for NFS
+ /etc/init.d/portmap start >/dev/tty1 2>&1 || die "/etc/init.d/portmap start failed!"
+
+ # For some reason NFS mounts hang if /e/i/networking is not run.
+ # For the time beeing I'm to lazy to investigate ;)
+ /etc/init.d/networking start || die "/etc/init.d/networking start failed!"
+
+ sleep 2
+
+ # After the PCMCIA service is started, an inserted WLAN card should automatically
+ # activate itself.
+ /etc/init.d/pcmcia start || die "/etc/init.d/pcmcia/start failed!"
+
+ # Give WLAN time to login into the network
+ echo "Waiting for WLAN..."
+ sleep 8
+
+ nfs_mounts="`cat /etc/fstab | grep -v ^# | grep nfs | awk '{print $1}'`"
+ nfs_mountpoints="`cat /etc/fstab | grep -v ^# | grep nfs | awk '{print $2}'`"
+
+ if test "` echo "$nfs_mountpoints" |wc -l | tr -d " "`" -gt 1
+ then
+ echo -e "Please select your NFS root:\n"
+
+ cnt=1
+ for nfs_mount in $nfs_mountpoints
+ do
+ echo -e "\t[$cnt] $nfs_mount"
+ let cnt=$cnt+1
+ done
+
+ echo ""
+
+ while test -z "$selection"
+ do
+ echo -n "Boot NFS root: "
+ read junk < /dev/tty1
+
+ cnt=1
+ for nfs_mount in $nfs_mounts
+ do
+ if test "$junk" = "$cnt"
+ then
+ selection="$nfs_mount"
+ fi
+ let cnt=$cnt+1
+ done
+
+ done
+ else
+ test -z "$nfs_mounts" && die "No NFS mounts configured in /etc/fstab!"
+ selection="$nfs_mounts"
+ fi
+
+ mkdir -p /media/nfsroot || die "mkdir -p /media/nfsroot failed!"
+
+ echo -n "Mounting NFS root..."
+ mount -t nfs "$selection" /media/nfsroot && echo ok || die "mount -t nfs "$selection" /media/nfsroot failed!"
+
+ check_target "/media/nfsroot"
+
+}
+
+case "$1" in
+title) echo "$M_TITLE";;
+run) run_module "$2";;
+esac
+
diff --git a/packages/altboot/files/spitz/altboot-menu/Advanced/55-bin-sh b/packages/altboot/files/spitz/altboot-menu/Advanced/55-bin-sh
new file mode 100644
index 0000000000..6db4adaf3a
--- /dev/null
+++ b/packages/altboot/files/spitz/altboot-menu/Advanced/55-bin-sh
@@ -0,0 +1,23 @@
+# !/bin/sh
+M_TITLE="init=/bin/sh"
+
+
+run_module() {
+
+ test -e /etc/altboot.func && . /etc/altboot.func || die "ERROR: /etc/altboot.func not found. Check your installation!"
+
+ test "$ASK_PW_ON_BOOT" != "yes" && verify_master_pw >/dev/tty0
+
+ echo -e "\nBoot system with 'exec /sbin/init 5'\n"
+ while true
+ do
+ exec $SH_SHELL </dev/tty0 >/dev/tty0 2>&1
+ echo "WARNING: Shell was killed!"
+ done
+}
+
+case "$1" in
+title) echo "$M_TITLE";;
+run) run_module;;
+esac
+
diff --git a/packages/altboot/files/spitz/altboot.cfg b/packages/altboot/files/spitz/altboot.cfg
new file mode 100644
index 0000000000..7ae0770086
--- /dev/null
+++ b/packages/altboot/files/spitz/altboot.cfg
@@ -0,0 +1,21 @@
+#
+# Handled by /sbin/init.altboot
+# Allow booting images from SD, CF or RAM instead of booting
+# the ROM. This is currently broken.
+ENABLE_ALTBOOT="yes"
+TIMEOUT="3"
+REAL_INIT="/sbin/init.sysvinit"
+SH_SHELL="/bin/sh"
+IMAGE_PATH="boot-images"
+FSCK_IMAGES="yes"
+SD_DEVICE="/dev/mmcda1"
+SD_KERNEL_MODULE="/media/hdd/lib/modules/2.4.20/kernel/drivers/block/sharp_mmcsd_m.o"
+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"
+