slitaz-tools rev 330

bootfloppybox: add floppy image manager
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Apr 13 13:35:56 2009 +0000 (2009-04-13)
parents 28fee072d4c3
children aff3175b8c8a
files tinyutils/bootfloppybox
line diff
     1.1 --- a/tinyutils/bootfloppybox	Mon Apr 13 13:32:05 2009 +0000
     1.2 +++ b/tinyutils/bootfloppybox	Mon Apr 13 13:35:56 2009 +0000
     1.3 @@ -415,6 +415,67 @@
     1.4  </window>
     1.5  '
     1.6  #
     1.7 +# Read/write floppy images
     1.8 +#
     1.9 +export FLOPPY_IMAGE='
    1.10 +<window title="Floppy image manager" icon-name="gtk-floppy">
    1.11 +  <vbox>
    1.12 +    <frame Floppy disk drive>
    1.13 +      <hbox>
    1.14 +        <text use-markup="true">
    1.15 +          <label>"<b>Device : </b>"</label>
    1.16 +        </text>
    1.17 +	<combobox>
    1.18 +          <variable>DEVICE</variable>'
    1.19 +for i in /sys/devices/platform/floppy.*/block:*; do
    1.20 +	[ -d $i ] || continue
    1.21 +	FLOPPY_IMAGE="$FLOPPY_IMAGE
    1.22 +	  <item>/dev/${i#*block:}</item>"
    1.23 +done
    1.24 +	FLOPPY_IMAGE="$FLOPPY_IMAGE
    1.25 +	</combobox>
    1.26 +        <button>
    1.27 +          <label>Format floppy</label>
    1.28 +          <input file icon=\"media-floppy\"></input>
    1.29 +	  <action>fdformat -n $DEVICE</action>
    1.30 +        </button>
    1.31 +      </hbox>
    1.32 +    </frame>
    1.33 +    <frame Floppy image file>
    1.34 +      <hbox>
    1.35 +        <text use-markup=\"true\">
    1.36 +          <label>\"<b>File : </b>\"</label>
    1.37 +        </text>
    1.38 +        <entry accept=\"filename\">
    1.39 +          <label>Select a floppy image</label>
    1.40 +          <variable>IMAGE</variable>
    1.41 +        </entry>
    1.42 +        <button>
    1.43 +          <input file stock=\"gtk-open\"></input>
    1.44 +          <action type=\"fileselect\">IMAGE</action>
    1.45 +        </button>
    1.46 +      </hbox>
    1.47 +    </frame>
    1.48 +    <hbox>
    1.49 +      <button>
    1.50 +        <input file icon=\"go-jump\"></input>
    1.51 +        <label>Write image to floppy</label>
    1.52 +        <action>dd if=\$IMAGE of=\$DEVICE</action>
    1.53 +      </button>
    1.54 +      <button>
    1.55 +        <input file icon=\"undo\"></input>
    1.56 +        <label>Get floppy image</label>
    1.57 +        <action>dd if=\$DEVICE of=\$IMAGE</action>
    1.58 +      </button>
    1.59 +      <button>
    1.60 +        <input file icon=\"gtk-close\"></input>
    1.61 +        <action type=\"closewindow\">FLOPPY_IMAGE</action>
    1.62 +      </button>
    1.63 +    </hbox>
    1.64 +  </vbox>
    1.65 +</window>
    1.66 +"
    1.67 +#
    1.68  # Write bootfloppy image to floppy device.
    1.69  #
    1.70  BOOT_DIALOG='
    1.71 @@ -453,7 +514,7 @@
    1.72  	</combobox>
    1.73          <button>
    1.74            <label>Format floppy</label>
    1.75 -          <input file icon="forward"></input>
    1.76 +          <input file icon="media-floppy"></input>
    1.77  	  <action>case "$DEVICE" in /dev/*) fdformat -n $DEVICE;; esac</action>
    1.78          </button>
    1.79        </hbox>
    1.80 @@ -572,6 +633,16 @@
    1.81      </notebook>
    1.82      <hbox>
    1.83        <button>
    1.84 +        <input file icon="media-cdrom"></input>
    1.85 +	<label>Burn cdrom image</label>
    1.86 +	<action>burnbox</action>
    1.87 +      </button>
    1.88 +      <button>
    1.89 +        <input file icon="media-floppy"></input>
    1.90 +	<label>Manage floppy image</label>
    1.91 +	<action type="launch">FLOPPY_IMAGE</action>
    1.92 +      </button>
    1.93 +      <button>
    1.94          <input file icon="exit"></input>
    1.95  	<label>Exit</label>
    1.96          <action type="exit">Exit</action>