#!/usr/bin/env bash 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" make-base "$OPUS_OUTPUT/$1" # Base image 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" 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