blob: ea5ce65e4cfb2554a2f7b7a7fde57b06bb778cac [file] [log] [blame]
Martin Roth9b1b3352016-02-24 12:27:06 -08001#!/bin/sh
2
3# check to see if the correct tools are installed
4for X in wc genisoimage
5do
6 if [ "$(which $X)" = "" ]; then
7 echo "makeiso.sh error: $X is not in your path." >&2
8 exit 1
9 elif [ ! -x $(which $X) ]; then
10 echo "makeiso.sh error: $X is not executable." >&2
11 exit 1
Martin Roth4dcd13d2016-02-24 13:53:07 -080012 fi
Martin Roth9b1b3352016-02-24 12:27:06 -080013done
14
15#check to see if memtest.bin is present
Martin Roth4dcd13d2016-02-24 13:53:07 -080016if [ ! -w memtest.bin ]; then
17 echo "makeiso.sh error: cannot find memtest.bin, did you compile it?" >&2
Martin Roth9b1b3352016-02-24 12:27:06 -080018 exit 1
19fi
20
21
22# enlarge the size of memtest.bin
23SIZE=$(wc -c memtest.bin | awk '{print $1}')
24FILL=$((1474560 - $SIZE))
25dd if=/dev/zero of=fill.tmp bs=$FILL count=1
26cat memtest.bin fill.tmp > memtest.img
27rm -f fill.tmp
28
29echo "Generating iso image ..."
30
31mkdir "cd"
32mkdir "cd/boot"
33mv memtest.img cd/boot
34cd cd
35
36# Create the cd.README
37echo -e "There is nothing to do here\r\r\nMemtest86+ is located on the bootsector of this CD\r\r\n" > README.TXT
38echo -e "Just boot from this CD and Memtest86+ will launch" >> README.TXT
39
40genisoimage -A "MKISOFS 1.1.2" -p "Memtest86+ 5.01" -publisher "Samuel D. <sdemeule@memtest.org>" -b boot/memtest.img -c boot/boot.catalog -V "MT501" -o memtest.iso .
41mv memtest.iso ../mt501.iso
42cd ..
43rm -rf cd
44
45echo "Done! Memtest86+ 5.01 ISO is mt501.iso"