aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--inittab13
-rwxr-xr-xmakedevs16
-rwxr-xr-xnetcfg18
-rw-r--r--rc.conf3
-rwxr-xr-xrc.shutdown8
-rwxr-xr-xrc.single6
-rwxr-xr-xrc.sysinit31
7 files changed, 54 insertions, 41 deletions
diff --git a/inittab b/inittab
index 25b2e5a..9c2e3fc 100644
--- a/inittab
+++ b/inittab
@@ -19,12 +19,13 @@ rm:2345:wait:/etc/rc.multi
rh:06:wait:/etc/rc.shutdown
su:S:wait:/sbin/sulogin -p
-c1:2345:respawn:/sbin/agetty 38400 vc/1 linux
-c2:2345:respawn:/sbin/agetty 38400 vc/2 linux
-c3:2345:respawn:/sbin/agetty 38400 vc/3 linux
-c4:2345:respawn:/sbin/agetty 38400 vc/4 linux
-c5:2345:respawn:/sbin/agetty 38400 vc/5 linux
-c6:2345:respawn:/sbin/agetty 38400 vc/6 linux
+# -8 options fixes umlauts problem on login
+c1:2345:respawn:/sbin/agetty -8 38400 vc/1 linux
+c2:2345:respawn:/sbin/agetty -8 38400 vc/2 linux
+c3:2345:respawn:/sbin/agetty -8 38400 vc/3 linux
+c4:2345:respawn:/sbin/agetty -8 38400 vc/4 linux
+c5:2345:respawn:/sbin/agetty -8 38400 vc/5 linux
+c6:2345:respawn:/sbin/agetty -8 38400 vc/6 linux
ca::ctrlaltdel:/sbin/shutdown -t3 -r now
diff --git a/makedevs b/makedevs
index 809f57b..3b5f41c 100755
--- a/makedevs
+++ b/makedevs
@@ -6,21 +6,21 @@ devdir="/dev"
cd $devdir
-for i in `find /sys/block -name dev`; do
+for i in $(find /sys/block -name dev); do
# get the second-to-last field
- name=`echo $i | rev | cut -d/ -f2 | rev`
- maj=`cat $i | cut -d: -f1`
- min=`cat $i | cut -d: -f2`
+ name=$(echo $i | rev | cut -d/ -f2 | rev)
+ maj=$(cat $i | cut -d: -f1)
+ min=$(cat $i | cut -d: -f2)
[ ! -e $name ] && mknod $name b $maj $min
done
-for i in `find /sys/class -name dev`; do
+for i in $(find /sys/class -name dev); do
# get the second-to-last field
- name=`echo $i | rev | cut -d/ -f2 | rev`
+ name=$(echo $i | rev | cut -d/ -f2 | rev)
# skip all the tty?? nodes
#[ "${name%%??}" = "tty" ] && continue
#[ "${name%%??}" = "pty" ] && continue
- maj=`cat $i | cut -d: -f1`
- min=`cat $i | cut -d: -f2`
+ maj=$(cat $i | cut -d: -f1)
+ min=$(cat $i | cut -d: -f2)
[ ! -e $name ] && mknod $name c $maj $min
done
diff --git a/netcfg b/netcfg
index d350e0c..6e10639 100755
--- a/netcfg
+++ b/netcfg
@@ -56,7 +56,7 @@ stop_profile()
# if the dhcp client received an unlimited lease then it just exits,
# so check for .pid file before trying to kill it.
if [ -f /var/run/dhcpcd-${INTERFACE}.pid ]; then
- kill `cat /var/run/dhcpcd-${INTERFACE}.pid`
+ kill $(cat /var/run/dhcpcd-${INTERFACE}.pid)
fi
fi
@@ -71,7 +71,7 @@ stop_profile()
stop_all()
{
[ -d $STATE_DIR ] || return
- for prof in `ls $STATE_DIR`; do
+ for prof in $(ls $STATE_DIR); do
unset INTERFACE
. $STATE_DIR/$prof
stop_profile $INTERFACE
@@ -120,7 +120,7 @@ start_profile()
WPA_CONF="/etc/wpa_supplicant.conf"
if [ "$AUTOWPA" = "yes" -o "$AUTOWPA" = "YES" ]; then
- WPA_CONF=`mktemp /tmp/wpa.XXXXXXXX`
+ WPA_CONF=$(mktemp /tmp/wpa.XXXXXXXX)
# file will contain PSK, limit reading
chmod 600 $WPA_CONF
echo "ctrl_interface=/var/run/wpa_supplicant" > $WPA_CONF
@@ -131,7 +131,7 @@ start_profile()
[ "$WPAOPTS" ] || WPAOPTS="-Dwext"
wpa_supplicant -wB -i ${WIFI_INTERFACE} -c ${WPA_CONF} $WPAOPTS
- # I don´t know how we could determine if wpa_supplicant is ready
+ # I don�t know how we could determine if wpa_supplicant is ready
sleep 2
let i=0
while ! wpa_cli status | grep "wpa_state=COMPLETED" >/dev/null 2>&1; do
@@ -185,7 +185,7 @@ start_profile()
menu()
{
- if [ "`ls $PROFILE_DIR 2>/dev/null | grep -v ^template$`" = "" -o ! -d $PROFILE_DIR ]; then
+ if [ "$(ls $PROFILE_DIR 2>/dev/null | grep -v ^template$)" = "" -o ! -d $PROFILE_DIR ]; then
echo "No profiles found. Add profiles in $PROFILE_DIR"
return
fi
@@ -193,7 +193,7 @@ menu()
unset profiles
DEFAULT=
i=0
- for prof in `ls $PROFILE_DIR`; do
+ for prof in $(ls $PROFILE_DIR); do
# ignore the template
[ "$prof" = "template" ] && continue
NAME=$prof
@@ -218,7 +218,7 @@ menu()
# if no default yet, use the first entry
[ "$DEFAULT" = "" ] && DEFAULT=${profiles[0]}
- ANSWER=`mktemp` || exit 1
+ ANSWER=$(mktemp) || exit 1
if [ "$TIMEOUT" != "" ]; then
dialog \
@@ -242,7 +242,7 @@ menu()
case $ret in
1) ;; # cancel - do nothing
255) start_profile $DEFAULT ;; # timeout - use default
- 0) start_profile `cat $ANSWER` ;; # user selection
+ 0) start_profile $(cat $ANSWER) ;; # user selection
# abnormal
*) echo "abnormal ret code from dialog: $ret" ;;
esac
@@ -254,7 +254,7 @@ menu()
# Begin
#
-if [ "`id -u`" != "0" ]; then
+if [ "$(id -u)" != "0" ]; then
echo "This script should be run as root."
exit 1
fi
diff --git a/rc.conf b/rc.conf
index c4c1a99..747bea2 100644
--- a/rc.conf
+++ b/rc.conf
@@ -54,6 +54,9 @@ HOSTNAME="myhost"
# Declare each interface then list in INTERFACES
# - prefix an entry in INTERFACES with a ! to disable it
# - no hyphens in your interface names - Bash doesn't like it
+# Don't disable lo, localhost (bound to lo by default) is often used for
+# interprocess communication.
+# Don't use this for wireless interfaces, see network profiles below
#
# Note: to use DHCP, set your interface to be "dhcp" (eth0="dhcp")
#
diff --git a/rc.shutdown b/rc.shutdown
index a6f8145..12b8f17 100755
--- a/rc.shutdown
+++ b/rc.shutdown
@@ -26,14 +26,14 @@ if [ "$PREVLEVEL" = "3" -o "$PREVLEVEL" = "5" ]; then
# Shutdown daemons
let i=${#DAEMONS[@]}
while [[ i -ge 0 ]]; do
- if [[ `echo ${DAEMONS[$i]} | grep '^[^\!]' | wc -l` -eq 1 ]]; then
- /etc/rc.d/${DAEMONS[$i]#@} stop
+ if [[ $(echo ${DAEMONS[$i]} | grep '^[^\!]' | wc -l) -eq 1 ]]; then
+ [ -f /var/run/daemons/${DAEMONS[$i]#@} ] && /etc/rc.d/${DAEMONS[$i]#@} stop
fi
let i=i-1
done
- # find any leftover daemons and shut them down
+ # find any leftover daemons and shut them down in reverse order
if [ -d /var/run/daemons ]; then
- for daemon in `ls /var/run/daemons`; do
+ for daemon in $(ls -1t /var/run/daemons); do
/etc/rc.d/$daemon stop
done
fi
diff --git a/rc.single b/rc.single
index edd20af..0d3581b 100755
--- a/rc.single
+++ b/rc.single
@@ -10,14 +10,14 @@ if [ "$PREVLEVEL" = "3" -o "$PREVLEVEL" = "5" ]; then
# Shutdown daemons
let i=${#DAEMONS[@]}
while [[ i -gt 0 ]]; do
- if [[ `echo ${DAEMONS[$i]} | grep '^[^\!]' | wc -l` -eq 1 ]]; then
+ if [[ $(echo ${DAEMONS[$i]} | grep '^[^\!]' | wc -l) -eq 1 ]]; then
/etc/rc.d/${DAEMONS[$i]#@} stop
fi
let i=i-1
done
# find any leftover daemons and shut them down
if [ -d /var/run/daemons ]; then
- for daemon in `ls /var/run/daemons`; do
+ for daemon in $(ls /var/run/daemons); do
/etc/rc.d/$daemon stop
done
fi
@@ -37,7 +37,7 @@ if [ "$PREVLEVEL" != "N" ]; then
if [ -x /etc/start_udev -a -d /sys/block ]; then
# We have a start_udev script and /sys appears to be mounted, use UDev
status "Starting UDev Daemon" /etc/start_udev
- if [ "`pidof -o %PPID /sbin/udevd`" ]; then
+ if [ "$(pidof -o %PPID /sbin/udevd)" ]; then
# If an old udevd is kicking around, we'll have to remount pts and shm
umount /dev/shm /dev/pts >/dev/null 2>&1
mount /dev/pts
diff --git a/rc.sysinit b/rc.sysinit
index b577707..c531eab 100755
--- a/rc.sysinit
+++ b/rc.sysinit
@@ -322,33 +322,40 @@ fi
status "Updating Module Dependencies" /sbin/depmod -A
-if [ "$KEYMAP" != "" ]; then
- status "Loading Keyboard Map: $KEYMAP" /bin/loadkeys -q $KEYMAP
-fi
-
# Flush old locale settings
: >/etc/profile.d/locale.sh
chmod 755 /etc/profile.d/locale.sh
# Set user defined locale
-[ "$LOCALE" != "" ] || LOCALE="en_US"
+[ -z "$LOCALE" ] && LOCALE="en_US"
stat_busy "Setting Locale: $LOCALE"
echo "export LANG=$LOCALE" >>/etc/profile.d/locale.sh
stat_done
-# If locale is *.utf set console to Unicode mode
-if [ "$(echo $LOCALE | /bin/grep -i utf)" ]; then
+if echo "$LOCALE" | /bin/grep -qi utf ; then
stat_busy "Setting Consoles to UTF-8"
/usr/bin/kbd_mode -u
- /usr/bin/dumpkeys | /bin/loadkeys --unicode
+ for i in $(seq 1 12); do
+ echo -ne "\e%G" >/dev/vc/${i}
+ done
+ stat_done
+ stat_busy "Loading Keyboard Map: $KEYMAP in utf-8 mode"
+ /bin/loadkeys -q -u "$KEYMAP" > /dev/null 2>&1
+else
+ stat_busy "Loading Keyboard Map: $KEYMAP in legacy mode"
+ /bin/loadkeys -q "$KEYMAP" > /dev/null 2>&1
+fi
# the $CONSOLE check helps us avoid this when running scripts from cron
echo 'if [ "$CONSOLE" = "" -a "$TERM" = "linux" -a -t 1 ]; then echo -ne "\e%G"; fi' >>/etc/profile.d/locale.sh
stat_done
-fi
-if [ "$CONSOLEFONT" != "" ]; then
+if [ -n "$CONSOLEFONT" ]; then
stat_busy "Loading Console Font: $CONSOLEFONT"
+ #CONSOLEMAP in UTF-8 shouldn't be used
+ if [ -n "$CONSOLEMAP" ] && echo "$LOCALE" | /bin/grep -qi utf ; then
+ CONSOLEMAP=""
+ fi
for i in $(seq 1 12); do
- if [ "$CONSOLEMAP" != "" ]; then
+ if [ -n "$CONSOLEMAP" ]; then
/usr/bin/setfont -m $CONSOLEMAP $CONSOLEFONT -C /dev/vc/${i}
else
/usr/bin/setfont $CONSOLEFONT -C /dev/vc/${i}
@@ -358,6 +365,7 @@ if [ "$CONSOLEFONT" != "" ]; then
echo 'if [ "$CONSOLE" = "" -a "$TERM" = "linux" -a -t 1 ]; then echo -ne "\e(K"; fi' >>/etc/profile.d/locale.sh
stat_done
fi
+
# Adding persistent network/cdrom generated rules
if [ -f "/dev/.udev/tmp-rules--70-persistent-cd.rules" ]; then
stat_busy "Adding persistent cdrom udev rules"
@@ -369,6 +377,7 @@ if [ -f "/dev/.udev/tmp-rules--70-persistent-net.rules" ]; then
/bin/cat /dev/.udev/tmp-rules--70-persistent-net.rules >> /etc/udev/rules.d/70-persistent-net.rules
stat_done
fi
+
# Screen blanks after 15 minutes idle time
/usr/bin/setterm -blank 15