slitaz-arm rev 11
sat: some fixes
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Fri May 25 23:19:55 2012 +0200 (2012-05-25) |
parents | 63041179b0c1 |
children | f915047f70ad |
files | sat |
line diff
1.1 --- a/sat Fri May 25 23:00:33 2012 +0200 1.2 +++ b/sat Fri May 25 23:19:55 2012 +0200 1.3 @@ -9,15 +9,14 @@ 1.4 #. /usr/lib/slitaz/libpkg.sh 1.5 . /etc/slitaz/slitaz.conf 1.6 1.7 -# Internal variables. 1.8 -: ${work=$(pwd)} 1.9 +# Internal variables: libtaz.sh set: --work= --init= 1.10 +[ "$work" ] || work="$(pwd)" 1.11 +[ "$init" ] || init="gz" 1.12 +initramfs="slitaz-arm.$init" 1.13 packages=$work/packages 1.14 distro=$work/distro 1.15 # http://mirror.slitaz.org/packages/cooking/arm/ 1.16 mirror="http://cook.slitaz.org/cross/arm/packages/" 1.17 -# libtaz.sh handle: --init= 1.18 -[ "$init" ] || init="gz" 1.19 -initramfs="slitaz-arm.$init" 1.20 1.21 # Help and usage 1.22 usage() { 1.23 @@ -37,7 +36,7 @@ 1.24 --spk Include Spk package manager in the distro 1.25 --work= Path to work dir with packages and rootfs 1.26 --size= Specify optional vdisk size (default 20Mb) 1.27 - --init= Specify the initramfs compression: gz xz 1.28 + --init= Specify the initramfs compression: gz xz 1.29 1.30 EOT 1.31 } 1.32 @@ -140,19 +139,23 @@ 1.33 # Update modules.dep 1.34 depmod -b . 3.2.14-slitaz 1.35 1.36 - # Custom rootfs 1.37 + # Custom rootfs: make sure all files belong to root. 1.38 if [ -d "$work/rootfs" ]; then 1.39 echo -n "Copying custom ARM rootfs..." 1.40 - cp -r $work/rootfs/* $distro 1.41 + tmp=$work/tmp-$$ 1.42 + mkdir -p $tmp 1.43 + cp -r $work/rootfs/* $tmp 1.44 + chown -R root.root $tmp 1.45 + cp -a $tmp/* $distro && rm -rf $tmp 1.46 status 1.47 fi 1.48 1.49 - # Rootfs cpio: gzip xz 1.50 - echo -n "Compressing initramfs: slitaz-arm.$format" 1.51 - case $format in 1.52 - bz) find . | cpio -o -H newc | bzip2 > ../$initramfs ;; 1.53 - gz) find . | cpio -o -H newc | gzip -9 > ../$initramfs ;; 1.54 - xz) find . | cpio -o -H newc | xz -9 --format=lzma \ 1.55 + # Rootfs cpio: gzip xz --> /usr/lib/slitaz/liblive.sh ??? 1.56 + echo -n "Compressing initramfs: $initramfs" 1.57 + case $initramfs in 1.58 + *.bz) find . | cpio -o -H newc | bzip2 > ../$initramfs ;; 1.59 + *.gz) find . | cpio -o -H newc | gzip -9 > ../$initramfs ;; 1.60 + *.xz) find . | cpio -o -H newc | xz -9 --format=lzma \ 1.61 > ../$initramfs ;; 1.62 esac 1.63 status