wok-current rev 19450

syslinux: typo in iso2exe
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Oct 17 15:31:24 2016 +0200 (2016-10-17)
parents 3af6a1c93f35
children 2547fda51451
files syslinux-extra/receipt syslinux/stuff/iso2exe/README.custom syslinux/stuff/iso2exe/init.custom syslinux/stuff/iso2exe/iso2exe.sh
line diff
     1.1 --- a/syslinux-extra/receipt	Mon Oct 17 10:20:42 2016 +0200
     1.2 +++ b/syslinux-extra/receipt	Mon Oct 17 15:31:24 2016 +0200
     1.3 @@ -28,5 +28,7 @@
     1.4      cp -a $src/isohybrid.sh $fs/usr/bin/isohybrid
     1.5      cp -a $src/iso2exe/iso2exe $fs/usr/bin/iso2exe
     1.6      cp -a $src/iso2exe/taziso $fs/usr/bin
     1.7 +    cp -a $src/iso2exe/README.custom $fs/usr/share/boot
     1.8 +    cp -a $src/iso2exe/init.custom $fs/usr/share/boot
     1.9      chown root.root $fs/usr/share/boot/* $fs/bin/* $fs/usr/bin/*
    1.10  }
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/syslinux/stuff/iso2exe/README.custom	Mon Oct 17 15:31:24 2016 +0200
     2.3 @@ -0,0 +1,64 @@
     2.4 +iso2exe can insert your custom settings in the SliTaz live iso image:
     2.5 +
     2.6 +For example let's say you live in Paris and you want to add your wifi settings
     2.7 +and your SSH keys into the live CD.
     2.8 +
     2.9 +Create a directory tree like
    2.10 +
    2.11 +extra
    2.12 +extra/init.d
    2.13 +extra/etc
    2.14 +extra/etc/dropbear
    2.15 +
    2.16 +copy /usr/share/boot/init.custom in the root (where is extra/)
    2.17 +copy /etc/dropbear/dropbear_*_host_key files in extra/etc/dropbear
    2.18 +
    2.19 +either:
    2.20 +	copy your network.conf in extra/etc/
    2.21 +or (better, compatible with any SliTaz version):
    2.22 +	add a shell script in extra/init.d/
    2.23 +cat > extra/init.d/wifi <<EOT
    2.24 +sed -i 's/^WIFI="no"/WIFI="yes"/' /etc/network.conf
    2.25 +sed -i 's/^WIFI_ESSID=".*/WIFI_ESSID="TheCustomESSID"/' /etc/network.conf
    2.26 +sed -i 's/^WIFI_KEY=".*/WIFI_KEY="TheWifiKey"/' /etc/network.conf
    2.27 +EOT
    2.28 +
    2.29 +Create the initranfs:
    2.30 +# find init.custom extra | cpio -o -H newc | gzip -9 > ../initrd.custom
    2.31 +# cd ..
    2.32 +
    2.33 +And update the ISO image:
    2.34 +# iso2exe -a "rdinit=/init.custom lang=fr_FR kmap=fr-latin1 tz=Europe/Paris" \
    2.35 +	-i initrd.custom slitaz.iso -f
    2.36 +
    2.37 +That's it!
    2.38 +
    2.39 +Note you can check whether an ISO image is customized:
    2.40 +$ iso2exe -l slitaz.iso
    2.41 +win32.exe at 0000 (6144 bytes).
    2.42 +syslinux.mbr at 1800 (512 bytes).
    2.43 +flavor.info at 1A00 (664 bytes).
    2.44 +6841 free bytes in 1C98..3751
    2.45 +tazboot.com at 3751 (6994 bytes).
    2.46 +rootfs.gz at 52A3 (11429 bytes).
    2.47 +dosstub at 7F48 (184 bytes).
    2.48 +boot.md5 at 7FF0 (16 bytes).
    2.49 +fs.iso at 8000 (47065088 bytes).
    2.50 +custom.magic at 2CEA800 (39 bytes).
    2.51 +custom.append at 2CEA82F (59 bytes).
    2.52 +custom.initrd at 2CEA878 (46749 bytes).
    2.53 +41195 free bytes in 2CF5F15..2D00000
    2.54 +MBR partitions :
    2.55 + 1:00000000  00016800  17
    2.56 +
    2.57 +And extract the initramfs:
    2.58 +$ iso2exe -r slitaz.iso custom.initrd
    2.59 +
    2.60 +The taziso tool is custom live cd aware:
    2.61 +# taziso slitaz.iso isomd5
    2.62 +SliTaz core-4in1  2016-10-16  slitaz.iso
    2.63 +Check the ISO image
    2.64 +----
    2.65 +Checking iso image...OK
    2.66 +Checking iso hybrid boot....OK
    2.67 +Checking iso custom config...OK
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/syslinux/stuff/iso2exe/init.custom	Mon Oct 17 15:31:24 2016 +0200
     3.3 @@ -0,0 +1,19 @@
     3.4 +#!/bin/sh
     3.5 +
     3.6 +if [ "$1" == "loramhack" ]; then
     3.7 +	cp $0 $2/init.extra
     3.8 +	sed -i 's|^exec |exec /sbin|' $2/init.extra
     3.9 +	cp -a /extra/. $2 
    3.10 +	exit
    3.11 +fi
    3.12 +if [ -d /etc ]; then
    3.13 +	[ -d /extra ] && cp -a /extra/. / && rm -rf /extra
    3.14 +	for i in /init.d/* ; do
    3.15 +		[ -f $i ] && echo "=== $(date)  $i === " && . $i
    3.16 +	done 2>&1 | tee /var/log/init.log
    3.17 +else
    3.18 +	sed -i	-e 's|fail 2mDone|&\n	'$0' loramhack /mnt$4|' \
    3.19 +		-e 's| /sbin/init| /init.extra|' /init
    3.20 +fi
    3.21 +
    3.22 +exec /init "$@"
     4.1 --- a/syslinux/stuff/iso2exe/iso2exe.sh	Mon Oct 17 10:20:42 2016 +0200
     4.2 +++ b/syslinux/stuff/iso2exe/iso2exe.sh	Mon Oct 17 15:31:24 2016 +0200
     4.3 @@ -185,7 +185,7 @@
     4.4  	custom.append)  OFFSET=$((2048*$c+47)) &&
     4.5  			SIZE=$(ddq bs=2k skip=$c if="$ISO" count=1 | \
     4.6  				sed '/^append=/!d;s/^[^=]*=.//' | wc -c);;
     4.7 -	custom.initrd)  i=$(ddq bs=2k skip=$c if="$ISO" count=1 | \
     4.8 +	custom.initrd)  x=$(ddq bs=2k skip=$c if="$ISO" count=1 | \
     4.9  				sed '/^append=\|^initrd:/!d' | wc -c)
    4.10  			OFFSET=$((2048*$c+$x+40))
    4.11  			SIZE=$(($(ddq bs=2k skip=$c if="$ISO" count=1 | \