#!/bin/bash # # This script supports Live's cheatcodes & initiate some vital commands. # # adding more loop devices for i in $(seq 99); do if [ ! -e /dev/loop$i ]; then mknod /dev/loop$i b 7 $i fi done # for cmdline_value . /usr/lib/liblinuxlive # passwd: Change root's password at startup newrootpass="`cmdline_value passwd`" if [ "$newrootpass" = "ask" ]; then echo -ne "\nEnter new password for root: " read -s newrootpass fi if [ ! "$newrootpass" = "" ]; then echo "root:$newrootpass" | /usr/sbin/chpasswd fi # lang: Override default language lang="`cmdline_value lang`" if [ "$lang" ]; then /usr/sbin/localesetup $lang fi # Make firefox match OS locale if [ -w /usr/lib/firefox/greprefs/all.js ]; then sed -i -e 's/pref("intl.locale.matchOS", false);/pref("intl.locale.matchOS", true);/g' /usr/lib/firefox/greprefs/all.js fi # Make thunderbird match OS locale if [ -w /usr/lib/thunderbird/greprefs/all.js ]; then sed -i -e 's/pref("intl.locale.matchOS", false);/pref("intl.locale.matchOS", true);/g' /usr/lib/thunderbird/greprefs/all.js fi # synaptics: Use the syanptics fdi for HAL synpatics="`cmdline_value synaptics`" if [ "$synpatics" = "on" ]; then mkdir -p /etc/hal/fdi/policy if [ ! -e /etc/hal/fdi/policy/11-x11-synaptics.fdi ]; then cp /usr/lib/salixlive/11-x11-synaptics.fdi /etc/hal/fdi/policy/ fi else if [ -e /etc/hal/fdi/policy/11-x11-synaptics.fdi ]; then rm -f /etc/hal/fdi/policy/11-x11-synaptics.fdi fi fi # keyb: Override default keyb settings keyb="`cmdline_value keyb`" if [ -z "$keyb" ]; then keyb=us fi # numlock: Override default numlock settings numlock="`cmdline_value numlock`" if [ -z "$numlock" ]; then numlock=off fi # scim: Override default SCIM settings scim="`cmdline_value scim`" if [ -z "$scim" ]; then scim=off fi /usr/sbin/keyboardsetup -k $keyb -n $numlock -s $scim # autologin: Enables autologin in GDM if [ "`cmdline_parameter autologin`" ]; then sed -i 's/AutomaticLoginEnable=.*/AutomaticLoginEnable=true/' /etc/gdm/custom.conf fi