From 3ad8287937071f551b18ba336c0c699756fd344d Mon Sep 17 00:00:00 2001 From: Dimitri Lizzi <dimitri.lizzi@etu.hesge.ch> Date: Mon, 17 Aug 2020 00:39:48 +0200 Subject: [PATCH] make customizations work :D --- Makefile | 2 +- deployer/bootiful-deploy | 18 ++++++++++++------ tftp/tftpboot/boot/deployer/initrd.img | 4 ++-- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 8518c09..526e887 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ LATEST_LOG := $(shell ls -1 nfs/nfsshared/log/*.log | tail -n 1) .PHONY: doc grub deployer start-server reprovision-server clean print_last_log help # Builds everything -all: doc grub deployer +all: grub deployer # Builds PDF and markdown documents doc: diff --git a/deployer/bootiful-deploy b/deployer/bootiful-deploy index e8d9f88..0fd3038 100755 --- a/deployer/bootiful-deploy +++ b/deployer/bootiful-deploy @@ -469,20 +469,26 @@ echo "Starting logging stdout and stderr to $log_file..." if [[ -n "$customization_choices" ]]; then start_step_batch "customizations deployment" - + readonly customization_partitions_mount_dir="/bootiful/mounted_customization_partitions" for customization_choice in $customization_choices; do - customization="${customizations[customization_choice]}" + customization="${customizations[$customization_choice]}" customization_dir="$remote_image_customizations_dir/$customization" - echo "Deploying customization '$customization' from '$customization_dir'" - for customization_partition in "$customization_dir"/*; do + echo "Deploying customization '$customization' ($customization_choice) from '$customization_dir'" + for customization_partition_full in "$customization_dir"/*; do + customization_partition=$(basename "$customization_partition_full") validate_with_regex "$customization_partition" '^sda[0-9]$' "customization sub-directory name does not match a partition of sda" - customization_partition_mount_point="/bootiful/mounted_customization_partitions/$customization_partition" + customization_partition_mount_point="$customization_partitions_mount_dir/$customization_partition" customization_partition_device="/dev/$customization_partition" ensure_mounted "$customization_partition_device" "$customization_partition_mount_point" - cp -RT "$customization_dir/$customization_partition/" + cp -RTf "$customization_partition_full/" "$customization_partition_mount_point/" done done + + for customization_partition_mount_dir in "$customization_partitions_mount_dir"/*; do + umount "$customization_partition_mount_dir" || + fatal_error "Cannot unmount '$customization_partition_mount_dir'" + done fi start_step_batch "EFI entrypoint file creation" diff --git a/tftp/tftpboot/boot/deployer/initrd.img b/tftp/tftpboot/boot/deployer/initrd.img index fee44fa..6489fde 100644 --- a/tftp/tftpboot/boot/deployer/initrd.img +++ b/tftp/tftpboot/boot/deployer/initrd.img @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8adea780e9701b6fde24275b83080bdc3a2d2d66bfcf0c07ad2db86b443f1135 -size 19322714 +oid sha256:4971beb5f0c7fa393f0f648af71a316ef05ce71b45894e93d2b1bf1c4f37eee4 +size 19104947 -- GitLab