V8.13.294.2025.10.28
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 1m38s

Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
2025-10-28 12:01:27 +01:00
parent d7c94122d0
commit cbbd855ca7
5 changed files with 95 additions and 35 deletions

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
# SPDX-Version: 3.0
# SPDX-CreationInfo: 2025-10-28; WEIDNER, Marc S.; <msw@coresecret.dev>
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git
@@ -23,7 +23,7 @@
set -e
# Including common functions
if [[ -e "${LIVE_BUILD}/scripts/build.sh" ]]; then
if [ -e "${LIVE_BUILD}/scripts/build.sh" ]; then
. "${LIVE_BUILD}/scripts/build.sh"
else
. /usr/lib/live/build.sh
@@ -74,7 +74,7 @@ esac
# Creating directory
mkdir -p "binary/${INITFS}"
if In_list "rootfs" "${LB_CACHE_STAGES}" && [[ -d cache/binary_rootfs ]]
if In_list "rootfs" "${LB_CACHE_STAGES}" && [ -d cache/binary_rootfs ]
then
# Removing old chroot
rm -rf binary/"${INITFS}"/filesystem.*
@@ -100,7 +100,7 @@ case "${LB_CHROOT_FILESYSTEM}" in
Install_packages
# Remove old image
if [[ -f "binary/${INITFS}/filesystem.${LB_CHROOT_FILESYSTEM}" ]]
if [ -f "binary/${INITFS}/filesystem.${LB_CHROOT_FILESYSTEM}" ]
then
rm -f "binary/${INITFS}/filesystem.${LB_CHROOT_FILESYSTEM}"
fi
@@ -135,7 +135,7 @@ case "${LB_CHROOT_FILESYSTEM}" in
FAKE_MTAB=true
fi
BLOCK_SIZE=1024
if [[ "${LB_DM_VERITY}" = "true" ]]
if [ "${LB_DM_VERITY}" = "true" ]
then
# Module dm-verity needs a block size of at least 4k
BLOCK_SIZE=4096
@@ -162,7 +162,7 @@ case "${LB_CHROOT_FILESYSTEM}" in
# Removing depends
Remove_packages
if [[ -e chroot/chroot.cache ]]
if [ -e chroot/chroot.cache ]
then
Remove_lockfile
mv chroot/chroot chroot.tmp
@@ -208,12 +208,12 @@ case "${LB_CHROOT_FILESYSTEM}" in
Install_packages
# Remove old jffs2 image
if [[ -f "binary/${INITFS}/filesystem.jffs2" ]]
if [ -f "binary/${INITFS}/filesystem.jffs2" ]
then
rm -f "binary/${INITFS}/filesystem.jffs2"
fi
if [[ -n "${LB_JFFS2_ERASEBLOCK}" ]]
if [ -n "${LB_JFFS2_ERASEBLOCK}" ]
then
JFFS2_OPTIONS="--eraseblock=${LB_JFFS2_ERASEBLOCK}"
fi
@@ -228,7 +228,7 @@ case "${LB_CHROOT_FILESYSTEM}" in
# Removing depends
Remove_packages
if [[ -e chroot/chroot.cache ]]
if [ -e chroot/chroot.cache ]
then
Remove_lockfile
mv chroot/chroot chroot.tmp
@@ -256,14 +256,14 @@ case "${LB_CHROOT_FILESYSTEM}" in
;;
plain)
if [[ -d "binary/${INITFS}/filesystem.dir" ]]
if [ -d "binary/${INITFS}/filesystem.dir" ]
then
rm -rf "binary/${INITFS}/filesystem.dir"
fi
case "${LB_BUILD_WITH_CHROOT}" in
true)
if [[ -e chroot/chroot.cache ]]
if [ -e chroot/chroot.cache ]
then
# Different from the other LB_CHROOT_FILESYSTEM values:
# continue working in the bootstrap chroot, not the generated chroot.
@@ -298,7 +298,7 @@ case "${LB_CHROOT_FILESYSTEM}" in
Echo_message "This may take a while."
# Remove old squashfs image
if [[ -f "binary/${INITFS}/filesystem.squashfs" ]]
if [ -f "binary/${INITFS}/filesystem.squashfs" ]
then
rm -f "binary/${INITFS}/filesystem.squashfs"
fi
@@ -309,17 +309,17 @@ case "${LB_CHROOT_FILESYSTEM}" in
# Do not display the progress bar if:
# - Run with --quiet, or
# - stdin is not a terminal (e.g., in CI, cron, etc.)
if [[ "${_QUIET}" = "true" ]] || [[ ! -t 0 ]]
if [ "${_QUIET}" = "true" ] || [ ! -t 0 ]
then
MKSQUASHFS_OPTIONS="-no-progress ${MKSQUASHFS_OPTIONS}"
fi
if [[ "${_VERBOSE}" = "true" ]]
if [ "${_VERBOSE}" = "true" ]
then
MKSQUASHFS_OPTIONS="-info ${MKSQUASHFS_OPTIONS}"
fi
if [[ -f config/rootfs/squashfs.sort ]]
if [ -f config/rootfs/squashfs.sort ]
then
MKSQUASHFS_OPTIONS="-sort squashfs.sort ${MKSQUASHFS_OPTIONS}"
@@ -335,28 +335,28 @@ case "${LB_CHROOT_FILESYSTEM}" in
fi
# Set squashfs compression type or default to xz
if [[ -n "${LB_CHROOT_SQUASHFS_COMPRESSION_TYPE}" ]]
if [ -n "${LB_CHROOT_SQUASHFS_COMPRESSION_TYPE}" ]
then
MKSQUASHFS_OPTIONS="-comp ${LB_CHROOT_SQUASHFS_COMPRESSION_TYPE} ${MKSQUASHFS_OPTIONS}"
else
MKSQUASHFS_OPTIONS="-comp xz ${MKSQUASHFS_OPTIONS}"
fi
if [[ -n "${LB_CHROOT_SQUASHFS_COMPRESSION_LEVEL}" ]]
if [ -n "${LB_CHROOT_SQUASHFS_COMPRESSION_LEVEL}" ]
then
MKSQUASHFS_OPTIONS="-Xcompression-level ${LB_CHROOT_SQUASHFS_COMPRESSION_LEVEL} ${MKSQUASHFS_OPTIONS}"
fi
case "${LB_BUILD_WITH_CHROOT}" in
true)
if [[ -e config/rootfs/excludes ]]
if [ -e config/rootfs/excludes ]
then
printf "\e[95m[INFO] Found: [config/rootfs/excludes] \n\e[0m"
cp -a config/rootfs/excludes chroot/excludes
if [[ -e chroot/excludes ]]
if [ -e chroot/excludes ]
then
printf "\e[95m[INFO] Found: [chroot/excludes] \n\e[0m"
@@ -384,7 +384,7 @@ case "${LB_CHROOT_FILESYSTEM}" in
# Removing depends
Remove_packages
if [[ -e chroot/chroot.cache ]]
if [ -e chroot/chroot.cache ]
then
Remove_lockfile
mv chroot/chroot chroot.tmp
@@ -403,7 +403,7 @@ case "${LB_CHROOT_FILESYSTEM}" in
;;
false)
if [[ -e config/rootfs/excludes ]]
if [ -e config/rootfs/excludes ]
then
MKSQUASHFS_OPTIONS="-wildcards -ef config/rootfs/excludes ${MKSQUASHFS_OPTIONS}"
fi
@@ -419,7 +419,7 @@ case "${LB_CHROOT_FILESYSTEM}" in
;;
none)
if [[ -d binary ]]
if [ -d binary ]
then
rm -rf binary
fi
@@ -444,7 +444,7 @@ then
mkdir -p cache/binary_rootfs
if [[ "${LB_CHROOT_FILESYSTEM}" != "none" ]]
if [ "${LB_CHROOT_FILESYSTEM}" != "none" ]
then
cp -a binary/"${INITFS}"/filesystem.* cache/binary_rootfs
fi