From 745b2be876b50b5033c7d2514facb5b71799c9ae Mon Sep 17 00:00:00 2001 From: Roland Clobus Date: Sun, 21 Mar 2021 12:32:54 +0100 Subject: 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 --- functions/configuration.sh | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'functions') diff --git a/functions/configuration.sh b/functions/configuration.sh index fac1d0958..c7d2dfc0f 100755 --- a/functions/configuration.sh +++ b/functions/configuration.sh @@ -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 -- cgit v1.2.3