Skip to content

Commit

Permalink
fix shellcheck build_qcow2.sh
Browse files Browse the repository at this point in the history
Signed-off-by: Florent CARLI <[email protected]>
  • Loading branch information
insatomcat committed Jun 17, 2024
1 parent b4a6b64 commit 8dff125
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions build_qcow2.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

wd=$(dirname $0)
wd=$(dirname "$0")
output_dir=.

# test if "docker compose" works
Expand All @@ -21,31 +21,31 @@ docker volume rm build_debian_iso_ext 2>/dev/null
set -ex

# Create the default config space
$COMPOSECMD -f $wd/docker-compose.yml run --rm fai-setup \
$COMPOSECMD -f "$wd"/docker-compose.yml run --rm fai-setup \
fai-mk-configspace

# Starting the container to add seapath stuff in the config space
$COMPOSECMD -f $wd/docker-compose.yml up --no-start fai-setup
$COMPOSECMD -f "$wd"/docker-compose.yml up --no-start fai-setup

# Adding the SEAPATH config
docker cp $wd/srv_fai_config/. fai-setup:ext/srv/fai/config/
docker cp "$wd"/srv_fai_config/. fai-setup:ext/srv/fai/config/

# Stopping the container after having added stuff in it
$COMPOSECMD -f $wd/docker-compose.yml down
$COMPOSECMD -f "$wd"/docker-compose.yml down

# Creating the VM
# patches /sbin/install_packages (bug in the process of being corrected upstream)
CLASSES="DEBIAN,FAIBASE,FRENCH,BOOKWORM64,SEAPATH_COMMON,SEAPATH_VM,GRUB_EFI,LAST"
$COMPOSECMD -f $wd/docker-compose.yml run fai-cd bash -c "\
$COMPOSECMD -f "$wd"/docker-compose.yml run fai-cd bash -c "\
sed -i -e \"s|-f \\\"\\\$FAI_ROOT/usr/sbin/apt-cache|-f \\\"\\\$FAI_ROOT/usr/bin/apt-cache|\" /sbin/install_packages && \
sed -i -e \"s/ --allow-change-held-packages//\" /sbin/install_packages && \
sed -i -e \"s/-c -o compression_type=zstd qcow2/qcow2/\" /usr/sbin/fai-diskimage && \
fai-diskimage -vu seapath-vm -S10G -c$CLASSES -s /ext/srv/fai/config /ext/seapath-vm.qcow2"

# Retrieving the ISO from the volume
$COMPOSECMD -f $wd/docker-compose.yml up --no-start fai-setup
$COMPOSECMD -f "$wd"/docker-compose.yml up --no-start fai-setup
docker cp fai-setup:/ext/seapath-vm.qcow2 $output_dir/
$COMPOSECMD -f $wd/docker-compose.yml down --remove-orphans
$COMPOSECMD -f "$wd"/docker-compose.yml down --remove-orphans

# Removing the volume
docker volume rm build_debian_iso_ext

0 comments on commit 8dff125

Please sign in to comment.