From b4f5beaa69b1b41b6b3affb27dfbcfa2c2fe89c3 Mon Sep 17 00:00:00 2001 From: Nils Freydank Date: Sun, 5 May 2024 18:28:44 +0200 Subject: [PATCH] control-m.sh: Move config into dir, change suffix into .bash To me it looks cleaner if all data are inside a subdirectory. The handling script itself stays outside, which brings us to a structure like this (as also mentioned in the file itself): ${HOME}/vm/ ${HOME}/vm/control-vm.sh ${HOME}/vm/Gentoo-guest-1/virtual-machine.img ${HOME}/vm/Gentoo-guest-1/virtual-machine.bash While on it, rename the file suffix of the config file that is sourced by the main script into '.bash'. This is a breaking change, paths in configs need to be adopted. --- control-vm.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/control-vm.sh b/control-vm.sh index cd9a248..8f62692 100755 --- a/control-vm.sh +++ b/control-vm.sh @@ -28,7 +28,7 @@ # Create a directory named exactly as the guest (case sensitive). # Create an qcow2 image named virtual-machine.img inside # the newly created directory. -# Create a configuration file named exactly as the guest plus a suffix '.sh'. +# Create a configuration file named exactly as the guest plus a suffix '.bash'. # Fill in the data from the example below into the configuration file. # Control the vm by calling: ./ , # e.g. ./control-vm.sh Gentoo-guest start @@ -38,14 +38,14 @@ # You should now have a setup like: # ${HOME}/vm/ # ${HOME}/vm/control-vm.sh -# ${HOME}/vm/Gentoo-guest/virtual-machine.img -# ${HOME}/vm/Gentoo-guest.sh +# ${HOME}/vm/Gentoo-guest-1/virtual-machine.img +# ${HOME}/vm/Gentoo-guest-1/virtual-machine.bash # === Configuration of the guest === # Create a file with the guest's parameters and name it same as the "GUEST_NAME" -# plus a "sh" suffix, so we can easily assume the name later. +# plus a ".bash" suffix, so we can easily assume the name later. # -# cat << _EOF > "${GUEST_NAME}.sh" +# cat << _EOF > "${GUEST_NAME}/virtual-machine.bash" # # Provide the GUEST_NAME which is used in further configuration. # GUEST_NAME="Guest-OS" # # Configure the number of CPUs. @@ -85,7 +85,7 @@ UI="${UI:-}" # Define paths. # Note: Sort in alphabetical order as long as inheritance is respected. BASE_PATH="${BASE_PATH:-${HOME}/vm/${GUEST_NAME}}" -GUEST_CONFIG_FILE="${HOME}/vm/${GUEST_NAME}.sh" +GUEST_CONFIG_FILE="${HOME}/vm/${GUEST_NAME}/virtual-machine.bash" IMAGE_PATH="${IMAGE_PATH:-${BASE_PATH}/virtual-machine.img}" ISO_PATH="${ISO_PATH:-${BASE_PATH}/../installer/${GUEST_NAME}.iso}" MONITOR_SOCKET="${MONITOR_SOCKET:-${BASE_PATH}/monitor.socket}"