slitaz-arm rev 21

sat: some fixes and improvments
author Christophe Lincoln <pankso@slitaz.org>
date Sun Feb 23 16:27:57 2014 +0100 (2014-02-23)
parents 432ac2334e26
children 0d3ac2d779e6
files sat
line diff
     1.1 --- a/sat	Tue Feb 18 22:50:38 2014 +0100
     1.2 +++ b/sat	Sun Feb 23 16:27:57 2014 +0100
     1.3 @@ -71,7 +71,20 @@
     1.4  		mkdir -p $distro
     1.5  
     1.6  		# Packages. Dep install is not well handled by tazpkg/spk actually.
     1.7 -		# So simply install all packages and don't resolve deps or use equiv.
     1.8 +		# So simply install all packages and don't resolve deps.
     1.9 +		if [ -f "packages.list" ]; then
    1.10 +			for pkg in $(cat $packages.list)
    1.11 +			do
    1.12 +				IFS="|"
    1.13 +				grep "^$pkg |" $work/mirror/packages.desc | while read pkg version desc
    1.14 +				do
    1.15 +					echo ${pkg}-${version}.tazpkg | sed s'/ //'g
    1.16 +				done
    1.17 +				unset IFS
    1.18 +			done
    1.19 +			exit 0
    1.20 +		else
    1.21 +		[ ! -d "$packages" ] && echo "Missing: $packages" && exit 1
    1.22  		cd $packages
    1.23  		for pkg in $packages/*.tazpkg
    1.24  		do
    1.25 @@ -87,6 +100,7 @@
    1.26  			md5sum $(basename $pkg) >> $db/installed.md5
    1.27  			status
    1.28  		done
    1.29 +		fi
    1.30  
    1.31  		# Install spk if requested. Spk multiarch support must be tested
    1.32  		if [ "$spk" ]; then
    1.33 @@ -101,7 +115,12 @@
    1.34  		fi
    1.35  
    1.36  		# Move kernel outside the distro
    1.37 -		cd $work && mv -f $distro/boot/linux-* linux-arm
    1.38 +		if [ -d "$distro/boot" ]; then
    1.39 +			cd $work && mv -f $distro/boot/linux-* linux-arm
    1.40 +		else
    1.41 +			echo -n "Missing: $distro/boot"; false
    1.42 +			status && exit 1
    1.43 +		fi
    1.44  
    1.45  		# SLITAZ_ARCH
    1.46  		echo -n "Setting SliTaz arch to: arm"
    1.47 @@ -115,7 +134,7 @@
    1.48  		# /init & /run
    1.49  		cd $distro
    1.50  		rm init && ln -s /bin/busybox init
    1.51 -		mkdir run
    1.52 +		mkdir -p run
    1.53  
    1.54  		# Update modules.dep
    1.55  		. var/lib/tazpkg/installed/linux/receipt
    1.56 @@ -148,12 +167,14 @@
    1.57  		echo "Build time  : ${time}s"
    1.58  		echo -n "Distro size : "
    1.59  		cd $work && du -sh $initramfs | awk '{print $1}' ;;
    1.60 +	
    1.61  	clean)
    1.62  		check_root
    1.63  		for r in distro linux-arm *.*z spk; do
    1.64  			echo -n "Cleaning: $r"
    1.65  			rm -rf $work/$r && status
    1.66  		done ;;
    1.67 +	
    1.68  	vdisk)
    1.69  		# Lets use and HD in Qemu to store files|packages|whatever
    1.70  		vdisk="vdisk.img"
    1.71 @@ -161,6 +182,7 @@
    1.72  		cd $work
    1.73  		dd if=/dev/zero of=$vdisk bs=1M count=$size
    1.74  		mkfs.ext4 -q -T ext4 -L "SliTaz" -F $vdisk ;;
    1.75 +	
    1.76  	emu)
    1.77  		cd $work
    1.78  		[ -f "vdisk.img" ] && opts="-hda vdisk.img"
    1.79 @@ -168,6 +190,7 @@
    1.80  			-M versatilepb -cpu arm1176 \
    1.81  			-kernel linux-arm \
    1.82  			-initrd $initramfs ;;
    1.83 +	
    1.84  	mirror)
    1.85  		#
    1.86  		# --> spk-mirror $mirror --sync --dest=/path ???
    1.87 @@ -206,8 +229,8 @@
    1.88  				status
    1.89  			fi
    1.90  		done
    1.91 -		[ "$count" == 0 ] && status
    1.92 -		;;
    1.93 +		[ "$count" == 0 ] && status ;;
    1.94 +	
    1.95  	*) usage ;;
    1.96  esac
    1.97  exit 0