slitaz-tools view tinyutils/bootfloppybox @ rev 340
tazx: Moved doc to Handbook
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Mon May 04 23:12:18 2009 +0200 (2009-05-04) |
parents | 10c0475b8cf2 |
children | e9ddf09500d2 |
line source
1 #! /bin/sh
2 #
3 # Gtkdialog box for the mount command. Part of SliTaz tools.
4 #
5 VERSION=20081121
7 # Check if user is root.
8 check_root()
9 {
10 if test $(id -u) != 0 ; then
11 echo -e "
12 You must be root to run `basename $0`. Please type 'su' and
13 root password to become super-user.\n"
14 exit 0
15 fi
16 }
18 # This function is used after each screen to contine or abort install.
19 check_retval()
20 {
21 case $retval in
22 1)
23 rm -f /tmp/floppybox.grub.menu
24 echo -e "\nVoluntary exit.\n" && exit 0 ;;
25 255)
26 rm -f /tmp/floppybox.grub.menu
27 echo -e "ESC pressed.\n" && exit 0 ;;
28 esac
29 }
31 select_floppy()
32 {
33 DEVICE="$DIALOG --title \" Floppy device \" --backtitle \"Boot Floppy Creation\" --clear --extra-button --extra-label \"Format\" --colors --radiolist \"
34 Select boot device
35 \" 18 70 50"
36 on=on
37 for i in /sys/devices/platform/floppy.*/block:*; do
38 [ -d $i ] || continue
39 DEVICE="$DEVICE /dev/${i#*block:} 'Floppy in ${i#*block:}' $on"
40 on=off
41 done
42 DEVICE="$DEVICE floppy \"cdrom image file boot.iso\" $on"
43 DEVICE="$DEVICE cdrom \"floppy image file boot.fd\" off 2>&1 1>&3"
44 exec 3>&1
45 DEVICE=`eval $DEVICE`
46 retval=$?
47 exec 3>&-
48 check_retval
49 if [ "$retval" = "3" ]; then
50 case "$DEVICE" in
51 /dev/*) fdformat -n $DEVICE;;
52 esac
53 fi
54 }
56 mkmenu()
57 {
58 if [ "$1" = "grub4dos" ]; then
59 SAVEDEFAULT="save default"
60 cat > /tmp/floppybox.grub.menu <<EOT
61 # grub4dos menu
62 default /default
63 EOT
64 else
65 SAVEDEFAULT="savedefault"
66 cat > /tmp/floppybox.grub.menu <<EOT
67 # grub menu
68 default saved
69 EOT
70 fi
71 cat >> /tmp/floppybox.grub.menu <<EOT
72 timeout 8
73 color yellow/brown light-green/black
75 EOT
76 entry=0
77 [ -f /boot/gpxe ] && entry=$(($entry + 1)) && cat >> /tmp/floppybox.grub.menu <<EOT
78 title gPXE (Boot from the Web, PXE/iSCSI/AoE support)
79 kernel /boot/gpxe $(dd if=/boot/gpxe bs=1 skip=519 count=255 2>/dev/null | strings)
81 EOT
82 [ -f /usr/share/boot/btmgr -a -f /usr/share/boot/memdisk.lzma ] \
83 && entry=$(($entry + 1)) && cat >> /tmp/floppybox.grub.menu <<EOT
84 title Smart Boot Manager (text - boot floppy, hard disk or CD/DVD)
85 kernel /boot/memdisk floppy c=80 h=2 s=18
86 initrd /boot/btmgr.gz
88 EOT
89 [ -f /usr/share/boot/plop.gz -a -f /usr/share/boot/memdisk.lzma ] \
90 && entry=$(($entry + 1)) && cat >> /tmp/floppybox.grub.menu <<EOT
91 title Plop Boot Manager (graphic - boot floppy, hard disk, CD/DVD or USB)
92 kernel /boot/memdisk floppy c=80 h=2 s=18
93 initrd /boot/plop.gz
95 EOT
96 [ -f /usr/share/boot/etherboot ] && entry=$(($entry + 1)) && cat >> /tmp/floppybox.grub.menu <<EOT
97 title Etherboot (LAN boot, PXE or NBI)
98 kernel /boot/etherboot
100 EOT
101 [ -f /usr/share/boot/memtest.lzma -a -f /usr/share/boot/memdisk.lzma ] \
102 && entry=$(($entry + 1)) && cat >> /tmp/floppybox.grub.menu <<EOT
103 title Memtest86+ (Test system memory)
104 kernel /boot/memdisk floppy c=80 h=2 s=18
105 initrd /boot/memtest.gz
107 EOT
108 [ "$1" = "grub4dos" ] && entry=$(($entry + 3)) && cat >> /tmp/floppybox.grub.menu <<EOT
109 title Windows (scan ntldr)
110 fallback $(($entry -3 + 1))
111 find --set-root /ntldr
112 chainloader /ntldr
113 $SAVEDEFAULT --wait=2
115 title Windows (scan cmldr)
116 fallback $(($entry -3 + 2))
117 find --set-root /cmldr
118 chainloader /cmldr
119 $SAVEDEFAULT --wait=2
121 title Windows (scan io.sys)
122 fallback $(($entry -3 + 3))
123 find --set-root /io.sys
124 chainloader /io.sys
125 $SAVEDEFAULT --wait=2
127 EOT
128 entry=$(($entry + 3)) && cat >> /tmp/floppybox.grub.menu <<EOT
129 title Windows (example on /dev/hda1)
130 rootnoverify (hd0,0)
131 chainloader +1
132 $SAVEDEFAULT
134 title Slitaz Frugal (example on /dev/hda1)
135 root (hd0,0)
136 kernel /boot/bzImage rw root=/dev/null vga=normal
137 initrd /boot/rootfs.gz
138 $SAVEDEFAULT
140 title Slitaz Installed (example on /dev/hda2)
141 root (hd0,1)
142 kernel /boot/bzImage ro root=/dev/hda2 vga=normal
143 $SAVEDEFAULT
145 EOT
146 [ "$1" = "grub4dos" ] && entry=$(($entry + 1)) && cat >> /tmp/floppybox.grub.menu <<EOT
147 title Slitaz cdrom image (example on /dev/hda1, DEFRAGMENTED)
148 map (hd0,0)/boot/slitaz-cooking.iso (hd1)
149 map --hook
150 kernel (hd1)/boot/bzImage rw root=/dev/null vga=normal
151 initrd (hd1)/boot/rootfs.gz
152 $SAVEDEFAULT
154 EOT
155 false && [ -f /usr/share/boot/grub.exe.lzma ] && entry=$(($entry + 1)) && cat >> /tmp/floppybox.grub.menu <<EOT
156 title Grub4Dos
157 kernel /boot/grub/grub.exe --config-file="configfile (fd0)/boot/grub/menu4dos.lst"
159 EOT
160 }
162 install_grub()
163 {
164 LOOP=""
165 GRUB_DEV=${DEVICE#/dev/}
166 GRUB_DEV=${GRUB_DEV%% *}
167 case "$DEVICE" in
168 floppy*)
169 LOOP="-o loop"
170 GRUB_DEV=fd0
171 DEVICE=boot.fd
172 dd if=/dev/zero of=$DEVICE bs=18k count=80;;
173 esac
174 grep -qs "^# $2 menu" /tmp/floppybox.grub.menu || mkmenu $2
175 case "$DEVICE" in
176 /dev/*|boot.fd)
177 yes y | mke2fs $DEVICE
178 mkdir /media/floppy
179 mount $LOOP $DEVICE /media/floppy
180 if [ "$2" = "grub4dos" ]; then
181 mkdir -p /media/floppy/boot
182 unlzma -c /usr/share/boot/grldr.lzma > /media/floppy/grldr
183 cp $1/boot/* /media/floppy/boot 2> /dev/null
184 cp /tmp/floppybox.grub.menu /media/floppy/menu.lst
185 umount -d /media/floppy
186 bootlace --floppy --sectors-per-track=18 --heads=2 \
187 --chs --ext2 $DEVICE
188 else
189 mkdir -p /media/floppy/boot/grub
190 cp /usr/lib/grub/i386-pc/stage? /media/floppy/boot/grub
191 cp -a $1/boot /media/floppy
192 cp /tmp/floppybox.grub.menu /media/floppy/boot/grub/menu.lst
193 grub-set-default --root-directory=/media/floppy 0
194 echo "($GRUB_DEV) $(losetup | grep $DEVICE | cut -d: -f1)" > $1/device.map
195 [ -n "$LOOP" ] && LOOP="--device-map=$1/device.map"
196 grub $LOOP --batch <<EOT
197 root ($GRUB_DEV)
198 setup ($GRUB_DEV)
199 quit
200 EOT
201 umount -d /media/floppy
202 fi ;;
203 cdrom*)
204 mkdir -p $1/boot/grub 2> /dev/null
205 cp /tmp/floppybox.grub.menu $1/boot/grub/menu.lst
206 if [ "$2" = "grub4dos" ]; then
207 unlzma -c /usr/share/boot/grldr.lzma > $1/boot/grub/grldr
208 genisoimage -R -o boot.iso -b boot/grub/grldr \
209 -c boot/boot.cat -no-emul-boot -boot-load-seg 0x1000 \
210 -hide boot/boot.cat -input-charset iso8859-1 $1
211 else
212 cp /usr/lib/grub/i386-pc/stage2_eltorito $1/boot/grub
213 genisoimage -R -o boot.iso -b boot/grub/stage2_eltorito \
214 -c boot/boot.cat -no-emul-boot -boot-load-size 4 \
215 -hide boot/boot.cat -input-charset iso8859-1 \
216 -boot-info-table $1
217 fi ;;
218 esac
219 }
221 while true; do
223 if [ "$1" == "call" ]; then
224 case "$2" in
225 mkmenu) mkmenu $3;;
226 install)
227 DIR=/tmp/mkbootfloppy$$
228 mkdir -p $DIR
229 DEVICE=$4
230 file=$5
231 case "$3" in
232 grub*)
233 mkdir -p $DIR/boot/grub
234 [ -f /usr/share/boot/btmgr -a -f /usr/share/boot/memdisk.lzma ] \
235 && cat /usr/share/boot/btmgr /dev/zero | \
236 dd bs=18k count=80 | gzip -9 > \
237 $DIR/boot/btmgr.gz \
238 && unlzma -c /usr/share/boot/memdisk.lzma > \
239 $DIR/boot/memdisk
240 [ -f /usr/share/boot/plop.gz -a \
241 -f /usr/share/boot/memdisk.lzma ] \
242 && zcat /usr/share/boot/plop.gz | \
243 cat - /dev/zero | dd bs=18k count=80 | \
244 gzip -9 > $DIR/boot/plop.gz \
245 && unlzma -c /usr/share/boot/memdisk.lzma > \
246 $DIR/boot/memdisk
247 [ -f /usr/share/boot/etherboot ] \
248 && cp /usr/share/boot/etherboot $DIR/boot
249 [ -f /boot/gpxe ]\
250 && cp /boot/gpxe $DIR/boot
251 [ -f /usr/share/boot/memtest.lzma -a \
252 -f /usr/share/boot/memdisk.lzma ] \
253 && unlzma -c /usr/share/boot/memtest.lzma | \
254 cat - /dev/zero | dd bs=18k count=80 | \
255 gzip -9 > $DIR/boot/memtest.gz \
256 && unlzma -c /usr/share/boot/memdisk.lzma > \
257 $DIR/boot/memdisk
258 install_grub $DIR $3
259 ;;
260 *)
261 case "$file" in
262 *.lzma) action="unlzma -c";;
263 *.gz) action="zcat";;
264 *) action="cat";;
265 esac
266 case "$DEVICE" in
267 /dev/*) $action $file > $DEVICE;;
268 flopp*) $action $file | cat - /dev/zero | \
269 dd bs=18k count=80 > boot.fd;;
270 cdrom*)
271 mkdir -p $DIR/boot/grub
272 case "$3" in
273 btmgr|plop|memtest)
274 $action $file | cat - /dev/zero | \
275 dd bs=18k count=80 | \
276 gzip -9 > $DIR/boot/$3.gz
277 unlzma -c /usr/share/boot/memdisk.lzma \
278 > $DIR/boot/memdisk
279 cat > /tmp/floppybox.grub.menu << EOT
280 # grub menu
281 timeout 0
282 title $3
283 kernel /boot/memdisk floppy c=80 h=2 s=18
284 initrd /boot/$3.gz
285 EOT
286 ;;
287 *) $action $file > $DIR/boot/$3
288 cat > /tmp/floppybox.grub.menu << EOT
289 # grub menu
290 timeout 0
291 title $3
292 kernel /boot/$3
293 EOT
294 ;;
295 esac
296 install_grub $DIR grub
297 ;;
298 esac
299 ;;
300 esac
301 rm -rf $DIR
302 ;;
303 get-plop)
304 PLOP_URL="$(wget -O - http://www.plop.at/en/bootmanagerdl.html |\
305 grep plpbt | head -1 |\
306 sed 's|.*href=\(.*\) target.*|\1|')"
307 VERSION="$(basename $PLOP_URL| sed 's/[^0-9\.]*\(.*\).zip/\1/')"
308 mkdir -p /tmp/get-plop$$/plop-$VERSION/fs/$(dirname $3)
309 wget -O - $PLOP_URL | unzip -p /dev/stdin '*/plpbt.img' | \
310 gzip -9 > /tmp/get-plop$$/plop-$VERSION/fs/$3
311 if [ -s /tmp/get-plop$$/plop-$VERSION/fs/$3 ]; then
312 cat > /tmp/get-plop$$/plop-$VERSION/receipt <<EOT
313 PACKAGE="plop"
314 VERSION="$VERSION"
315 CATEGORY="non-free"
316 SHORT_DESC="Plop boot manager."
317 WEB_SITE="http://www.plop.at/en/bootmanager.html"
318 EOT
319 ( cd /tmp/get-plop$$ ; tazpkg pack plop-$VERSION )
320 tazpkg install /tmp/get-plop$$/plop-$VERSION.tazpkg
321 fi
322 rm -rf /tmp/get-plop$$
323 ;;
324 *) echo "Invalid command $0 $@" 1>&2
325 exit 1;;
326 esac
327 exit 0
328 fi
330 if [ -z "$XAUTHORITY" ]; then
332 : ${DIALOG=dialog}
334 DEVICE=/dev/fd0
335 while true; do
336 exec 3>&1
337 ID_SOURCE=`$DIALOG --title " Choose a boot floppy " \
338 --backtitle "Boot Floppy Creation on $DEVICE" --clear \
339 --extra-button --extra-label "Change floppy" \
340 --yes-label "Install" \
341 --no-label "Quit" \
342 --colors --radiolist "
343 Create a floppy or a cdrom to boot a LiveCD in a PXE network...
344 May need a floppy disk in drive. Erase the whole floppy disk.
345 " 18 70 50\
346 SmartBtmgr "Boot any partition or ATAPI CD-ROM." on \
347 Plop "Boot harddisk floppy CD/DVD or USB." off \
348 Etherboot "Replacement for proprietary PXE ROMs." off \
349 gPXE "Boot from http://boot.slitaz.org/" off \
350 Memtest86+ "Memory failures detection tool." off \
351 Grub4DOS "Enhanced grub version supporting NTFS." off \
352 Grub "Boot loader with command shell." off 2>&1 1>&3`
353 retval=$?
354 exec 3>&-
355 check_retval
356 if [ "$retval" = "3" ]; then
357 select_floppy
358 continue;
359 fi
360 while read key file pkg; do
361 [ "$key" = "$ID_SOURCE" ] || continue
362 if [ ! -f "$file" ]; then
363 $DIALOG --title " Install package " --colors \
364 --backtitle "Boot Floppy Creation" --clear \
365 --yes-label "Install" \
366 --no-label "Quit" \
367 --yesno "The package $pkg is not yet installed. Install it ?" 18 70
368 retval=$?
369 if [ "$pkg" = "plop" ]; then
370 bootfloppybox call get-plop $file
371 else
372 tazpkg get-install $pkg
373 fi
374 fi
375 bootfloppybox call install "$pkg" "$DEVICE" "$file"
376 exit 0
377 done <<EOT
378 SmartBtmgr /usr/share/boot/btmgr btmgr
379 Plop /usr/share/boot/plop.gz plop
380 Etherboot /usr/share/boot/etherboot etherboot
381 gPXE /boot/gpxe gpxe
382 Memtest86+ /usr/share/boot/memtest.lzma memtest
383 Grub4DOS /usr/share/boot/grldr.lzma grub4dos
384 Grub /usr/sbin/grub grub
385 EOT
386 done
387 fi
388 #
389 # Describe gPXE arguments.
390 #
391 export HELP='
392 <window title="gPXE forced url" icon-name="gtk-floppy">
393 <vbox>
394 <text use-markup="true">
395 <label>"
396 <b>Web boot parameters</b>"
397 </label>
398 </text>
399 <frame>
400 <text wrap="true" width-chars="58" use-markup="true">
401 <label>
402 "Without parameters (i.e. with an empty Boot URL) gPXE will perform a normal PXE boot: IP configuration with DHCP and download the DHCP bootfile with TFTP.
404 You can override the DHCP bootfile with a Boot URL such as <i>tftp://192.168.0.1/pxe/pxeloader</i>, <i>http://mirror.slitaz.org/pxe/pxelinux.0</i>, or <i>x-tftm://192.168.0.201//lts/vmlinuz.ltsp</i>.
406 You can override IP configuration too (useful without a DHCP server), example: <i>ip=192.168.0.10/24 gw=192.168.0.1 dns=192.168.0.1 nodhcp url=http://mirror.slitaz.org/pxe/pxelinux.0</i>
408 The <i>nodhcp</i> keyword avoids dhcp timeouts and the <i>url=</i> keyword is optional when the url is the only one argument.
410 Comma separated URL list are supported. The PXE client will try to load the first URL. If the load fails, it will try the next URL, and so on.
411 "
412 </label>
413 </text>
414 </frame>
415 </vbox>
416 </window>
417 '
418 #
419 # Read/write floppy images
420 #
421 export FLOPPY_IMAGE='
422 <window title="Floppy image manager" icon-name="gtk-floppy">
423 <vbox>
424 <frame Floppy disk drive>
425 <hbox>
426 <text use-markup="true">
427 <label>"<b>Device : </b>"</label>
428 </text>
429 <combobox>
430 <variable>DEVICE</variable>'
431 for i in /sys/devices/platform/floppy.*/block:*; do
432 [ -d $i ] || continue
433 FLOPPY_IMAGE="$FLOPPY_IMAGE
434 <item>/dev/${i#*block:}</item>"
435 done
436 FLOPPY_IMAGE="$FLOPPY_IMAGE
437 </combobox>
438 <button>
439 <label>Format floppy</label>
440 <input file icon=\"media-floppy\"></input>
441 <action>fdformat -n $DEVICE</action>
442 </button>
443 </hbox>
444 </frame>
445 <frame Floppy image file>
446 <hbox>
447 <text use-markup=\"true\">
448 <label>\"<b>File : </b>\"</label>
449 </text>
450 <entry accept=\"filename\">
451 <label>Select a floppy image</label>
452 <variable>IMAGE</variable>
453 </entry>
454 <button>
455 <input file stock=\"gtk-open\"></input>
456 <action type=\"fileselect\">IMAGE</action>
457 </button>
458 </hbox>
459 </frame>
460 <hbox>
461 <button>
462 <input file icon=\"go-jump\"></input>
463 <label>Write image to floppy</label>
464 <action>dd if=\$IMAGE of=\$DEVICE</action>
465 </button>
466 <button>
467 <input file icon=\"undo\"></input>
468 <label>Get floppy image</label>
469 <action>dd if=\$DEVICE of=\$IMAGE</action>
470 </button>
471 <button>
472 <input file icon=\"gtk-close\"></input>
473 <action type=\"closewindow\">FLOPPY_IMAGE</action>
474 </button>
475 </hbox>
476 </vbox>
477 </window>
478 "
479 #
480 # Write bootfloppy image to floppy device.
481 #
482 BOOT_DIALOG='
483 <window title="bootfloppybox" icon-name="gtk-floppy">
484 <vbox>
486 <text use-markup="true">
487 <label>
488 "
489 <b>SliTaz - Bootfloppybox</b>"
490 </label>
491 </text>
492 <text wrap="false" width-chars="44" use-markup="true">
493 <label>
494 "
495 Create a floppy or a cdrom to boot a LiveCD in a PXE network or the WEB...
496 May need a floppy disk in drive. Erase the whole floppy disk.
497 "
498 </label>
499 </text>
501 <frame Floppy disk drive>
502 <hbox>
503 <text use-markup="true">
504 <label>"<b>Device : </b>"</label>
505 </text>
506 <combobox>
507 <variable>DEVICE</variable>'
508 for i in /sys/devices/platform/floppy.*/block:*; do
509 [ -d $i ] || continue
510 BOOT_DIALOG="$BOOT_DIALOG
511 <item>/dev/${i#*block:}</item>"
512 done
513 tmp=' <item>floppy image (boot.fd)</item>
514 <item>cdrom image (boot.iso)</item>
515 </combobox>
516 <button>
517 <label>Format floppy</label>
518 <input file icon="media-floppy"></input>
519 <action>case "$DEVICE" in /dev/*) fdformat -n $DEVICE;; esac</action>
520 </button>
521 </hbox>
522 </frame>
523 <notebook labels="LiveCD|USB|PXE Network|WEB Network|Memory Test|Windows|Expert">
524 '
525 BOOT_DIALOG="$BOOT_DIALOG$tmp"
526 while read name file pkg desc; do
527 tmp="<frame $name>
528 <hbox>
529 <text wrap=\"true\" width-chars=\"44\" use-markup=\"true\">
530 <label>
531 \"
532 $(echo -e $desc)
533 \"
534 </label>
535 </text>
536 </hbox>
537 <hbox>
538 "
539 if [ -f $file ]; then
540 if [ "$pkg" = "grub" -o "$pkg" = "grub4dos" ]; then
541 tmp="$tmp
542 <button>
543 <label>Grub menu</label>
544 <input file icon=\"accessories-text-editor\"></input>
545 <action>bootfloppybox call mkmenu $pkg</action>
546 <action type=\"lauch\">leafpad /tmp/floppybox.grub.menu</action>
547 </button>
548 "
549 elif [ "$pkg" = "etherboot" ]; then
550 tmp="$tmp
551 <button>
552 <input file icon=\"browser\"></input>
553 <label>Wiki</label>
554 <action>firefox http://wiki.slitaz.org/doku.php?id=quickstart:pxe &</action>
555 </button>
556 "
557 elif [ "$pkg" = "gpxe" ]; then
558 tmp="$tmp
559 <text wrap=\"true\" use-markup=\"true\">
560 <label> \"<b>Boot URL:</b>\" </label>
561 </text>
562 <entry>
563 <default>$(dd if=$file bs=1 skip=519 count=255 2>/dev/null | strings)</default>
564 <variable>URL</variable>
565 </entry>
566 </hbox>
567 <hbox>
568 <button>
569 <input file icon=\"browser\"></input>
570 <label>Wiki</label>
571 <action>firefox http://wiki.slitaz.org/doku.php?id=quickstart:pxe &</action>
572 </button>
573 <button help>
574 <action type=\"launch\">HELP</action>
575 </button>
576 <button>
577 <label>Update</label>
578 <input file icon=\"reload\"></input>
579 <action>echo -n \"\$URL\" | cat - /dev/zero | dd conv=notrunc bs=1 count=255 seek=519 of=$file 2>/dev/null</action>
580 </button>
581 "
582 fi
583 receipt=/var/lib/tazpkg/installed/$pkg/receipt
584 if [ -f $receipt ]; then
585 . $receipt
586 tmp="$tmp
587 <button>
588 <input file icon=\"browser\"></input>
589 <label>Web</label>
590 <action>firefox $WEB_SITE &</action>
591 </button>
592 "
593 fi
594 tmp="$tmp
595 <button>
596 <label>Write floppy</label>
597 <input file icon=\"forward\"></input>
598 <action>bootfloppybox call install \"$pkg\" \"\$DEVICE\" \"$file\"</action>
599 </button>
600 </hbox>
601 </frame>
602 "
603 else
604 tmp2="tazpkg get-install $pkg --forced"
605 [ "$pkg" = "plop" ] && tmp2="bootfloppybox call get-plop $file"
606 tmp="$tmp
607 <text wrap=\"true\" width-chars=\"34\" use-markup=\"true\">
608 <label>
609 \"<i>The package <b>$pkg</b> is not yet installed</i>\"
610 </label>
611 </text>
612 <button>
613 <input file icon=\"go-jump\"></input>
614 <label>Install</label>
615 <action>[ -f /var/lib/tazpkg/packages.list ] || tazpkg recharge</action>
616 <action>xterm -fa MiscFixed -fs 11 -bg gray93 -fg black -geometry 80x17 -title \"$pkg install\" -e \"$tmp2 ; sleep 2\"</action>
617 <action type=\"exit\">restart</action>
618 </button>
619 </hbox>
620 </frame>
621 "
622 fi
623 BOOT_DIALOG="$BOOT_DIALOG$tmp"
624 done <<EOT
625 SmartBtmgr /usr/share/boot/btmgr btmgr This OS independent Smart Boot Manager can boot any partition or ATAPI CD-ROM.
626 Plop /usr/share/boot/plop.gz plop This non free Boot Manager can boot a floppy disk, hardisk, USB or CD/DVD. Hit Ctrl-ESC for text mode.
627 Etherboot /usr/share/boot/etherboot etherboot This network bootloader provides a replacement for proprietary PXE or NBI ROMs.
628 gPXE /boot/gpxe gpxe PXE / iSCSI / AoE network bootloader.
629 Memtest86+ /usr/share/boot/memtest.lzma memtest Memory failures detection tool.
630 Grub4DOS /usr/share/boot/grldr.lzma grub4dos Enhanced grub version supporting NTFS.
631 Grub /usr/sbin/grub grub General purpose boot loader with command shell.
632 EOT
633 tmp='
634 </notebook>
635 <hbox>
636 <button>
637 <input file icon="media-cdrom"></input>
638 <label>Burn cdrom image</label>
639 <action>burnbox</action>
640 </button>
641 <button>
642 <input file icon="media-floppy"></input>
643 <label>Manage floppy image</label>
644 <action type="launch">FLOPPY_IMAGE</action>
645 </button>
646 <button>
647 <input file icon="exit"></input>
648 <label>Exit</label>
649 <action type="exit">Exit</action>
650 </button>
651 </hbox>
653 </vbox>
654 </window>
655 '
656 BOOT_DIALOG="$BOOT_DIALOG$tmp"
657 export BOOT_DIALOG
659 # Only root can create floppy.
660 check_root
661 gtkdialog --program=BOOT_DIALOG | grep -q 'EXIT="restart"' && continue
662 rm -f /tmp/floppybox.grub.menu
663 exit 0
664 done