summaryrefslogtreecommitdiff
path: root/packages/initrdscripts/files
diff options
context:
space:
mode:
authorPaul Sokolovsky <pmiscml@gmail.com>2008-03-09 01:35:38 +0000
committerPaul Sokolovsky <pmiscml@gmail.com>2008-03-09 01:35:38 +0000
commit8fd3f13e159ef7506aeed77b3ad2120f91492aae (patch)
tree0d4388b51bfce89f8f562e7029ffeba0010c74a8 /packages/initrdscripts/files
parent579bf2572c3688fafa0a2f5674c3a088c38daba0 (diff)
initramfs-*: Use $CONSOLE for input/output.
Diffstat (limited to 'packages/initrdscripts/files')
-rw-r--r--packages/initrdscripts/files/30-bootmenu.sh22
-rw-r--r--packages/initrdscripts/files/87-kexecboot.sh6
-rw-r--r--packages/initrdscripts/files/init.sh3
3 files changed, 16 insertions, 15 deletions
diff --git a/packages/initrdscripts/files/30-bootmenu.sh b/packages/initrdscripts/files/30-bootmenu.sh
index f5ecb8c828..283daadd44 100644
--- a/packages/initrdscripts/files/30-bootmenu.sh
+++ b/packages/initrdscripts/files/30-bootmenu.sh
@@ -36,14 +36,14 @@ add_menu_item()
}
show_menu() {
- echo -e -n "${E}3;0H"
+ echo -e -n "${E}3;0H" >$CONSOLE
cnt=0
echo -e $list | \
while read l; do
if [ $cnt == $num ]; then
- echo -e -n "${E}1m"
+ echo -e -n "${E}1m" >$CONSOLE
fi
- echo -e "$cnt: $l${E}0m"
+ echo -e "$cnt: $l${E}0m" >$CONSOLE
cnt=$((cnt + 1))
done
}
@@ -109,14 +109,14 @@ total=`echo -e $list | wc -l`
num=0
# Draw UI
-stty -echo
-echo -e -n "${E}2J"
-echo -e -n "${E}0;0H"
-echo "Select boot image:"
+stty -F $CONSOLE -echo
+echo -e -n "${E}2J" >$CONSOLE
+echo -e -n "${E}0;0H" >$CONSOLE
+echo "Select boot image:" >$CONSOLE
# Main loop
show_menu
-while read -n1 i; do
+while read -s -n1 i; do
case "$i" in
"A")
num=$((num - 1))
@@ -139,7 +139,7 @@ while read -n1 i; do
esac
show_menu
# echo "*$esc$i"
-done
+done < $CONSOLE
stty echo
@@ -170,8 +170,8 @@ else
CMDLINE="$CMDLINE root=$ROOT_DEVICE"
fi
-echo ROOT_DEVICE=$ROOT_DEVICE
-echo CMDLINE=$CMDLINE
+echo ROOT_DEVICE=$ROOT_DEVICE >$CONSOLE
+echo CMDLINE=$CMDLINE >$CONSOLE
##############################
fi
diff --git a/packages/initrdscripts/files/87-kexecboot.sh b/packages/initrdscripts/files/87-kexecboot.sh
index 9232934f98..2a51b4d9c8 100644
--- a/packages/initrdscripts/files/87-kexecboot.sh
+++ b/packages/initrdscripts/files/87-kexecboot.sh
@@ -3,15 +3,15 @@
if [ -n "$BOOT_ROOT" -a -f "$BOOT_ROOT/boot/zImage" ]; then
if ! expr "$CMDLINE" : '.*nokexec'; then
- echo "Kernel found in rootfs:"
- ls -l "$BOOT_ROOT/boot/zImage"
+ echo "Kernel found in rootfs:" >$CONSOLE
+ ls -l "$BOOT_ROOT/boot/zImage" >$CONSOLE
initramfs=""
if [ -f "$BOOT_ROOT/boot/initramfs.bin" ]; then
echo "Initramfs found in rootfs:"
ls -l "$BOOT_ROOT/boot/initramfs.bin"
initramfs="--initrd=$BOOT_ROOT/boot/initramfs.bin"
fi
- echo /usr/sbin/kexec -f "$BOOT_ROOT/boot/zImage" $initramfs --command-line="$CMDLINE nokexec"
+ echo /usr/sbin/kexec -f "$BOOT_ROOT/boot/zImage" $initramfs --command-line="$CMDLINE nokexec" >$CONSOLE
sleep 10
/usr/sbin/kexec -f "$BOOT_ROOT/boot/zImage" $initramfs --command-line="$CMDLINE nokexec"
sleep 10000
diff --git a/packages/initrdscripts/files/init.sh b/packages/initrdscripts/files/init.sh
index c3b4336e40..06b9119a1c 100644
--- a/packages/initrdscripts/files/init.sh
+++ b/packages/initrdscripts/files/init.sh
@@ -41,6 +41,7 @@ read_args() {
load_modules() {
for module in $MODULE_DIR/$1; do
+ # Cannot redir to $CONSOLE here easily - may not be set yet
echo "initramfs: Loading $module module"
source $module
done
@@ -67,7 +68,7 @@ load_modules '0*'
read_args
if [ -n "$rootdelay" ]; then
- echo "Waiting $rootdelay seconds for devices to settle..."
+ echo "Waiting $rootdelay seconds for devices to settle..." >$CONSOLE
sleep $rootdelay
fi