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-20 04:58:37 +00:00
make-base "$OPUS_OUTPUT/$1" # Base image
2022-05-23 04:30:20 +00:00
export OPUS_PACKAGES=""
export OPUS_PACKAGES_DL=""
export OPUS_PACKAGES_REMOVE=""
source apply-mod "$OPUS_HOME/mkinitramfs-disable" "$OPUS_OUTPUT/$1"
source apply-mod "$OPUS_HOME/mandb-disable" "$OPUS_OUTPUT/$1"
# Base
source apply-mod "$OPUS_HOME/input/sources" "$OPUS_OUTPUT/$1"
source apply-mod "$OPUS_HOME/input/oobe" "$OPUS_OUTPUT/$1"
# Base - Hardware
source apply-mod "$OPUS_HOME/input/kernel" "$OPUS_OUTPUT/$1"
source apply-mod "$OPUS_HOME/input/firmware-free" "$OPUS_OUTPUT/$1"
# Graphical
source apply-mod "$OPUS_HOME/input/packages-graphical" "$OPUS_OUTPUT/$1"
# Overrides
source apply-mod "$OPUS_HOME/input/hostname" "$OPUS_OUTPUT/$1"
source apply-mod "$OPUS_HOME/input/user-config" "$OPUS_OUTPUT/$1"
# Extra - hardware
source apply-mod "$OPUS_HOME/enable-mkinitramfs" "$OPUS_OUTPUT/$1"
# Raw image
source apply-mod "$OPUS_HOME/input/raw-disk" "$OPUS_OUTPUT/$1"
# Packages
source apply-mod "$OPUS_HOME/input/packages-apply" "$OPUS_OUTPUT/$1"
2022-05-10 20:53:09 +00:00
make-image "$OPUS_OUTPUT/$1" "$OPUS_OUTPUT/${OPUS_NAME}-${OPUS_DIST}-${OPUS_ARCH}_$(date "+%Y.%m.%d-%H.%M.%S").img" # Disk image
then
set +e
else
set +e
echo
echo Script execution ended due to error. Cleaning up...
fchroot-end "$OPUS_OUTPUT/$1"
rm -r "$OPUS_OUTPUT/$1"
echo Script execution ended due to error.
fi