Skip to content

Commit

Permalink
make encrypted save files work when the main SFS contains a non-ancie…
Browse files Browse the repository at this point in the history
…nt cryptsetup
  • Loading branch information
dimkr committed Jan 13, 2023
1 parent bb6ec7a commit 918fd29
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions woof-code/rootfs-skeleton/etc/rc.d/rc.shutdown
Expand Up @@ -157,6 +157,7 @@ killall dbus-launch >/dev/null 2>&1
# udev
udevadm control --exit
killall udevd >/dev/null 2>&1
export DM_DISABLE_UDEV=1 # prevent cryptsetup from waiting forever if built with udev support
# pulse
killall pulseaudio >/dev/null 2>&1
# dhcpcd
Expand Down
6 changes: 5 additions & 1 deletion woof-code/rootfs-skeleton/usr/sbin/shutdownconfig
Expand Up @@ -602,7 +602,11 @@ If anything looks wrong, choose \Zb\\\${T_notsave}\ZB...\"`"
DEVLOOP="$(losetup -f)"
if [ "$CRYPTO" = "luks" ] ; then
losetup -v $DEVLOOP ${SMNTPT}$SAVEFILE >>/tmp/mk2fs.log
echo -n "$MYPASSWORD" | cryptsetup luksFormat -v $DEVLOOP - &>>/tmp/mk2fs.log
VER="$(cryptsetup --version)"
VER="${VER#cryptsetup }"
OPTS=""
vercmp "$VER" ge 2.1.0 && OPTS="--type luks1" # cryptsetup 1.7.5 in initrd doesn't support luks2
echo -n "$MYPASSWORD" | cryptsetup luksFormat -v $DEVLOOP $OPTS - &>>/tmp/mk2fs.log
echo -n "$MYPASSWORD" | cryptsetup luksOpen -v $DEVLOOP savefile - &>>/tmp/mk2fs.log
FSCK_DEV=/dev/mapper/savefile
fi
Expand Down
Expand Up @@ -51,6 +51,7 @@ yes|connman|connman|exe,dev,doc,nls||deps:yes
yes|coreutils|coreutils|exe,dev,doc,nls||deps:yes
yes|cpio|cpio|exe,dev>null,doc,nls||deps:yes
yes|crda|wireless-regdb|exe,dev,doc,nls||deps:yes
yes|cryptsetup|cryptsetup-bin|exe,dev,doc,nls||deps:yes
yes|curl|curl,libcurl4,libcurl4-openssl-dev|exe,dev,doc,nls||deps:yes
yes|dash|dash|exe,dev,doc,nls||deps:yes
yes|dbus|dbus,libdbus-1-dev|exe,dev,doc,nls||deps:yes
Expand Down
Expand Up @@ -53,6 +53,7 @@ yes|connman|connman|exe,dev,doc,nls||deps:yes
yes|coreutils|coreutils|exe,dev,doc,nls||deps:yes
yes|cpio|cpio|exe,dev>null,doc,nls||deps:yes
yes|crda|crda,wireless-regdb|exe,dev,doc,nls||deps:yes
yes|cryptsetup|cryptsetup-bin|exe,dev,doc,nls||deps:yes
yes|curl|curl,libcurl4,libcurl4-openssl-dev|exe,dev,doc,nls||deps:yes
yes|dash|dash|exe,dev,doc,nls||deps:yes
yes|dbus|dbus,libdbus-1-dev|exe,dev,doc,nls||deps:yes
Expand Down
Expand Up @@ -53,6 +53,7 @@ yes|connman|connman|exe,dev,doc,nls||deps:yes
yes|coreutils|coreutils|exe,dev,doc,nls||deps:yes
yes|cpio|cpio|exe,dev>null,doc,nls||deps:yes
yes|crda|wireless-regdb|exe,dev,doc,nls||deps:yes
yes|cryptsetup|cryptsetup-bin|exe,dev,doc,nls||deps:yes
yes|curl|curl,libcurl4,libcurl4-openssl-dev|exe,dev,doc,nls||deps:yes
yes|dash|dash|exe,dev,doc,nls||deps:yes
yes|dbus|dbus,libdbus-1-dev|exe,dev,doc,nls||deps:yes
Expand Down
Expand Up @@ -82,6 +82,7 @@ no|colord|libcolord2,libcolord-dev|exe,dev,doc,nls #needed by gtk+3.
yes|cpio|cpio|exe,dev>null,doc,nls||deps:yes
yes|cpp|cpp|exe,dev>exe,doc,nls||deps:yes # needed by x11-xserver-utils
yes|crda|wireless-regdb|exe,dev,doc,nls||deps:yes
yes|cryptsetup|cryptsetup-bin|exe,dev,doc,nls||deps:yes
no|ctorrent|ctorrent|exe,dev>null,doc,nls
no|cryptsetup||exe # must use wce static binary
no|cups|cups-bsd,cups,cups-common,cups-core-drivers,cups-server-common,cups-client,cups-ppdc,libcups2,libcups2-dev,libcupsimage2,libcupsimage2-dev,cups-daemon|exe,dev,doc,nls
Expand Down

0 comments on commit 918fd29

Please sign in to comment.