mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-12 19:30:04 +01:00
18 lines
589 B
Bash
Executable File
18 lines
589 B
Bash
Executable File
#!/bin/sh
|
|
|
|
REENC=$(getargs rd_REENCRYPT=)
|
|
REENC_DEV=$(echo $REENC | sed 's/:.*//')
|
|
REENC_SIZE=$(echo $REENC | sed -n 's/.*://p')
|
|
|
|
if [ -n "$REENC_DEV" ] ; then
|
|
{
|
|
printf 'SUBSYSTEM!="block", GOTO="reenc_end"\n'
|
|
printf 'ACTION!="add|change", GOTO="reenc_end"\n'
|
|
printf 'KERNEL!="%s", GOTO="reenc_end"\n' $REENC_DEV
|
|
printf 'ENV{ID_FS_TYPE}=="crypto_LUKS", RUN+="/sbin/initqueue \
|
|
--unique --onetime --name crypt-reencrypt-%%k \
|
|
/sbin/reencrypt $env{DEVNAME} %s"\n' "$REENC_SIZE"
|
|
printf 'LABEL="reenc_end"\n'
|
|
} > /etc/udev/rules.d/69-reencryption.rules
|
|
fi
|