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

Add option screen=text (dont start X login manager)
author Christophe Lincoln <pankso@slitaz.org>
date Sat Feb 23 01:40:59 2008 +0100 (2008-02-23)
parents 0a34abfb23d2
children 1e2fdd797456
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
14 DEVID=$DEVICE
15 if [ -x /sbin/blkid ]; then
16 #can be label, uuid or devname
17 DEVID=`/sbin/blkid | grep $DEVICE | cut -d: -f1`
18 fi
19 if [ -n "$DEVID" ] && grep -q "$DEVID" /proc/partitions ; then
20 echo "Mounting /home on /dev/$DEVID... "
21 mv /home/hacker /tmp/hacker-home
22 mount -o uid=500,gid=500 /dev/$DEVID /home
23 else
24 echo "Unable to find $DEVICE... "
25 fi
26 # Move all hacker dir if needed.
27 if [ ! -d "/home/hacker" ] ; then
28 mv /tmp/hacker-home /home/hacker
29 chown -R hacker.hacker /home/hacker
30 else
31 rm -rf /tmp/hacker-home
32 fi
33 }
35 # Parse /proc/cmdline with grep.
36 #
38 echo "Parsing kernel cmdline for SliTaz live options... "
40 # Check for a specified home directory on cmdline (home=*).
41 #
42 if grep -q "home=usb" /proc/cmdline; then
43 DEVICE=sda1
44 mount_home
45 elif grep -q "home=" /proc/cmdline; then
46 DEVICE=`cat /proc/cmdline | sed 's/.*home=\([^ ]*\).*/\1/'`
47 mount_home
48 fi
50 # Active an eventual swap file in /home and on local hd.
51 #
52 if [ -f "/home/swap" ]; then
53 echo "Activing swap (/home/swap) memory..."
54 swapon /home/swap
55 fi
56 if [ "`fdisk -l | grep swap`" ]; then
57 for SWAP_DEV in `fdisk -l | grep swap | awk '{ print $1 }'`; do
58 echo "Swap memory detected on: $SWAP_DEV"
59 swapon $SWAP_DEV
60 done
61 fi
63 # Check for a specified locale (lang=*).
64 #
65 if grep -q "lang=*" /proc/cmdline; then
66 LANG=`cat /proc/cmdline | sed 's/.*lang=\([^ ]*\).*/\1/'`
67 echo -n "Setting system locale to: $LANG... "
68 echo "LANG=$LANG" > /etc/locale.conf
69 echo "LC_ALL=$LANG" >> /etc/locale.conf
70 status
71 fi
73 # Check for a specified keymap (kmap=*).
74 #
75 if grep -q "kmap=*" /proc/cmdline; then
76 KMAP=`cat /proc/cmdline | sed 's/.*kmap=\([^ ]*\).*/\1/'`
77 echo -n "Setting system keymap to: $KMAP..."
78 echo "KMAP=$KMAP.kmap" > /etc/kmap.conf
79 status
80 fi
82 # Check for a specified screen (screen=*).
83 #
84 if grep -q "screen=*" /proc/cmdline; then
85 SCREEN=`cat /proc/cmdline | sed 's/.*screen=\([^ ]*\).*/\1/'`
86 if [ "$SCREEN" = "text" ];
87 echo -n "Disabling X login manager: slim..."
88 sed -i s/'slim'/''/ /etc/rcS.conf
89 status
90 else
91 echo "Option not yet implemented: screen=$SCREEN"
92 sleep 2
93 fi
94 fi