2022-05-10 11:39:01 +00:00
|
|
|
#!/usr/bin/env bash
|
2022-05-10 20:53:09 +00:00
|
|
|
set -e
|
|
|
|
if
|
|
|
|
if [ "$1" = "" ]; then
|
|
|
|
echo "Define i386/amd64 as the first argument."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
cd "$(dirname "$(realpath -s "$BASH_SOURCE")")"
|
|
|
|
source shell
|
|
|
|
source "env-$1"
|
2022-05-23 06:17:35 +00:00
|
|
|
source "env-proprietary"
|
2022-05-23 05:24:47 +00:00
|
|
|
#export OPUS_IMAGEDIR="/media/zram/$1"
|
|
|
|
export OPUS_IMAGEDIR="$OPUS_OUTPUT/$1"
|
|
|
|
make-base "$OPUS_IMAGEDIR" # Base image
|
|
|
|
export OPUS_PACKAGES=""
|
|
|
|
export OPUS_PACKAGES_DL=""
|
|
|
|
export OPUS_PACKAGES_REMOVE=""
|
|
|
|
|
|
|
|
# Base
|
|
|
|
source apply-mod "$OPUS_HOME/input/sources" "$OPUS_IMAGEDIR"
|
|
|
|
source apply-mod "$OPUS_HOME/input/oobe" "$OPUS_IMAGEDIR"
|
|
|
|
|
|
|
|
# Base - Hardware
|
|
|
|
source apply-mod "$OPUS_HOME/input/kernel" "$OPUS_IMAGEDIR"
|
|
|
|
source apply-mod "$OPUS_HOME/input/firmware-free" "$OPUS_IMAGEDIR"
|
|
|
|
source apply-mod "$OPUS_HOME/input/firmware-proprietary" "$OPUS_IMAGEDIR"
|
|
|
|
source apply-mod "$OPUS_HOME/input/grub" "$OPUS_IMAGEDIR"
|
|
|
|
|
|
|
|
# Graphical
|
|
|
|
source apply-mod "$OPUS_HOME/input/packages-graphical" "$OPUS_IMAGEDIR"
|
|
|
|
|
|
|
|
# Overrides
|
|
|
|
source apply-mod "$OPUS_HOME/input/hostname" "$OPUS_IMAGEDIR"
|
|
|
|
source apply-mod "$OPUS_HOME/input/user-config" "$OPUS_IMAGEDIR"
|
|
|
|
|
|
|
|
# Raw image
|
|
|
|
source apply-mod "$OPUS_HOME/input/image-raw" "$OPUS_IMAGEDIR"
|
|
|
|
|
|
|
|
# Packages
|
|
|
|
source apply-mod "$OPUS_HOME/input/packages-apply" "$OPUS_IMAGEDIR"
|
|
|
|
|
2022-05-24 22:19:32 +00:00
|
|
|
# Extra
|
|
|
|
source apply-mod "$OPUS_HOME/input/clean-logs" "$OPUS_IMAGEDIR"
|
|
|
|
|
2022-05-23 05:24:47 +00:00
|
|
|
make-image "$OPUS_IMAGEDIR" "$OPUS_OUTPUT/${OPUS_NAME}-${OPUS_DIST}-${OPUS_ARCH}_$(date "+%Y.%m.%d-%H.%M.%S").img" # Disk image
|
2022-05-10 20:53:09 +00:00
|
|
|
then
|
|
|
|
set +e
|
|
|
|
else
|
|
|
|
set +e
|
|
|
|
echo
|
|
|
|
echo Script execution ended due to error. Cleaning up...
|
2022-05-23 05:24:47 +00:00
|
|
|
fchroot-end "$OPUS_IMAGEDIR"
|
|
|
|
rm -r "$OPUS_IMAGEDIR"
|
2022-05-10 20:53:09 +00:00
|
|
|
echo Script execution ended due to error.
|
|
|
|
fi
|