From: Plom Heller Date: Mon, 7 Sep 2026 03:18:53 +0000 (+0200) Subject: Minor code-style improvements. X-Git-Url: https://plomlompom.com/repos/foo.html?a=commitdiff_plain;h=39c9445956770791fcc61bc193cb14a050fa7587;p=confplom Minor code-style improvements. --- diff --git a/setup_scripts/chrooted_command.sh b/setup_scripts/chrooted_command.sh index 9c1f74f..26a987a 100755 --- a/setup_scripts/chrooted_command.sh +++ b/setup_scripts/chrooted_command.sh @@ -22,11 +22,11 @@ mount_privately "${PATH_VG_ROOT}" "${PATH_MNT_ROOT}" rbind_mnt # enact command -RC=0 -chroot_sh "${COMMAND}" || RC=$? +RETURN_CODE=0 +chroot_sh "${COMMAND}" || RETURN_CODE=$? # clean up mounts unmount_unrbind close_luksvg -msg 'Finished! (command exit status: %s)' "${RC}" -exit "${RC}" +msg 'Finished! (command exit status: %s)' "${RETURN_CODe}" +exit "${RETURN_CODE}" diff --git a/setup_scripts/install_debian.sh b/setup_scripts/install_debian.sh index 5ef5ed9..6c9a05f 100755 --- a/setup_scripts/install_debian.sh +++ b/setup_scripts/install_debian.sh @@ -51,7 +51,6 @@ efibootmgr \ | grep -Fxq "${NAME_BOOT}"\ && error "an EFI boot entry named '${NAME_BOOT}' already exists" -# run inputs by user and ask for confirmation msg 'Your installation choices:' msg '- target partition: [ %s ]' "${PARTITION}" msg '- name for new boot option: [ %s ]' "${NAME_BOOT}" @@ -69,30 +68,25 @@ msg 'Installing Debian Suite "%s" there via debootstrap …' "${DEB_SUITE}" debootstrap "${DEB_SUITE}" "${PATH_MNT_ROOT}" rbind_mnt -# set up minimal fstab -msg 'Writing fstab …' +msg 'Setting up fstab …' cat <| "${PATH_MNT_FSTAB}" ${PATH_VG_ROOT} / ext4 errors=remount-ro 0 1 ${PATH_VG_DATA} /${NAME_DATA} ext4 errors=remount-ro 0 2 ${PATH_VG_SWAP} none swap sw 0 0 EOF -# set up crypttab -msg 'Writing crypttab …' +msg 'Setting up crypttab …' printf '%s UUID=%s none luks\n' \ "${NAME_LUKSVG}" "$(cryptsetup luksUUID "${PARTITION}")" \ >| "${PATH_MNT_CRYPTTAB}" -# enable non-free-firmware component for firmware-iwlwifi below (as debootstrap -# only enables "main" by default) +# for firmware-iwlwifi below (as debootstrap only enables "main" by default) msg 'Enabling non-free-firmware component in target sources.list …' sed -i 's/ main$/ main non-free-firmware/' "${PATH_MNT_APT_SOURCES}" -# reduce installation footprint msg 'Disabling automatic installation of APT recommends …' printf 'APT::Install-Recommends "false";\n' >| "${PATH_MNT_APT_NORECOMMENDS}" -# set up kernel, initrd etc. msg 'Into chroot environment installing LVM tools, kernel, initrd etc. …' chroot_sh "apt-get -qq update" chroot_sh \ @@ -136,7 +130,6 @@ method=auto EOF chmod 600 "${PATH_MNT_NM_CONN}" -# install kernel and initrd into EFI tree/vars msg 'EFI setup: copying kernel and initrd into %s …' "${PATH_EFI_NAME_BOOT}" mkdir "${PATH_EFI_NAME_BOOT}" for FILENAME in "${FNAME_INITRD}" "${FNAME_VMLINUZ}"; do @@ -156,7 +149,7 @@ efibootmgr \ msg 'Setting up root login …' chroot_sh "passwd" -# clean up mounts +# clean up unmount_unrbind close_luksvg msg 'Finished!' diff --git a/setup_scripts/setup_luksvg.sh b/setup_scripts/setup_luksvg.sh index 3cbc508..8127571 100755 --- a/setup_scripts/setup_luksvg.sh +++ b/setup_scripts/setup_luksvg.sh @@ -25,8 +25,7 @@ msg_nonl 'To continue, type "YES!" (all caps, exclamation mark, no quotes): ' read -r CONFIRM; [ "${CONFIRM}" = 'YES!' ]\ || die 'ABORTED: expected confirmation not given.' -# encrypt partition -msg 'Formatting %s as LUKS container …' "${PARTITION}" +msg 'Encrypting %s as LUKS container …' "${PARTITION}" cryptsetup luksFormat --batch-mode "${PARTITION}" open_luksvg "${PARTITION}" diff --git a/setup_scripts/start_root.sh b/setup_scripts/start_root.sh index 75d529f..2e13e68 100755 --- a/setup_scripts/start_root.sh +++ b/setup_scripts/start_root.sh @@ -19,8 +19,6 @@ TLP_THRESH_STOP=80 # constants derived from changeables PATH_TO_COPY="${PATH_REPO}/to_copy" -augment_profile - msg 'Ensuring packages: %s' "${TO_INSTALL}" apt-get -y update apt-get -y install ${TO_INSTALL} @@ -53,3 +51,5 @@ usermod -a -G sudo,video "${USERNAME}" msg 'Synchronizing clock …' ntpdate-debian + +augment_profile diff --git a/setup_scripts/start_user.sh b/setup_scripts/start_user.sh index be0e919..ccb3f54 100755 --- a/setup_scripts/start_user.sh +++ b/setup_scripts/start_user.sh @@ -5,7 +5,6 @@ PATH_SKEL_USER="${PATH_REPO}/home_user" augment_profile - msg 'Linking %s files into home directory …' "${PATH_SKEL_USER}" find "${PATH_SKEL_USER}" -mindepth 1 -maxdepth 1\ -exec ln -v -s {} "${HOME}/" \;