wok-current diff syslinux/stuff/iso2exe/taziso @ rev 21542

fix fusedav
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun May 05 18:36:52 2019 +0200 (2019-05-05)
parents 426eec51ef7c
children 5b74f1dbb49a
line diff
     1.1 --- a/syslinux/stuff/iso2exe/taziso	Sat Mar 16 13:37:17 2019 +0100
     1.2 +++ b/syslinux/stuff/iso2exe/taziso	Sun May 05 18:36:52 2019 +0200
     1.3 @@ -12,7 +12,7 @@
     1.4  get()
     1.5  {
     1.6  	od -v -j $1 -N ${4:-${3:-2}} -t u${3:-2} -w${3:-2} -An "$2" 2>/dev/null ||
     1.7 -	hexdump -v -s $1 -n ${4:-${3:-2}} -e "\"\" 1/${3:-2} \" %d\n\"" "$2"
     1.8 +	hexdump -v -s $1 -n ${4:-${3:-2}} -e "\"\" 1/${3:-2} \" %u\n\"" "$2"
     1.9  }
    1.10  
    1.11  bytes2bin()
    1.12 @@ -31,15 +31,17 @@
    1.13  
    1.14  gettazboot()
    1.15  {
    1.16 -	echo "Creating $(basename $1) ..."
    1.17 +	echo -e "\nCreating $(basename $1) ..."
    1.18 +	X=$(($(get 20 /mnt/$ISO) - 0xC0))
    1.19 +	[ $X -lt 30000 ] && X=$((0x7FF0))
    1.20  	O=$(($(get 64 "$ISO") - 0xC0))
    1.21 -	L=$(($(get 20 "$ISO") - 0xC0 - $(get 24 "$ISO") - $O))
    1.22 +	L=$(($X - $(get 24 "$ISO") - $O))
    1.23  	S=$((32+$L))
    1.24  	P=$((($S+511)/512))
    1.25  	E=$((4096-(32*$P)))
    1.26  	words2bin 0x5A4D $(($S%512)) $P 0 2 $E -1 $((${2:-0}-16)) \
    1.27  			-2 0 256 -16 28 0x6C53 0x5469 0x7A61 > $1
    1.28 -	ddq bs=1 count=$L skip=$(echo $O) if="$ISO" >> $1
    1.29 +	ddq bs=1 count=$(echo $L) skip=$(echo $O) if="$ISO" >> $1
    1.30  }
    1.31  
    1.32  uncpio()
    1.33 @@ -78,8 +80,7 @@
    1.34  	PAD=$(($(stat -c %s $1) % 4))
    1.35  	[ $PAD -ne 0 ] && ddq if=/dev/zero bs=1 count=$((4 - $PAD)) >> $1
    1.36  	mkdir -p /tmp/fs$$/etc /tmp/fs$$/lib /tmp/fs$$/home
    1.37 -	cp -a /etc/locale.conf /tmp/fs$$/etc 2> /dev/null
    1.38 -	cp -a /etc/keymap.conf /tmp/fs$$/etc 2> /dev/null
    1.39 +	cp -a /etc/locale.conf /etc/locale.conf /tmp/fs$$/etc 2> /dev/null
    1.40  	cat > /tmp/fs$$/init1 <<EOT
    1.41  #!/bin/sh
    1.42  sed -i 's|sbin/init|init2|' /init
    1.43 @@ -89,7 +90,7 @@
    1.44  #!/bin/sh
    1.45  
    1.46  mount -t proc /proc /proc
    1.47 -for i in /lib/*.ko* ; do insmod \$i 2> /dev/null ; done; sleep 2
    1.48 +for i in /lib/modules/*.ko* ; do insmod \$i 2> /dev/null ; done; sleep 2
    1.49  v=\$(sed '/\\/home=/!d;s|.*/home=\\([^ ]*\\).*|\\1|' /proc/cmdline /cmdline 2> /dev/null)
    1.50  mount / -o remount,rw
    1.51  mkdir /mnt/dos
    1.52 @@ -113,10 +114,12 @@
    1.53  fi
    1.54  $([ "$2" ] || echo '# ')mount.posixovl -F \$mnt -- -oallow_other -odefault_permissions -osuid
    1.55  mount --bind \$mnt /home
    1.56 +mount -o size=0,ro -t tmpfs tmpfs \$mnt
    1.57  umount /proc
    1.58  exec /sbin/init
    1.59  EOT
    1.60  	chmod 755 /tmp/fs$$/init?
    1.61 +	ln -s /sqfs/bin/gzip /bin 2> /dev/null
    1.62  	( cd /tmp/fs$$ ; find * | cpio -o -H newc ) | gzip -9 >> $1
    1.63  	rm -rf /tmp/fs$$
    1.64  }
    1.65 @@ -128,8 +131,8 @@
    1.66  	for i in bin lib dev proc tmp mnt etc ; do
    1.67  		mkdir -p $fs/$i
    1.68  	done
    1.69 -	for i in /dev/console /dev/null /dev/tty /dev/tty0 /dev/tty1 /dev/tty2 \
    1.70 -		 /dev/fuse /dev/hd* /dev/sd* ; do
    1.71 +	for i in /dev/null /dev/tty /dev/tty[012] /dev/fuse /dev/[hs]d* \
    1.72 +			/dev/console ; do
    1.73  		cp -a $2$i $fs/dev/
    1.74  	done
    1.75  	for i in /bin/busybox $(which mount.posixovl) $(which blkid); do
    1.76 @@ -137,6 +140,7 @@
    1.77  		sed 's|.*=> \(.*/lib/l[^ ]*\).*|\1|;/^\//!d') $fs/lib
    1.78  		cp $i $fs/bin
    1.79  	done
    1.80 +	cp -a /sqfs/lib/ld-* /tmp/fs/lib 2> /dev/null ||
    1.81  	cp -a /lib/ld-* $fs/lib
    1.82  	for i in $(busybox | sed '/Current/,$!d'); do
    1.83  		[ -e $fs/bin/${i%,} ] || ln -s busybox $fs/bin/${i%,}
    1.84 @@ -176,7 +180,7 @@
    1.85  fi
    1.86  $([ "$3" ] || echo '# ')mount.posixovl -F /mnt/\$val -- -oallow_other -odefault_permissions -osuid
    1.87  mount --bind /mnt /mnt/\$val/mnt/dos
    1.88 -mount -o size=0 -t tmpfs tmpfs /mnt/\$val/mnt/dos/\$val
    1.89 +mount -o size=0,ro -t tmpfs tmpfs /mnt/\$val/mnt/dos/\$val
    1.90  LDSO=\$(ls /mnt/\$val/lib/ld-* | sed q)
    1.91  export LD_LIBRARY_PATH=\$val/lib:\$val/usr/lib:/lib
    1.92    [ "$debug" = "true" ] && sh
    1.93 @@ -239,11 +243,12 @@
    1.94  		$media/README $media/boot/memtest* ; do
    1.95  		[ -s $i ] && cp $i $mnt/slitaz/boot
    1.96  	done
    1.97 -	for i in $mnt/slitaz/boot/memtest $mnt/slitaz/boot/*pxe* ; do
    1.98 +	for i in $mnt/slitaz/boot/memtest $mnt/slitaz/boot/*pxe ; do
    1.99  		[ $(get 0 $i 2> /dev/null || echo 0) -eq 23117 ] &&
   1.100  		mv $i $i.exe
   1.101  	done
   1.102  	bzimage=$(cd $mnt/slitaz/boot ; ls bzimage*)
   1.103 +	cp /etc/keymap.conf /etc/locale.conf $mnt/slitaz/etc 2> /dev/null
   1.104  	gettazboot $mnt/slitaz/boot/tazboot.exe	# autoappend 64 suffix
   1.105  	unix2dos > $mnt/slitaz/boot/tazboot.cmd <<EOT
   1.106  kernel=/slitaz/boot/bzimage
   1.107 @@ -672,7 +677,7 @@
   1.108  
   1.109  mkfloppy()
   1.110  {
   1.111 -	dotwait "Create a $(basename $1) boot floppy"
   1.112 +	dotwait "Create a $(basename $1 .exe) boot floppy"
   1.113  	ddq if=$1 of=/dev/fd0
   1.114  	mkfat12 $1
   1.115  	rm -f /tmp/wait
   1.116 @@ -696,7 +701,7 @@
   1.117  {
   1.118  	gotcdfile '?pxe*'
   1.119  	if [ -z "$1" ]; then
   1.120 -		$DIALOG --clear --title " Create $(basename $file).exe ? " \
   1.121 +		$DIALOG --clear --title " Create $(basename $file .exe).exe ? " \
   1.122  			--yes-label "Install" --yesno \
   1.123  "\nBoot your operating system from the internet and enjoy a full system
   1.124  working entirely in RAM with speed and stability in mind. The Linux Kernel
   1.125 @@ -704,8 +709,8 @@
   1.126  from the Web using PXE and HTTP protocols.\n" 0 0
   1.127  		[ $? -eq 0 ] || return
   1.128  	fi
   1.129 -	cp $file $(basename $file).exe
   1.130 -	du -h $PWD/$(basename $file).exe
   1.131 +	cp $file $(basename $file .exe).exe
   1.132 +	du -h $PWD/$(basename $file .exe).exe
   1.133  }
   1.134  
   1.135  fdpxe()