From b549e1059dc7dfe0c88cf213c1d85e11426de3dd Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 14 Dec 2019 16:57:25 +0100 Subject: [PATCH] prepend out-dir for building image --- debian-devuan-netboot.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/debian-devuan-netboot.sh b/debian-devuan-netboot.sh index 8eb9817..fdc43f4 100755 --- a/debian-devuan-netboot.sh +++ b/debian-devuan-netboot.sh @@ -4,19 +4,21 @@ #this can only run in the ungleich-tools directory because of the cat magiccommand........ -if [ $# -ne 1 ]; then - echo $0 suite # rootpw +if [ $# -ne 2 ]; then + echo $0 suite out-directory + echo out-directory: into which directory to place resulting files echo suite is for instance ascii, beowulf, etc -# echo rootpw: set root password exit 1 fi -#pw=$2 + suite=$1; shift +outdir=$1; shift date=$(date +%F) -dir=${suite}-${date} +dir=${outdir}/${suite}-${date} kernel=${dir}-kernel +initramfs=${dir}-initramfs keyurl=https://code.ungleich.ch/ungleich-public/__ungleich_staff_ssh_access/raw/master/files debootstrap "${suite}" "${dir}" @@ -33,7 +35,7 @@ EOF cp ${dir}/boot/vmlinuz-* ${kernel} -echo '* * * * * root ip -o -6 addr show | grep -E -v "lo|one" > /etc/issue' > ${dir}/etc/cron.d/ipv6addr +echo '* * * * * root ip -o -6 addr show | grep -E -v 'lo |one' > /etc/issue' > ${dir}/etc/cron.d/ipv6addr mkdir -p ${dir}/root/.ssh @@ -46,4 +48,4 @@ done # in our case, they are just the same ln -s /sbin/init ${dir}/init -( cd ${dir} ; find . | cpio -H newc -o | gzip -9 > ../${dir}-initramfs ) +( cd ${dir} ; find . | cpio -H newc -o | gzip -9 > ${initramfs} )