slitaz-boot-scripts view etc/init.d/bootopts.sh @ rev 12

Fixed hwconf.sh 'status' + sound=no + rcS msg
author Christophe Lincoln <pankso@slitaz.org>
date Thu Dec 06 11:07:55 2007 +0100 (2007-12-06)
parents 5ef45b38e0e5
children 93db726efd01
line source
1 #!/bin/sh
2 # /etc/init.d/bootopts.sh - SliTaz boot options from the cmdline.
3 #
4 . /etc/init.d/rc.functions
6 # Mount /home and check for user hacker home dir.
7 #
8 mount_home()
9 {
10 echo "Home has been specified to $DEVICE..."
11 echo "Sleeping 10 s to let the kernel detect the device... "
12 sleep 10
13 if grep -q "$DEVICE" /proc/partitions ; then
14 echo "Mounting /home on /dev/$DEVICE... "
15 mv /home/hacker /tmp/hacker-home
16 mount -t ext3 /dev/$DEVICE /home
17 else
18 echo "Unable to find $DEVICE in /proc/partitions... "
19 fi
20 # Move all hacker dir if needed.
21 if [ ! -d "/home/hacker" ] ; then
22 mv /tmp/hacker-home /home/hacker
23 chown -R hacker.hacker /home/hacker
24 else
25 rm -rf /tmp/hacker-home
26 fi
27 }
29 # Parse /proc/cmdline with grep.
30 #
32 echo "Parsing kernel cmdline for SliTaz live options... "
34 # Check for a specified home directory on cmdline (home=*).
35 #
36 if grep -q "home=usb" /proc/cmdline; then
37 DEVICE=sda1
38 mount_home
39 elif grep -q "home=" /proc/cmdline; then
40 DEVICE=`cat /proc/cmdline | sed 's/.*home=\([^ ]*\).*/\1/'`
41 mount_home
42 fi
44 # Active an eventual swap file in /home and on local hd.
45 #
46 if [ -f "/home/swap" ]; then
47 echo "Activing swap (/home/swap) memory..."
48 swapon /home/swap
49 fi
50 if [ "`fdisk -l | grep swap`" ]; then
51 for SWAP_DEV in `fdisk -l | grep swap | awk '{ print $1 }'`; do
52 echo "Swap memory detected on : $SWAP_DEV"
53 swapon $SWAP_DEV
54 done
55 fi
57 # Check for a specified locale (lang=*).
58 #
59 if grep -q "lang=*" /proc/cmdline; then
60 LANG=`cat /proc/cmdline | sed 's/.*lang=\([^ ]*\).*/\1/'`
61 echo -n "Setting system locale to: $LANG... "
62 echo "LANG=$LANG" > /etc/locale.conf
63 echo "LC_ALL=$LANG" >> /etc/locale.conf
64 status
65 fi
67 # Check for a specified keymap (kmap=*).
68 #
69 if grep -q "kmap=*" /proc/cmdline; then
70 KMAP=`cat /proc/cmdline | sed 's/.*kmap=\([^ ]*\).*/\1/'`
71 echo -n "Setting system keymap to: $KMAP..."
72 echo "KMAP=$KMAP.kmap" > /etc/kmap.conf
73 status
74 fi