summaryrefslogtreecommitdiff
path: root/packages/altboot/files
diff options
context:
space:
mode:
Diffstat (limited to 'packages/altboot/files')
-rw-r--r--packages/altboot/files/akita/altboot-2.6.cfg3
-rw-r--r--packages/altboot/files/altboot-menu/Advanced/30-bootUSB-Stick1
-rw-r--r--packages/altboot/files/altboot-menu/Advanced/35-kexec62
-rw-r--r--packages/altboot/files/altboot-menu/Advanced/40-bootNFS2
-rw-r--r--packages/altboot/files/altboot-menu/Advanced/70-install-tgz40
-rw-r--r--packages/altboot/files/altboot.func24
-rw-r--r--packages/altboot/files/altboot.rc/loadkeymap.sh5
-rw-r--r--packages/altboot/files/borzoi/.mtn2git_empty0
-rw-r--r--packages/altboot/files/borzoi/altboot-2.4.cfg27
-rw-r--r--packages/altboot/files/borzoi/altboot-2.6.cfg30
-rw-r--r--packages/altboot/files/c7x0/.mtn2git_empty0
-rw-r--r--packages/altboot/files/c7x0/altboot-2.4.cfg26
-rw-r--r--packages/altboot/files/c7x0/altboot-2.6.cfg26
-rw-r--r--packages/altboot/files/init.altboot4
14 files changed, 224 insertions, 26 deletions
diff --git a/packages/altboot/files/akita/altboot-2.6.cfg b/packages/altboot/files/akita/altboot-2.6.cfg
index 42f0968134..69f7c8351b 100644
--- a/packages/altboot/files/akita/altboot-2.6.cfg
+++ b/packages/altboot/files/akita/altboot-2.6.cfg
@@ -18,6 +18,9 @@ USB_STORAGE_MODULES="usb_ohci_pxa27x usb-storage"
USB_STORAGE_PARTITION="/dev/sda1"
USB_STORAGE_WAIT="4"
+KEXEC_KERNEL_DIR="/boot"
+KEXEC_BIN="/usr/sbin/kexec"
+
INIT_RUNLEVEL="5"
NO_GUI_RL="2"
MASTER_PASSWORD=""
diff --git a/packages/altboot/files/altboot-menu/Advanced/30-bootUSB-Stick b/packages/altboot/files/altboot-menu/Advanced/30-bootUSB-Stick
index c5222800e5..3cf8c506b0 100644
--- a/packages/altboot/files/altboot-menu/Advanced/30-bootUSB-Stick
+++ b/packages/altboot/files/altboot-menu/Advanced/30-bootUSB-Stick
@@ -8,6 +8,7 @@
M_TITLE="Boot USB Storage"
test "$USB_HOST_AVAILABLE" = "yes" || exit 0
+
die() {
echo "ERROR: $1" >/dev/tty0
exec $SH_SHELL </dev/tty0 >/dev/tty0 2>&1
diff --git a/packages/altboot/files/altboot-menu/Advanced/35-kexec b/packages/altboot/files/altboot-menu/Advanced/35-kexec
new file mode 100644
index 0000000000..41b193a379
--- /dev/null
+++ b/packages/altboot/files/altboot-menu/Advanced/35-kexec
@@ -0,0 +1,62 @@
+# !/bin/sh
+M_TITLE="init=/bin/sh"
+
+exit 0
+
+# Only kernel 2.6 offers kexec support
+uname -r | grep -q "^2.6" || exit 0
+
+run_module() {
+
+ test -e /etc/altboot.func && . /etc/altboot.func || die "ERROR: /etc/altboot.func not found. Check your installation!"
+
+ test -z "$KEXEC_KERNEL_DIR" && KEXEC_KERNEL_DIR="/boot"
+ test -x "$KEXEC_BIN" || die "kexec-tools not found [$KEXEC_BIN]"
+
+ # Mount /proc, etc
+ init_rootfs
+
+ if test "`find "$KEXEC_KERNEL_DIR" -type f -name "*zImage*" | wc -l | tr -d " "`" -gt 1
+ then
+ echo "Please choose a kernel to boot:"
+ cd "$KEXEC_KERNEL_DIR"
+
+ cnt=1
+ for f in `ls -1 "$KEXEC_KERNEL_DIR"`
+ do
+ echo "[$cnt] $f"
+ let cnt=$cnt+1
+ done
+
+ while true
+ do
+ echo -n "Boot kernel: "
+ read junk
+
+ if test -n "$junk"
+ then
+ cnt=1
+ for f in `ls -1 "$KEXEC_KERNEL_DIR"`
+ do
+ if test "$cnt" = "$junk"
+ then
+ KEXEC_KERNEL="$f"
+ break
+ fi
+ let cnt=$cnt+1
+ done
+ fi
+ done
+
+ echo "kernel dir:[$KEXEC_KERNEL_DIR]"
+ echo "Using kernel: [$KEXEC_KERNEL]"
+
+
+ for
+}
+
+case "$1" in
+title) echo "$M_TITLE";;
+run) run_module;;
+esac
+
diff --git a/packages/altboot/files/altboot-menu/Advanced/40-bootNFS b/packages/altboot/files/altboot-menu/Advanced/40-bootNFS
index cf1d1da8e6..3a41fccf79 100644
--- a/packages/altboot/files/altboot-menu/Advanced/40-bootNFS
+++ b/packages/altboot/files/altboot-menu/Advanced/40-bootNFS
@@ -116,7 +116,7 @@ run_module() {
# Use configured resolv.conf in the pivoted rootfs
echo -n "Copying resolv.conf..."
- cp /etc/resolv.conf /media/nfsroot/etc && echo ok || echo "FAILED"
+ #cp /etc/resolv.conf /media/nfsroot/etc && echo ok || echo "FAILED"
check_target "/media/nfsroot"
diff --git a/packages/altboot/files/altboot-menu/Advanced/70-install-tgz b/packages/altboot/files/altboot-menu/Advanced/70-install-tgz
index 2ff380418d..cdfa052747 100644
--- a/packages/altboot/files/altboot-menu/Advanced/70-install-tgz
+++ b/packages/altboot/files/altboot-menu/Advanced/70-install-tgz
@@ -51,8 +51,18 @@ run_module(){
read junk
case "$junk" in
- 1) rootfs_target="/media/card"; break ;;
- 2) rootfs_target="/media/cf" ; break ;;
+ 1) if (mount | grep -q "/media/card ")
+ then
+ rootfs_target="/media/card"; break
+ else
+ echo -e "\nInstallation target [/media/card] not mounted\n"
+ fi ;;
+ 2) if (mount | grep -q "/media/cf ")
+ then
+ rootfs_target="/media/cf"; break
+ else
+ echo -e "\nInstallation target [/media/cf] not mounted\n"
+ fi ;;
esac
done
@@ -68,7 +78,13 @@ run_module(){
read junk
case "$junk" in
- 1) rootfs_type="image"; break ;;
+ 1) if test -x /sbin/mkfs.ext2
+ then
+ rootfs_type="image"
+ break
+ else
+ echo -e "\nNOTE: mkfs.ext2 (from e2fsprogs-mke2fs) not found, loop-images not supported\n"
+ fi ;;
2) rootfs_type="direct" ; break ;;
esac
done
@@ -86,8 +102,11 @@ clear_directories(){
for d in bin dev media proc sys usr boot etc lib mnt sbin tmp var
do
- echo "Removing [$1/$d]..."
- rm -rf "$1/$d"
+ if test -d "$1/$d"
+ then
+ echo "Removing [$1/$d]..."
+ rm -rf "$1/$d"
+ fi
done
}
@@ -95,6 +114,8 @@ clear_directories(){
install_rootfs_direct(){
+ mount | grep -q "$1 " || die "Installation target [$1] not mounted"
+
echo -e "Do you want to remove existing directories from [$1]\n before installing the new rootfs?"
echo ""
@@ -110,8 +131,7 @@ install_rootfs_direct(){
echo "Please press <ENTER> to begin the installation"
read junk </dev/tty0 >/dev/tty0 2>&1
-
- mount | grep -q "$1 " || die "Installation target [$1] not mounted"
+
test -d "$1" || die "Directory [$1] not found"
echo -n "Installing rootfs, please wait..."
@@ -121,7 +141,7 @@ install_rootfs_direct(){
sync
echo "done"
- umount "$1"
+# umount "$1"
echo "Press <ENTER> to bring up the altboot menu"
read junk </dev/tty0 >/dev/tty0 2>&1
@@ -152,7 +172,7 @@ install_rootfs_image(){
while true
do
- echo -n "Overwrite? [N|y] "
+ echo -n "Overwrite? [y|N] "
read junk2
case "$junk2" in
@@ -190,7 +210,7 @@ install_rootfs_image(){
if test -n "$junk"
then
- if test "$junk" -gt 1
+ if test "$junk" -gt 29
then
echo -n "Is [${junk}Mb] correct? [Y|n] "
read junk2
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`"
diff --git a/packages/altboot/files/altboot.rc/loadkeymap.sh b/packages/altboot/files/altboot.rc/loadkeymap.sh
index f9a7774549..97cff13dbb 100644
--- a/packages/altboot/files/altboot.rc/loadkeymap.sh
+++ b/packages/altboot/files/altboot.rc/loadkeymap.sh
@@ -1,5 +1,8 @@
#!/bin/sh
# Note: With kernel 2.6 the standard keymap is unusable
-test -x /etc/init.d/keymap && /etc/init.d/keymap start >/dev/null 2>&1
+test -x /etc/init.d/keymap && /etc/init.d/keymap start >/dev/null 2>&1
+
+# Do not exit w/ errorcode when the if above fails
+/bin/true
diff --git a/packages/altboot/files/borzoi/.mtn2git_empty b/packages/altboot/files/borzoi/.mtn2git_empty
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/packages/altboot/files/borzoi/.mtn2git_empty
diff --git a/packages/altboot/files/borzoi/altboot-2.4.cfg b/packages/altboot/files/borzoi/altboot-2.4.cfg
new file mode 100644
index 0000000000..8c404d4768
--- /dev/null
+++ b/packages/altboot/files/borzoi/altboot-2.4.cfg
@@ -0,0 +1,27 @@
+# Handled by /sbin/init.altboot
+# Allow booting images from SD or CF instead of booting
+# the ROM.
+ENABLE_ALTBOOT="yes"
+TIMEOUT="4"
+REAL_INIT="/sbin/init.sysvinit"
+SH_SHELL="/bin/sh"
+
+IMAGE_PATH="boot-images"
+IMAGE_TYPE="ext2"
+FSCK_IMAGES="yes"
+
+SD_DEVICE="/dev/mmcda1"
+SD_KERNEL_MODULE="/lib/modules/2.4.20/kernel/drivers/block/sharp_mmcsd_m.o"
+
+USB_HOST_AVAILABLE="yes"
+USB_STORAGE_MODULES="usb_ohci_pxa27x usb-storage"
+USB_STORAGE_PARTITION="/dev/sda1"
+USB_STORAGE_WAIT="4"
+
+INIT_RUNLEVEL="5"
+NO_GUI_RL="2"
+MASTER_PASSWORD=""
+ASK_PW_ON_BOOT="no"
+
+SD_MOUNTPOINT="/media/card"
+CF_MOUNTPOINT="/media/cf"
diff --git a/packages/altboot/files/borzoi/altboot-2.6.cfg b/packages/altboot/files/borzoi/altboot-2.6.cfg
new file mode 100644
index 0000000000..69f7c8351b
--- /dev/null
+++ b/packages/altboot/files/borzoi/altboot-2.6.cfg
@@ -0,0 +1,30 @@
+# Handled by /sbin/init.altboot
+# Allow booting images from SD or CF instead of booting
+# the ROM.
+ENABLE_ALTBOOT="yes"
+TIMEOUT="4"
+REAL_INIT="/sbin/init.sysvinit"
+SH_SHELL="/bin/sh"
+
+IMAGE_PATH="boot-images"
+IMAGE_TYPE="ext2"
+FSCK_IMAGES="yes"
+
+SD_DEVICE="/dev/mmcblk0p1"
+SD_KERNEL_MODULE=""
+
+USB_HOST_AVAILABLE="no"
+USB_STORAGE_MODULES="usb_ohci_pxa27x usb-storage"
+USB_STORAGE_PARTITION="/dev/sda1"
+USB_STORAGE_WAIT="4"
+
+KEXEC_KERNEL_DIR="/boot"
+KEXEC_BIN="/usr/sbin/kexec"
+
+INIT_RUNLEVEL="5"
+NO_GUI_RL="2"
+MASTER_PASSWORD=""
+ASK_PW_ON_BOOT="no"
+
+SD_MOUNTPOINT="/media/card"
+CF_MOUNTPOINT="/media/cf"
diff --git a/packages/altboot/files/c7x0/.mtn2git_empty b/packages/altboot/files/c7x0/.mtn2git_empty
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/packages/altboot/files/c7x0/.mtn2git_empty
diff --git a/packages/altboot/files/c7x0/altboot-2.4.cfg b/packages/altboot/files/c7x0/altboot-2.4.cfg
new file mode 100644
index 0000000000..32956e7f71
--- /dev/null
+++ b/packages/altboot/files/c7x0/altboot-2.4.cfg
@@ -0,0 +1,26 @@
+# Handled by /sbin/init.altboot
+# Allow booting images from SD or CF instead of booting
+# the ROM.
+ENABLE_ALTBOOT="yes"
+TIMEOUT="4"
+REAL_INIT="/sbin/init.sysvinit"
+SH_SHELL="/bin/sh"
+
+IMAGE_PATH="boot-images"
+IMAGE_TYPE="ext2"
+FSCK_IMAGES="yes"
+
+SD_DEVICE="/dev/mmcda1"
+SD_KERNEL_MODULE="/lib/modules/2.4.28/kernel/drivers/block/sharp_mmcsd_m.o"
+
+USB_STORAGE_MODULES="usb_ohci_pxa27x usb-storage"
+USB_STORAGE_PARTITION="/dev/sda1"
+USB_STORAGE_WAIT="4"
+
+INIT_RUNLEVEL="5"
+NO_GUI_RL="2"
+MASTER_PASSWORD=""
+ASK_PW_ON_BOOT="no"
+
+SD_MOUNTPOINT="/media/card"
+CF_MOUNTPOINT="/media/cf"
diff --git a/packages/altboot/files/c7x0/altboot-2.6.cfg b/packages/altboot/files/c7x0/altboot-2.6.cfg
new file mode 100644
index 0000000000..ad15f7169e
--- /dev/null
+++ b/packages/altboot/files/c7x0/altboot-2.6.cfg
@@ -0,0 +1,26 @@
+# Handled by /sbin/init.altboot
+# Allow booting images from SD or CF instead of booting
+# the ROM.
+ENABLE_ALTBOOT="yes"
+TIMEOUT="4"
+REAL_INIT="/sbin/init.sysvinit"
+SH_SHELL="/bin/sh"
+
+IMAGE_PATH="boot-images"
+IMAGE_TYPE="ext2"
+FSCK_IMAGES="yes"
+
+SD_DEVICE="/dev/mmcblk0p1"
+SD_KERNEL_MODULE=""
+
+USB_STORAGE_MODULES="usb_ohci_pxa27x usb-storage"
+USB_STORAGE_PARTITION="/dev/sda1"
+USB_STORAGE_WAIT="4"
+
+INIT_RUNLEVEL="5"
+NO_GUI_RL="2"
+MASTER_PASSWORD=""
+ASK_PW_ON_BOOT="no"
+
+SD_MOUNTPOINT="/media/card"
+CF_MOUNTPOINT="/media/cf"
diff --git a/packages/altboot/files/init.altboot b/packages/altboot/files/init.altboot
index 2ba6f654b5..850912f20c 100644
--- a/packages/altboot/files/init.altboot
+++ b/packages/altboot/files/init.altboot
@@ -255,8 +255,7 @@ wait_for_input() {
# Don't remount rw if the drive is already mounted rw
# Only helpful for testing / debugging
if test "`mount|sed -n "/\/dev\/root/s/.*(\(.*\))/\1/p"`" != "rw"
- then
-
+ then
mount -o remount,rw / >/dev/null 2>&1
echo "$junk" > /etc/altboot.conf
mount -o remount,ro / >/dev/null 2>&1
@@ -278,6 +277,7 @@ if test "`runlevel`" != "unknown" -a "$1" != "-force"
then
echo "altboot: Using real init [$REAL_INIT] [$*] *" >/dev/tty1
exec $REAL_INIT $*
+# exec $SH_SHELL </dev/tty0 >/dev/tty0 2>&1
exit 0
else
# Boot original init if altboot is turned off