centos7/LUKS script: take LUKS passphrase as command-line argument
This commit is contained in:
parent
1e39b0aa84
commit
8db3786b5b
1 changed files with 7 additions and 1 deletions
|
@ -16,7 +16,6 @@ ARCH=x86_64
|
||||||
IMAGE_PATH=centos-luks-$RELEASE-$(date --iso-8601).img
|
IMAGE_PATH=centos-luks-$RELEASE-$(date --iso-8601).img
|
||||||
IMAGE_SIZE=10G
|
IMAGE_SIZE=10G
|
||||||
LOOPBACK_DEVICE=/dev/loop0
|
LOOPBACK_DEVICE=/dev/loop0
|
||||||
LUKS_PASSPHRASE=secret
|
|
||||||
LUKS_DEVICE_NAME=cryptroot
|
LUKS_DEVICE_NAME=cryptroot
|
||||||
LUKS_DEVICE="/dev/mapper/$LUKS_DEVICE_NAME"
|
LUKS_DEVICE="/dev/mapper/$LUKS_DEVICE_NAME"
|
||||||
DISABLED_ONE_SCRIPTS="loc-20-set-username-password loc-22-ssh_public_key"
|
DISABLED_ONE_SCRIPTS="loc-20-set-username-password loc-22-ssh_public_key"
|
||||||
|
@ -24,6 +23,13 @@ DISABLED_ONE_SCRIPTS="loc-20-set-username-password loc-22-ssh_public_key"
|
||||||
ONE_CONTEXT_RPM_URL="https://github.com/OpenNebula/addon-context-linux/releases/download/v5.10.0/one-context-5.10.0-1.el$RELEASE.noarch.rpm"
|
ONE_CONTEXT_RPM_URL="https://github.com/OpenNebula/addon-context-linux/releases/download/v5.10.0/one-context-5.10.0-1.el$RELEASE.noarch.rpm"
|
||||||
ONE_CONTEXT_RPM_PATH=/root/one-context.rpm
|
ONE_CONTEXT_RPM_PATH=/root/one-context.rpm
|
||||||
|
|
||||||
|
# Get LUKS passphrase.
|
||||||
|
if [ -z "$1" ]; then
|
||||||
|
echo "Usage: centos7-build-luks-opennebula-image.sh LUKS_PASSPHRASE"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
LUKS_PASSPHRASE="$1"
|
||||||
|
|
||||||
cleanup() {
|
cleanup() {
|
||||||
# The order here is important.
|
# The order here is important.
|
||||||
umount /mnt/dev/pts 2>/dev/null || true
|
umount /mnt/dev/pts 2>/dev/null || true
|
||||||
|
|
Loading…
Reference in a new issue