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
+ 15
11
Compare changes
  • Side-by-side
  • Inline
+ 15
11
@@ -134,6 +134,17 @@ _verify_signature() {
return ${_status}
}
_archisodevice() {
# shellcheck disable=SC2154
if [ -e "${root}" ]; then
archisodevice="/run/cryptdev"
bootmnt_opts="bind"
else
archisodevice="/dev/disk/by-label/${archisolabel}"
bootmnt_opts="defaults"
fi
}
run_hook() {
[ -z "${arch}" ] && arch="$(uname -m)"
[ -z "${copytoram_size}" ] && copytoram_size="75%"
@@ -141,7 +152,7 @@ run_hook() {
[ -z "${dm_snap_prefix}" ] && dm_snap_prefix="arch"
# shellcheck disable=SC2154
# defined via initcpio's parse_cmdline()
[ -z "${archisodevice}" ] && archisodevice="/dev/disk/by-label/${archisolabel}"
[ -z "${archisodevice}" ] && _archisodevice
[ -z "${cow_spacesize}" ] && cow_spacesize="256M"
# shellcheck disable=SC2154
# defined via initcpio's parse_cmdline()
@@ -168,17 +179,10 @@ run_hook() {
archiso_mount_handler() {
local newroot="${1}"
local airootfs sigfile fs_img
local bootmnt="/run/archiso/bootmnt"
local bootmnt_opts="-r defaults"
# shellcheck disable=SC2154
if [ -f "${root}" ]; then
bootmnt="/run/cryptdev"
bootmnt_opts="-r bind"
fi
bootmnt="/run/archiso/bootmnt"
if ! mountpoint -q "${bootmnt}"; then
_mnt_dev "${archisodevice}" "${bootmnt}" "${bootmnt_opts}"
_mnt_dev "${archisodevice}" "${bootmnt}" "-r" "${bootmnt_opts}"
fi
local airootfs_dir="${bootmnt}/${archisobasedir}/${arch}"
@@ -243,7 +247,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