Skip to content

Commit

Permalink
working on idaholab#266, Malcolm ISO should format bigger drives for …
Browse files Browse the repository at this point in the history
…index and artifact storage, NOT DONE YET
  • Loading branch information
mmguero committed Mar 20, 2024
1 parent 2bc9214 commit e207704
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
2 changes: 2 additions & 0 deletions malcolm-iso/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ if [ -d "$WORKDIR" ]; then
cp ./config/includes.binary/install/preseed_multipar.cfg ./config/includes.binary/install/preseed_multipar_crypto.cfg
cp ./config/includes.binary/install/preseed_base.cfg ./config/includes.binary/install/preseed_minimal.cfg
sed -i "s@\(partman-auto/method[[:space:]]*string[[:space:]]*\)lvm@\1crypto@g" ./config/includes.binary/install/preseed_multipar_crypto.cfg
sed -i "s@\(/etc/capture_storage_format\)@\1.crypt@g" ./config/includes.binary/install/preseed_multipar_crypto.cfg
sed -i "s@\(/etc/capture_storage_format\)@\1.none@g" ./config/includes.binary/install/preseed_minimal.cfg

# make sure we install the firmwares, etc.
for PKG in firmware-linux \
Expand Down
18 changes: 18 additions & 0 deletions malcolm-iso/config/hooks/normal/0900-setup-rc-local.hook.chroot
Original file line number Diff line number Diff line change
@@ -1,10 +1,28 @@
#!/bin/bash

# Copyright (c) 2024 Battelle Energy Alliance, LLC. All rights reserved.

sed -i 's/^exit 0//' /etc/rc.local 2>/dev/null

cat << 'EOF' >> /etc/rc.local
# if this is the initial boot, format and set up storage drive(s)
if [ -f /etc/capture_storage_format.crypt ]; then
CAPTURE_STORAGE_FORMAT_FILE="/etc/capture_storage_format.crypt"
CAPTURE_STORAGE_FORMAT_FLAG="-c"
else
CAPTURE_STORAGE_FORMAT_FILE="/etc/capture_storage_format"
CAPTURE_STORAGE_FORMAT_FLAG=""
fi
if [ -f "$CAPTURE_STORAGE_FORMAT_FILE" ]; then
logger "Initializing disk(s) to store captured artifacts"
date >>/var/log/os-disk-config.log 2>&1
python3 /usr/local/bin/os-disk-config.py -m hedgehog -u $CAPTURE_STORAGE_FORMAT_FLAG >>/var/log/os-disk-config.log 2>&1
rm -f "$CAPTURE_STORAGE_FORMAT_FILE"
fi
# other agg-specific initialization prior to starting up
echo "Running Malcolm initialization" > /dev/tty0
/usr/local/bin/agg-init.sh
systemctl mask ctrl-alt-del.target
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ d-i preseed/late_command string \
echo 'deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware' > /target/etc/apt/sources.list; \
echo 'deb http://security.debian.org/debian-security bookworm-security main contrib non-free' >> /target/etc/apt/sources.list; \
echo 'deb http://deb.debian.org/debian bookworm-updates main contrib non-free' >> /target/etc/apt/sources.list; \
in-target touch /etc/capture_storage_format; \
in-target bash /usr/local/bin/agg-init.sh; \
in-target bash -c "(virt-what | grep -q vmware) || apt-get purge -y open-vm-tools-desktop"; \
in-target bash -c "(virt-what | grep -q virtualbox) || apt-get purge -y virtualbox-guest*"; \
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[Desktop Entry]
Encoding=UTF-8
Name=capture-format-wait
Comment=Format Data Storage
Exec=/usr/local/bin/capture-format-wait.sh
Terminal=false
Type=Application

0 comments on commit e207704

Please sign in to comment.