slitaz-arm rev 205

tazbian: non-slitaz support
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Feb 05 08:53:57 2015 +0000 (2015-02-05)
parents 05f37837d344
children 4ed997df7958
files rpi/tazbian
line diff
     1.1 --- a/rpi/tazbian	Fri Dec 05 00:40:18 2014 -0500
     1.2 +++ b/rpi/tazbian	Thu Feb 05 08:53:57 2015 +0000
     1.3 @@ -1,6 +1,6 @@
     1.4  #!/bin/sh
     1.5  #
     1.6 -# (C) 2014 SliTaz GNU/Linux - GPL2
     1.7 +# (C) 2014-2015 SliTaz GNU/Linux - GPL2
     1.8  #
     1.9  # Creates a Debian package to install SliTaz on a Raspbian without
    1.10  # repartitioning.
    1.11 @@ -10,7 +10,36 @@
    1.12  
    1.13  [ $(id -u) -ne 0 ] && echo "Must be root. Abort." && exit 1
    1.14  
    1.15 +tazpkg()
    1.16 +{
    1.17 +	if [ -x /usr/bin/tazpkg ]; then
    1.18 +		/usr/bin/tazpkg "$@"
    1.19 +		exit $?
    1.20 +	fi
    1.21 +	[ "$1" == "get-install" ] && echo "abort: can't find $2" && exit 1
    1.22 +	mkdir -p tazpkg$$
    1.23 +	cd tazpkg$$
    1.24 +	cpio -i < ../$2
    1.25 +	gunzip fs.cpio.gz 2> /dev/null
    1.26 +	[ -s fs.cpio ] || unlzma fs.cpio.lzma
    1.27 +	cpio -idmu < fs.cpio
    1.28 +	cd ..
    1.29 +	sh <<EOT
    1.30 +. tazpkg$$/receipt
    1.31 +mkdir -p ${3#--root=}/var/lib/tazpkg/installed/\$PACKAGE
    1.32 +grep -qs ^pre_install tazpkg$$/receipt && pre_install ${3#--root=}
    1.33 +cp -a tazpkg$$/fs/. ${3#--root=}
    1.34 +grep -qs ^post_install tazpkg$$/receipt && post_install ${3#--root=}
    1.35 +rm -rf tazpkg$$/fs*
    1.36 +mv tazpkg$$/* ${3#--root=}/var/lib/tazpkg/installed/\$PACKAGE
    1.37 +EOT
    1.38 +	md5sum $2 >> ${3#--root=}/var/lib/tazpkg/installed.md5
    1.39 +	rm -rf tazpkg$$
    1.40 +}
    1.41 +
    1.42 +[ -x /usr/bin/ar -o -x /bin/ar ] || tazpkg get-install binutils
    1.43  CURDIR=$PWD
    1.44 +EXE=$(cd $(dirname $0); pwd)/$(basename $0)
    1.45  TMPDIR=/tmp/rasp$$
    1.46  mkdir -p $TMPDIR
    1.47  cd $TMPDIR
    1.48 @@ -103,6 +132,7 @@
    1.49  		rm -f $LIVE/$file
    1.50  	fi
    1.51  done
    1.52 +cp $EXE $BASE/root/
    1.53  ( cd $BASE/ ; find -type d ) | while read dir; do
    1.54  	rmdir $LIVE/$dir 2> /dev/null
    1.55  done
    1.56 @@ -126,7 +156,7 @@
    1.57  Installed-Size: $(($(du -ks fs | cut -f1) + $LIVESZ))
    1.58  Section: miscellaneous
    1.59  Priority: optional
    1.60 -Homepage: http://arm.slitaz.org/
    1.61 +Homepage: http://arm.slitaz.org/rpi/
    1.62  Description: Tiny Linux distribution with multi boot features
    1.63   SliTaz can run fully in RAM or can be installed on the SD card in a
    1.64   subdirectory of your Raspbian (example /$DESTDIR).
    1.65 @@ -231,7 +261,6 @@
    1.66  tar czf control.tar.gz md5sums control postinst prerm
    1.67  rm -rf fs/$DESTDIR/*
    1.68  cd fs ; tar czf ../data.tar.gz . ; cd ..
    1.69 -[ -x /usr/bin/ar ] || tazpkg get-install binutils
    1.70  ar rcs slitaz-$VERSION-1_armhf.deb debian-binary control.tar.gz data.tar.gz
    1.71  mv slitaz-$VERSION-1_armhf.deb $CURDIR
    1.72  cd $CURDIR