slitaz-boot-scripts rev 430

init: add serial live console (again)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat May 21 17:20:19 2016 +0200 (2016-05-21)
parents 90c9aecd15b4
children 2a9569d6dbc7
files etc/init.d/network.sh init
line diff
     1.1 --- a/etc/init.d/network.sh	Sun Apr 24 12:34:34 2016 +0300
     1.2 +++ b/etc/init.d/network.sh	Sat May 21 17:20:19 2016 +0200
     1.3 @@ -21,7 +21,7 @@
     1.4  		interface="$INTERFACE"
     1.5  	fi
     1.6  
     1.7 -	for i in $(find ${XDG_CONFIG_HOME:-$HOME/.config}/lxpanel -name panel); do
     1.8 +	for i in $(find ${XDG_CONFIG_HOME:-$HOME/.config}/lxpanel -name panel 2> /dev/null); do
     1.9  		fgrep -q netstatus "$i" || continue
    1.10  		sed -i '/iface/s|=.*$|='$interface'|' "$i"
    1.11  	done
    1.12 @@ -62,6 +62,7 @@
    1.13  	local user="$(ps aux | grep [l]xde-session | awk 'END{print $2}')"
    1.14  	local icon="$1" rpid=''
    1.15  	[ -s "$npid" ] && rpid="-r $(cat $npid)"
    1.16 +	which notify-send > /dev/null &&
    1.17  	su -c "notify-send $rpid -p -i $icon 'Network' \"$2\"" - $user | tail -n1 > $npid
    1.18  }
    1.19  
    1.20 @@ -74,7 +75,7 @@
    1.21  		su -l -c "$0 netapplet" - "$user"
    1.22  	done
    1.23  	# restart if LXPanel running
    1.24 -	lxpanelctl restart
    1.25 +	which lxpanelctl > /dev/null && lxpanelctl restart
    1.26  }
    1.27  
    1.28  
     2.1 --- a/init	Sun Apr 24 12:34:34 2016 +0300
     2.2 +++ b/init	Sat May 21 17:20:19 2016 +0200
     2.3 @@ -58,6 +58,9 @@
     2.4  
     2.5  quit() {
     2.6  	[ -d /mnt$4/etc ] || return
     2.7 +	grep -q serial /proc/ioports && ! grep -q ttyS /mnt$4/etc/inittab &&
     2.8 +	echo "ttyS0::respawn:/sbin/getty 115200,38400,9600,4800,2400 ttyS0" \
     2.9 +		>> /mnt$4/etc/inittab
    2.10  	[ -n "$4" ] || grep -q 'tmpfs /mnt tmpfs' /proc/mounts || 
    2.11  		busybox mount /mnt -o remount,ro
    2.12  	busybox mount --move /run /mnt/${1:-run}
    2.13 @@ -194,9 +197,6 @@
    2.14  [ -d /proc/sys/dev/cdrom ] &&
    2.15  	ln -s $(sed '/name/!d;s/.*:[^a-z]*//' /proc/sys/dev/cdrom/info) /dev/cdrom
    2.16  
    2.17 -grep -q serial /proc/ioports &&
    2.18 -echo "ttyS0::respawn:/sbin/getty 115200,38400,9600,4800,2400 ttyS0" >> /etc/inittab
    2.19 -
    2.20  if use dmraid; then
    2.21  	dmraid -s | sed '/^type/!ds/.*: *//' | ldraid
    2.22  	[ ${root:0:4} = /dev ] ||