Skip to content

Commit

Permalink
Cleanned up setup-disk patch
Browse files Browse the repository at this point in the history
  • Loading branch information
UrsaDK committed Aug 30, 2023
1 parent 8c7239d commit 434b1a8
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions apkovl/root/setup-disk.patch
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
mkfs.$ROOTFS $MKFS_OPTS_ROOT $mkfs_args "$root_dev"
mkdir -p "$SYSROOT"
mount -t $ROOTFS $root_dev "$SYSROOT" || return 1
+ # if [ -n "${USE_CRYPT}" ]; then
+ # cryptsetup luksAddKey --key-file "${CRYPT_KEYFILE}" "${root_dev}" "${CRYPT_KEYFILE}"
+ # fi
+ if [ -n "${USE_CRYPT}" ]; then
+ cryptsetup luksAddKey "${root_dev}" "${CRYPT_KEYFILE}"
+ fi
if [ -n "$boot_dev" ]; then
# use separate esp partirion with UEFI but without crypt
if [ -n "$USE_EFI" ] && [ -z "$USE_CRYPT" ]; then
@@ -1286,26 +1293,16 @@
@@ -1286,26 +1293,14 @@
setup_crypt() {
local dev="$1" local dmname="$2"
mkdir -p /run/cryptsetup
Expand All @@ -47,14 +47,12 @@
- echo "" >&2
- done
+ cryptsetup luksFormat --key-file "${CRYPT_KEYFILE}" --batch-mode --type luks2 "$dev" >&2
+
+ cryptsetup open --key-file "${CRYPT_KEYFILE}" "$dev" "$dmname" >&2
+ cryptsetup luksAddKey "/dev/mapper/${dmname}" "${CRYPT_KEYFILE}" >&2
+
echo "/dev/mapper/$dmname"
return 0
}
@@ -1592,6 +1589,12 @@
@@ -1592,6 +1587,12 @@
arm*|aarch64) : ${BOOTLOADER:=u-boot};;
esac

Expand All @@ -67,7 +65,7 @@
if [ -d "$1" ]; then
# install to given mounted root
apk add --quiet $(select_bootloader_pkg)
@@ -1726,4 +1729,3 @@
@@ -1726,4 +1727,3 @@
none) exit 0;;
*) die "Not a valid install mode: $DISK_MODE" ;;
esac
Expand Down

0 comments on commit 434b1a8

Please sign in to comment.