slitaz-arm rev 46
Fixes to tazberry and spi
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Sun Mar 09 12:19:03 2014 +0100 (2014-03-09) |
parents | 5d870dbf2641 |
children | 9b97790e8d8f |
files | rpi/tazberry spi |
line diff
1.1 --- a/rpi/tazberry Sun Mar 09 10:14:33 2014 +0100 1.2 +++ b/rpi/tazberry Sun Mar 09 12:19:03 2014 +0100 1.3 @@ -158,7 +158,7 @@ 1.4 # Handle options 1.5 opt=${?} 1.6 case "$opt" in 1.7 - 1|255) rm ${tmpdir} && exit 0 ;; 1.8 + 1|255) rm -rf ${tmpdir} && exit 0 ;; 1.9 esac 1.10 1.11 # Handle actions
2.1 --- a/spi Sun Mar 09 10:14:33 2014 +0100 2.2 +++ b/spi Sun Mar 09 12:19:03 2014 +0100 2.3 @@ -104,7 +104,7 @@ 2.4 for t in $toolslist 2.5 do 2.6 [ "$up" ] && rm -f ${tools}/${t} 2.7 - if [ ! -f "$data/$t" ]; then 2.8 + if [ ! -f "$tools/$t" ]; then 2.9 echo -n "Fetching: $t" 2.10 wget -q --no-check-certificate ${tools_url}${t} \ 2.11 -O ${tools}/${t}; status 2.12 @@ -169,7 +169,8 @@ 2.13 rpiroot="/media/rpi/rootfs" 2.14 header "SliTaz Raspberry Pi install" 2.15 if [ ! "$dev" ]; then 2.16 - echo "Missing: --dev= cmdline option" && exit 1 2.17 + echo "Missing: --dev= cmdline option" 2.18 + newline && exit 1 2.19 fi 2.20 2.21 # Store sdcard partition(s) list 2.22 @@ -191,6 +192,11 @@ 2.23 mkdir -p ${rpiboot} ${rpiroot} 2.24 mount /dev/${dev}1 ${rpiboot} 2.25 mount /dev/${dev}3 ${rpiroot}; status 2.26 + echo -n "Cleaning: filesystem directories" 2.27 + for dir in bin dev etc lib media mnt proc sbin sys tmp usr var run 2.28 + do 2.29 + rm -rf ${rpiroot}/${dir} 2.30 + done; status 2.31 echo -n "Installing: boot files" 2.32 cp -rf ${boot}/* ${rpiboot}; status 2.33 echo -n "Installing: rootfs files" 2.34 @@ -277,25 +283,6 @@ 2.35 fi 2.36 fi 2.37 2.38 - # Kernel 2.39 - kvers=$(ls $data/linux-*/fs/lib/modules) 2.40 - kvers=${kvers%-slitaz-rpi} 2.41 - kpkg="$rootfs/var/lib/tazpkg/installed/linux" 2.42 - fs="$data/linux-$kvers/fs" 2.43 - ksize=$(du -sh $fs | awk '{print $1}') 2.44 - if [ -d "$fs" ]; then 2.45 - echo -n "Copying: kernel $kvers ($ksize)" 2.46 - rm -rf ${rootfs}/lib/modules 2.47 - cp -rf ${fs}/lib/* ${rootfs}/lib 2.48 - cp -f ${fs}/boot/* ${boot} 2.49 - mkdir -p ${kpkg} 2.50 - cd ${data}/linux-${kvers} 2.51 - cp -f files.list md5sum receipt ${kpkg} 2.52 - status 2.53 - else 2.54 - echo "RPi Kernel: not used" 2.55 - fi 2.56 - 2.57 # RPi VC libraries 2.58 if [ "$vc" ]; then 2.59 vc="${rootfs}/opt/vc" 2.60 @@ -315,6 +302,25 @@ 2.61 status 2.62 fi 2.63 2.64 + # Kernel at last 2.65 + . $data/linux-*/receipt 2.66 + kvers="$VERSION" 2.67 + kpkg="$rootfs/var/lib/tazpkg/installed/linux" 2.68 + fs="$data/linux-$kvers/fs" 2.69 + ksize=$(du -sh $fs | awk '{print $1}') 2.70 + if [ -d "$fs" ]; then 2.71 + echo -n "Copying: kernel $kvers ($ksize)" 2.72 + rm -rf ${rootfs}/lib/modules 2.73 + cp -rf ${fs}/lib/* ${rootfs}/lib 2.74 + cp -f ${fs}/boot/* ${boot} 2.75 + mkdir -p ${kpkg} 2.76 + cd ${data}/linux-${kvers} 2.77 + cp -f files.list md5sum receipt ${kpkg} 2.78 + status 2.79 + else 2.80 + echo "RPi Kernel: not used" 2.81 + fi 2.82 + 2.83 separator 2.84 echo -n "Boot: $(du -sh $boot | awk '{print $1}') " 2.85 echo "- Rootfs: $(du -sh $rootfs | awk '{print $1}')" 2.86 @@ -359,7 +365,7 @@ 2.87 2.88 # Pack 2.89 kvers=$(ls ${install}/lib/modules) 2.90 - kvers=${kvers%-slitaz-rpi} 2.91 + kvers=${kvers%-slitaz-rpi+}+ 2.92 fs="$data/linux-$kvers/fs" 2.93 newline 2.94 echo "Kernel version: $kvers" 2.95 @@ -367,14 +373,14 @@ 2.96 rm -rf ${data}/linux-${kvers} 2.97 mkdir -p ${data}/linux-${kvers} 2.98 cp -a ${install} ${fs} 2.99 - rm ${fs}/lib/modules/build ${fs}/lib/modules/source 2.100 + rm -f ${fs}/lib/modules/build ${fs}/lib/modules/source 2.101 fi 2.102 get_tools 2.103 echo "Compressing: zImage to kernel.img" 2.104 cd ${tools} 2.105 python imagetool-uncompressed.py ${fs}/boot/zImage 2.106 + mv -f kernel.img ${fs}/boot && rm ${fs}/boot/zImage 2.107 cd ${data} 2.108 - mv kernel.img ${fs}/boot && rm ${fs}/boot/zImage 2.109 echo "Creating package: receipt" 2.110 cat > linux-$kvers/receipt << EOT 2.111 # SliTaz package receipt