working scripts

This commit is contained in:
Bryan Joshua Pedini 2022-08-15 02:31:03 +02:00
parent 7efb365b14
commit a884f563f6
3 changed files with 31 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*.iso
preseed.cfg

8
docker.sh Executable file
View File

@ -0,0 +1,8 @@
#!/usr/bin/env bash
apt-get update
apt-get install -y xorriso genisoimage
cd /root/unattended
genisoimage -r -J -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o $(ls | grep "netinst.iso" | sed 's/netinst/unattended/') isofiles
chown 1000:1000 $(ls | grep "netinst.iso" | sed 's/netinst/unattended/')

21
unattended.sh Executable file
View File

@ -0,0 +1,21 @@
#!/usr/bin/env bash
xorriso -osirrox on -indev debian-11.3.0-amd64-netinst.iso -extract / isofiles
sudo sed -i '/vesamenu.c32/d' isofiles/isolinux/isolinux.cfg
if [[ $(grep timeout_style isofiles/boot/grub/grub.cfg) == "" ]]; then sudo sed -i 's/insmod play/set timeout_style=hidden\nset timeout=0\nset default=1\n\ninsmod play/' isofiles/boot/grub/grub.cfg; fi
chmod +w -R isofiles/install.amd/
gunzip isofiles/install.amd/initrd.gz
echo preseed.cfg | cpio -H newc -o -A -F isofiles/install.amd/initrd
gzip isofiles/install.amd/initrd
chmod -w -R isofiles/install.amd/
cd isofiles/
chmod a+w md5sum.txt
md5sum $(find -follow -type f) > md5sum.txt
chmod a-w md5sum.txt
cd ..
chmod a+w isofiles/isolinux/isolinux.bin
docker run --interactive --tty --rm --volume $(pwd):/root/unattended debian:buster /root/unattended/docker.sh
sudo rm -rf isofiles