autoinst

scripts to make installation of custom debian easier and more automated
git clone git://deadbeef.fr/autoinst.git
Log | Files | Refs | README | LICENSE

commit 7c6285542dd96c0d7ed09600b29029af108190e7
parent c672138c9be075be3973a101b03a8167325b7cf3
Author: Morel BĂ©renger <berenger.morel@neutralite.org>
Date:   Thu, 14 Nov 2019 13:20:53 +0100

generate a bootable ISO from a debian system

Diffstat:
Aetc/fstab | 2++
Aetc/hostname | 1+
Aetc/mtab | 2++
Aetc/runit/2 | 31+++++++++++++++++++++++++++++++
Amkiso.sh | 37+++++++++++++++++++++++++++++++++++++
Asyslinux/ldlinux.c32 | 0
Asyslinux/libcom32.c32 | 0
Asyslinux/libutil.c32 | 0
Asyslinux/syslinux.cfg | 13+++++++++++++
Asyslinux/vesamenu.c32 | 0
10 files changed, 86 insertions(+), 0 deletions(-)

diff --git a/etc/fstab b/etc/fstab @@ -0,0 +1,2 @@ +tmpfs /tmp tmpfs nosuid,nodev,size=64M 0 0 +tmpfs /var tmpfs nosuid,nodev,size=64M 0 0 diff --git a/etc/hostname b/etc/hostname @@ -0,0 +1 @@ +foobar diff --git a/etc/mtab b/etc/mtab @@ -0,0 +1 @@ +/proc/mounts+ \ No newline at end of file diff --git a/etc/runit/2 b/etc/runit/2 @@ -0,0 +1,31 @@ +#!/bin/sh + +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:/bin:/usr/bin +SVDIR=/var/lib/runit/service + +mkdir -p /var/log $SVDIR +find /etc/service/ -type l -execdir cp -r -L -t $SVDIR {} \+ + +# This script is also invoked in runit-systemd and runit-sysv packages. +# We must start sulogin and sysv scripts only if `runit' is current init +# system. +if [ -f /run/runit.stopit ] ; then + # single mode + if grep -q -w -i 'single' /proc/cmdline ; then + chpst -P /sbin/sulogin -p /dev/tty1 + fi + + + # Give sysv scripts 90 seconds (hardcoded in async-timeout source) to + # start. If something goes wrong, they are detached from controlling + # terminal. + # + # In this case tty1 would likely look ugly -- output from sysv scripts + # is written over terminal session, but at least we would be able to + # login. + + /lib/runit/async-timeout /lib/runit/run_sysv_scripts '/etc/rc2.d' +fi + +exec env - PATH=$PATH \ +runsvdir -P "${SVDIR}" 'log: ...........................................................................................................................................................................................................................................................................................................................................................................................................' diff --git a/mkiso.sh b/mkiso.sh @@ -0,0 +1,37 @@ +#!/bin/sh + +rm -r iso_dir/* +PKG_LIST="${PKG_LIST}isolinux,syslinux-common,syslinux,syslinux-efi," +PKG_LIST="${PKG_LIST}busybox," +PKG_LIST="${PKG_LIST}linux-image-amd64," +PKG_LIST="${PKG_LIST}runit-init," +PKG_LIST="${PKG_LIST}udhcpc," +PKG_LIST="${PKG_LIST}lynx," +PKG_LIST="${PKG_LIST}dialog," +PKG_LIST="${PKG_LIST}kbd,console-data," +PKG_LIST="${PKG_LIST}ntpdate," +PKG_LIST="${PKG_LIST}dropbear-bin" + +debootstrap --no-merged-usr --variant=minbase "--include=$PKG_LIST" buster iso_dir + +cp -ar syslinux iso_dir +cp -ar etc/* iso_dir/etc + +chpasswd -R $(pwd)/iso_dir <<EOF +root:toor +EOF + +rm -r iso_dir/var/* + +xorriso -as mkisofs \ + -r -V 'CUSTOM_ISO_AMD64' \ + -o custom.iso \ + -J -joliet-long \ + -isohybrid-gpt-basdat \ + -isohybrid-mbr iso_dir/usr/lib/ISOLINUX/isohdpfx.bin \ + -boot-load-size 4 -boot-info-table -eltorito-alt-boot -b usr/lib/ISOLINUX/isolinux.bin \ + -no-emul-boot \ + iso_dir \ + 2>&1 | grep -vi 'WARNING.*Symlinks' + #-e boot/grub/efi.img \ + #-c isolinux/boot.cat \ diff --git a/syslinux/ldlinux.c32 b/syslinux/ldlinux.c32 Binary files differ. diff --git a/syslinux/libcom32.c32 b/syslinux/libcom32.c32 Binary files differ. diff --git a/syslinux/libutil.c32 b/syslinux/libutil.c32 Binary files differ. diff --git a/syslinux/syslinux.cfg b/syslinux/syslinux.cfg @@ -0,0 +1,13 @@ +prompt 0 +timeout 50 +default live + +ui vesamenu.c32 +menu title custom live boot + +label live + linux ../boot/vmlinuz-4.19.0-6-amd64 + initrd ../boot/initrd.img-4.19.0-6-amd64 + append ro root=/dev/sr0 + + diff --git a/syslinux/vesamenu.c32 b/syslinux/vesamenu.c32 Binary files differ.