wok-4.x rev 3759
mirror-tools/mkpkgiso: fix sort weights (again)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Jul 24 18:59:49 2009 +0200 (2009-07-24) |
parents | ca7105738738 |
children | b0283dcad6f1 |
files | mirror-tools/stuff/usr/bin/mkpkgiso |
line diff
1.1 --- a/mirror-tools/stuff/usr/bin/mkpkgiso Fri Jul 24 10:58:22 2009 +0000 1.2 +++ b/mirror-tools/stuff/usr/bin/mkpkgiso Fri Jul 24 18:59:49 2009 +0200 1.3 @@ -8,8 +8,8 @@ 1.4 VERSION=0.5 1.5 1.6 ROOT=/home/slitaz/iso 1.7 -SORT_DIR=_iso.$$ 1.8 -TEMP_DIR=${ROOT}/$SORT_DIR 1.9 +SORT_DIR=${ROOT}/_iso.$$ 1.10 +TEMP_DIR=${ROOT}/_iso.$$ 1.11 SORT_FILE=${ROOT}/_sort.$$ 1.12 PKG_VER=$1 1.13 shift 1.14 @@ -55,15 +55,6 @@ 1.15 echo -e "\\033[0;39m ]" 1.16 } 1.17 1.18 -add_sort() 1.19 -{ 1.20 - if true; then 1.21 - echo "$1 $2" 1.22 - else 1.23 - ( cd $ROOT ; find $1 | awk "{ printf \"%s $2\\n\",\$0 }" ) 1.24 - fi 1.25 -} 1.26 - 1.27 # Create temp directory 1.28 mkdir -p $TEMP_DIR/packages/$PKG_VER 1.29 1.30 @@ -198,7 +189,7 @@ 1.31 echo "=> Wok (cooking) is in \$DIR/wok" 1.32 EOF 1.33 if get_from_hg wok "wok (cooking)"; then 1.34 - add_sort $SORT_DIR/wok -8000 >> $SORT_FILE 1.35 + echo "$SORT_DIR/wok -8000" >> $SORT_FILE 1.36 fi;; 1.37 --wok-stable) 1.38 cat >>$TEMP_DIR/install.sh<<EOF 1.39 @@ -206,11 +197,11 @@ 1.40 EOF 1.41 if get_from_hg wok-stable "wok (stable)"; then 1.42 mv $TEMP_DIR/wok-stable $TEMP_DIR/wok 1.43 - add_sort $SORT_DIR/wok -8000 >> $SORT_FILE 1.44 + echo "$SORT_DIR/wok -8000" >> $SORT_FILE 1.45 fi;; 1.46 --website) 1.47 if get_from_hg website "web site"; then 1.48 - add_sort $SORT_DIR/website -6000 >> $SORT_FILE 1.49 + echo "$SORT_DIR/website -6000" >> $SORT_FILE 1.50 cat >>$TEMP_DIR/install.sh<<EOF 1.51 [ -d /var/www ] || mkdir -p /var/www 1.52 ln -s \$DIR/website /var/www 1.53 @@ -271,16 +262,37 @@ 1.54 echo -n "Enable loram autodetection" 1.55 cp $PXE_DIR/ifmem.c32 "$TEMP_DIR/boot/isolinux" 1.56 isoinfo -R -x "/usr.sqfs" -i $isoloram > "$TEMP_DIR/usr.sqfs" 1.57 - add_sort $SORT_DIR/usr.sqfs -5000 >> $SORT_FILE 1.58 + echo "$SORT_DIR/usr.sqfs -5000" >> $SORT_FILE 1.59 isoinfo -R -x "/boot/rootfs.gz" -i $isoloram > \ 1.60 "$TEMP_DIR/boot/loram.gz" 1.61 - sed -i -e 's|kernel /boot/bzImage|kernel /boot/isolinux/ifmem.c32\n\tappend 160768 core loram\n|' \ 1.62 + cat >> $TEMP_DIR/boot/isolinux/common.cfg <<EOT 1.63 +label noram 1.64 + config noram.cfg 1.65 +EOT 1.66 + cat >> $TEMP_DIR/boot/isolinux/noram.cfg <<EOT 1.67 +display isolinux.msg 1.68 +say Not enough RAM to boot slitaz. 1.69 +default reboot 1.70 +label reboot 1.71 + com32 reboot.c32 1.72 + 1.73 +implicit 0 1.74 +prompt 1 1.75 +timeout 80 1.76 +F1 help.txt 1.77 +F2 options.txt 1.78 +F3 isolinux.msg 1.79 +F4 display.txt 1.80 +F5 enhelp.txt 1.81 +F6 enopts.txt 1.82 +EOT 1.83 + sed -i -e 's|kernel /boot/bzImage|kernel /boot/isolinux/ifmem.c32\n\tappend 160768 core 29696 loram noram\n|' \ 1.84 -e 's|\(.*/\)rootfs\(.gz .*\)$|label core\n\tkernel /boot/bzImage\n\1rootfs\2\n\nlabel loram\n\tkernel /boot/bzImage\n\1loram\2|' \ 1.85 $TEMP_DIR/boot/isolinux/*.cfg 1.86 status 1.87 ;; 1.88 esac 1.89 - add_sort $SORT_DIR/boot 0 >> $SORT_FILE 1.90 + echo "$SORT_DIR/boot 0" >> $SORT_FILE 1.91 ;; 1.92 *\ --webboot\ *) 1.93 if extract_boot gpxe; then 1.94 @@ -289,7 +301,7 @@ 1.95 isoinfo -x "/BOOT/ISOLINUX/ISOLINUX.BIN;1" -i $iso > \ 1.96 $TEMP_DIR/boot/isolinux/isolinux.bin 1.97 mv $TEMP_DIR/boot/gpxe $TEMP_DIR/boot/isolinux 1.98 - add_sort $SORT_DIR/boot 0 >> $SORT_FILE 1.99 + echo "$SORT_DIR/boot 0" >> $SORT_FILE 1.100 cat > $TEMP_DIR/boot/isolinux/isolinux.cfg <<EOT 1.101 default gpxe 1.102 append http://mirror.slitaz.org/pxe/pxelinux.0 1.103 @@ -306,8 +318,6 @@ 1.104 tail -1 | awk '{ print $1 }') used by boot." 1.105 fi 1.106 1.107 -sort -r -k 2 $SORT_FILE > $SORT_FILE.$$ 1.108 -mv $SORT_FILE.$$ $SORT_FILE 1.109 case " $OPTIONS " in 1.110 *\ --dry-run\ *) 1.111 echo "Please check and remove $TEMP_DIR and $SORT_FILE"