Skip to content

Commit 2728c10

Browse files
committed
fix: do not fail if data disk is not mounted
1 parent e37e083 commit 2728c10

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

ebssurrogate/scripts/surrogate-bootstrap-nix.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ function create_partition_table {
141141
mkpart UEFI 1MiB 100MiB \
142142
mkpart ROOT 100MiB 100%
143143
set 1 esp on \
144-
set 1 boot on
144+
set 1 boot on
145145
parted --script /dev/xvdf print
146146
else
147147
sgdisk -Zg -n1:0:4095 -t1:EF02 -c1:GRUB -n2:0:0 -t2:8300 -c2:EXT4 /dev/xvdf
@@ -193,11 +193,11 @@ function format_and_mount_rootfs {
193193
mount -o noatime,nodiratime /dev/xvdf2 /mnt
194194
if [ "${ARCH}" = "arm64" ]; then
195195
mkfs.fat -F32 /dev/xvdf1
196-
mkdir -p /mnt/boot/efi
196+
mkdir -p /mnt/boot/efi
197197
sleep 2
198198
mount /dev/xvdf1 /mnt/boot/efi
199199
fi
200-
200+
201201
mkfs.ext4 /dev/xvdh
202202

203203
# Explicitly reserving 100MiB worth of blocks for the data volume
@@ -230,7 +230,7 @@ cat > "/mnt/etc/fstab" << EOF
230230
$(printf "${FMT}" "# DEVICE UUID" "MOUNTPOINT" "TYPE" "OPTIONS" "DUMP" "FSCK")
231231
$(findmnt -no SOURCE /mnt | xargs blkid -o export | awk -v FMT="${FMT}" '/^UUID=/ { printf(FMT, $0, "/", "ext4", "defaults,discard", "0", "1" ) }')
232232
$(findmnt -no SOURCE /mnt/boot/efi | xargs blkid -o export | awk -v FMT="${FMT}" '/^UUID=/ { printf(FMT, $0, "/boot/efi", "vfat", "umask=0077", "0", "1" ) }')
233-
$(findmnt -no SOURCE /mnt/data | xargs blkid -o export | awk -v FMT="${FMT}" '/^UUID=/ { printf(FMT, $0, "/data", "ext4", "defaults,discard", "0", "2" ) }')
233+
$(findmnt -no SOURCE /mnt/data | xargs blkid -o export | awk -v FMT="${FMT}" '/^UUID=/ { printf(FMT, $0, "/data", "ext4", "defaults,discard,nofail,x-systemd.device-timeout=5s", "0", "2" ) }')
234234
$(printf "$FMT" "/swapfile" "none" "swap" "sw" "0" "0")
235235
EOF
236236
unset FMT
@@ -257,7 +257,7 @@ function setup_chroot_environment {
257257
mount --rbind /proc /mnt/proc
258258
mount --rbind /sys /mnt/sys
259259

260-
# Create build mount point and mount
260+
# Create build mount point and mount
261261
mkdir -p /mnt/tmp
262262
mount /dev/xvdc /mnt/tmp
263263
chmod 777 /mnt/tmp
@@ -307,7 +307,7 @@ tee /etc/ansible/ansible.cfg <<EOF
307307
callbacks_enabled = timer, profile_tasks, profile_roles
308308
EOF
309309
# Run Ansible playbook
310-
#export ANSIBLE_LOG_PATH=/tmp/ansible.log && export ANSIBLE_DEBUG=True && export ANSIBLE_REMOTE_TEMP=/mnt/tmp
310+
#export ANSIBLE_LOG_PATH=/tmp/ansible.log && export ANSIBLE_DEBUG=True && export ANSIBLE_REMOTE_TEMP=/mnt/tmp
311311
export ANSIBLE_LOG_PATH=/tmp/ansible.log && export ANSIBLE_REMOTE_TEMP=/mnt/tmp
312312
ansible-playbook -c chroot -i '/mnt,' /tmp/ansible-playbook/ansible/playbook.yml \
313313
--extra-vars '{"nixpkg_mode": true, "debpkg_mode": false, "stage2_nix": false} ' \
@@ -381,7 +381,7 @@ function upload_ccache {
381381
docker cp /mnt/tmp/ccache/. ccachedata:/build/ccache
382382
docker stop ccachedata
383383
docker commit ccachedata "${DOCKER_IMAGE}:${DOCKER_IMAGE_TAG}"
384-
echo ${DOCKER_PASSWD} | docker login --username ${DOCKER_USER} --password-stdin
384+
echo ${DOCKER_PASSWD} | docker login --username ${DOCKER_USER} --password-stdin
385385
docker push "${DOCKER_IMAGE}:${DOCKER_IMAGE_TAG}"
386386
}
387387

0 commit comments

Comments
 (0)