slitaz-pizza rev 32
rootfs.cgi: add loram support
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Tue Mar 27 09:49:03 2012 +0200 (2012-03-27) |
parents | ce872f64c4a7 |
children | fc0563855ade |
files | web/rootfs.cgi |
line diff
1.1 --- a/web/rootfs.cgi Tue Mar 27 09:49:04 2012 +0200 1.2 +++ b/web/rootfs.cgi Tue Mar 27 09:49:03 2012 +0200 1.3 @@ -59,9 +59,9 @@ 1.4 # So now it time to move the addfile to flavor files. 1.5 if [ -d "$upload/rootfs" ]; then 1.6 echo "Additional rootfs: accepted" | tee -a $log 1.7 - mkdir -p $tmpdir/slitaz-$id 1.8 - mv $upload/rootfs $tmpdir/slitaz-$id 1.9 - rm -rf $tmpdir/slitaz-$id/upload-* 1.10 + mkdir -p $tmpdir/slitaz-$id/rootfs 1.11 + mv $upload/rootfs/* $tmpdir/slitaz-$id/rootfs 1.12 + rm -rf $tmpdir/slitaz-$id/upload-* $upload/rootfs 1.13 fi 1.14 echo "</pre>" 1.15 rm -rf $upload 1.16 @@ -73,7 +73,6 @@ 1.17 1.18 case " $(FILE) " in 1.19 *\ wallpaper\ *) 1.20 - id="$(POST id)" 1.21 tmpname="$(FILE wallpaper tmpname)" 1.22 wallpaper="$(FILE wallpaper name)" 1.23 size="$(FILE wallpaper size)" 1.24 @@ -102,7 +101,6 @@ 1.25 esac 1.26 ;; 1.27 *\ tarball\ *) 1.28 - id="$(POST id)" 1.29 tmpname="$(FILE tarball tmpname)" 1.30 tarball="$(FILE tarball name)" 1.31 size="$(FILE tarball size)" ;; 1.32 @@ -110,6 +108,25 @@ 1.33 id="$(GET id)" ;; 1.34 esac 1.35 1.36 +[ -n "$id" ] || id="$(POST id)" 1.37 + 1.38 +if [ "$(GET loram)" != "none" ]; then 1.39 + echo "Low RAM convertion: $(GET loram)" | tee -a $log 1.40 + mkdir -p $tmpdir/slitaz-$id/rootfs/etc/tazlito 2> /dev/null 1.41 + cat > $tmpdir/slitaz-$id/rootfs/etc/tazlito/loram.final <<EOT 1.42 +cd \$1/.. 1.43 +iso=\$(ls *.iso) 1.44 +if [ -s "\$iso" ]; then 1.45 + echo "Converting \$iso to low ram iso..." 1.46 + yes y | tazlito build-loram \$iso $iso.\$\$ $(GET loram) 1.47 + mv -f \$iso.\$\$ \$iso 1.48 + md5sum \$iso > \${iso%.iso}.md5 1.49 + echo "================================================================================" 1.50 +fi 1.51 +cd - > /dev/null 1.52 +EOT 1.53 +fi 1.54 + 1.55 # 1.56 # Source receipt and display page with additional rootfs or file upload. 1.57 # 1.58 @@ -170,6 +187,17 @@ 1.59 </div> 1.60 <input type="hidden" name="id" value="$id" /> 1.61 <input type="submit" value="Upload rootfs" /> 1.62 + 1.63 +<h3>$(gettext "ISO image convertion")</h3> 1.64 + 1.65 + $(gettext "Low RAM support"): 1.66 + <select name="loram"> 1.67 + <option value="none">$(gettext "No")</option> 1.68 + <option value="ram">$(gettext "In RAM only")</option> 1.69 + <option value="smallcdrom">$(gettext "Small CDROM or RAM")</option> 1.70 + <option value="cdrom">$(gettext "Large CDROM or RAM")</option> 1.71 + </select> 1.72 + <input type="submit" value="Convert" /> 1.73 </form> 1.74 1.75 $([ "$tarball" ] && tarball_handler)