wok-next rev 14247

syslinux/iso2exe: use posixovl -F
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Mar 24 23:14:15 2013 +0100 (2013-03-24)
parents da018658b8df
children 786aeb618875
files syslinux/stuff/iso2exe/README syslinux/stuff/iso2exe/init
line diff
     1.1 --- a/syslinux/stuff/iso2exe/README	Sun Mar 24 22:22:59 2013 +0100
     1.2 +++ b/syslinux/stuff/iso2exe/README	Sun Mar 24 23:14:15 2013 +0100
     1.3 @@ -1,7 +1,7 @@
     1.4  (c) GPLv2, Pascal Bellard <pascal.bellard@slitaz.org>
     1.5  
     1.6 -The iso2exe tool inserts a DOS .EXE header in an ISO image.
     1.7 -The ISO image can be launched by DOS :
     1.8 +The iso2exe tool inserts a DOS/WIN32 .EXE header in an ISO image.
     1.9 +The ISO image can be launched by DOS or Windows :
    1.10  
    1.11  C:\> ren slitaz-5.0.iso slitaz.exe
    1.12  C:\> slitaz
    1.13 @@ -22,6 +22,8 @@
    1.14  
    1.15  - to create a SliTaz USB Key.
    1.16  
    1.17 +When the slitaz.exe program can't boot SliTaz directly it will prompt to create
    1.18 +a bootable image on a removeable media (Memory card, USB stick or ... floppy).
    1.19  
    1.20  Usage:
    1.21  
    1.22 @@ -57,7 +59,7 @@
    1.23      +-----------------+
    1.24      | DOS .COM loader | Load bzImage, the last rootfs*.gz and the ISO initramfs
    1.25      +-----------------+
    1.26 -    |  WIN32 PE .exe  | Windows UMSDOS like installer / USB Key creator.
    1.27 +    |  WIN32 PE .exe  | USB boot Key creator / floppy bootstrap creator.
    1.28      +-----------------+
    1.29             unused
    1.30      +-----------------+
    1.31 @@ -66,7 +68,7 @@
    1.32      | isohybrid boot  | Starts isolinux.bin
    1.33  512 +-----------------+
    1.34      |  iso2exe boot   | Boot starts isohybrid (*), .EXE starts DOS .COM loader
    1.35 -  0 +-----------------+ or 32 bits Windows UMSDOS like installer
    1.36 +  0 +-----------------+ or 32 bits Windows boot device creator
    1.37  
    1.38  * Eltorito boot (i.e. bootable CD-ROM by BIOS) is not concerned by iso2exe.
    1.39  
    1.40 @@ -75,20 +77,29 @@
    1.41  
    1.42  - Only DOS 3, 4 and 6 supported. Checked with http://www.allbootdisks.com/
    1.43  
    1.44 -- Real mode support only. VM86 is not supported.
    1.45 +- Real mode support only. VM86 is not supported. Will not boot directly, but
    1.46 +  a removable boot media is created.
    1.47  
    1.48  - Image/zImage format not supported, bzImage only. Can't boot memtest or gpxe.
    1.49  
    1.50 -- posixovl still needs fixes !
    1.51 -
    1.52  - The tiny Linux loader can't load more than 15Mb of files. (not really a 
    1.53    problem since many-in-1 ISO format).
    1.54  
    1.55  - The DOS Linux loader and the ISO initramfs must fit in ~30Kb.
    1.56  
    1.57 -- Old Linux kernels don't support multiple initramfs load. They will not
    1.58 -  find the /init.exe file. Only the "text" mode will work:
    1.59 +- Linux kernels before version 2.6.30 don't support multiple initramfs load.
    1.60 +  They will not find the /init.exe file. The "text" mode will be forced:
    1.61  	C:\> slitaz.exe text
    1.62  
    1.63  - The ISO image must include the files /boot/bzImage and /boot/rootfs*.
    1.64  
    1.65 +TODO:
    1.66 +
    1.67 +- Add Windows boot device creator
    1.68 +
    1.69 +- Add XMM and VCPI (VM86) support.
    1.70 +
    1.71 +- floppy bootstrap
    1.72 +
    1.73 +- zImage support ?
    1.74 +
     2.1 --- a/syslinux/stuff/iso2exe/init	Sun Mar 24 22:22:59 2013 +0100
     2.2 +++ b/syslinux/stuff/iso2exe/init	Sun Mar 24 23:14:15 2013 +0100
     2.3 @@ -99,7 +99,7 @@
     2.4  arg mount "Mount device"
     2.5  mount \$( (blkid /dev/?d* || blkid) | grep \$val | sed 's/:.*//;q') /mnt
     2.6  arg subroot "Change root to directory"
     2.7 -mount.posixovl /mnt/\$val
     2.8 +mount.posixovl -F /mnt/\$val
     2.9  mount --bind /mnt /mnt/\$val/mnt/dos
    2.10  LDSO=\$(ls /mnt/\$val/lib/ld-* | sed q)
    2.11  umount /proc
    2.12 @@ -119,7 +119,7 @@
    2.13  doinstall()
    2.14  {
    2.15  	mkdir /mnt/slitaz
    2.16 -	mount.posixovl /mnt/slitaz || return
    2.17 +	mount.posixovl -F /mnt/slitaz || return
    2.18  	mkdir -p /mnt/slitaz/boot /mnt/slitaz/mnt/dos
    2.19  	if [ -d /media/cdrom/fs ]; then
    2.20  		cp -a /media/cdrom/fs/. /mnt/slitaz
    2.21 @@ -146,16 +146,16 @@
    2.22  	umount -d /media/cdrom
    2.23  	gettazboot /mnt/slitaz/boot/tazboot.exe
    2.24  	mkinitrd /mnt/slitaz/boot/initrd
    2.25 -	cat > /mnt/slitaz/boot/tazboot.cmd <<EOT
    2.26 +	unix2dos > /mnt/slitaz/boot/tazboot.cmd <<EOT
    2.27  kernel=\\slitaz\\boot\\bzimage
    2.28  initrd=\\slitaz\\boot\\initrd
    2.29  rw root=/dev/null mount=$(getuuid) subroot=slitaz autologin
    2.30  EOT
    2.31  	unix2dos /mnt/slitaz/boot/he* /mnt/slitaz/boot/opt* \
    2.32 -		/mnt/slitaz/boot/README /mnt/slitaz/boot/tazboot.cmd
    2.33 +		/mnt/slitaz/boot/README
    2.34  	[ -x /mnt/slitaz/usr/sbin/mount.posixovl ] ||
    2.35  	cp $(which mount.posixovl) /mnt/slitaz/usr/sbin
    2.36 -	! grep -qs tazboot /mnt/boot.ini && cat >> /mnt/boot.ini <<EOT
    2.37 +	! grep -qs tazboot /mnt/boot.ini && unix2dos >> /mnt/boot.ini <<EOT
    2.38  C:\\slitaz\\boot\\tazboot.exe="SliTaz"
    2.39  EOT
    2.40  	grep -qs menuitem /mnt/config.sys && !grep -q tazboot /mnt/config.sys &&
    2.41 @@ -164,6 +164,7 @@
    2.42  [slitaz]
    2.43  device=\\slitaz\\boot\\tazboot.exe
    2.44  EOT
    2.45 +	unix2dos /mnt/config.sys
    2.46  }
    2.47  
    2.48  install()
    2.49 @@ -310,7 +311,7 @@
    2.50  to machine.\n\n
    2.51  Please plug your USB stick in now.\n 
    2.52  " 18 70
    2.53 -	[ $? -eq 0 ] || return
    2.54 +	[ $? -eq 0 -a -n "$(which tazusb)" ] || return
    2.55  	sleep 5
    2.56  	DEV="$(grep -l 1 /sys/block/*/removable | \
    2.57  		sed 's|/sys/block/\(.*\)/removable|\1|')"
    2.58 @@ -407,9 +408,9 @@
    2.59  	getty -n -l /bin/ash 38400 tty1 || sh
    2.60  }
    2.61  
    2.62 -[ -x /usr/sbin/mount.posixovl ] ||
    2.63 -mv /bin/mount.posixovl.iso2exe /usr/sbin/mount.posixovl 2> /dev/null ||
    2.64 -mv /bin/mount.posixovl.iso2exe /bin/mount.posixovl
    2.65 +BIN=bin/mount.posixovl
    2.66 +[ -x /usr/s$BIN ] || mv /bin/mount.posixovl.iso2exe \
    2.67 +/usr/s$BIN 2> /dev/null || mv /bin/mount.posixovl.iso2exe /$BIN
    2.68  mount -t proc /proc /proc
    2.69  ISO="$(getarg iso | sed 's/.://;s|\\|/|g')"
    2.70  getiso
    2.71 @@ -419,6 +420,7 @@
    2.72  *live*)		live ;;
    2.73  *text*)		text ;;
    2.74  esac
    2.75 +which $DIALOG || live
    2.76  dmesg > /tmp/dmesg
    2.77  
    2.78  while true; do