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
+ 10
8
Compare changes
  • Side-by-side
  • Inline
+ 10
8
@@ -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}"
@@ -187,7 +188,8 @@ archiso_mount_handler() {
airootfs="${airootfs_dir}/airootfs.sfs"
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
@@ -242,10 +244,10 @@ archiso_mount_handler() {
chmod 0700 "/run/archiso/cowspace/${cow_directory}"
# shellcheck disable=SC2154
if [ -f "${airootfs}" ]; then
fs_img="${airootfs}"
if [ -f "${airootfs}" ]; then
fs_img="${airootfs}"
elif [ -f "${root}" ]; then
fs_img="${root}"
fs_img="${root}"
else
echo "ERROR: no root file system image found"
launch_interactive_shell
Loading