Choose-able output directory for make-base, choose-able output file for make-image

This commit is contained in:
Fierelier 2022-05-10 18:53:00 +02:00
parent 71defcc696
commit 5bcfa2e0aa
4 changed files with 27 additions and 19 deletions

16
make-os
View File

@ -1,10 +1,14 @@
#!/usr/bin/env bash
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 # Base image
apply-stage "$OPUS_HOME/input/stage01" "$OPUS_OUTPUT/base" # Packages (non-graphical)
apply-stage "$OPUS_HOME/input/stage50" "$OPUS_OUTPUT/base" # Packages (graphical)
apply-stage "$OPUS_HOME/input/stage98" "$OPUS_OUTPUT/base" # Default configs, etc.
apply-stage "$OPUS_HOME/input/stage99" "$OPUS_OUTPUT/base" # Disk image preparation
make-image "$OPUS_OUTPUT/base" # Disk image
make-base "$OPUS_OUTPUT/$1" "$OPUS_OUTPUT/$1" # Base image
apply-stage "$OPUS_HOME/input/stage01" "$OPUS_OUTPUT/$1" # Packages (non-graphical)
apply-stage "$OPUS_HOME/input/stage50" "$OPUS_OUTPUT/$1" # Packages (graphical)
apply-stage "$OPUS_HOME/input/stage98" "$OPUS_OUTPUT/$1" # Default configs, etc.
apply-stage "$OPUS_HOME/input/stage99" "$OPUS_OUTPUT/$1" # Disk image preparation
make-image "$OPUS_OUTPUT/$1" "$OPUS_OUTPUT/${OPUS_NAME}-${OPUS_DIST}-${OPUS_ARCH}_$(date "+%Y.%m.%d-%H.%M.%S").img" # Disk image

View File

@ -1,12 +1,16 @@
#!/usr/bin/env bash
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"
source "env-proprietary"
make-base # Base image
apply-stage "$OPUS_HOME/input/stage01" "$OPUS_OUTPUT/base" # Packages (non-graphical)
apply-stage "$OPUS_HOME/input/stage49" "$OPUS_OUTPUT/base" # Packages (proprietary firmware)
apply-stage "$OPUS_HOME/input/stage50" "$OPUS_OUTPUT/base" # Packages (graphical)
apply-stage "$OPUS_HOME/input/stage98" "$OPUS_OUTPUT/base" # Default configs, etc.
apply-stage "$OPUS_HOME/input/stage99" "$OPUS_OUTPUT/base" # Disk image preparation
make-image "$OPUS_OUTPUT/base" # Disk image
apply-stage "$OPUS_HOME/input/stage01" "$OPUS_OUTPUT/$1" # Packages (non-graphical)
apply-stage "$OPUS_HOME/input/stage49" "$OPUS_OUTPUT/$1" # Packages (proprietary firmware)
apply-stage "$OPUS_HOME/input/stage50" "$OPUS_OUTPUT/$1" # Packages (graphical)
apply-stage "$OPUS_HOME/input/stage98" "$OPUS_OUTPUT/$1" # Default configs, etc.
apply-stage "$OPUS_HOME/input/stage99" "$OPUS_OUTPUT/$1" # Disk image preparation
make-image "$OPUS_OUTPUT/$1" "$OPUS_OUTPUT/${OPUS_NAME}-${OPUS_DIST}-${OPUS_ARCH}_$(date "+%Y.%m.%d-%H.%M.%S").img" # Disk image

View File

@ -1,8 +1,8 @@
#!/usr/bin/env bash
if [ -d "$OPUS_OUTPUT/base" ]; then
rm -rf "$OPUS_OUTPUT/base"
if [ -d "$1" ]; then
rm -rf "$1"
fi
mkdir "$OPUS_OUTPUT/base"
debootstrap --arch="$OPUS_ARCH" "$OPUS_DIST" "$OPUS_OUTPUT/base" "$OPUS_URL"
fchroot "$OPUS_OUTPUT/base" apt -y autoclean
find "$OPUS_OUTPUT/base/var/log" -type f -delete
mkdir "$1"
debootstrap --arch="$OPUS_ARCH" "$OPUS_DIST" "$1" "$OPUS_URL"
fchroot "$1" apt -y autoclean
find "$1/var/log" -type f -delete

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash
export DISK_IMAGE="$OPUS_OUTPUT/${OPUS_NAME}-${OPUS_DIST}-${OPUS_ARCH}_$(date "+%Y.%m.%d-%H.%M.%S").img"
export DISK_IMAGE="$2"
export ROOT_MOUNT="$OPUS_OUTPUT/mount"
# Get the approximate size required for the image