windvn/make-os

53 lines
1.5 KiB
Plaintext
Raw Normal View History

2022-05-10 10:50:10 +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 05:24:47 +00:00
#export OPUS_IMAGEDIR="/media/zram/$1"
export OPUS_IMAGEDIR="$OPUS_OUTPUT/$1"
make-base "$OPUS_IMAGEDIR" # Base image
2022-05-23 04:30:20 +00:00
export OPUS_PACKAGES=""
export OPUS_PACKAGES_DL=""
export OPUS_PACKAGES_REMOVE=""
# Base
2022-05-23 05:24:47 +00:00
source apply-mod "$OPUS_HOME/input/sources" "$OPUS_IMAGEDIR"
source apply-mod "$OPUS_HOME/input/oobe" "$OPUS_IMAGEDIR"
2022-05-23 04:30:20 +00:00
# Base - Hardware
2022-05-23 05:24:47 +00:00
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/grub" "$OPUS_IMAGEDIR"
2022-05-23 04:30:20 +00:00
# Graphical
2022-05-23 05:24:47 +00:00
source apply-mod "$OPUS_HOME/input/packages-graphical" "$OPUS_IMAGEDIR"
2022-05-23 04:30:20 +00:00
# Overrides
2022-05-23 05:24:47 +00:00
source apply-mod "$OPUS_HOME/input/hostname" "$OPUS_IMAGEDIR"
source apply-mod "$OPUS_HOME/input/user-config" "$OPUS_IMAGEDIR"
2022-05-23 04:30:20 +00:00
# Raw image
2022-05-23 05:24:47 +00:00
source apply-mod "$OPUS_HOME/input/image-raw" "$OPUS_IMAGEDIR"
2022-05-23 04:30:20 +00:00
# Packages
2022-05-23 05:24:47 +00:00
source apply-mod "$OPUS_HOME/input/packages-apply" "$OPUS_IMAGEDIR"
2022-05-23 04:30:20 +00:00
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