Fixed handling of checksums in combination with the d-i installer.

1) lb config rejected multiple checksum types
2) When using the installer, cdrom-checker requires a md5 checksum file,
   use 'Check the integrity of the installation media' in the installer
3) The comments in the first lines of the checksum files caused
   cdrom-checker to fail the integrity of the image
This commit is contained in:
Roland Clobus 2021-03-21 12:32:54 +01:00
parent 9524705c34
commit 745b2be876
No known key found for this signature in database
GPG Key ID: 62C57C6AA61495BD
3 changed files with 35 additions and 27 deletions

View File

@ -352,6 +352,19 @@ Prepare_config ()
Echo_warning "A value of 'true' for option LB_DEBIAN_INSTALLER is deprecated, please use 'netinst' in future."
fi
# cdrom-checker in d-i requires a md5 checksum file
if [ "${LB_DEBIAN_INSTALLER}" != "none" ]
then
if [ "${LB_CHECKSUMS}" = "none" ]
then
LB_CHECKSUMS="md5"
else
if ! In_list md5 ${LB_CHECKSUMS}; then
LB_CHECKSUMS=${LB_CHECKSUMS}" md5"
fi
fi
fi
LB_DEBIAN_INSTALLER_DISTRIBUTION="${LB_DEBIAN_INSTALLER_DISTRIBUTION:-${LB_DISTRIBUTION}}"
LB_DEBIAN_INSTALLER_GUI="${LB_DEBIAN_INSTALLER_GUI:-true}"
@ -648,9 +661,14 @@ Validate_config_permitted_values ()
fi
done
if ! In_list "${LB_CHECKSUMS}" md5 sha1 sha224 sha256 sha384 sha512 none; then
Echo_error "You have specified an invalid value for LB_CHECKSUMS (--checksums)."
exit 1
local CHECKSUM
if [ "${LB_CHECKSUMS}" != "none" ]; then
for CHECKSUM in ${LB_CHECKSUMS}; do
if ! In_list "${CHECKSUM}" md5 sha1 sha224 sha256 sha384 sha512; then
Echo_error "You have specified an invalid value for LB_CHECKSUMS (--checksums): '%s'" "${CHECKSUM}"
exit 1
fi
done
fi
if ! In_list "${LB_CHROOT_FILESYSTEM}" ext2 ext3 ext4 squashfs jffs2 none; then

View File

@ -55,21 +55,16 @@ do
\! -path './boot/grub/stage2_eltorito' \
\! -path './*SUMS' \
\! -path './*sum.txt' \
-print0 | sort -z | xargs -0 ${CHECKSUM}sum > ../${CHECKSUMS}
\! -path './*sum.README' \
-print0 | sort -z | xargs -0 ${CHECKSUM}sum > ${CHECKSUMS}
cat > ${CHECKSUMS} << EOF
## This file contains the list of ${CHECKSUM} checksums of all files on this
## medium.
##
## You can verify them automatically with the 'verify-checksums' boot parameter,
## or, manually with: '${CHECKSUM}sum -c ${CHECKSUMS}'.
##
##
cat > ${CHECKSUM}sum.README << EOF
The file ${CHECKSUMS} contains the ${CHECKSUM} checksums of all files on this medium.
You can verify them automatically with the 'verify-checksums' boot parameter,
or, manually with: '${CHECKSUM}sum -c ${CHECKSUMS}'.
EOF
cat ../${CHECKSUMS} >> ${CHECKSUMS}
rm -f ../${CHECKSUMS}
cd "${OLDPWD}"
done

View File

@ -59,21 +59,16 @@ do
find . -type f \
\! -path './*SUMS' \
\! -path './*sum.txt' \
-print0 | sort -z | xargs -0 ${CHECKSUM}sum > ../${CHECKSUMS}
\! -path './*sum.README' \
-print0 | sort -z | xargs -0 ${CHECKSUM}sum > ${CHECKSUMS}
cat > ${CHECKSUMS} << EOF
## This file contains the list of ${CHECKSUM} checksums of all files on this
## medium.
##
## You can verify them automatically with the 'verify-checksums' boot parameter,
## or, manually with: '${CHECKSUM}sum -c ${CHECKSUMS}'.
##
##
cat > ${CHECKSUM}sum.README << EOF
The file ${CHECKSUMS} contains the ${CHECKSUM} checksums of all files on this medium.
You can verify them automatically with the 'verify-checksums' boot parameter,
or, manually with: '${CHECKSUM}sum -c ${CHECKSUMS}'.
EOF
cat ../${CHECKSUMS} >> ${CHECKSUMS}
rm -f ../${CHECKSUMS}
cd "${OLDPWD}"
done