home *** CD-ROM | disk | FTP | other *** search
/ PCNET 2006 September - Disc 1 / PCNET_CD_2006_09.iso / linux / puppy-barebones-2.01r2.iso / pup_201.sfs / usr / sbin / wakepup2 < prev    next >
Encoding:
Text File  |  2006-05-11  |  2.7 KB  |  51 lines

  1. #!/bin/sh
  2.  
  3. DLGBOX="
  4.  <wtitle>WakePup2</wtitle>
  5.  <vbox>
  6.  <text><label>Welcome! This little program will create a boot floppy disk, for booting puppy. WakePup2 is a floppy disk that will search for Puppy on USB, CD/DVD or hard drive and if found will boot puppy. A limitation is that Puppy must be installed in a FAT partition on the USB or hard drive.</label></text>
  7.  <text><label>Why use WakePup2? The most common reason is you have used the Puppy Universal Installer (see 'Setup' menu) to install Puppy to a USB Flash 'key' drive, but the PC refuses to boot from it. Or, you have a PC that has a CD drive but refuses to boot from it. This is a solution for such cantankerous PCs, but of course is not applicable if you have a modern sans-floppy-drive PC.</label></text>
  8.  <text><label>Note, if you need to boot Puppy installed in a Linux partition (ext2, ext3, reiserfs, or minix), it is possible to create a GRUB boot floppy and this can be done when the 'Puppy Universal Installer' (in 'Setup' menu) is executed, or by selecting 'GRUB bootloader config' from the 'Control Panel' menu.</label></text>
  9.  <text><label>(FAT is the filesystem used by MSDOS and Windows up to version 98 -- Windows XP can also be installed on a FAT partition but usually isn't, instead XP is usually in a NTFS partition. Note, in Linux we often refer to a FAT filesystem by the names 'msdos' and 'vfat', where 'msdos' refers to using the filesystem with only the 8.3 filename size, and 'vfat' is when long filenames are supported)</label></text>
  10.  <text><label>PLEASE INSERT A FLOPPY DISK RIGHT NOW, then click the 'Create WakePup floppy' button...</label></text>
  11.  <hbox>
  12.   <button>
  13.    <label>Create WakePup floppy</label>
  14.    <action>Exit:WAKEPUP</action>
  15.   </button>
  16.   <button cancel></button>
  17.  </hbox>
  18.  </vbox>
  19. "
  20.  
  21. RETSTR="`echo "$DLGBOX" | gtkdialog2 --stdin`"
  22.  
  23. if [ ! "`echo "$RETSTR" | grep "WAKEPUP"`" = "" ];then
  24.  while [ 1 ];do
  25.   xmessage -bg orange -title "WakePup2" -center -buttons "" "Now writing WakePup2 disk image, please wait..." &
  26.   MSGID=$!
  27.   dd if=/lib/wakepup2.img of=/dev/fd0
  28.   sync
  29.   dd if=/dev/fd0 of=/tmp/wakepup2.img bs=512 count=2880
  30.   sync
  31.   MD5ORIG="`md5sum /lib/wakepup2.img | cut -f 1 -d " "`"
  32.   MD5CHK="`md5sum /tmp/wakepup2.img | cut -f 1 -d " "`"
  33.   sync
  34.   rm -f /tmp/wakepup2.img
  35.   kill $MSGID 2>/dev/null
  36.   if [ "$MD5ORIG" = "$MD5CHK" ];then
  37.    xmessage -bg green -title "WakePup2: SUCCESS" -center "DONE! Please remove floppy"
  38.    break
  39.   else
  40.    xmessage -bg '#ff8080' -title "WakePup2: ERROR" -center -buttons "TRY_AGAIN:10,CANCEL:11" "There was an error writing to the floppy disk.
  41. If you want to try a different floppy disk, insert it right now.
  42.  
  43. Click 'TRY_AGAIN' button to try again...
  44. or 'CANCEL' to give up..."
  45.    [ $? -ne 10 ] && break
  46.   fi
  47.  done
  48. fi
  49.  
  50. ###END###
  51.