diff options
author | Koen Kooi <koen@openembedded.org> | 2006-03-02 17:54:35 +0000 |
---|---|---|
committer | OpenEmbedded Project <openembedded-devel@lists.openembedded.org> | 2006-03-02 17:54:35 +0000 |
commit | 40ce95ca64d662c16cec3d1efabc966dda5a2610 (patch) | |
tree | c5687492fbbc7f7e46b8db8448b1da640fef9955 /packages/altboot | |
parent | 858ca7bc53e7c03eac036217486e87e36eb1e3e6 (diff) | |
parent | 966f3a94af2c83ffd2c634171fbe04917731b6f9 (diff) |
explicit_merge of '601faaded8a6427e29dc8dc43433fe9be662c96c'
and 'a67386ccbaf4538441ab5d8769e018207ab0c744'
using ancestor '9c1b32d8825be71ddfdcbe3ddfa31b4cc8bb2aa0'
to branch 'org.openembedded.dev'
Diffstat (limited to 'packages/altboot')
-rw-r--r-- | packages/altboot/altboot.bb | 98 | ||||
-rw-r--r-- | packages/altboot/altboot_0.0.0.bb | 118 | ||||
-rw-r--r-- | packages/altboot/altboot_0.0.5.bb | 152 | ||||
-rw-r--r-- | packages/altboot/files/akita/altboot-2.6.cfg | 3 | ||||
-rw-r--r-- | packages/altboot/files/altboot-menu/Advanced/30-bootUSB-Stick | 1 | ||||
-rw-r--r-- | packages/altboot/files/altboot-menu/Advanced/35-kexec | 62 | ||||
-rw-r--r-- | packages/altboot/files/altboot-menu/Advanced/40-bootNFS | 2 | ||||
-rw-r--r-- | packages/altboot/files/altboot-menu/Advanced/70-install-tgz | 40 | ||||
-rw-r--r-- | packages/altboot/files/altboot.func | 24 | ||||
-rw-r--r-- | packages/altboot/files/altboot.rc/loadkeymap.sh | 5 | ||||
-rw-r--r-- | packages/altboot/files/borzoi/.mtn2git_empty | 0 | ||||
-rw-r--r-- | packages/altboot/files/borzoi/altboot-2.4.cfg | 27 | ||||
-rw-r--r-- | packages/altboot/files/borzoi/altboot-2.6.cfg | 30 | ||||
-rw-r--r-- | packages/altboot/files/c7x0/.mtn2git_empty | 0 | ||||
-rw-r--r-- | packages/altboot/files/c7x0/altboot-2.4.cfg | 26 | ||||
-rw-r--r-- | packages/altboot/files/c7x0/altboot-2.6.cfg | 26 | ||||
-rw-r--r-- | packages/altboot/files/init.altboot | 4 |
17 files changed, 494 insertions, 124 deletions
diff --git a/packages/altboot/altboot.bb b/packages/altboot/altboot.bb deleted file mode 100644 index ce586f6f4b..0000000000 --- a/packages/altboot/altboot.bb +++ /dev/null @@ -1,98 +0,0 @@ -DESCRIPTION = "A text-based bootmanager allowing a Zaurus to boot from SD, CF, USB-Storage and NFS. \ -Tested machines: Collie, Poodle, Akita, Spitz" -SECTION = "base" -PRIORITY = "optional" -MAINTAINER = "Matthias 'CoreDump' Hentges <oe@hentges.net>" -LICENSE = "GPL" -IGNORE_STRIP_ERRORS = "1" - -PR = "r20" - - -SRC_URI = "file://altboot-menu \ - file://altboot.rc \ - file://altboot.func \ - file://init.altboot \ - file://altboot*.cfg" - -# S = "${WORKDIR}/files" - -do_install() { - install -d ${D}/sbin - install -d ${D}/etc/altboot-menu - install -d ${D}/etc/altboot-menu/Advanced - install -d ${D}/etc/altboot.rc - install -d ${D}/usr/share/doc/altboot - - install -m 0644 ${WORKDIR}/altboot*.cfg ${D}/etc - install -m 0644 ${WORKDIR}/altboot.func ${D}/etc -# install -m 0644 ${WORKDIR}/docs/altboot/*.txt ${D}/usr/share/doc/altboot - install -m 0755 ${WORKDIR}/init.altboot ${D}/sbin - install -m 0755 ${WORKDIR}/altboot-menu/*-* ${D}/etc/altboot-menu - install -m 0755 ${WORKDIR}/altboot-menu/Advanced/*-* ${D}/etc/altboot-menu/Advanced - install -m 0755 ${WORKDIR}/altboot.rc/*.sh ${D}/etc/altboot.rc - install -m 0644 ${WORKDIR}/altboot.rc/*.txt ${D}/etc/altboot.rc -} - - - -pkg_postinst() { - update-alternatives --install /sbin/init init /sbin/init.altboot 55 -} - -pkg_postinst_spitz() { - # Note: Spitz support is a royal pain in the ass. - # Since Spitz pivot_roots by default, there is no real way - # a user can install an altboot.ipk into the flash FS. - # So we need to do that manually (*SIGH*) - - # /l/m only exists on the HDD on spitz - if test -d /lib/modules - then - if [ -e /media/realroot/sbin/init ]; then - ROOT_MOUNT_POINT="/media/realroot" - elif [ -e /media/ROM/sbin/init ]; then - ROOT_MOUNT_POINT="/media/ROM" - fi - if [ ! "$ROOT_MOUNT_POINT" = "" ]; then - ROOT_MOUNT_DEVICE=`cat /proc/mounts | grep $ROOT_MOUNT_POINT | grep jffs2 | cut -d " " -f 1` - if [ ! "$ROOT_MOUNT_DEVICE" = "" ]; then - mount -oremount,rw $ROOT_MOUNT_DEVICE $ROOT_MOUNT_POINT - cp -R /etc/altboot* $ROOT_MOUNT_POINT/etc - cp /sbin/init.altboot $ROOT_MOUNT_POINT/sbin - if [ -f $ROOT_MOUNT_POINT/sbin/init ]; then - mv $ROOT_MOUNT_POINT/sbin/init $ROOT_MOUNT_POINT/sbin/init.orig - fi - ln -s /sbin/init.altboot $ROOT_MOUNT_POINT/sbin/init - fi - fi - fi -} - -pkg_postrm() { - update-alternatives --remove init /sbin/init.altboot -} - -pkg_postrm_spitz() { - if test -d /lib/modules - then - if [ -e /media/realroot/sbin/init ]; then - ROOT_MOUNT_POINT="/media/realroot" - elif [ -e /media/ROM/sbin/init ]; then - ROOT_MOUNT_POINT="/media/ROM" - fi - if [ ! "$ROOT_MOUNT_POINT" = "" ]; then - ROOT_MOUNT_DEVICE=`cat /proc/mounts | grep $ROOT_MOUNT_POINT | grep jffs2 | cut -d " " -f 1` - if [ ! "$ROOT_MOUNT_DEVICE" = "" ]; then - mount -oremount,rw $ROOT_MOUNT_DEVICE $ROOT_MOUNT_POINT - if [ -f $ROOT_MOUNT_POINT/sbin/init.orig ]; then - rm $ROOT_MOUNT_POINT/sbin/init - rm $ROOT_MOUNT_POINT/sbin/init.altboot - mv $ROOT_MOUNT_POINT/sbin/init.orig $ROOT_MOUNT_POINT/sbin/init - else - echo "$ROOT_MOUNT_POINT/sbin/init.orig not found, not uninstalling altboot!" - fi - fi - fi - fi -} diff --git a/packages/altboot/altboot_0.0.0.bb b/packages/altboot/altboot_0.0.0.bb new file mode 100644 index 0000000000..7d56cbd3a6 --- /dev/null +++ b/packages/altboot/altboot_0.0.0.bb @@ -0,0 +1,118 @@ +DESCRIPTION = "A text-based bootmanager allowing a Zaurus to boot from SD, CF, USB-Storage and NFS. \ +Tested machines: Collie, Poodle, Akita, Spitz" +SECTION = "base" +PRIORITY = "optional" +MAINTAINER = "Matthias 'CoreDump' Hentges <oe@hentges.net>" +LICENSE = "GPL" +IGNORE_STRIP_ERRORS = "1" + +PR = "r26" + + +SRC_URI = "file://altboot-menu \ + file://altboot.rc \ + file://altboot.func \ + file://init.altboot \ + file://altboot*.cfg" + +# S = "${WORKDIR}/files" + +do_install() { + install -d ${D}/sbin + install -d ${D}/etc/altboot-menu + install -d ${D}/etc/altboot-menu/Advanced + install -d ${D}/etc/altboot.rc + install -d ${D}/usr/share/doc/altboot + + install -m 0644 ${WORKDIR}/altboot*.cfg ${D}/etc + install -m 0644 ${WORKDIR}/altboot.func ${D}/etc +# install -m 0644 ${WORKDIR}/docs/altboot/*.txt ${D}/usr/share/doc/altboot + install -m 0755 ${WORKDIR}/init.altboot ${D}/sbin + install -m 0755 ${WORKDIR}/altboot-menu/*-* ${D}/etc/altboot-menu + install -m 0755 ${WORKDIR}/altboot-menu/Advanced/*-* ${D}/etc/altboot-menu/Advanced + install -m 0755 ${WORKDIR}/altboot.rc/*.sh ${D}/etc/altboot.rc + install -m 0644 ${WORKDIR}/altboot.rc/*.txt ${D}/etc/altboot.rc +} + +do_configure() { + cat ${WORKDIR}/init.altboot | sed "s/^VERSION=.*/VERSION=\"0.0.0 Developer Snapshot (${DATE})\"/" > ${WORKDIR}/init.altboot_ + mv ${WORKDIR}/init.altboot_ ${WORKDIR}/init.altboot +} + + +pkg_postinst() { + update-alternatives --install /sbin/init init /sbin/init.altboot 55 +} + +pkg_postinst_spitz() { + # Note: Spitz support is a royal pain in the ass. + # Since Spitz pivot_roots by default, there is no real way + # a user can install an altboot.ipk into the flash FS. + # So we need to do that manually (*SIGH*) + + # the 2.6 kernel for spitz boots from HDD, no need to copy to flash + if cat /proc/version | awk '{print $3}' | grep -q '^2.6'; then + update-alternatives --install /sbin/init init /sbin/init.altboot 55 + # no need to copy to flash if we're installing to flash already + elif mount | grep ' / ' | grep -q mtdblock; then + update-alternatives --install /sbin/init init /sbin/init.altboot 55 + else + # /l/m only exists on the HDD on spitz + if test -d /lib/modules + then + if [ -e /media/realroot/sbin/init ]; then + ROOT_MOUNT_POINT="/media/realroot" + elif [ -e /media/ROM/sbin/init ]; then + ROOT_MOUNT_POINT="/media/ROM" + fi + if [ ! "$ROOT_MOUNT_POINT" = "" ]; then + ROOT_MOUNT_DEVICE=`cat /proc/mounts | grep $ROOT_MOUNT_POINT | grep jffs2 | cut -d " " -f 1` + if [ ! "$ROOT_MOUNT_DEVICE" = "" ]; then + mount -oremount,rw $ROOT_MOUNT_DEVICE $ROOT_MOUNT_POINT + cp -R /etc/altboot* $ROOT_MOUNT_POINT/etc + cp /sbin/init.altboot $ROOT_MOUNT_POINT/sbin + if [ -f $ROOT_MOUNT_POINT/sbin/init ]; then + mv $ROOT_MOUNT_POINT/sbin/init $ROOT_MOUNT_POINT/sbin/init.orig + fi + ln -s /sbin/init.altboot $ROOT_MOUNT_POINT/sbin/init + fi + fi + fi + fi +} + +pkg_postrm() { + update-alternatives --remove init /sbin/init.altboot +} + +pkg_postrm_spitz() { + # the 2.6 kernel for spitz boots from HDD, no need to remove from flash + if cat /proc/version | awk '{print $3}' | grep -q '^2.6'; then + update-alternatives --remove init /sbin/init.altboot + # no need to copy to flash if we're removing from flash already + elif mount | grep ' / ' | grep -q mtdblock; then + update-alternatives --remove init /sbin/init.altboot + else + if test -d /lib/modules + then + if [ -e /media/realroot/sbin/init ]; then + ROOT_MOUNT_POINT="/media/realroot" + elif [ -e /media/ROM/sbin/init ]; then + ROOT_MOUNT_POINT="/media/ROM" + fi + if [ ! "$ROOT_MOUNT_POINT" = "" ]; then + ROOT_MOUNT_DEVICE=`cat /proc/mounts | grep $ROOT_MOUNT_POINT | grep jffs2 | cut -d " " -f 1` + if [ ! "$ROOT_MOUNT_DEVICE" = "" ]; then + mount -oremount,rw $ROOT_MOUNT_DEVICE $ROOT_MOUNT_POINT + if [ -f $ROOT_MOUNT_POINT/sbin/init.orig ]; then + rm $ROOT_MOUNT_POINT/sbin/init + rm $ROOT_MOUNT_POINT/sbin/init.altboot + mv $ROOT_MOUNT_POINT/sbin/init.orig $ROOT_MOUNT_POINT/sbin/init + else + echo "$ROOT_MOUNT_POINT/sbin/init.orig not found, not uninstalling altboot!" + fi + fi + fi + fi + fi +} diff --git a/packages/altboot/altboot_0.0.5.bb b/packages/altboot/altboot_0.0.5.bb new file mode 100644 index 0000000000..1cb51a3639 --- /dev/null +++ b/packages/altboot/altboot_0.0.5.bb @@ -0,0 +1,152 @@ +#! /bin/sh +# +# Copyright Matthias Hentges <devel@hentges.net> (c) 2006 +# License: GPL (see http://www.gnu.org/licenses/gpl.txt for a copy of the license) +# +# Filename: altboot_0.0.5-rc2.bb +# Date: 21-Feb-06 + +DESCRIPTION = "The altboot bootmanager" +MAINTAINER = "Matthias 'CoreDump' Hentges <oe@hentges.net>" +HOMEPAGE = "http://www.hentges.net/misc/openzaurus/index.shtml" + +###################################################################################### + +PR = "r0" + +###################################################################################### + +PACKAGE_ARCH = "${MACHINE}" + +TAG = "${@'v' + bb.data.getVar('PV',d,1).replace('.', '-')}" + +SRC_URI = "cvs://anonymous@hentges.net/hentgescvs;method=pserver;tag=${TAG};module=altboot" + +###################################################################################### + +do_install() { + install -d ${D}/sbin + install -d ${D}/etc/altboot-menu + install -d ${D}/etc/altboot-menu/Advanced + install -d ${D}/etc/altboot.rc + install -d ${D}/usr/share/doc/altboot + + if test -d ${WORKDIR}/altboot/${MACHINE} + then + install -m 0644 ${WORKDIR}/altboot/${MACHINE}/altboot*.cfg ${D}/etc + else + install -m 0644 ${WORKDIR}/altboot/altboot*.cfg ${D}/etc + fi + + install -m 0644 ${WORKDIR}/altboot/altboot.func ${D}/etc + install -m 0755 ${WORKDIR}/altboot/init.altboot ${D}/sbin + + if test -d ${WORKDIR}/altboot/${MACHINE}/altboot-menu/ + then + install -m 0755 ${WORKDIR}/altboot/${MACHINE}/altboot-menu/*-* ${D}/etc/altboot-menu + else + install -m 0755 ${WORKDIR}/altboot/altboot-menu/*-* ${D}/etc/altboot-menu + fi + + if test -d ${WORKDIR}/altboot/${MACHINE}/altboot-menu/Advanced/ + then + install -m 0755 ${WORKDIR}/altboot/${MACHINE}/altboot-menu/Advanced/*-* ${D}/etc/altboot-menu/Advanced + else + install -m 0755 ${WORKDIR}/altboot/altboot-menu/Advanced/*-* ${D}/etc/altboot-menu/Advanced + fi + + install -m 0755 ${WORKDIR}/altboot/altboot.rc/*.sh ${D}/etc/altboot.rc + install -m 0644 ${WORKDIR}/altboot/altboot.rc/*.txt ${D}/etc/altboot.rc +} + +###################################################################################### + +do_configure() { + cat ${WORKDIR}/altboot/init.altboot | sed "s/^VERSION=.*/VERSION=\"${PV}\"/" > ${WORKDIR}/altboot/init.altboot_ + mv ${WORKDIR}/altboot/init.altboot_ ${WORKDIR}/altboot/init.altboot +} + +###################################################################################### + +pkg_postinst() { + update-alternatives --install /sbin/init init /sbin/init.altboot 55 +} + +pkg_postinst_spitz() { + # Note: Spitz support is a royal pain in the ass. + # Since Spitz pivot_roots by default, there is no real way + # a user can install an altboot.ipk into the flash FS. + # So we need to do that manually (*SIGH*) + + # the 2.6 kernel for spitz boots from HDD, no need to copy to flash + if cat /proc/version | awk '{print $3}' | grep -q '^2.6'; then + update-alternatives --install /sbin/init init /sbin/init.altboot 55 + # no need to copy to flash if we're installing to flash already + elif mount | grep ' / ' | grep -q mtdblock; then + update-alternatives --install /sbin/init init /sbin/init.altboot 55 + else + # /l/m only exists on the HDD on spitz + if test -d /lib/modules + then + if [ -e /media/realroot/sbin/init ]; then + ROOT_MOUNT_POINT="/media/realroot" + elif [ -e /media/ROM/sbin/init ]; then + ROOT_MOUNT_POINT="/media/ROM" + fi + if [ ! "$ROOT_MOUNT_POINT" = "" ]; then + ROOT_MOUNT_DEVICE=`cat /proc/mounts | grep $ROOT_MOUNT_POINT | grep jffs2 | cut -d " " -f 1` + if [ ! "$ROOT_MOUNT_DEVICE" = "" ]; then + mount -oremount,rw $ROOT_MOUNT_DEVICE $ROOT_MOUNT_POINT + cp -R /etc/altboot* $ROOT_MOUNT_POINT/etc + cp /sbin/init.altboot $ROOT_MOUNT_POINT/sbin + if [ -f $ROOT_MOUNT_POINT/sbin/init ]; then + mv $ROOT_MOUNT_POINT/sbin/init $ROOT_MOUNT_POINT/sbin/init.orig + fi + ln -s /sbin/init.altboot $ROOT_MOUNT_POINT/sbin/init + fi + fi + fi + fi +} + +###################################################################################### + +pkg_postrm() { + update-alternatives --remove init /sbin/init.altboot +} + +pkg_postrm_spitz() { + # the 2.6 kernel for spitz boots from HDD, no need to remove from flash + if cat /proc/version | awk '{print $3}' | grep -q '^2.6'; then + update-alternatives --remove init /sbin/init.altboot + # no need to copy to flash if we're removing from flash already + elif mount | grep ' / ' | grep -q mtdblock; then + update-alternatives --remove init /sbin/init.altboot + else + if test -d /lib/modules + then + if [ -e /media/realroot/sbin/init ]; then + ROOT_MOUNT_POINT="/media/realroot" + elif [ -e /media/ROM/sbin/init ]; then + ROOT_MOUNT_POINT="/media/ROM" + fi + if [ ! "$ROOT_MOUNT_POINT" = "" ]; then + ROOT_MOUNT_DEVICE=`cat /proc/mounts | grep $ROOT_MOUNT_POINT | grep jffs2 | cut -d " " -f 1` + if [ ! "$ROOT_MOUNT_DEVICE" = "" ]; then + mount -oremount,rw $ROOT_MOUNT_DEVICE $ROOT_MOUNT_POINT + if [ -f $ROOT_MOUNT_POINT/sbin/init.orig ]; then + rm $ROOT_MOUNT_POINT/sbin/init + rm $ROOT_MOUNT_POINT/sbin/init.altboot + mv $ROOT_MOUNT_POINT/sbin/init.orig $ROOT_MOUNT_POINT/sbin/init + else + echo "$ROOT_MOUNT_POINT/sbin/init.orig not found, not uninstalling altboot!" + fi + fi + fi + fi + fi +} + + + + 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 |