diff --git a/.gitignore b/.gitignore index 363e4b21..2fe92828 100644 --- a/.gitignore +++ b/.gitignore @@ -45,3 +45,4 @@ local.conf build linux-* initramfs/response/wrapper.* +initramfs/response/*.hash diff --git a/initramfs/bootscript b/initramfs/bootscript index fac11d33..f15a29f6 100755 --- a/initramfs/bootscript +++ b/initramfs/bootscript @@ -182,10 +182,9 @@ install_img() { curl "$URL" | tee "$MAPPER" | sha256sum - | tee "$TMPDIR/url.hash" \ || die "$DEV: unable to fetch $URL" - if [ -n "$URL_HASH" ]; then - echo "$URL_HASH -" > "$TMPDIR/url.hash.golden" - if ! cmp "$TMPDIR/url.hash" "$TMPDIR/url.hash.golden" ; then - die "$URL: hash failed. Expected $URL_HASH" + if [ -r "$TMPDIR/img.hash" ]; then + if ! cmp "$TMPDIR/img.hash" "$TMPDIR/url.hash" ; then + die "$URL: hash failed!" fi warn "$URL: verified $URL_HASH" diff --git a/initramfs/response/startup.sh b/initramfs/response/startup.sh index 016660e6..c2e9d103 100755 --- a/initramfs/response/startup.sh +++ b/initramfs/response/startup.sh @@ -2,5 +2,4 @@ echo "hello world!" DEV="/dev/sda" -URL="http://10.0.2.2:8000/focal-server-cloudimg-amd64.img" -URL_HASH="b723a8fa028d6ab80242239c52c0ef7d11d9dc534b491094fbc44e8d908a76ee" +URL="http://10.0.2.2:8080/focal-server-cloudimg-amd64.img"