wok-tiny rev 102

keyboard: add kernel cmdline optional support
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Jan 05 14:44:30 2016 +0100 (2016-01-05)
parents c9e797b1bf36
children 981558572b0f
files base-tiny/stuff/etc/init.d/rcS base-tiny/stuff/etc/inittab busybox/receipt keyboard/receipt linux/stuff/bundle
line diff
     1.1 --- a/base-tiny/stuff/etc/init.d/rcS	Tue Nov 03 21:58:21 2015 +0100
     1.2 +++ b/base-tiny/stuff/etc/init.d/rcS	Tue Jan 05 14:44:30 2016 +0100
     1.3 @@ -179,10 +179,9 @@
     1.4  	echo "Kernel log daemons are disabled in /etc/rc.conf..."
     1.5  fi
     1.6  
     1.7 -[ -d /usr/share/kmap ] &&
     1.8 -echo "Load keymap $(basename /usr/share/kmap/* .kmap)" &&
     1.9 -cat /usr/share/kmap/* | loadkmap &&
    1.10 -rm -rf /usr/share/kmap
    1.11 +[ -d /usr/share/kmap ] && echo -n "Load keymap..." &&
    1.12 +cat /usr/share/kmap/* | { /bin/loadkmap 2>/etc/null || loadkmap; } &&
    1.13 +rm -rf /usr/share/kmap && status
    1.14  
    1.15  # Start all scripts specified with $RUN_SCRIPTS.
    1.16  echo "Executing all initialization scripts..."
     2.1 --- a/base-tiny/stuff/etc/inittab	Tue Nov 03 21:58:21 2015 +0100
     2.2 +++ b/base-tiny/stuff/etc/inittab	Tue Jan 05 14:44:30 2016 +0100
     2.3 @@ -3,14 +3,14 @@
     2.4  #
     2.5  ::sysinit:/etc/init.d/rcS
     2.6  
     2.7 -# /sbin/getty respawn shell invocations for selected ttys.
     2.8 -tty1::askfirst:/sbin/getty 38400 tty1
     2.9 -tty2::askfirst:/sbin/getty 38400 tty2
    2.10 +# getty respawn shell invocations for selected ttys.
    2.11 +tty1::askfirst:getty 38400 tty1
    2.12 +tty2::askfirst:getty 38400 tty2
    2.13  
    2.14  # Stuff to do when restarting the init
    2.15  # process, or before rebooting.
    2.16  ::restart:/etc/init.d/rc.shutdown
    2.17  ::restart:/init
    2.18 -::ctrlaltdel:/sbin/reboot
    2.19 +::ctrlaltdel:reboot
    2.20  ::shutdown:/etc/init.d/rc.shutdown
    2.21  
     3.1 --- a/busybox/receipt	Tue Nov 03 21:58:21 2015 +0100
     3.2 +++ b/busybox/receipt	Tue Jan 05 14:44:30 2016 +0100
     3.3 @@ -70,8 +70,7 @@
     3.4  {
     3.5  	cp -a $WOK/base-tiny/stuff/. $fs/
     3.6      cp -a $src/_install/bin/busybox $fs/bin
     3.7 -    for i in /bin/sh /bin/login /bin/getty /bin/false \
     3.8 -    	     /sbin/getty /sbin/reboot; do
     3.9 +    for i in /bin/sh /bin/login /bin/false ; do
    3.10  	ln $fs/bin/busybox $fs$i
    3.11      done
    3.12      mkdir -p $fs/etc/init.d
    3.13 @@ -123,7 +122,7 @@
    3.14  
    3.15  	rm -rf $fs/*
    3.16  	cp rootfs.cpio $fs
    3.17 -	cp $stuff/busybox*config $fs/busybox.config.txt
    3.18 +	cp $stuff/busybox-${VERSION%.*}*config $fs/busybox.config.txt
    3.19  }
    3.20  
    3.21  # Force glibc-2.7 reinstall if 2.3.6 still in use.
     4.1 --- a/keyboard/receipt	Tue Nov 03 21:58:21 2015 +0100
     4.2 +++ b/keyboard/receipt	Tue Jan 05 14:44:30 2016 +0100
     4.3 @@ -7,17 +7,34 @@
     4.4  MAINTAINER="pascal.bellard@slitaz.org"
     4.5  LICENSE="GPL2"
     4.6  WEB_SITE="http://tiny.slitaz.org/"
     4.7 +
     4.8  DEPENDS="base-tiny"
     4.9 +BUILD_DEPENDS="advancecomp"
    4.10  
    4.11  # Rules to configure and make the package.
    4.12  compile_rules()
    4.13  {
    4.14 -	mkdir -p $DESTDIR/usr/share $stuff
    4.15 +	mkdir -p $DESTDIR/usr/share/i18n $stuff
    4.16  	cd $stuff
    4.17 -	tazpkg get kbd-busybox
    4.18 -	tazpkg extract kbd-busybox*
    4.19 -	mv kbd-busybox*/fs/usr/share/kmap $DESTDIR/usr/share
    4.20 -	cd ..
    4.21 +	for i in kbd-busybox glibc-base glibc-locale ; do
    4.22 +		tazpkg get $i
    4.23 +		tazpkg extract $i*
    4.24 +	done
    4.25 +	cp -a kbd-busybox*/fs/usr/share/kmap $DESTDIR/usr/share
    4.26 +	cp -a glibc-*/fs/usr/share/i18n/locales $DESTDIR/usr/share/i18n
    4.27 +	cp -a glibc-*/fs/usr/share/zoneinfo $DESTDIR/usr/share
    4.28 +	cd $DESTDIR/usr/share
    4.29 +	for i in i18n/locales zoneinfo ; do
    4.30 +		( cd $i; find * -type f | while read f; do
    4.31 +			grep -q $f $stuff/../receipt || rm -f $f; done )
    4.32 +		find $i -type d | tac | while read d; do
    4.33 +			rmdir $d 2> /dev/null
    4.34 +		done
    4.35 +	done
    4.36 +	find kmap/*.kmap i18n/locales zoneinfo | cpio -o -H newc | \
    4.37 +		gzip -9 > data.cpio.gz
    4.38 +	advdef -z4 data.cpio.gz
    4.39 +	cd $stuff/..
    4.40  	rm -rf $stuff
    4.41  }
    4.42  
    4.43 @@ -117,26 +134,54 @@
    4.44  </select></td>
    4.45  </tr>
    4.46  </table>
    4.47 +<input type="checkbox" name="USECMDLINE" $([ "$USECMDLINE" == "on" ] && echo "checked=checked ")value="yes">
    4.48 +Use the kernel command line arguments <b><i>kmap=</i></b>,
    4.49 +<b><i>lang=</i></b> and <b><i>tz=</i></b> (+200Kb).
    4.50  EOT
    4.51  }
    4.52  
    4.53  post_install()
    4.54  {
    4.55 +	if [ "$USECMDLINE" == "yes" ]; then
    4.56 +		mkdir $1/bin
    4.57 +		cat > $1/bin/loadkmap <<EOT
    4.58 +#!/bin/sh
    4.59 +
    4.60 +cd /usr/share
    4.61 +for i in \$(cat /proc/cmdline); do
    4.62 +	j=\${i#*=}
    4.63 +	case "\$i" in
    4.64 +	kmap=*) d=kmap
    4.65 +		j=\$j.kmap ;;
    4.66 +	lang=*) d=i18n/locales
    4.67 +		echo -e "LANG=\$j\nLC_ALL=\$j" > /etc/locale.conf ;;
    4.68 +	tz=*)	d=zoneinfo
    4.69 +		echo "\$j" > /etc/TZ ;;
    4.70 +	*)	continue
    4.71 +	esac
    4.72 +	rm -rf \$d
    4.73 +	zcat data.cpio.gz | cpio -id \$d/\$j 2>/dev/null
    4.74 +done
    4.75 +cat kmap/* | busybox loadkmap
    4.76 +rm -f /bin/loadkmap data.cpio.gz
    4.77 +EOT
    4.78 +		chmod +x $1/bin/loadkmap
    4.79 +	else
    4.80 +		rm -f $1/usr/share/data.cpio.gz
    4.81 +	fi
    4.82 +	for i in $1/usr/share/i18n/locales/* ; do
    4.83 +		[ $i == $1/usr/share/i18n/locales/$LOCALE ] || rm $i
    4.84 +	done
    4.85 +	[ -n "$LOCALE" ] && cat > $1/etc/locale.conf <<EOT
    4.86 +LANG=$LOCALE
    4.87 +LC_ALL=$LOCALE
    4.88 +EOT
    4.89 +	find $1/usr/share/zoneinfo -type f | while read i; do
    4.90 +		[ $i == $1/usr/share/zoneinfo/$TIMEZONE ] || rm $i
    4.91 +	done
    4.92 +	rmdir $1/usr/share/zoneinfo/* 2> /dev/null
    4.93 +	[ -n "$TIMEZONE" ] && echo "$TIMEZONE" > $1/etc/TZ
    4.94  	for i in $1/usr/share/kmap/*.kmap ; do
    4.95  		[ $i == $1/usr/share/kmap/$KEYBOARD.kmap ] || rm $i
    4.96  	done
    4.97 -	if [ -n "$LOCALE" ]; then
    4.98 -		mkdir -p $1/usr/share/i18n/locales $1/etc
    4.99 -		cat > $1/etc/locale.conf <<EOT
   4.100 -LANG=$LOCALE
   4.101 -LC_ALL=$LOCALE
   4.102 -EOT
   4.103 -		cp /usr/share/i18n/locales/$LOCALE $1/usr/share/i18n/locales
   4.104 -	fi
   4.105 -	if [ -n "$TIMEZONE" ]; then
   4.106 -		mkdir -p $1/usr/share/zoneinfo $1/etc
   4.107 -		echo "$TIMEZONE" > $1/etc/TZ
   4.108 -		( cd /usr/share/zoneinfo; echo $TIMEZONE | cpio -o -H newc ) | \
   4.109 -		( cd $1/usr/share/zoneinfo ; cpio -id )
   4.110 -	fi
   4.111  }
     5.1 --- a/linux/stuff/bundle	Tue Nov 03 21:58:21 2015 +0100
     5.2 +++ b/linux/stuff/bundle	Tue Jan 05 14:44:30 2016 +0100
     5.3 @@ -25,13 +25,14 @@
     5.4  
     5.5  if [ ! -s "$1" ]; then
     5.6  	cat <<EOT
     5.7 -Usage: $0 kernel [initrd]
     5.8 +Usage: $0 kernel [initrd] [@]
     5.9  EOT
    5.10  elif [ -s "$2" ]; then
    5.11 -	base_initrd=$(( (($(get 0x1F4 "$1")*33 + 65535)&-65536) + 0x100000 ))
    5.12 +	base_initrd=$((0x00300000))
    5.13  	size_initrd=$(stat -c %s "$2")
    5.14  	[ $(($base_initrd + $size_initrd)) -gt $((0x1000000)) ] &&
    5.15  	base_initrd=$((0x01400000))
    5.16 +	[ "$3" ] && base_initrd=$(($3))
    5.17  	printf "initrd @%X %X\n" $base_initrd $size_initrd
    5.18  	store 0x218 $base_initrd "$1"
    5.19  	store 0x21C $size_initrd "$1"