prepend out-dir for building image
This commit is contained in:
parent
2ef8e21847
commit
b549e1059d
1 changed files with 9 additions and 7 deletions
|
@ -4,19 +4,21 @@
|
||||||
|
|
||||||
#this can only run in the ungleich-tools directory because of the cat magiccommand........
|
#this can only run in the ungleich-tools directory because of the cat magiccommand........
|
||||||
|
|
||||||
if [ $# -ne 1 ]; then
|
if [ $# -ne 2 ]; then
|
||||||
echo $0 suite # rootpw
|
echo $0 suite out-directory
|
||||||
|
echo out-directory: into which directory to place resulting files
|
||||||
echo suite is for instance ascii, beowulf, etc
|
echo suite is for instance ascii, beowulf, etc
|
||||||
# echo rootpw: set root password
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
#pw=$2
|
|
||||||
suite=$1; shift
|
suite=$1; shift
|
||||||
|
outdir=$1; shift
|
||||||
|
|
||||||
date=$(date +%F)
|
date=$(date +%F)
|
||||||
|
|
||||||
dir=${suite}-${date}
|
dir=${outdir}/${suite}-${date}
|
||||||
kernel=${dir}-kernel
|
kernel=${dir}-kernel
|
||||||
|
initramfs=${dir}-initramfs
|
||||||
keyurl=https://code.ungleich.ch/ungleich-public/__ungleich_staff_ssh_access/raw/master/files
|
keyurl=https://code.ungleich.ch/ungleich-public/__ungleich_staff_ssh_access/raw/master/files
|
||||||
|
|
||||||
debootstrap "${suite}" "${dir}"
|
debootstrap "${suite}" "${dir}"
|
||||||
|
@ -33,7 +35,7 @@ EOF
|
||||||
|
|
||||||
cp ${dir}/boot/vmlinuz-* ${kernel}
|
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
|
mkdir -p ${dir}/root/.ssh
|
||||||
|
|
||||||
|
@ -46,4 +48,4 @@ done
|
||||||
# in our case, they are just the same
|
# in our case, they are just the same
|
||||||
ln -s /sbin/init ${dir}/init
|
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} )
|
||||||
|
|
Loading…
Reference in a new issue