From 5c10d0c72ebfbc7297b157a12ac6333fd54791e5 Mon Sep 17 00:00:00 2001 From: Matthias Hentges Date: Sun, 23 Apr 2006 10:03:28 +0000 Subject: sysvinit: Add support for more than one enabled getty in inittab through setting SYSVINIT_ENABLED_GETTYS. --- packages/sysvinit/sysvinit_2.86.bb | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'packages') diff --git a/packages/sysvinit/sysvinit_2.86.bb b/packages/sysvinit/sysvinit_2.86.bb index d15afdfa23..e33e9e8728 100644 --- a/packages/sysvinit/sysvinit_2.86.bb +++ b/packages/sysvinit/sysvinit_2.86.bb @@ -3,7 +3,7 @@ SECTION = "base" LICENSE = "GPL" MAINTAINER = "Chris Larson " HOMEPAGE = "http://freshmeat.net/projects/sysvinit/" -PR = "r22" +PR = "r23" # USE_VT and SERIAL_CONSOLE are generally defined by the MACHINE .conf. # Set PACKAGE_ARCH appropriately. @@ -17,6 +17,7 @@ FILES_${PN}-inittab = "${sysconfdir}/inittab" CONFFILES_${PN}-inittab = "${sysconfdir}/inittab" USE_VT ?= "1" +SYSVINIT_ENABLED_GETTYS ?= "1" SRC_URI = "ftp://ftp.cistron.nl/pub/people/miquels/sysvinit/sysvinit-2.85.tar.gz \ file://sysvinit-2.86.patch;patch=1 \ @@ -72,11 +73,14 @@ do_install () { # Format: # ::: # -1:2345:respawn:${base_sbindir}/getty 38400 tty1 -# 2:23:respawn:${base_sbindir}/getty 38400 tty2 -# 3:23:respawn:${base_sbindir}/getty 38400 tty3 -# 4:23:respawn:${base_sbindir}/getty 38400 tty4 + EOF + + for n in ${SYSVINIT_ENABLED_GETTYS} + do + echo "$n:2345:respawn:${base_sbindir}/getty 38400 tty$n" >> ${D}${sysconfdir}/inittab + done + echo "" >> ${D}${sysconfdir}/inittab fi install -m 0644 ${WORKDIR}/rcS-default ${D}${sysconfdir}/default/rcS install -m 0755 ${WORKDIR}/rc ${D}${sysconfdir}/init.d -- cgit v1.2.3 From a6e74fd03c93ec9cdb31570b9a6b676aef4ee4c5 Mon Sep 17 00:00:00 2001 From: Matthias Hentges Date: Sun, 23 Apr 2006 14:47:58 +0000 Subject: altboot: - Removed multiple die() functions - Altboot no longer activates an off-flash altboot-menu when not booting from flash - Added a debug_echo function which is disabled in non-rc and non-snapshot builds - RC's and snapshots now spawn a debug shell on tty4 right after the kernel is booted - die() messages are now colored red/white, debug is purple(?)/white - Fixed start_networking() on collie and made it a little bit more verbose --- packages/altboot/altboot_0.0.0.bb | 1 - packages/altboot/files/akita/altboot-2.6.cfg | 4 +- packages/altboot/files/altboot-menu/15-bootSD | 5 --- packages/altboot/files/altboot-menu/20-bootCF | 5 --- .../files/altboot-menu/99-ownScripts-example | 8 ---- .../files/altboot-menu/Advanced/30-bootUSB-Stick | 7 +--- .../altboot/files/altboot-menu/Advanced/40-bootNFS | 9 +---- .../files/altboot-menu/Advanced/70-install-tgz | 5 --- .../files/altboot-menu/Advanced/70-setKernel | 8 ++-- .../files/altboot-menu/Advanced/80-configure-kexec | 8 ++-- .../files/altboot-menu/Advanced/80-copyrootfs | 5 --- packages/altboot/files/altboot.func | 45 ++++++++++++++++++---- packages/altboot/files/init.altboot | 24 +++++++++++- 13 files changed, 74 insertions(+), 60 deletions(-) (limited to 'packages') diff --git a/packages/altboot/altboot_0.0.0.bb b/packages/altboot/altboot_0.0.0.bb index 7b62414d1c..3bda946415 100644 --- a/packages/altboot/altboot_0.0.0.bb +++ b/packages/altboot/altboot_0.0.0.bb @@ -13,7 +13,6 @@ RRECOMMENDS_append_c7x0 = " kexec-tools" PR = "r41" - SRC_URI = "file://altboot-menu \ file://altboot.rc \ file://altboot.func \ diff --git a/packages/altboot/files/akita/altboot-2.6.cfg b/packages/altboot/files/akita/altboot-2.6.cfg index 2254a35552..c763f8b953 100644 --- a/packages/altboot/files/akita/altboot-2.6.cfg +++ b/packages/altboot/files/akita/altboot-2.6.cfg @@ -14,8 +14,8 @@ ENABLE_IMAGECONF="yes" SD_DEVICE="/dev/mmcblk0p1" SD_KERNEL_MODULE="" -USB_HOST_AVAILABLE="no" -USB_STORAGE_MODULES="usb_ohci_pxa27x usb-storage" +USB_HOST_AVAILABLE="yes" +USB_STORAGE_MODULES="ohci_hcd usb_storage sd_mod" USB_STORAGE_PARTITION="/dev/sda1" USB_STORAGE_WAIT="4" diff --git a/packages/altboot/files/altboot-menu/15-bootSD b/packages/altboot/files/altboot-menu/15-bootSD index 7123491000..0476a5ce0f 100644 --- a/packages/altboot/files/altboot-menu/15-bootSD +++ b/packages/altboot/files/altboot-menu/15-bootSD @@ -7,11 +7,6 @@ M_TITLE="Boot SD card" -die() { - echo "ERROR: $1" >/dev/tty0 - exec $SH_SHELL /dev/tty0 2>&1 -} - # This function is activated by init.altboot by calling this script with the "run" option run_module() { diff --git a/packages/altboot/files/altboot-menu/20-bootCF b/packages/altboot/files/altboot-menu/20-bootCF index 3a3f4fbafe..36d6b8245f 100644 --- a/packages/altboot/files/altboot-menu/20-bootCF +++ b/packages/altboot/files/altboot-menu/20-bootCF @@ -7,11 +7,6 @@ M_TITLE="Boot CF card" -die() { - echo "ERROR: $1" >/dev/tty0 - exec $SH_SHELL /dev/tty0 2>&1 -} - # This function is activated by init.altboot by calling this script with the "run" option run_module() { diff --git a/packages/altboot/files/altboot-menu/99-ownScripts-example b/packages/altboot/files/altboot-menu/99-ownScripts-example index b1b444f2d1..7566416b87 100644 --- a/packages/altboot/files/altboot-menu/99-ownScripts-example +++ b/packages/altboot/files/altboot-menu/99-ownScripts-example @@ -20,14 +20,6 @@ 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 2>&1 -} - # This function is activated by init.altboot by calling this script with the "run" option run_module() { diff --git a/packages/altboot/files/altboot-menu/Advanced/30-bootUSB-Stick b/packages/altboot/files/altboot-menu/Advanced/30-bootUSB-Stick index 3cf8c506b0..b573e7a10c 100644 --- a/packages/altboot/files/altboot-menu/Advanced/30-bootUSB-Stick +++ b/packages/altboot/files/altboot-menu/Advanced/30-bootUSB-Stick @@ -8,12 +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 2>&1 -} - + # This function is activated by init.altboot by calling this script with the "run" option run_module() { diff --git a/packages/altboot/files/altboot-menu/Advanced/40-bootNFS b/packages/altboot/files/altboot-menu/Advanced/40-bootNFS index 352b29ed07..9a36b8ed01 100644 --- a/packages/altboot/files/altboot-menu/Advanced/40-bootNFS +++ b/packages/altboot/files/altboot-menu/Advanced/40-bootNFS @@ -9,11 +9,6 @@ M_TITLE="Boot from NFS" -die() { - echo -e "ERROR: $1" >/dev/tty0 - exec $SH_SHELL /dev/tty0 2>&1 -} - # This function is activated by init.altboot by calling this script with the "run" option run_module() { @@ -24,9 +19,7 @@ run_module() { nfs_host="`cat /etc/fstab | grep -v ^# | grep nfs | awk '{print $1}'|sed -n "s/\(.*\)\:\(.*\)/\1/p" `" nfs_mounts="`cat /etc/fstab | grep -v ^# | grep nfs | awk '{print $1}'`" - nfs_mountpoints="`cat /etc/fstab | grep -v ^# | grep nfs | awk '{print $2}'`" - - WLAN_NIC="`iwconfig 2>/dev/null | grep ESSID | awk '{print $1}'`" + nfs_mountpoints="`cat /etc/fstab | grep -v ^# | grep nfs | awk '{print $2}'`" start_networking "$nfs_host" diff --git a/packages/altboot/files/altboot-menu/Advanced/70-install-tgz b/packages/altboot/files/altboot-menu/Advanced/70-install-tgz index 2ee92cd27e..cb8b2722d5 100644 --- a/packages/altboot/files/altboot-menu/Advanced/70-install-tgz +++ b/packages/altboot/files/altboot-menu/Advanced/70-install-tgz @@ -2,11 +2,6 @@ M_TITLE="Install RootFS from tar.gz" -# die() { -# echo "ERROR: $1" >/dev/tty0 -# exec $SH_SHELL /dev/tty0 2>&1 -# } - run_module(){ test -e /etc/altboot.func && . /etc/altboot.func || die "ERROR: /etc/altboot.func not found. Check your installation!" diff --git a/packages/altboot/files/altboot-menu/Advanced/70-setKernel b/packages/altboot/files/altboot-menu/Advanced/70-setKernel index a2c1efa81b..6192232a73 100644 --- a/packages/altboot/files/altboot-menu/Advanced/70-setKernel +++ b/packages/altboot/files/altboot-menu/Advanced/70-setKernel @@ -40,11 +40,13 @@ run_module() { get_pref "kexec_klist" "$junk" KEXEC_SELECTED_KERNEL && break - done - - echo "Using [$KEXEC_SELECTED_KERNEL]" + done + else + KEXEC_SELECTED_KERNEL="`ls -1 $KEXEC_KERNEL_DIR/zImage* | grep -v "kexec.cfg" `" fi + echo -e "\nUsing [$KEXEC_SELECTED_KERNEL]" + if ! test -e "$KEXEC_SELECTED_KERNEL.kexec.cfg" then echo -e "\nWARNING: This kernel has not been configured." diff --git a/packages/altboot/files/altboot-menu/Advanced/80-configure-kexec b/packages/altboot/files/altboot-menu/Advanced/80-configure-kexec index 27b6a871a6..e294df683f 100644 --- a/packages/altboot/files/altboot-menu/Advanced/80-configure-kexec +++ b/packages/altboot/files/altboot-menu/Advanced/80-configure-kexec @@ -38,11 +38,13 @@ run_module() { get_pref "kexec_klist" "$junk" KEXEC_KERNEL && break - done - - echo "Using [$KEXEC_KERNEL]" + done + else + KEXEC_KERNEL="`ls -1 $KEXEC_KERNEL_DIR/zImage* | grep -v "kexec.cfg" `" fi + echo -e "\nUsing [$KEXEC_KERNEL]" + configure_rootdev configure_roottype configure_verbose diff --git a/packages/altboot/files/altboot-menu/Advanced/80-copyrootfs b/packages/altboot/files/altboot-menu/Advanced/80-copyrootfs index 13f98a0d41..af6bd38c1d 100644 --- a/packages/altboot/files/altboot-menu/Advanced/80-copyrootfs +++ b/packages/altboot/files/altboot-menu/Advanced/80-copyrootfs @@ -4,11 +4,6 @@ M_TITLE="Copy rootfs to SD/CF" # Unfinished script. exit 0 -die() { - echo "ERROR: $1" >/dev/tty0 - exec $SH_SHELL /dev/tty0 2>&1 -} - ask_target() { available_disks="`mount | grep "/media" | grep -v ram | awk '{print $3}'`" diff --git a/packages/altboot/files/altboot.func b/packages/altboot/files/altboot.func index 5b587c453a..13ee515d6a 100644 --- a/packages/altboot/files/altboot.func +++ b/packages/altboot/files/altboot.func @@ -1,4 +1,12 @@ #! /bin/sh + +C_RED="\033[31m" +C_YELLOW="\033[35m" +C_BLUE="\033[34m" +C_WHITE="\033[38m" +C_RESET="\033[0m" + + # This function checks for the presence of a real filesystem and loop-images on the target # $1 = folder of rootfs, $2 = runlevel (defaults to 5) # $2 = name of calling module @@ -231,7 +239,8 @@ do_pivot(){ boot_new_rootfs_splash echo "Calling INIT" - exec /usr/sbin/chroot . /sbin/init $2 >/dev/tty0 2>&1 + exec /usr/sbin/chroot . $REAL_INIT $2 >/dev/tty0 2>&1 + #exec /usr/sbin/chroot . /sbin/init $2 >/dev/tty0 2>&1 else echo "FAILED" die "* * * pivot_root failed! * * *" @@ -281,7 +290,7 @@ image_conf(){ while true do echo -e "Wasting RAM is never a good idea.\nOnly say Y if your rootfs is very small in size" - echo -n "Do you want to store ipkg package data in RAM? [N|y] " + echo -en "Do you want to store ipkg package data\nin RAM? [N|y] " read junk if test "$junk" = "" -o "$junk" = n -o "$junk" = N @@ -301,7 +310,7 @@ image_conf(){ then while true do - echo -n "Do you want to keep the SD, CF and /home ipkg install targets? [N|y] " + echo -en "Do you want to keep the SD, CF and /home\nipkg install targets? [N|y] " read junk if test "$junk" = "" -o "$junk" = n -o "$junk" = N @@ -557,7 +566,7 @@ show_menu() { } mdie() { - echo "ERROR: $1" >/dev/tty0 + echo -e "${C_RED}ERROR:${C_RESET}${C_WHITE} $1${C_RESET}" >/dev/tty0 echo -e "\nPress to return to the menu" read junk @@ -612,8 +621,14 @@ get_pref() { test -n "$data_value" && return 0 } +debug_echo() { + test "$ENABLE_DEBUG" = "yes" && echo -e "${C_YELLOW}DEBUG:${C_RESET}${C_WHITE} $1 ${C_RESET}" >/dev/tty0 2>&1 +} + start_networking() { + test -z "$1" && mdie "No remote host configured, check /etc/fstab for NFS hosts" + if test "$USB_NETWORKING_AVAILABLE" = "yes" then echo "" @@ -636,7 +651,7 @@ start_networking() { junk="`cat /etc/.altboot-lanselect.last`" test -z "$junk" && junk=1 - echo -n "Connection Type: $junk (autoboot)" + echo "Connection Type: $junk (autoboot)" fi case "$junk" in @@ -669,12 +684,16 @@ start_networking() { if test -x /etc/init.d/pcmcia then + echo -e "\nRunning cardctl to setup networking..." /etc/init.d/pcmcia start >/dev/null 2>&1 || die "/etc/init.d/pcmcia start failed!" + sleep 1 else # With kernel 2.6.16+ udev is used - ps ax| grep -v grep | grep -q udevd || /etc/init.d/udev start >/dev/null 2>&1 || die "/etc/init.d/udev start failed!" + echo -e "\nRunning udevd to setup networking..." + ps ax | grep -v grep | grep -q udevd || /etc/init.d/udev start >/dev/null 2>&1 || die "/etc/init.d/udev start failed!" - /etc/init.d/udev stop + # Stop udev to work around some very ugly (yet harmless) error messages on boot + /etc/init.d/udev stop >/dev/null 2>&1 fi fi @@ -695,9 +714,19 @@ start_networking() { ifup "$USB_NW_DEVICE" fi + + WLAN_NIC="`iwconfig 2>/dev/null | grep ESSID | grep -v wifi | awk '{print $1}'`" + + if test -z "$WLAN_NIC" + then + debug_echo "WARNING: WLAN_NIC is empty!\n" + debug_echo "Filter result: [$WLAN_NIC]" + debug_echo "iwconfig: [`iwconfig`]" + mdie "No network interface found" + fi # WLAN with DHCP needs some time to get a lease, set up the routing, etc. - echo -n "Waiting for Network." + echo -n "Waiting for host [$1] on [$WLAN_NIC]." cnt=0 while true do diff --git a/packages/altboot/files/init.altboot b/packages/altboot/files/init.altboot index a987918760..3dc7c60240 100644 --- a/packages/altboot/files/init.altboot +++ b/packages/altboot/files/init.altboot @@ -27,16 +27,31 @@ esac test -e "$ALTBOOT_CFG_FILE" && . "$ALTBOOT_CFG_FILE" || echo "WARNING: No $ALTBOOT_CFG_FILE found! Check your installation of Altboot!" > /dev/tty1 C_RED="\033[31m" +C_YELLOW="\033[33m" C_BLUE="\033[34m" C_WHITE="\033[37m" C_RESET="\033[0m" die() { - echo -e "ERROR: $1" >/dev/tty0 + echo -e "${C_RED}ERROR: $1${C_RESET}" >/dev/tty0 exec $SH_SHELL /dev/tty0 2>&1 } +debug_shell() { + # VT 2 = Opie, VT 3 = GPE + test -z "$1" && VT=4 || VT=$1 + + echo -e "\033c" > /dev/tty$VT + + echo -en "\nPress to activate the debug shell." > /dev/tty$VT + read junk /dev/tty$VT + /bin/sh /dev/tty$VT 2>&1 + + #openvt -lf -c$VT -- /bin/sh /dev/tty$VT 2>&1 +} # This function prints the boot-menu # $1: Directory containing the scripts for the menu-items @@ -299,6 +314,13 @@ wait_for_input() { # 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 + ENABLE_DEBUG="yes" + debug_shell 4 >/dev/null 2>&1 & +fi + if test -f /proc/cmdline -a "`ps ax|wc -l|tr -d " "`" -gt 30 -a "$1" != "-force" then echo "altboot: Using real init [$REAL_INIT] [$*] [`ps ax|wc -l|tr -d " "`] *" >/dev/tty1 -- cgit v1.2.3 From 25c3f29eae34ff0b250ca6757362dada9e426278 Mon Sep 17 00:00:00 2001 From: Matthias Hentges Date: Sun, 23 Apr 2006 15:03:56 +0000 Subject: altboot: Add 1.0.7-rc2 --- packages/altboot/altboot_1.0.7-rc1.bb | 91 ----------------------------------- packages/altboot/altboot_1.0.7-rc2.bb | 91 +++++++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+), 91 deletions(-) delete mode 100644 packages/altboot/altboot_1.0.7-rc1.bb create mode 100644 packages/altboot/altboot_1.0.7-rc2.bb (limited to 'packages') diff --git a/packages/altboot/altboot_1.0.7-rc1.bb b/packages/altboot/altboot_1.0.7-rc1.bb deleted file mode 100644 index 5f76d1b516..0000000000 --- a/packages/altboot/altboot_1.0.7-rc1.bb +++ /dev/null @@ -1,91 +0,0 @@ -#! /bin/sh -# -# Copyright Matthias Hentges (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 " -HOMEPAGE = "http://www.hentges.net/misc/openzaurus/index.shtml" - -###################################################################################### - -RRECOMMENDS = "e2fsprogs-e2fsck dosfstools" -RRECOMMENDS_append_akita = " kexec-tools" -RRECOMMENDS_append_spitz = " kexec-tools" -RRECOMMENDS_append_c7x0 = " kexec-tools" - -###################################################################################### - -PR = "r1" - -###################################################################################### - -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" - -S = "${WORKDIR}/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 - 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 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_postrm() { - update-alternatives --remove init /sbin/init.altboot -} - diff --git a/packages/altboot/altboot_1.0.7-rc2.bb b/packages/altboot/altboot_1.0.7-rc2.bb new file mode 100644 index 0000000000..18ba022a71 --- /dev/null +++ b/packages/altboot/altboot_1.0.7-rc2.bb @@ -0,0 +1,91 @@ +#! /bin/sh +# +# Copyright Matthias Hentges (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 " +HOMEPAGE = "http://www.hentges.net/misc/openzaurus/index.shtml" + +###################################################################################### + +RRECOMMENDS = "e2fsprogs-e2fsck dosfstools" +RRECOMMENDS_append_akita = " kexec-tools" +RRECOMMENDS_append_spitz = " kexec-tools" +RRECOMMENDS_append_c7x0 = " kexec-tools" + +###################################################################################### + +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" + +S = "${WORKDIR}/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 + 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 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_postrm() { + update-alternatives --remove init /sbin/init.altboot +} + -- cgit v1.2.3