From 27bff76662d767125afe6ad137b4271360cfbefb Mon Sep 17 00:00:00 2001 From: Fierelier Date: Mon, 23 May 2022 07:24:47 +0200 Subject: [PATCH] Various fixes for the previous commit --- input/grub/modscript | 2 + input/{raw-disk => image-raw}/data/isRawImage | 0 input/{raw-disk => image-raw}/data/setupdisk | 0 input/mandb-disable/data/chroot | 2 + .../data/etc/dpkg/99-opus-no_mandb | 1 - input/oobe/modscript | 2 +- make-os | 35 +++++++-------- make-os-proprietary | 45 ++++++++++++++----- 8 files changed, 57 insertions(+), 30 deletions(-) create mode 100755 input/grub/modscript rename input/{raw-disk => image-raw}/data/isRawImage (100%) rename input/{raw-disk => image-raw}/data/setupdisk (100%) create mode 100755 input/mandb-disable/data/chroot delete mode 100644 input/mandb-disable/data/etc/dpkg/99-opus-no_mandb diff --git a/input/grub/modscript b/input/grub/modscript new file mode 100755 index 0000000..3b274a9 --- /dev/null +++ b/input/grub/modscript @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +export OPUS_PACKAGES="$OPUS_PACKAGES grub2" \ No newline at end of file diff --git a/input/raw-disk/data/isRawImage b/input/image-raw/data/isRawImage similarity index 100% rename from input/raw-disk/data/isRawImage rename to input/image-raw/data/isRawImage diff --git a/input/raw-disk/data/setupdisk b/input/image-raw/data/setupdisk similarity index 100% rename from input/raw-disk/data/setupdisk rename to input/image-raw/data/setupdisk diff --git a/input/mandb-disable/data/chroot b/input/mandb-disable/data/chroot new file mode 100755 index 0000000..5799209 --- /dev/null +++ b/input/mandb-disable/data/chroot @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +dpkg-divert --divert /usr/bin/mandb /usr/bin/mandb.bak \ No newline at end of file diff --git a/input/mandb-disable/data/etc/dpkg/99-opus-no_mandb b/input/mandb-disable/data/etc/dpkg/99-opus-no_mandb deleted file mode 100644 index 57e3d21..0000000 --- a/input/mandb-disable/data/etc/dpkg/99-opus-no_mandb +++ /dev/null @@ -1 +0,0 @@ -path-exclude=/usr/bin/mandb \ No newline at end of file diff --git a/input/oobe/modscript b/input/oobe/modscript index 168744e..aa2909c 100755 --- a/input/oobe/modscript +++ b/input/oobe/modscript @@ -1,3 +1,3 @@ #!/usr/bin/env bash -export OPUS_PACKAGES="$OPUS_PACKAGES keyboard-configuration network-manager python3" +export OPUS_PACKAGES="$OPUS_PACKAGES sudo keyboard-configuration network-manager python3" export OPUS_PACKAGES_DL="$OPUS_PACKAGES console-setup locales tzdata" \ No newline at end of file diff --git a/make-os b/make-os index 3b6a3ce..90fdcef 100755 --- a/make-os +++ b/make-os @@ -8,46 +8,45 @@ if cd "$(dirname "$(realpath -s "$BASH_SOURCE")")" source shell source "env-$1" - make-base "$OPUS_OUTPUT/$1" # Base image + #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="" - source apply-mod "$OPUS_HOME/mkinitramfs-disable" "$OPUS_OUTPUT/$1" - source apply-mod "$OPUS_HOME/mandb-disable" "$OPUS_OUTPUT/$1" + source apply-mod "$OPUS_HOME/mandb-disable" "$OPUS_IMAGEDIR" # Base - source apply-mod "$OPUS_HOME/input/sources" "$OPUS_OUTPUT/$1" - source apply-mod "$OPUS_HOME/input/oobe" "$OPUS_OUTPUT/$1" + 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_OUTPUT/$1" - source apply-mod "$OPUS_HOME/input/firmware-free" "$OPUS_OUTPUT/$1" + 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" # Graphical - source apply-mod "$OPUS_HOME/input/packages-graphical" "$OPUS_OUTPUT/$1" + source apply-mod "$OPUS_HOME/input/packages-graphical" "$OPUS_IMAGEDIR" # 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" + 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/raw-disk" "$OPUS_OUTPUT/$1" + source apply-mod "$OPUS_HOME/input/image-raw" "$OPUS_IMAGEDIR" # Packages - source apply-mod "$OPUS_HOME/input/packages-apply" "$OPUS_OUTPUT/$1" + source apply-mod "$OPUS_HOME/input/packages-apply" "$OPUS_IMAGEDIR" - make-image "$OPUS_OUTPUT/$1" "$OPUS_OUTPUT/${OPUS_NAME}-${OPUS_DIST}-${OPUS_ARCH}_$(date "+%Y.%m.%d-%H.%M.%S").img" # Disk image + make-image "$OPUS_IMAGEDIR" "$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" + fchroot-end "$OPUS_IMAGEDIR" + rm -r "$OPUS_IMAGEDIR" echo Script execution ended due to error. fi \ No newline at end of file diff --git a/make-os-proprietary b/make-os-proprietary index 57bd7cb..096f602 100755 --- a/make-os-proprietary +++ b/make-os-proprietary @@ -8,21 +8,46 @@ if cd "$(dirname "$(realpath -s "$BASH_SOURCE")")" source shell source "env-$1" - source "env-proprietary" - make-base "$OPUS_OUTPUT/$1" # Base 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 + #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="" + + source apply-mod "$OPUS_HOME/mandb-disable" "$OPUS_IMAGEDIR" + + # 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" + + make-image "$OPUS_IMAGEDIR" "$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" + fchroot-end "$OPUS_IMAGEDIR" + rm -r "$OPUS_IMAGEDIR" echo Script execution ended due to error. fi \ No newline at end of file