slitaz-arm rev 28

Rename slitaz-arm.sh to tazarm, improve, disable rdate by default and support --append= with Qemu
author Christophe Lincoln <pankso@slitaz.org>
date Mon Mar 03 16:47:11 2014 +0100 (2014-03-03)
parents 686faffdd9d0
children 78abe0d7b64e
files rootfs/etc/init.d/rcS rootfs/etc/rcS.conf rootfs/usr/bin/slitaz-arm.sh rootfs/usr/bin/tazarm sat
line diff
     1.1 --- a/rootfs/etc/init.d/rcS	Mon Mar 03 14:39:11 2014 +0100
     1.2 +++ b/rootfs/etc/init.d/rcS	Mon Mar 03 16:47:11 2014 +0100
     1.3 @@ -74,9 +74,11 @@
     1.4  fi
     1.5  
     1.6  # System time
     1.7 -echo -n "Setting system date..."
     1.8 -rdate -s 203.129.68.14 2>/dev/null
     1.9 -status
    1.10 +if fgrep -q 'rdate' /proc/cmdline; then
    1.11 +	echo -n "Setting system date..."
    1.12 +	rdate -s 203.129.68.14 2>/dev/null
    1.13 +	status
    1.14 +fi
    1.15  
    1.16  newline
    1.17  colorize 32 "$MESSAGE"
     2.1 --- a/rootfs/etc/rcS.conf	Mon Mar 03 14:39:11 2014 +0100
     2.2 +++ b/rootfs/etc/rcS.conf	Mon Mar 03 16:47:11 2014 +0100
     2.3 @@ -1,4 +1,4 @@
     2.4 -# /etc/rcS.conf - Initial boot script configuration for Arm
     2.5 +# /etc/rcS.conf - Initial boot script configuration for SliTaz ARM
     2.6  # Config file used by /etc/init.d/rcS
     2.7  #
     2.8  
     3.1 --- a/rootfs/usr/bin/slitaz-arm.sh	Mon Mar 03 14:39:11 2014 +0100
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,13 +0,0 @@
     3.4 -#/bin/sh
     3.5 -
     3.6 -log=/tmp/slitaz-arm.log
     3.7 -
     3.8 -echo "uname:" | tee $log
     3.9 -uname -a | tee -a $log
    3.10 -
    3.11 -echo "ls[pci/usb]:" | tee -a $log
    3.12 -lspci | tee -a $log
    3.13 -lsusb 2>&1 | tee -a $log
    3.14 -
    3.15 -echo "dmesg:"
    3.16 -dmesg | tee -a $log
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/rootfs/usr/bin/tazarm	Mon Mar 03 16:47:11 2014 +0100
     4.3 @@ -0,0 +1,56 @@
     4.4 +#!/bin/sh
     4.5 +#
     4.6 +# tazarm - A small tool designed to run on ARM devices.
     4.7 +#
     4.8 +. /lib/libtaz.sh
     4.9 +
    4.10 +[ "$log" ] || log=$(pwd)/slitaz-arm.log
    4.11 +
    4.12 +# Handle commands
    4.13 +case "$1" in
    4.14 +	info)
    4.15 +		/usr/bin/slitaz
    4.16 +		# To remove on next slitaz-base-file release
    4.17 +		echo -n "Machine type : " && uname -m
    4.18 +		echo -n "System date  : " && date
    4.19 +		newline ;;
    4.20 +	
    4.21 +	flavor)
    4.22 +		if [ -f "/etc/slitaz/flavor.conf" ]; then
    4.23 +			. /etc/slitaz/flavor.conf
    4.24 +			newline
    4.25 +			boldify "SliTaz ARM flavor"
    4.26 +			separator
    4.27 +			echo "Flavor     : $FLAVOR"
    4.28 +			echo "Build date : $BUILD_DATE"
    4.29 +			echo "Maintainer : $MAINTAINER"
    4.30 +			echo "Short desc : $SHORT_DESC"
    4.31 +			echo "Web site   : $WEB_SITE"
    4.32 +		else
    4.33 +			echo "Missing: /etc/slitaz/flavor.conf"
    4.34 +		fi 
    4.35 +		separator && newline ;;
    4.36 +	
    4.37 +	report)
    4.38 +		echo -e "--> uname:" | tee $log
    4.39 +		uname -a | tee -a $log
    4.40 +		
    4.41 +		echo -e "--> ls[pci/usb]:" | tee -a $log
    4.42 +		lspci | tee -a $log
    4.43 +		lsusb 2>&1 | tee -a $log
    4.44 +		
    4.45 +		echo -e "--> dmesg:" | tee -a $log
    4.46 +		dmesg | tee -a $log
    4.47 +		
    4.48 +		echo -e "--> ifconfig:" | tee -a $log
    4.49 +		ifconfig -a | tee -a $log 
    4.50 +		
    4.51 +		newline
    4.52 +		echo "Log path: $log" 
    4.53 +		newline ;;
    4.54 +	
    4.55 +	*)
    4.56 +		echo "Usage: $(basename $0) [info|flavor|report] [--log=]" ;;
    4.57 +esac
    4.58 +exit 0
    4.59 +	
     5.1 --- a/sat	Mon Mar 03 14:39:11 2014 +0100
     5.2 +++ b/sat	Mon Mar 03 16:47:11 2014 +0100
     5.3 @@ -44,6 +44,7 @@
     5.4    --size=    Specify optional vdisk size (default 20Mb)
     5.5    --init=    Specify the initramfs compression: gz bz2 xz
     5.6    --flavor=  Generate specified SliTaz ARM flavor
     5.7 +  --append=  SliTaz and Kernel bootime arguments for Qemu
     5.8  
     5.9  EOT
    5.10  }
    5.11 @@ -203,7 +204,15 @@
    5.12  		# --kmap
    5.13  		if [ "$kmap" ]; then
    5.14  			echo -n "Copying local: /etc/keymap.conf"
    5.15 -			cp -a /etc/keymap.conf ${rootfs}
    5.16 +			cp -f /etc/keymap.conf ${rootfs}/etc
    5.17 +			status
    5.18 +		fi
    5.19 +		
    5.20 +		# Distro: /etc/slitaz/flavor.conf
    5.21 +		if [ -f "${data}/flavor.conf" ]; then
    5.22 +			echo -n "Including $FLAVOR: flavor.conf"
    5.23 +			echo "BUILD_DATE=\"$(date '+%Y%m%d')\"" >> ${data}/flavor.conf
    5.24 +			cp -f ${data}/flavor.conf ${rootfs}/etc/slitaz
    5.25  			status
    5.26  		fi
    5.27  
    5.28 @@ -291,17 +300,30 @@
    5.29  		# Lets use and HD in Qemu to store files|packages|whatever
    5.30  		vdisk="vdisk.img"
    5.31  		: ${size=20}
    5.32 +		echo "Creating virtual disk: $vdisk"
    5.33  		cd $work
    5.34  		dd if=/dev/zero of=$vdisk bs=1M count=$size
    5.35 -		mkfs.ext4 -q -T ext4 -L "SliTaz" -F $vdisk ;;
    5.36 +		#mkfs.ext3 -q -T ext3 -L "SliTaz" -F $vdisk 
    5.37 +		# Partition
    5.38 +		echo "Creating partition with: fdisk"
    5.39 +		echo "
    5.40 +o
    5.41 +n
    5.42 +p
    5.43 +1
    5.44 +
    5.45 +
    5.46 +w" \
    5.47 +		| fdisk $vdisk >/dev/null 2>/dev/null && newline ;;
    5.48  	
    5.49  	emu)
    5.50  		cd $work
    5.51  		[ -f "vdisk.img" ] && opts="-hda vdisk.img"
    5.52 -		qemu-system-arm -m 256 $opts \
    5.53 +		[ "$append" ] && append="-append ${append}"
    5.54 +		qemu-system-arm -m 256 ${opts} \
    5.55  			-M versatilepb -cpu arm1176 \
    5.56  			-kernel ${distro}/linux-arm \
    5.57 -			-initrd ${distro}/${initramfs} ;;
    5.58 +			-initrd ${distro}/${initramfs} ${append} ;;
    5.59  	
    5.60  	mirror)
    5.61  		#