From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 2DCC0138350 for ; Thu, 13 Feb 2020 16:40:59 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4FAC3E08D4; Thu, 13 Feb 2020 16:40:58 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 27DCCE08D4 for ; Thu, 13 Feb 2020 16:40:58 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id D2E1234ED77 for ; Thu, 13 Feb 2020 16:40:55 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 483BC132 for ; Thu, 13 Feb 2020 16:40:53 +0000 (UTC) From: "Rick Farina" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Rick Farina" Message-ID: <1581612048.dc295a5569353ef7a4f42a9b4796fd36f9520e68.zerochaos@gentoo> Subject: [gentoo-commits] proj/catalyst:master commit in: examples/, targets/support/ X-VCS-Repository: proj/catalyst X-VCS-Files: examples/livecd-stage2_template.spec targets/support/create-iso.sh X-VCS-Directories: targets/support/ examples/ X-VCS-Committer: zerochaos X-VCS-Committer-Name: Rick Farina X-VCS-Revision: dc295a5569353ef7a4f42a9b4796fd36f9520e68 X-VCS-Branch: master Date: Thu, 13 Feb 2020 16:40:53 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: df5ce4c8-0eee-4483-823b-caacb209ee89 X-Archives-Hash: 1e9e094ffaf47b4ce13fae8292408eb4 commit: dc295a5569353ef7a4f42a9b4796fd36f9520e68 Author: Rick Farina (Zero_Chaos) gentoo org> AuthorDate: Thu Feb 13 16:40:08 2020 +0000 Commit: Rick Farina gentoo org> CommitDate: Thu Feb 13 16:40:48 2020 +0000 URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=dc295a55 update livecd/verify to control digest type plus document it right Signed-off-by: Rick Farina (Zero_Chaos) gentoo.org> examples/livecd-stage2_template.spec | 7 ++++--- targets/support/create-iso.sh | 22 +++++++++++++++++----- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/examples/livecd-stage2_template.spec b/examples/livecd-stage2_template.spec index cc5cf00e..7dd64c3f 100644 --- a/examples/livecd-stage2_template.spec +++ b/examples/livecd-stage2_template.spec @@ -331,10 +331,11 @@ boot/kernel/gentoo/machine_type: # boot/kernel/gentoo/console: tty0 ttyS0 boot/kernel/gentoo/console: -# This feature will make sha512 checksums for every file in the iso (including files provided by livecd/overlay +# This feature will make sha512, blake2, or both checksums for every file in the iso (including files provided by livecd/overlay # These checksums can be verified at boot using the genkernel option "verify" added to the kernel line. -# Currently this feature will be enabled if livecd/verify is defined to *any* value, leave commented to disable. -#livecd/verify: true +# Currently this feature will generate both checksums if livecd/verify is defined to *any* value other than "blake2" or "sha512" +# No checksums are generated if this is left commented. +#livecd/verify: sha512 # This feature controls the depclean run after fsscript and before unmerge. # The default is unset, and will run emerge --depclean --with-bdeps=n which results diff --git a/targets/support/create-iso.sh b/targets/support/create-iso.sh index 92efaa8b..ed581763 100755 --- a/targets/support/create-iso.sh +++ b/targets/support/create-iso.sh @@ -98,14 +98,26 @@ fi #from genkernel during boot. Here we make a function to create the sha512sums, and blake2sums isoroot_checksum() { echo "Creating checksums for all files included in the iso, please wait..." - find "${clst_target_path}" -type f ! -name 'isoroot_checksums' ! -name 'isolinux.bin' ! -name 'isoroot_b2sums' -exec sha512sum {} + > "${clst_target_path}"/isoroot_checksums - ${clst_sed} -i "s#${clst_target_path}/\?##" "${clst_target_path}"/isoroot_checksums - find "${clst_target_path}" -type f ! -name 'isoroot_checksums' ! -name 'isolinux.bin' ! -name 'isoroot_b2sums' -exec b2sum {} + > "${clst_target_path}"/isoroot_b2sums - ${clst_sed} -i "s#${clst_target_path}/\?##" "${clst_target_path}"/isoroot_b2sums + if [ -z "${1}" ] || [ "${1}" = "sha512" ]; then + find "${clst_target_path}" -type f ! -name 'isoroot_checksums' ! -name 'isolinux.bin' ! -name 'isoroot_b2sums' -exec sha512sum {} + > "${clst_target_path}"/isoroot_checksums + ${clst_sed} -i "s#${clst_target_path}/\?##" "${clst_target_path}"/isoroot_checksums + fi + if [ -z "${1}" ] || [ "${1}" = "blake2" ]; then + find "${clst_target_path}" -type f ! -name 'isoroot_checksums' ! -name 'isolinux.bin' ! -name 'isoroot_b2sums' -exec b2sum {} + > "${clst_target_path}"/isoroot_b2sums + ${clst_sed} -i "s#${clst_target_path}/\?##" "${clst_target_path}"/isoroot_b2sums + fi } run_mkisofs() { - [ -n "${clst_livecd_verify}" ] && isoroot_checksum + if [ -n "${clst_livecd_verify}" ]; then + if [ "${clst_livecd_verify}" = "sha512" ]; then + isoroot_checksum sha512 + elif [ "${clst_livecd_verify}" = "blake2" ]; then + isoroot_checksum blake2 + else + isoroot_checksum + fi + fi echo "Running \"mkisofs ${@}\"" mkisofs "${@}" || die "Cannot make ISO image" }