summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKoen Kooi <koen@openembedded.org>2006-10-28 16:43:13 +0000
committerKoen Kooi <koen@openembedded.org>2006-10-28 16:43:13 +0000
commitd92174e738d4e8a0674a9bc7c2d5a0e777e9d936 (patch)
tree2ade1c3dc425790dc5f3235924e9569b4c1448b5
parent7e53d9ec53589d1e900ef9c0c18ec962e2302603 (diff)
parentb2326e7420103c6e77e7d22cd6e72334f860bc01 (diff)
merge of '80203f8e0e1f0ca5359560cbebadc073a4aa239c'
and '8605cce0c3f57ef0a8d2c41260b71d2e06273548'
-rw-r--r--packages/altboot/altboot_1.1.0-wip.bb96
-rw-r--r--packages/altboot/files/altboot.func2
-rwxr-xr-xpackages/altboot/files/altbootctl4
-rw-r--r--packages/altboot/files/altbootctl.conf12
-rw-r--r--packages/altboot/files/init.altboot22
5 files changed, 127 insertions, 9 deletions
diff --git a/packages/altboot/altboot_1.1.0-wip.bb b/packages/altboot/altboot_1.1.0-wip.bb
new file mode 100644
index 0000000000..a60e735f0c
--- /dev/null
+++ b/packages/altboot/altboot_1.1.0-wip.bb
@@ -0,0 +1,96 @@
+#! /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_1.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"
+LICENSE = "GPL"
+
+######################################################################################
+
+RRECOMMENDS_${PN} = "e2fsprogs-e2fsck dosfstools"
+RRECOMMENDS_${PN}_append_akita = " kexec-tools"
+RRECOMMENDS_${PN}_append_spitz = " kexec-tools"
+RRECOMMENDS_${PN}_append_c7x0 = " kexec-tools"
+
+RDEPENDS_${PN} = "${PN}-conf"
+RDEPENDS_${PN}-conf = "${PN}"
+
+######################################################################################
+
+WIP_DATE = "20061028"
+PR = "${WIP_DATE}-r0"
+
+######################################################################################
+
+PACKAGES = "${PN}-conf ${PN}-doc ${PN}"
+
+PACKAGE_ARCH_${PN} = all
+PACKAGE_ARCH_${PN}-doc = all
+PACKAGE_ARCH_${PN}-conf = "${MACHINE}"
+
+TAG = "${@'v' + bb.data.getVar('PV',d,1).replace('.', '-')}"
+
+SRC_URI = "cvs://anonymous@hentges.net/hentgescvs;method=pserver;tag=${TAG}-${WIP_DATE};module=altboot"
+
+S = "${WORKDIR}/altboot/"
+
+######################################################################################
+
+FILES_${PN}-conf = "/etc/altboot*.cfg"
+
+######################################################################################
+
+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 -d ${D}/usr/share/sounds
+
+ 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/beep.raw ${D}/usr/share/sounds
+ install -m 0644 ${WORKDIR}/altboot/altboot.func ${D}/etc
+ install -m 0644 ${WORKDIR}/altboot/altbootctl.conf ${D}/etc
+ install -m 0755 ${WORKDIR}/altboot/init.altboot ${D}/sbin
+ install -m 0755 ${WORKDIR}/altboot/altbootctl ${D}/sbin
+
+ install -m 0755 ${WORKDIR}/altboot/altboot-menu/*-* ${D}/etc/altboot-menu
+
+ install -m 0755 ${WORKDIR}/altboot/altboot-menu/Advanced/*-* ${D}/etc/altboot-menu/Advanced
+
+ 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_${PN}() {
+ update-alternatives --install /sbin/init init /sbin/init.altboot 55
+}
+
+######################################################################################
+
+pkg_postrm_${PN}() {
+ update-alternatives --remove init /sbin/init.altboot
+}
+
diff --git a/packages/altboot/files/altboot.func b/packages/altboot/files/altboot.func
index b3d25ff9f4..a4ac6ed337 100644
--- a/packages/altboot/files/altboot.func
+++ b/packages/altboot/files/altboot.func
@@ -606,7 +606,7 @@ echo_pref() {
dump_pref() {
data_name="$1"
- echo "`eval echo -e ${data_name} | sed "s/\#\#\#/\#\#\#\\n/g"|sed s/^\ // `"
+ echo "`eval echo -e \\$${data_name} | sed "s/\#\#\#/\#\#\#\\n/g"|sed s/^\ // `"
#echo "-- `eval echo ${data_name}` --"
#debug_echo "[$menu_fileflags]"
diff --git a/packages/altboot/files/altbootctl b/packages/altboot/files/altbootctl
index e09df1927b..58976afd0d 100755
--- a/packages/altboot/files/altbootctl
+++ b/packages/altboot/files/altbootctl
@@ -55,7 +55,7 @@ ask_pref() {
#echo "[$1] -> $SETTING_OLD_VALUE"
#echo -e "$SETTING_TEXT"
-
+
if test "$SETTING_VALUES" = "<STRING>"
then
@@ -92,6 +92,8 @@ ask_pref() {
# If it's not a string, it's a fixed list of possible settings
echo -e "\nSelect one of the following:\n"
cnt=1
+
+ echo " $SETTING_VALUES"
for val in $SETTING_VALUES
do
if test "$val" != "$SETTING_OLD_VALUE"
diff --git a/packages/altboot/files/altbootctl.conf b/packages/altboot/files/altbootctl.conf
index 0a358c7e2d..09681bf229 100644
--- a/packages/altboot/files/altbootctl.conf
+++ b/packages/altboot/files/altbootctl.conf
@@ -10,7 +10,7 @@
TARGETS="REMEMBER_LAST_SELECTION ENABLE_ALTBOOT FSCK_IMAGES TIMEOUT INIT_RUNLEVEL NO_GUI_RL \
USB_HOST_AVAILABLE USB_NETWORKING_AVAILABLE ASK_PW_ON_BOOT SD_DEVICE SD_KERNEL_MODULE \
IMAGE_PATH IMAGE_TYPE ENABLE_IMAGECONF USB_STORAGE_MODULES USB_STORAGE_PARTITION \
- USB_STORAGE_WAIT SD_MOUNTPOINT"
+ USB_STORAGE_WAIT SD_MOUNTPOINT ENABLE_DEBUGGING ENABLE_DEBUG_SHELL"
REMEMBER_LAST_SELECTION_VALUES="yes no"
@@ -33,9 +33,13 @@ NO_GUI_RL_VALUES="<STRING>"
NO_GUI_RL_TEXT="GUI-less runlevel"
NO_GUI_RL_MENUPOS="Core"
-ENABLE_DEBUG_VALUES="yes no"
-ENABLE_DEBUG_TEXT="Enable debug output"
-ENABLE_DEBUG_MENUPOS="Core"
+ENABLE_DEBUGGING_VALUES="auto yes no"
+ENABLE_DEBUGGING_TEXT="Enable debugging output"
+ENABLE_DEBUGGING_MENUPOS="Core"
+
+ENABLE_DEBUG_SHELL_VALUES="yes no"
+ENABLE_DEBUG_SHELL_TEXT="Enable a shell prompt after kernel init"
+ENABLE_DEBUG_SHELL_MENUPOS="Core"
FSCK_IMAGES_VALUES="yes no"
FSCK_IMAGES_TEXT="Automatically fsck loop-images"
diff --git a/packages/altboot/files/init.altboot b/packages/altboot/files/init.altboot
index e09739c8fa..dc3ff07ad8 100644
--- a/packages/altboot/files/init.altboot
+++ b/packages/altboot/files/init.altboot
@@ -141,6 +141,8 @@ show_menu() {
done
cd "$OLD_PWD"
+ else
+ debug_echo "show_menu(): \$M_TITLE is empty"
fi
M_TITLE=""
fi
@@ -160,10 +162,13 @@ show_sub_menu() {
d_entries="`dump_pref "menu_filelist" | grep "$dirname/"`"
+ #dump_pref "menu_filelist"
+ #dump_pref "menu_fileflags"
#echo "[$d_entries]"
echo -e "\naltboot v$VERSION: $dirname menu\n"
+ #debug_echo "show_sub_menu(): ping"
for d_entry in $d_entries
do
@@ -376,16 +381,27 @@ wait_for_input() {
}
# * * * * * * This is the main function * * * * * *
-# Note: this is positively ugly. If someone knows a better way to detect wheter
-# we are already booted into a runlevel _without_ reading /var and / or using `runlevel`
-# PLEASE let me know.
if ( echo "$VERSION" | egrep -iq "(snapshot|-rc)" )
then
+ if test "$ENABLE_DEBUGGING" = "auto" -o -z "$ENABLE_DEBUGGING"
+ then
+ ENABLE_DEBUG="yes"
+ fi
+fi
+
+test "$ENABLE_DEBUG_SHELL" = "yes" && debug_shell 4 >/dev/null 2>&1 &
+
+if test "$ENABLE_DEBUGGING" = "yes"
+then
ENABLE_DEBUG="yes"
debug_shell 4 >/dev/null 2>&1 &
fi
+# Note: this is positively ugly. If someone knows a better way to detect whether
+# we are already booted into a runlevel _without_ reading /var and / or using `runlevel`
+# PLEASE let me know.
+
if test -f /proc/cmdline -a "`ps ax|wc -l|tr -d " "`" -gt 30 -a "$1" != "-force" -a "$1" != "+force"
then
echo "altboot: Using real init [$REAL_INIT] [$*] [`ps ax|wc -l|tr -d " "`] *" >"$OUT_TTY"