slitaz-arm rev 9

sat: fixes and improvments
author Christophe Lincoln <pankso@slitaz.org>
date Fri May 25 22:51:17 2012 +0200 (2012-05-25)
parents 45f11048cf67
children 63041179b0c1
files rootfs/etc/inittab sat
line diff
     1.1 --- a/rootfs/etc/inittab	Fri May 25 14:48:52 2012 +0200
     1.2 +++ b/rootfs/etc/inittab	Fri May 25 22:51:17 2012 +0200
     1.3 @@ -1,8 +1,9 @@
     1.4 -# /etc/inittab: init configuration for SliTaz GNU/Linux.
     1.5 +# /etc/inittab: init configuration for SliTaz ARM.
     1.6  #
     1.7  ::sysinit:/etc/init.d/rcS
     1.8 +::respawn:-/bin/sh -l
     1.9  #tty1::respawn:/sbin/getty 38400 tty1
    1.10 -::respawn:-/bin/sh -l
    1.11 -tty2::askfirst:-/bin/sh
    1.12 +tty2::respawn:/sbin/getty 38400 tty2
    1.13 +tty3::askfirst:-/bin/sh
    1.14  ::ctrlaltdel:/bin/umount -a -r
    1.15  ::ctrlaltdel:/sbin/reboot
     2.1 --- a/sat	Fri May 25 14:48:52 2012 +0200
     2.2 +++ b/sat	Fri May 25 22:51:17 2012 +0200
     2.3 @@ -15,6 +15,9 @@
     2.4  distro=$work/distro
     2.5  # http://mirror.slitaz.org/packages/cooking/arm/
     2.6  mirror="http://cook.slitaz.org/cross/arm/packages/"
     2.7 +# libtaz.sh handle: --init=
     2.8 +[ "$init" ] || init="gz"
     2.9 +initramfs="slitaz-arm.$init"
    2.10  
    2.11  # Help and usage
    2.12  usage() {
    2.13 @@ -34,6 +37,7 @@
    2.14    --spk      Include Spk package manager in the distro
    2.15    --work=    Path to work dir with packages and rootfs
    2.16    --size=    Specify optional vdisk size (default 20Mb)
    2.17 +  --init=    Specify the initramfs compression: gz xz
    2.18  
    2.19  EOT
    2.20  }
    2.21 @@ -64,7 +68,7 @@
    2.22  	gen)
    2.23  		time=$(date +%s)
    2.24  		check_root
    2.25 -		rm -rf $distro distro-arm.gz
    2.26 +		rm -rf $distro slitaz-arm.xz
    2.27  		mkdir -p $distro
    2.28  
    2.29  		# Packages. Dep install it not well handled by tazpkg/spk actually
    2.30 @@ -100,7 +104,7 @@
    2.31  		# Move kernel outside the distro
    2.32  		cd $work && mv -f $distro/boot/linux-* linux-arm
    2.33  
    2.34 -		# Get a default kmap
    2.35 +		# Get a default kmap: we kbd-base and tazkeymap working now :-)
    2.36  		if [ "$kmap" ]; then
    2.37  			echo -n "Dumping current keymap..."
    2.38  			mkdir $distro/usr/share/kmap
    2.39 @@ -143,19 +147,25 @@
    2.40  			status
    2.41  		fi
    2.42  
    2.43 -		# Rootfs cpio/gzip
    2.44 -		echo -n "Compressing initramfs: cpio/gzip"
    2.45 -		find . -print | cpio -o -H newc | gzip -9 > ../distro-arm.gz
    2.46 +		# Rootfs cpio: gzip xz
    2.47 +		echo -n "Compressing initramfs: slitaz-arm.$format"
    2.48 +		case $format in
    2.49 +			bz) find . | cpio -o -H newc | bzip2 > ../$initramfs ;;
    2.50 +			gz) find . | cpio -o -H newc | gzip -9 > ../$initramfs ;;
    2.51 +			xz) find . | cpio -o -H newc | xz -9 --format=lzma \
    2.52 +					> ../$initramfs ;;
    2.53 +		esac
    2.54  		status
    2.55  		time=$(($(date +%s) - $time))
    2.56  		echo "Build time  : ${time}s"
    2.57  		echo -n "Distro size : "
    2.58 -		cd $work && du -sh distro-arm.gz | awk '{print $1}';;
    2.59 +		cd $work && du -sh $initramfs | awk '{print $1}' ;;
    2.60  	clean)
    2.61  		check_root
    2.62 -		echo -n "Cleaning: $work"
    2.63 -		rm -rf distro linux-arm distro-arm.gz spk
    2.64 -		status ;;
    2.65 +		for r in distro linux-arm *.*z spk; do
    2.66 +			echo -n "Cleaning: $r"
    2.67 +			rm -rf $work/$r && status
    2.68 +		done ;;
    2.69  	vdisk)
    2.70  		# Let use and HD in Qemu to store files|packages|whatever
    2.71  		vdisk="vdisk.img"
    2.72 @@ -164,19 +174,16 @@
    2.73  		dd if=/dev/zero of=$vdisk bs=1M count=$size
    2.74  		mkfs.ext4 -q -T ext4 -L "SliTaz" -F $vdisk ;;
    2.75  	emu)
    2.76 -		: ${mem=256}
    2.77  		cd $work
    2.78  		[ -f "vdisk.img" ] && opts="-hda vdisk.img"
    2.79 -		qemu-system-arm -m $mem $opts \
    2.80 +		qemu-system-arm -m 256 $opts \
    2.81  			-M versatilepb -cpu arm1176 \
    2.82  			-kernel linux-arm \
    2.83 -			-initrd distro-arm.gz ;;
    2.84 +			-initrd $initramfs ;;
    2.85  	mirror)
    2.86  		#
    2.87  		# --> spk-mirror $mirror --sync --dest=/path ???
    2.88  		#
    2.89 -		# Just dl lists/packages for now, we can add a --rsync option to
    2.90 -		# have all mirrored packages locally to build distro's.
    2.91  		count=0
    2.92  		mkdir -p $work/mirror && cd $work/mirror
    2.93  		if ! check_mirror_id; then