diff --git a/scripts/common/lockout.sh b/scripts/common/lockout.sh index 275d190de..0787ea90c 100644 --- a/scripts/common/lockout.sh +++ b/scripts/common/lockout.sh @@ -1,12 +1,12 @@ #!/bin/bash -eux # Randomize the root password and then lock the root account. -if [[ "$PACKER_BUILD_NAME" =~ ^(generic|magma)-(freebsd1[1-3]|hardenedbsd1[1-3]|openbsd[6-7])-(vmware|hyperv|libvirt|parallels|virtualbox)$ ]]; then +if [[ "$PACKER_BUILD_NAME" =~ ^(generic|magma)-(freebsd1[1-3]|hardenedbsd|hardenedbsd1[1-3]|openbsd[6-7])-(vmware|hyperv|libvirt|parallels|virtualbox)$ ]]; then LOCKPWD=`dd if=/dev/urandom count=128 msgfmt=quiet | md5 | awk -F' ' '{print $1}'` printf "$LOCKPWD\n$LOCKPWD\n" | passwd root -elif [[ "$PACKER_BUILD_NAME" =~ ^(generic|magma)-(dragonflybsd[5-6])-(vmware|hyperv|libvirt|parallels|virtualbox)$ ]]; then +elif [[ "$PACKER_BUILD_NAME" =~ ^(generic|magma)-(dragonflybsd[5-6]?)-(vmware|hyperv|libvirt|parallels|virtualbox)$ ]]; then LOCKPWD=`dd if=/dev/urandom count=128 status=value | md5 | awk -F' ' '{print $1}'` echo "$LOCKPWD" | pw mod user root -h 0 diff --git a/scripts/common/zerodisk.sh b/scripts/common/zerodisk.sh index 04d0b4866..ddc120852 100644 --- a/scripts/common/zerodisk.sh +++ b/scripts/common/zerodisk.sh @@ -1,6 +1,6 @@ #!/bin/bash -ux -if [[ "$PACKER_BUILD_NAME" =~ ^(generic|magma)-(freebsd1[1-3]|hardenedbsd1[1-3]|openbsd[6-7]|alpine3[5-9]|alpine31[0-8])-(vmware|hyperv|libvirt|parallels|virtualbox)$ ]]; then +if [[ "$PACKER_BUILD_NAME" =~ ^(generic|magma)-(freebsd1[1-3]|hardenedbsd|hardenedbsd1[1-3]|openbsd[6-7]|alpine3[5-9]|alpine31[0-8])-(vmware|hyperv|libvirt|parallels|virtualbox)$ ]]; then # We fill until full so don't abort on error. # set -ux @@ -24,7 +24,7 @@ elif [[ "$PACKER_BUILD_NAME" =~ ^(generic|magma)-(netbsd[8-9])-(vmware|hyperv|li sync -f /zerofill rm -f /zerofill -elif [[ "$PACKER_BUILD_NAME" =~ ^(generic|magma)-(dragonflybsd[5-6])-(vmware|hyperv|libvirt|parallels|virtualbox)$ ]]; then +elif [[ "$PACKER_BUILD_NAME" =~ ^(generic|magma)-(dragonflybsd[5-6]?)-(vmware|hyperv|libvirt|parallels|virtualbox)$ ]]; then AVAIL=`df -m / | tail -1 | awk -F' ' '{print $4}'` let FILL=${AVAIL}-256