slitaz-tools rev 220

bootfloppybox: add non free plop to boot from USB
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Jun 25 10:05:29 2008 +0000 (2008-06-25)
parents 034b656cd661
children a54349b53418
files tinyutils/bootfloppybox
line diff
     1.1 --- a/tinyutils/bootfloppybox	Tue Jun 24 20:52:25 2008 +0200
     1.2 +++ b/tinyutils/bootfloppybox	Wed Jun 25 10:05:29 2008 +0000
     1.3 @@ -2,7 +2,8 @@
     1.4  # 
     1.5  # Gtkdialog box for the mount command. Part of SliTaz tools.
     1.6  #
     1.7 -VERSION=20080618
     1.8 +VERSION=20080625
     1.9 +PLOP_URL=http://download.plop.at/plop/bootmngr/plpbt50rc12flp.zip
    1.10  
    1.11  # Check if user is root.
    1.12  check_root()
    1.13 @@ -63,6 +64,12 @@
    1.14  			&& cp /usr/share/boot/btmgr /media/floppy/boot \
    1.15  			&& unlzma -c /usr/share/boot/memdisk.lzma > \
    1.16  				/media/floppy/boot/memdisk
    1.17 +		[ -f /usr/share/boot/plop.gz -a \
    1.18 +		  -f /usr/share/boot/memdisk.lzma ]\
    1.19 +			&& zcat /usr/share/boot/plop.gz > \
    1.20 +				/media/floppy/boot/plop \
    1.21 +			&& unlzma -c /usr/share/boot/memdisk.lzma > \
    1.22 +				/media/floppy/boot/memdisk
    1.23  		[ -f /usr/share/boot/etherboot ]\
    1.24  			&& cp /usr/share/boot/etherboot /media/floppy/boot
    1.25  		[ -f /usr/share/boot/memtest.lzma ]\
    1.26 @@ -79,6 +86,30 @@
    1.27  quit
    1.28  EOT
    1.29  		;;
    1.30 +	get-plop)
    1.31 +		wget -O - $PLOP_URL | unzip -p /dev/stdin | \
    1.32 +			dd bs=18k count=6 | gzip -9 > $3
    1.33 +		[ -s $3 ] || exit 1
    1.34 +		mkdir /tmp/get-plop$$
    1.35 +		cd /tmp/get-plop$$
    1.36 +		echo $3 > files.list
    1.37 +		cpio -o -H newc < files.list | gzip -9 > fs.cpio.gz
    1.38 +		cat > receipt <<EOT
    1.39 +PACKAGE="plop"
    1.40 +VERSION="1.0"
    1.41 +CATEGORY="non-free"
    1.42 +SHORT_DESC="Plop boot manager."
    1.43 +WEB_SITE="http://www.plop.at/en/bootmanager.html"
    1.44 +EOT
    1.45 +		cpio -o -H newc > plop-1.0.tazpkg <<EOT
    1.46 +receipt
    1.47 +files.list
    1.48 +fs.cpio.gz
    1.49 +EOT
    1.50 +		tazpkg install plop-1.0.tazpkg
    1.51 +		cd ..
    1.52 +		rm -rf /tmp/get-plop$$
    1.53 +		;;
    1.54  	*)	echo "Invalid command $0 $@" 1>&2
    1.55  		exit 1;;
    1.56  	esac
    1.57 @@ -108,11 +139,18 @@
    1.58  EOT
    1.59  [ -f /usr/share/boot/btmgr -a -f /usr/share/boot/memdisk.lzma ]\
    1.60  	&& cat >> /tmp/floppybox.grub.menu <<EOT
    1.61 -title Smart Boot Manager
    1.62 +title Smart Boot Manager (boot floppy, hard disk or CD/DVD)
    1.63  	kernel /boot/memtest
    1.64  	initrd /boot/btmgr
    1.65  
    1.66  EOT
    1.67 +[ -f /usr/share/boot/plop.gz -a -f /usr/share/boot/memdisk.lzma ]\
    1.68 +	&& cat >> /tmp/floppybox.grub.menu <<EOT
    1.69 +title Plop Boot Manager (boot floppy, hard disk, CD/DVD or USB)
    1.70 +	kernel /boot/memtest
    1.71 +	initrd /boot/plop
    1.72 +
    1.73 +EOT
    1.74  [ -f /usr/share/boot/etherboot ] && cat >> /tmp/floppybox.grub.menu <<EOT
    1.75  title Etherboot
    1.76  	kernel /boot/etherboot
    1.77 @@ -145,10 +183,11 @@
    1.78  Create a floppy to boot a LiveCD, in a PXE network...
    1.79  Need a floppy disk in drive. Erase the whole floppy disk.
    1.80  		" 18 70 50\
    1.81 -		SmartBtmgr "	Boot any partition or ATAPI CD-ROM." on \
    1.82 -		Etherboot "	Replacement for proprietary PXE ROMs." off \
    1.83 -		Memtest86+ "	Memory failures detection tool." off \
    1.84 -		Grub	"	Boot loader with command shell." off  2>&1 1>&3`
    1.85 +		SmartBtmgr	"Boot any partition or ATAPI CD-ROM." on \
    1.86 +		Plop		"Boot harddisk floppy CD/DVD or USB." off \
    1.87 +		Etherboot	"Replacement for proprietary PXE ROMs." off \
    1.88 +		Memtest86+	"Memory failures detection tool." off \
    1.89 +		Grub		"Boot loader with command shell." off  2>&1 1>&3`
    1.90  	retval=$?
    1.91  	exec 3>&-
    1.92  	check_retval
    1.93 @@ -165,7 +204,11 @@
    1.94  				--no-label "Quit" \
    1.95  				--yesno "The package $pkg is not yet installed. Install it ?" 18 70
    1.96  			retval=$?
    1.97 -			tazpkg get-install $pkg
    1.98 +			if [ "$pkg" = "plop" ]; then
    1.99 +				bootfloppybox call get-plop $file
   1.100 +			else
   1.101 +				tazpkg get-install $pkg
   1.102 +			fi
   1.103  		fi
   1.104  		if [ "$pkg" = "grub" ]; then
   1.105  			bootfloppybox call setup-grub $DEVICE
   1.106 @@ -180,6 +223,7 @@
   1.107  		exit 0
   1.108  	done <<EOT
   1.109  SmartBtmgr /usr/share/boot/btmgr btmgr
   1.110 +Plop /usr/share/boot/plop.gz plop
   1.111  Etherboot /usr/share/boot/etherboot etherboot
   1.112  Memtest86+ /usr/share/boot/memtest.lzma memtest
   1.113  Grub /usr/sbin/grub grub
   1.114 @@ -223,7 +267,7 @@
   1.115          </button>
   1.116        </hbox>
   1.117      </frame>
   1.118 -    <notebook labels="LiveCD|PXE Network|Memory Test|Expert">
   1.119 +    <notebook labels="LiveCD|USB|PXE Network|Memory Test|Expert">
   1.120  '  
   1.121  while read name file pkg desc; do
   1.122      tmp="<frame $name>
   1.123 @@ -272,6 +316,9 @@
   1.124  "
   1.125      fi
   1.126    else
   1.127 +    tmp2="[ -f /var/lib/tazpkg/packages.list ] || tazpkg recharge</action>
   1.128 +	<action>xterm -fa MiscFixed -fs 11 -bg gray93 -fg black -geometry 80x17 -title \"$pkg install\" -e \"tazpkg get-install $pkg ; echo -e \\\"----\\n\\nENTER to continue...\\\" && read close\""
   1.129 +    [ "$pkg" = "plop" ] && tmp2="bootfloppybox call get-plop $file"
   1.130      tmp="$tmp
   1.131        <hbox>
   1.132        <text wrap=\"true\" width-chars=\"34\" use-markup=\"true\">
   1.133 @@ -282,8 +329,7 @@
   1.134        <button>
   1.135          <input file icon=\"go-jump\"></input>
   1.136  	<label>Install</label>
   1.137 -        <action>[ -f /var/lib/tazpkg/packages.list ] || tazpkg recharge</action>
   1.138 -	<action>xterm -fa MiscFixed -fs 11 -bg gray93 -fg black -geometry 80x17 -title \"$pkg install\" -e \"tazpkg get-install $pkg ; echo -e \\\"----\\n\\nENTER to continue...\\\" && read close\"</action>
   1.139 +        <action>$tmp2</action>
   1.140          <action type=\"exit\">Exit</action>
   1.141        </button>
   1.142        </hbox>
   1.143 @@ -293,6 +339,7 @@
   1.144    BOOT_DIALOG="$BOOT_DIALOG$tmp"
   1.145  done <<EOT
   1.146  SmartBtmgr /usr/share/boot/btmgr btmgr This OS independent Smart Boot Manager can boot any          partition or ATAPI CD-ROM.
   1.147 +Plop /usr/share/boot/plop.gz plop This non free Boot Manager can boot floppy,         hardisk, CD/DVD or USB.
   1.148  Etherboot /usr/share/boot/etherboot etherboot This network bootloader provides a replacement for proprietary PXE or NBI ROMs.
   1.149  Memtest86+ /usr/share/boot/memtest.lzma memtest Memory failures detection tool.
   1.150  Grub /usr/sbin/grub grub General purpose boot loader with command shell