revert from two images to only a single image (GPT)

This commit is contained in:
Pratham Patel 2023-10-16 08:08:05 +05:30
parent ed721f8d7f
commit cbbee2dbbe
No known key found for this signature in database
5 changed files with 32 additions and 51 deletions

View File

@ -1,2 +0,0 @@
clearpart --drives=sda --disklabel=gpt --all
%include includes/distros/rocky-base.ksi

View File

@ -1,2 +0,0 @@
clearpart --drives=sda --all
%include includes/distros/rocky-base.ksi

6
Rocky.ks Normal file
View File

@ -0,0 +1,6 @@
# Note to self with OCD: this can be alphabetically sorted
%include includes/base-configuration.ksi
%include includes/disk-layout.ksi
%include includes/package-list.ksi
%include includes/post/post-install.ksi
%include includes/repos/repos-master.ksi

View File

@ -3,12 +3,8 @@
set -x set -x
KICKSTART_BASE="Rocky" KICKSTART_BASE="Rocky"
TODAY="$(TZ='UTC' date +%Y.%m.%d)" TODAY="$(TZ='UTC' date +%Y.%m.%d)"
APPLIANCE_BASE="${KICKSTART_BASE}-$(dnf config-manager --dump-variables | grep releasever | awk '{print $3}')-$(uname -m)-minimal-${TODAY}" KICKSTART_FILE="${KICKSTART_BASE}.ks"
PARTITION_TYPES=('GPT' 'MBR') APPLIANCE_NAME="${KICKSTART_BASE}-$(dnf config-manager --dump-variables | grep releasever | awk '{print $3}')-$(uname -m)-minimal-${TODAY}"
for P_LAYOUT in "${PARTITION_TYPES[@]}"; do
KICKSTART_FILE="${KICKSTART_BASE}-${P_LAYOUT}.ks"
APPLIANCE_NAME="${APPLIANCE_BASE}-${P_LAYOUT}"
IMAGE_NAME="${APPLIANCE_NAME}.raw" IMAGE_NAME="${APPLIANCE_NAME}.raw"
COMMANDS_TO_CHECK=('appliance-creator' 'shasum' 'zstd') COMMANDS_TO_CHECK=('appliance-creator' 'shasum' 'zstd')
@ -32,24 +28,13 @@ for P_LAYOUT in "${PARTITION_TYPES[@]}"; do
if [[ -d "${APPLIANCE_NAME}" ]]; then if [[ -d "${APPLIANCE_NAME}" ]]; then
pushd "${APPLIANCE_NAME}" || exit 1 pushd "${APPLIANCE_NAME}" || exit 1
mv "${APPLIANCE_NAME}-sda.raw" "${IMAGE_NAME}" mv "${APPLIANCE_NAME}-sda.raw" "${IMAGE_NAME}"
zstd --compress -9 "${IMAGE_NAME}"
popd || exit 0 popd || exit 0
else else
>&2 echo "$0: ERROR: unable to find the appliance output directory" >&2 echo "$0: ERROR: unable to find the appliance output directory"
>&2 echo "$0: ${APPLIANCE_NAME}" >&2 echo "$0: ${APPLIANCE_NAME}"
exit 1 exit 1
fi fi
done
rm -rf "${APPLIANCE_BASE}" && mkdir "${APPLIANCE_BASE}"
find . -type f \( -name "*.log" -o -name "*.raw*" \) -exec mv {} "${APPLIANCE_BASE}/" \;
rm -rf "${APPLIANCE_BASE}"-{GPT,MBR}
pushd "${APPLIANCE_BASE}" || exit 1
sha512sum -- *.raw* > SHA512SUMS
sha256sum -- *.raw* > SHA256SUMS
popd || exit 1
if [[ -n "$1" ]]; then if [[ -n "$1" ]]; then
chown "$1":"$1" -vR "${APPLIANCE_BASE}" chown "$1":"$1" -vR "${APPLIANCE_NAME}"
fi fi

View File

@ -1,6 +0,0 @@
# Note to self with OCD: this can be alphabetically sorted
%include ../base-configuration.ksi
%include ../disk-layout.ksi
%include ../package-list.ksi
%include ../post/post-install.ksi
%include ../repos/repos-master.ksi