Martin Roth | 9b1b335 | 2016-02-24 12:27:06 -0800 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | # check to see if the correct tools are installed |
| 4 | for X in wc genisoimage |
| 5 | do |
| 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 |
| 12 | fi |
| 13 | done |
| 14 | |
| 15 | #check to see if memtest.bin is present |
| 16 | if [ ! -w memtest.bin ]; then |
| 17 | echo "makeiso.sh error: cannot find memtest.bin, did you compile it?" >&2 |
| 18 | exit 1 |
| 19 | fi |
| 20 | |
| 21 | |
| 22 | # enlarge the size of memtest.bin |
| 23 | SIZE=$(wc -c memtest.bin | awk '{print $1}') |
| 24 | FILL=$((1474560 - $SIZE)) |
| 25 | dd if=/dev/zero of=fill.tmp bs=$FILL count=1 |
| 26 | cat memtest.bin fill.tmp > memtest.img |
| 27 | rm -f fill.tmp |
| 28 | |
| 29 | echo "Generating iso image ..." |
| 30 | |
| 31 | mkdir "cd" |
| 32 | mkdir "cd/boot" |
| 33 | mv memtest.img cd/boot |
| 34 | cd cd |
| 35 | |
| 36 | # Create the cd.README |
| 37 | echo -e "There is nothing to do here\r\r\nMemtest86+ is located on the bootsector of this CD\r\r\n" > README.TXT |
| 38 | echo -e "Just boot from this CD and Memtest86+ will launch" >> README.TXT |
| 39 | |
| 40 | genisoimage -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 . |
| 41 | mv memtest.iso ../mt501.iso |
| 42 | cd .. |
| 43 | rm -rf cd |
| 44 | |
| 45 | echo "Done! Memtest86+ 5.01 ISO is mt501.iso" |