From 080922ac3977148fb9b5e24ea520ec19e5174d2b Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 1 Dec 2019 00:38:13 +0100 Subject: [PATCH] [alpine] update for stuff --- alpine-rebuild-initramfs.sh | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/alpine-rebuild-initramfs.sh b/alpine-rebuild-initramfs.sh index 6539367..d9dfab9 100755 --- a/alpine-rebuild-initramfs.sh +++ b/alpine-rebuild-initramfs.sh @@ -29,27 +29,28 @@ curl "$rootfs_url" -o "$working_directory/$IMAGE" tar xf $IMAGE -C $rootfs_tmpdir # Add SSH keys -run_root mkdir root/.ssh +run_root mkdir -p root/.ssh echo $SSH_KEYS > $rootfs_tmpdir/root/.ssh/authorized_keys run_root chmod 0600 root/.ssh/authorized_keys run_root chmod 0700 root/.ssh # Import local resolv.conf. -cat $RESOLVCONF > $rootfs_tmpdir/etc/resolv.conf +cat "$RESOLVCONF" > $rootfs_tmpdir/etc/resolv.conf # Make sure init is found by the kernel. run_root ln -s /sbin/init /init -cat > $rootfs_tmpdir/etc/network/interfaces < "$rootfs_tmpdir/etc/network/interfaces" <> /etc/issue EOF -cat > $rootfs_tmpdir/etc/hostname < "$rootfs_tmpdir/etc/hostname" < "$working_directory/alpine-initramfs.gz") -cp $rootfs_tmpdir/boot/vmlinuz-vanilla "$working_directory/alpine-kernel" - -# Upload to netboot server. -scp alpine-initramfs.gz alpine-kernel root@netboot.hack4glarus.ungleich.cloud:/var/www/html/ +cp "$rootfs_tmpdir/boot/vmlinuz-vanilla" "$working_directory/alpine-kernel" # Cleanup. -rm -r $rootfs_tmpdir -(cd "$working_directory/"; rm vmlinuz-vanilla alpine-kernel $IMAGE) +rm -r "$rootfs_tmpdir" + +# Upload to netboot server. - needs to be done outside sudo +echo "Use alpine-initramfs.gz alpine-kernel from $working_directory"!