wok view slitaz-eeepc/stuff/tazeee @ rev 2732

Add: vcdimager, vcdimager-dev, vcdimager-xmltools
author Rohit Joshi <jozee@slitaz.org>
date Fri Apr 24 07:38:33 2009 +0000 (2009-04-24)
parents 1d87b6c16397
children f560002068fe
line source
1 #!/bin/sh
2 #
3 # Configure SliTaz for EeePC. Tazee prodide first boot initialisation
4 # to configure the EeePC model and a GTK box to have quick access to
5 # SliTaz EeePC stuff.
6 #
7 # 20090307 <pankso@slitaz.org> - GNU gpl v3.
8 #
9 : ${DIALOG=dialog}
11 check_root()
12 {
13 if test $(id -u) != 0 ; then
14 echo -e "\nYou must be root to run `basename $0` with this option."
15 echo -e "Please use 'su' and root password to become super-user.\n"
16 exit 0
17 fi
18 }
20 get_model()
21 {
22 EEEPC_MODEL=`dmidecode -s system-product-name`
23 echo "EeePC model detected: $EEEPC_MODEL"
24 # Create config file used at boot time by init script.
25 cat > /etc/eeepc.conf << _EOF_
26 # EeePC configuration file for SliTaz GNU/Linux.
27 #
28 EEEPC_MODEL="$EEEPC_MODEL"
29 _EOF_
30 }
32 # Specific model settings.
33 model_config()
34 {
35 . /etc/eeepc.conf
36 case $EEEPC_MODEL in
37 701)
38 SCREEN_SIZE='800x480x24'
39 HACK_915='5c 800 480 32'
40 KERNEL_MODULES='atl2 ath_pci'
41 WIFI_INTERFACE='ath0' ;;
42 900)
43 SCREEN_SIZE='1024x600x24'
44 HACK_915='54 1024 600 32'
45 KERNEL_MODULES='atl2 ath_pci'
46 WIFI_INTERFACE='ath0'
47 # Fix poweroff
48 echo 'rmmod snd_hda_intel' >> /etc/init.d/shutdown.sh ;;
49 901)
50 SCREEN_SIZE='1024x600x24'
51 HACK_915='54 1024 600 32'
52 KERNEL_MODULES='atl1e rt2860sta'
53 WIFI_INTERFACE='ra0' ;;
54 1000)
55 SCREEN_SIZE='1024x600x24'
56 HACK_915='54 1024 600 32'
57 KERNEL_MODULES='atl1e rt2860sta'
58 WIFI_INTERFACE='ra0' ;;
59 *)
60 echo "Skipping EeePC $EEEPC_MODEL setup..." && exit 0 ;;
61 esac
62 cat >> /etc/eeepc.conf << _EOF_
64 # Screen
65 SCREEN_SIZE="$SCREEN_SIZE"
66 HACK_915="$HACK_915"
68 # Network
69 KERNEL_MODULES="$KERNEL_MODULES"
70 WIFI_INTERFACE="$WIFI_INTERFACE"
71 _EOF_
72 }
74 # Load module now and add them to LOAD_MODULE for next boot if installed
75 # With this /etc/init.d/network.sh will start the wireless interface.
76 load_modules()
77 {
78 for mod in $KERNEL_MODULES
79 do
80 modprobe $mod
81 done
82 # Add module to rcS.conf and avoid duplication.
83 . /etc/rcS.conf
84 sed -i s/"LOAD_MODULES=\"$LOAD_MODULES\""/"LOAD_MODULES=\"$LOAD_MODULES $KERNEL_MODULES\""/ \
85 /etc/rcS.conf
86 }
88 # Active wifi interface it will be configured by network.sh and config
89 # LXpanel.
90 active_wifi()
91 {
92 sed -i s/'WIFI="no"'/'WIFI="yes"'/ /etc/network.conf
93 sed -i s/'iface=eth0'/"iface=$WIFI_INTERFACE"/ \
94 /etc/lxpanel/default/panels/panel
95 }
97 # Small GTKdialog box the have quick access to slitaz-eeepc stuff.
98 box()
99 {
100 export EEE_BOX='
101 <window title="SliTaz EeePC Box" icon-name="computer">
102 <vbox>
103 <vbox>
104 <pixmap>
105 <input file>/usr/share/images/eeepc-logo.png</input>
106 </pixmap>
107 <text>
108 <label>
109 "
110 Small interface to access SliTaz EeePC information and tools
111 "
112 </label>
113 </text>
114 </vbox>
115 <hbox>
116 <button>
117 <label>Documentation</label>
118 <input file icon="help"></input>
119 <action>firefox /usr/share/doc/slitaz-flavors/eeepc.html &</action>
120 </button>
121 <button>
122 <label>Show configuration</label>
123 <input file icon="computer"></input>
124 <action>leafpad /etc/eeepc.conf &</action>
125 </button>
126 <button>
127 <label>SSD/HDD install</label>
128 <input file icon="system-installer"></input>
129 <action>subox "xterm -e tazeee install" &</action>
130 </button>
131 <button>
132 <label>Exit</label>
133 <input file icon="exit"></input>
134 <action type="exit">exit</action>
135 </button>
136 </hbox>
137 </vbox>
138 </window>'
139 gtkdialog --center --program=EEE_BOX
140 }
142 case $1 in
143 setup)
144 check_root
145 get_model
146 model_config
147 load_modules
148 [ -n $WIFI_INTERFACE ] && active_wifi
149 echo "EeePC setup completed..." ;;
150 box)
151 box ;;
152 show-config)
153 echo ""
154 cat /etc/eeepc.conf
155 echo "" ;;
156 install)
157 # EeePC havn't got a cdrom so we must fake it.
158 echo ""
159 echo "Starting SliTaz EeePC installation..."
160 echo "Please do not reboot through the installer, just exit."
161 sleep 4
162 rmdir /media/cdrom
163 ln -s /home /media/cdrom
164 slitaz-installer
165 # Installer/GBUB see /dev/hdc1 as (hd2,0) --> we need (hd0,0)
166 mount /dev/hdc1 /mnt/target 2>/dev/null
167 if grep -q 'root=/dev/hdc1' /mnt/target/boot/grub/menu.lst 2>/dev/null; then
168 sed -i s/'(hd2,0)'/'(hd0,0)'/ /mnt/target/boot/grub/menu.lst
169 fi
170 umount /mnt/target 2>/dev/null
171 echo ""
172 echo "Installation completed. You can now reboot your EeePC"
173 echo "" ;;
174 *)
175 echo -e "\nUsage: `basename $0` [setup|box|show-config|install]\n" ;;
176 esac
178 exit 0