| #!/bin/bash |
| |
| [ $# != 2 ] && echo missing parameters && exit 1 |
| |
| out=tmp/cd |
| grubcfg=$out/boot/grub/grub.cfg |
| |
| mkdir $out |
| bsdtar -C $out -xf $1 |
| |
| if [ -d $out/install.a64 ]; then |
| # Debian |
| kpath=/install.a64 |
| kname=vmlinuz |
| elif [ -d $out/install ] ; then |
| # Ubuntu (new) |
| kpath=/install |
| kname=vmlinuz |
| else |
| # Ubuntu |
| kpath="" |
| kname=linux |
| fi |
| |
| cp preseed.cfg $out/ |
| chmod u+w $grubcfg |
| cat <<EOF >>$grubcfg |
| menuentry 'Install preseeded' --id preseed { |
| set background_color=black |
| linux $kpath/$kname auto=true priority=critical file=/cdrom/preseed.cfg --- quiet |
| initrd $kpath/initrd.gz |
| } |
| |
| default=preseed |
| timeout=5 |
| EOF |
| |
| xorriso -as mkisofs -V 'Debian stretch-DI-seed arm64 1' \ |
| -r -o $2 -J -joliet-long -cache-inodes \ |
| -efi-boot-part --efi-boot-image \ |
| -e boot/grub/efi.img -no-emul-boot $out |
| |
| chmod -R a+rw $out |
| rm -rf $out |