Skip to content

Commit 69d6f46

Browse files
committed
Fixes for ephemeral drive setup.
1 parent 7502f79 commit 69d6f46

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

bootstrap/src/scripts/boot_as_compute

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ RC=0
3939
mkdir -p /scratch
4040
chmod 1777 /scratch
4141
MAPPING=$(/usr/bin/ec2-metadata -b | grep ephemeral | awk '{print $2}' | sed 's/sd/xvd/')
42-
for m in MAPPING; do
43-
check=$(stat -t /dev/${m} >/dev/null 2>&1)
42+
for m in $MAPPING; do
43+
stat -t /dev/${m} >/dev/null 2>&1
44+
check=$?
4445
if [ ${check} -eq 0 ]; then
4546
DEVS="${m} $DEVS"
4647
fi
@@ -62,7 +63,7 @@ sleep 10
6263
# Setup LVM
6364
pvcreate $PARTITIONS
6465
vgcreate vg.01 $PARTITIONS
65-
if [ "$cfn_encrypted_ephemeral" == "true" ] then
66+
if [ "$cfn_encrypted_ephemeral" == "true" ]; then
6667
mkfs -q /dev/ram1 1024
6768
mkdir -p /root/keystore
6869
mount /dev/ram1 /root/keystore

bootstrap/src/scripts/boot_as_master

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,9 @@ RC=0
5858
mkdir -p /scratch
5959
chmod 1777 /scratch
6060
MAPPING=$(/usr/bin/ec2-metadata -b | grep ephemeral | awk '{print $2}' | sed 's/sd/xvd/')
61-
for m in MAPPING; do
62-
check=$(stat -t /dev/${m} >/dev/null 2>&1)
61+
for m in $MAPPING; do
62+
stat -t /dev/${m} >/dev/null 2>&1
63+
check=$?
6364
if [ ${check} -eq 0 ]; then
6465
DEVS="${m} $DEVS"
6566
fi
@@ -81,7 +82,7 @@ sleep 10
8182
# Setup LVM
8283
pvcreate $PARTITIONS
8384
vgcreate vg.01 $PARTITIONS
84-
if [ "$cfn_encrypted_ephemeral" == "true" ] then
85+
if [ "$cfn_encrypted_ephemeral" == "true" ]; then
8586
mkfs -q /dev/ram1 1024
8687
mkdir -p /root/keystore
8788
mount /dev/ram1 /root/keystore

0 commit comments

Comments
 (0)