wok rev 18248

tazpanel-extra/floppy.cgi: multiple files support
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Aug 02 13:31:26 2015 +0200 (2015-08-02)
parents 5cf113b34a09
children 629dd2a26150
files tazpanel-extra/stuff/bootloader tazpanel-extra/stuff/floppy.cgi
line diff
     1.1 --- a/tazpanel-extra/stuff/bootloader	Sat Aug 01 15:09:36 2015 +0200
     1.2 +++ b/tazpanel-extra/stuff/bootloader	Sun Aug 02 13:31:26 2015 +0200
     1.3 @@ -283,6 +283,7 @@
     1.4  	esac
     1.5  	while [ -L "$RDEV" ]; do RDEV="$(readlink "$RDEV")"; done
     1.6  	[ -b "$RDEV" ] && RDEV=$(stat -c '0x%02t%02T' $RDEV 2> /dev/null)
     1.7 +	[ "$(echo $RDEV | tr '[0-9A-FXa-fx]' 0 | sed 's/0//g')" ] ||
     1.8  	store 16 $RootDevOfs $RDEV $bs RDEV
     1.9  
    1.10  	[ $FORMAT -lt 720  ] && store 8 0x15F 40	 $bs	360K
     2.1 --- a/tazpanel-extra/stuff/floppy.cgi	Sat Aug 01 15:09:36 2015 +0200
     2.2 +++ b/tazpanel-extra/stuff/floppy.cgi	Sun Aug 02 13:31:26 2015 +0200
     2.3 @@ -46,13 +46,14 @@
     2.4  	dd if=$(POST fromfd) of=$(POST toimage)
     2.5  	;;
     2.6  *\ build\ *)
     2.7 -	cd $(POST workdir)
     2.8  	cmd=""
     2.9  	toremove=""
    2.10  	while read key file ; do
    2.11  		[ "$(FILE $file size)" ] || continue
    2.12 -		cmd="$cmd $key $(FILE $file tmpname)"
    2.13 -		toremove="$toremove $(FILE $file tmpname)"
    2.14 +		for i in $(seq 1 $(FILE $file count)); do
    2.15 +			cmd="$cmd $key $(FILE $file tmpname $i)"
    2.16 +			toremove="$toremove $(FILE $file tmpname $i)"
    2.17 +		done
    2.18  	done <<EOT
    2.19  bootloader	kernel
    2.20  --initrd	initrd
    2.21 @@ -70,8 +71,10 @@
    2.22  		TITLE="$(_ 'TazPanel - floppy')"
    2.23  		header
    2.24  		xhtml_header
    2.25 +		cd $(POST workdir)
    2.26  		eval $cmd 2>&1
    2.27 -		[ "$toremove" ] && rm -f $toremove
    2.28 +		echo "</pre>"
    2.29 +		[ "$toremove" ] && rm -f $toremove && rmdir $(dirname $toremove)
    2.30  		xhtml_footer
    2.31  		exit 0
    2.32  	fi
    2.33 @@ -141,11 +144,11 @@
    2.34  	</tr>
    2.35  	<tr>
    2.36  	<td>$(_ 'Initramfs / Initrd:')</td>
    2.37 -	<td><input name="initrd" size="37" type="file"> <i>$(_ 'optional')</i></td>
    2.38 +	<td><input name="initrd[]" size="37" type="file" multiple> <i>$(_ 'optional')</i></td>
    2.39  	</tr>
    2.40  	<tr>
    2.41  	<td>$(_ 'Extra initramfs:')</td>
    2.42 -	<td><input name="initrd2" size="37" type="file"> <i>$(_ 'optional')</i></td>
    2.43 +	<td><input name="initrd2[]" size="37" type="file" multiple> <i>$(_ 'optional')</i></td>
    2.44  	</tr>
    2.45  	<tr>
    2.46  	<td>$(_ 'Boot message:')</td>
    2.47 @@ -158,7 +161,7 @@
    2.48  	</tr>
    2.49  	<tr>
    2.50  	<td>$(_ 'Root device:')</td>
    2.51 -	<td><input name="rdev" size="8" value="/dev/fd0" type="text">
    2.52 +	<td><input name="rdev" size="8" value="/dev/ram0" type="text">
    2.53  	&nbsp;&nbsp;$(_ 'Flags:') <select name="flags">
    2.54  		<option selected="selected" value="1">R/O</option>
    2.55  		<option value="0">R/W</option>