Skip to content
Snippets Groups Projects

Make compatible with cryptsetup's encrypt hook

Closed Tallero Tallero requested to merge tallero/mkinitcpio-archiso:crypto into master
2 unresolved threads
Compare and Show latest version
1 file
+ 7
6
Compare changes
  • Side-by-side
  • Inline
+ 7
6
@@ -168,17 +168,18 @@ run_hook() {
archiso_mount_handler() {
local newroot="${1}"
local airootfs sigfile fs_img
local bootmnt="/run/archiso/bootmnt"
local bootmnt_opts="-r defaults"
local bootmnt_opts="defaults"
local bootmnt_flg="-r"
bootmnt="/run/archiso/bootmnt"
# shellcheck disable=SC2154
if [ -f "${root}" ]; then
bootmnt="/run/cryptdev"
bootmnt_opts="-r bind"
bootmnt_flg="bind"
fi
if ! mountpoint -q "${bootmnt}"; then
_mnt_dev "${archisodevice}" "${bootmnt}" "${bootmnt_opts}"
_mnt_dev "${archisodevice}" "${bootmnt}" "${bootmnt_flg}" "${bootmnt_opts}"
fi
local airootfs_dir="${bootmnt}/${archisobasedir}/${arch}"
@@ -188,7 +189,7 @@ archiso_mount_handler() {
elif [ -f "${airootfs_dir}/airootfs.erofs" ]; then
airootfs="${airootfs_dir}/airootfs.erofs"
fi
# shellcheck disable=SC2154
# defined via initcpio's parse_cmdline()
if [ "${checksum}" = "y" ]; then
@@ -243,7 +244,7 @@ archiso_mount_handler() {
chmod 0700 "/run/archiso/cowspace/${cow_directory}"
# shellcheck disable=SC2154
if [ -f "${airootfs}" ]; then
if [ -f "${airootfs}" ]; then
fs_img="${airootfs}"
elif [ -f "${root}" ]; then
fs_img="${root}"
Loading