# HG changeset patch # User Christophe Lincoln # Date 1203790203 -3600 # Node ID 8d77d0bba81147cb490fff172ba3cc0f141f4a51 # Parent 7bcff1537b8a94895644695238e7f2f37c0d1549 Fix home=*, screen=text and swap opt only with home=* diff -r 7bcff1537b8a -r 8d77d0bba811 etc/init.d/bootopts.sh --- a/etc/init.d/bootopts.sh Sat Feb 23 11:59:48 2008 +0100 +++ b/etc/init.d/bootopts.sh Sat Feb 23 19:10:03 2008 +0100 @@ -16,7 +16,7 @@ #can be label, uuid or devname DEVID=`/sbin/blkid | grep $DEVICE | cut -d: -f1` fi - if [ -n "$DEVID" ] && grep -q "$DEVID" /proc/partitions ; then + if [ -n "$DEVID" ] && grep -q "$DEVICE" /proc/partitions ; then echo "Mounting /home on /dev/$DEVID... " mv /home/hacker /tmp/hacker-home mount -o uid=500,gid=500 /dev/$DEVID /home @@ -32,6 +32,20 @@ fi } +# Check if swap file must be generated in /home: swap=size (Mb). +# This option is used with home=device. +gen_home_swap() +{ + if grep -q "swap=[1-9]*" /proc/cmdline; then + SWAP_SIZE=`cat /proc/cmdline | sed 's/.*swap=\([^ ]*\).*/\1/'` + # DD to gen a virtual disk. + echo "Generating swap file: /home/swap ($SWAP_SIZE)..." + dd if=/dev/zero of=/home/swap bs=1M count=$SWAP_SIZE + # Make the Linux swap filesystem. + mkswap /home/swap + fi +} + # Parse /proc/cmdline with grep. # @@ -42,21 +56,11 @@ if grep -q "home=usb" /proc/cmdline; then DEVICE=sda1 mount_home + gen_home_swap elif grep -q "home=" /proc/cmdline; then DEVICE=`cat /proc/cmdline | sed 's/.*home=\([^ ]*\).*/\1/'` mount_home -fi - -# Check if swap file must be generated: swap=size (Mb). -# -if grep -q "swap=[1-9]*" /proc/cmdline; then - SWAP_SIZE=`cat /proc/cmdline | sed 's/.*swap=\([^ ]*\).*/\1/'` - # DD to gen a virtual disk. - echo -n "Generating swap file: /home/swap ($SWAP_SIZE)..." - dd if=/dev/zero of=/home/swap bs=1M count=$SWAP_SIZE 2>/dev/null - status - # Make the Linux swap filesystem. - mkswap /home/swap + gen_home_swap fi # Active an eventual swap file in /home and on local hd. @@ -99,6 +103,9 @@ echo -n "Disabling X login manager: slim..." sed -i s/'slim'/''/ /etc/rcS.conf status + # Creat /etc/X11/screen.conf to avoid tazx execution by hwconf.sh + mkdir -p /etc/X11 + echo 'SCREEN=1024x768x24' > /etc/X11/screen.conf else echo "Option not yet implemented: screen=$SCREEN" sleep 2 diff -r 7bcff1537b8a -r 8d77d0bba811 etc/init.d/hwconf.sh --- a/etc/init.d/hwconf.sh Sat Feb 23 11:59:48 2008 +0100 +++ b/etc/init.d/hwconf.sh Sat Feb 23 19:10:03 2008 +0100 @@ -41,6 +41,6 @@ fi # Screen size config for slim/Xvesa. -if [ ! -f /etc/X11/screen.conf -a -e /usr/bin/slim ]; then +if [ ! -f /etc/X11/screen.conf -a -x /usr/bin/slim ]; then tazx fi diff -r 7bcff1537b8a -r 8d77d0bba811 etc/init.d/rcS --- a/etc/init.d/rcS Sat Feb 23 11:59:48 2008 +0100 +++ b/etc/init.d/rcS Sat Feb 23 19:10:03 2008 +0100 @@ -133,14 +133,22 @@ echo "Executing all initialisation scripts..." for script in $RUN_SCRIPTS do - /etc/init.d/$script + if [ -x /etc/init.d/$daemon ]; then + /etc/init.d/$script + fi done +# Re-source main config file, in Live mode daemons list ca be modified +# by boot options. +. /etc/rcS.conf + # Start all daemons specified with $RUN_DAEMONS. echo "Starting all daemons specified in /etc/rcS.conf..." for daemon in $RUN_DAEMONS do - /etc/init.d/$daemon start + if [ -x /etc/init.d/$daemon ]; then + /etc/init.d/$daemon start + fi done # Reset screen and display a bold message.