guysoft / CustomPiOS

A Raspberry Pi and other ARM devices distribution builder
GNU General Public License v3.0
508 stars 146 forks source link

docker build: failed to set up loop device: No such file or directory #215

Closed splitbrain closed 10 months ago

splitbrain commented 10 months ago

I'm just trying your script for the first time. I haven't done much other than adding a few entries to $MODULES. When building with docker, the process fails at the end with losetup: 2023-10-10-raspios-bookworm-armhf-lite.img: failed to set up loop device: No such file or directory

I assume I did something wrong, but I'm not sure where to start looking.

Full output below. Host system is ArchLinux: Linux rumpel 6.6.2-arch1-1 #1 SMP PREEMPT_DYNAMIC Mon, 20 Nov 2023 23:18:21 +0000 x86_64 GNU/Linux

$ docker run --rm -v `pwd`:/distro --device /dev/loop-control guysoft/custompios:devel build
Unable to find image 'guysoft/custompios:devel' locally
devel: Pulling from guysoft/custompios
0a9573503463: Pull complete 
7dc4be1c28e7: Pull complete 
266182b54fee: Pull complete 
8f22f9ea447e: Pull complete 
462c8bf665b5: Pull complete 
98c2b65e0720: Pull complete 
Digest: sha256:1924986f8d8dd95d28552d93363271b5287af95fdfcf1fe8c79707a787aa2033
Status: Downloaded newer image for guysoft/custompios:devel
+ set -e
+ export DIST_PATH=/distro
+ DIST_PATH=/distro
+ export CUSTOM_PI_OS_PATH=/CustomPiOS
+ CUSTOM_PI_OS_PATH=/CustomPiOS
+ source /CustomPiOS/argparse.bash
++ which python
+++ which python
++ PYTHON=/usr/bin/python
++ echo /usr/bin/build
++ grep -q argparse.bash
+ argparse
++ mktemp
+ argparser=/tmp/tmp.lYD9e7W1wH
+ cat
+ cat
+ cat
+ /usr/bin/python /tmp/tmp.lYD9e7W1wH
++ /usr/bin/python /tmp/tmp.lYD9e7W1wH
+ eval 'WORKSPACE_SUFFIX="default";' 'RPI_IMAGER="";' 'RPI_IMAGER_URL="MISSING_URL";'
++ WORKSPACE_SUFFIX=default
++ RPI_IMAGER=
++ RPI_IMAGER_URL=MISSING_URL
+ retval=0
+ rm /tmp/tmp.lYD9e7W1wH
+ return 0
+ WORKSPACE_POSTFIX=
+ '[' default '!=' default ']'
+ '[' '' == yes ']'
++ lsof /distro/workspace/mount
++ awk '{print $2}'
+ for i in `lsof "${DIST_PATH}/workspace${WORKSPACE_POSTFIX}/mount" | awk '{print $2}'`
+ kill -9 PID
/usr/bin/build: line 28: kill: PID: arguments must be process or job IDs
+ for i in `lsof "${DIST_PATH}/workspace${WORKSPACE_POSTFIX}/mount" | awk '{print $2}'`
+ kill -9 1
+ for i in `lsof "${DIST_PATH}/workspace${WORKSPACE_POSTFIX}/mount" | awk '{print $2}'`
+ kill -9 1
+ for i in `lsof "${DIST_PATH}/workspace${WORKSPACE_POSTFIX}/mount" | awk '{print $2}'`
+ kill -9 1
+ for i in `lsof "${DIST_PATH}/workspace${WORKSPACE_POSTFIX}/mount" | awk '{print $2}'`
+ kill -9 1
+ for i in `lsof "${DIST_PATH}/workspace${WORKSPACE_POSTFIX}/mount" | awk '{print $2}'`
+ kill -9 19
/usr/bin/build: line 28: kill: (19) - No such process
+ for i in `lsof "${DIST_PATH}/workspace${WORKSPACE_POSTFIX}/mount" | awk '{print $2}'`
+ kill -9 19
/usr/bin/build: line 28: kill: (19) - No such process
+ for i in `lsof "${DIST_PATH}/workspace${WORKSPACE_POSTFIX}/mount" | awk '{print $2}'`
+ kill -9 19
/usr/bin/build: line 28: kill: (19) - No such process
+ for i in `lsof "${DIST_PATH}/workspace${WORKSPACE_POSTFIX}/mount" | awk '{print $2}'`
+ kill -9 20
/usr/bin/build: line 28: kill: (20) - No such process
+ for i in `lsof "${DIST_PATH}/workspace${WORKSPACE_POSTFIX}/mount" | awk '{print $2}'`
+ kill -9 20
/usr/bin/build: line 28: kill: (20) - No such process
+ for i in `lsof "${DIST_PATH}/workspace${WORKSPACE_POSTFIX}/mount" | awk '{print $2}'`
+ kill -9 20
/usr/bin/build: line 28: kill: (20) - No such process
+ for i in `lsof "${DIST_PATH}/workspace${WORKSPACE_POSTFIX}/mount" | awk '{print $2}'`
+ kill -9 21
/usr/bin/build: line 28: kill: (21) - No such process
+ for i in `lsof "${DIST_PATH}/workspace${WORKSPACE_POSTFIX}/mount" | awk '{print $2}'`
+ kill -9 21
/usr/bin/build: line 28: kill: (21) - No such process
+ for i in `lsof "${DIST_PATH}/workspace${WORKSPACE_POSTFIX}/mount" | awk '{print $2}'`
+ kill -9 21
/usr/bin/build: line 28: kill: (21) - No such process
+ for i in `lsof "${DIST_PATH}/workspace${WORKSPACE_POSTFIX}/mount" | awk '{print $2}'`
+ kill -9 23
/usr/bin/build: line 28: kill: (23) - No such process
+ for i in `lsof "${DIST_PATH}/workspace${WORKSPACE_POSTFIX}/mount" | awk '{print $2}'`
+ kill -9 23
/usr/bin/build: line 28: kill: (23) - No such process
+ for i in `lsof "${DIST_PATH}/workspace${WORKSPACE_POSTFIX}/mount" | awk '{print $2}'`
+ kill -9 23
/usr/bin/build: line 28: kill: (23) - No such process
+ true
+ rm '/distro/workspace/*.img'
rm: cannot remove '/distro/workspace/*.img': No such file or directory
+ true
+ rm '/distro/workspace/*.raw'
+ true
rm: cannot remove '/distro/workspace/*.raw': No such file or directory
+ rm '/distro/workspace/*.zip'
rm: cannot remove '/distro/workspace/*.zip': No such file or directory
+ true
+ pushd /distro
/distro /
+ umount /distro/workspace/mount/boot
umount: /distro/workspace/mount/boot: must be superuser to unmount.
+ true
+ umount /distro/workspace/mount/dev/pts
umount: /distro/workspace/mount/dev/pts: must be superuser to unmount.
+ true
+ umount /distro/workspace/mount
umount: /distro/workspace/mount: must be superuser to unmount.
+ true
+ /CustomPiOS/build_custom_os default
Distro path: /distro
CustomPiOS path: /CustomPiOS
================================================================
+ /CustomPiOS/build default
+ '[' -n '' ']'
+ LOG=build.log
+ define SCRIPT
+ IFS='\n'
+ read -r -d '' SCRIPT
+ true
+ '[' build.log '!=' no ']'
+ touch build.log
+ chmod 666 build.log
+ eval 'BUILD_SCRIPT_PATH=$(dirname $(realpath -s $BASH_SOURCE))
source ${BUILD_SCRIPT_PATH}/common.sh
install_cleanup_trap

CUSTOM_OS_PATH=$(dirname $(realpath -s $0))

source ${CUSTOM_PI_OS_PATH}/config ${@}
${CUSTOM_PI_OS_PATH}/config_sanity

[ "$CONFIG_ONLY" == "yes" ] || source ${CUSTOM_OS_PATH}/custompios
'
+ tee build.log
++++ realpath -s /CustomPiOS/build
+++ dirname /CustomPiOS/build
++ BUILD_SCRIPT_PATH=/CustomPiOS
++ source /CustomPiOS/common.sh
++ install_cleanup_trap
++ set -e
++ trap cleanup SIGINT SIGTERM
++++ realpath -s /CustomPiOS/build
+++ dirname /CustomPiOS/build
++ CUSTOM_OS_PATH=/CustomPiOS
++ source /CustomPiOS/config default
+++++ realpath -s /CustomPiOS/config
++++ dirname /CustomPiOS/config
+++ CONFIG_DIR=/CustomPiOS
+++ WORKSPACE_POSTFIX=
+++ export BUILD_VARIANT=
+++ BUILD_VARIANT=
+++ BUILD_VARIANT=default
+++ : default
+++ export BUILD_FLAVOR=
+++ BUILD_FLAVOR=
+++ : default
+++ echo -e '--> Building VARIANT default, FLAVOR default'
--> Building VARIANT default, FLAVOR default
+++ '[' -f /CustomPiOS/config.local ']'
+++ source /distro/config
++++ export DIST_NAME=dokupi
++++ DIST_NAME=dokupi
++++ export DIST_VERSION=0.1.0
++++ DIST_VERSION=0.1.0
++++ export RPI_IMAGER_NAME=dokupi
++++ RPI_IMAGER_NAME=dokupi
++++ export 'RPI_IMAGER_DESCRIPTION=A raspberrypi distro built with CustomPiOS'
++++ RPI_IMAGER_DESCRIPTION='A raspberrypi distro built with CustomPiOS'
++++ export RPI_IMAGER_WEBSITE=https://github.com/guysoft/CustomPiOS
++++ RPI_IMAGER_WEBSITE=https://github.com/guysoft/CustomPiOS
++++ export RPI_IMAGER_ICON=https://raw.githubusercontent.com/guysoft/CustomPiOS/devel/media/rpi-imager-CustomPiOS.png
++++ RPI_IMAGER_ICON=https://raw.githubusercontent.com/guysoft/CustomPiOS/devel/media/rpi-imager-CustomPiOS.png
++++ export AUTO_HOTSPOT_PASSWORD=dokuwiki
++++ AUTO_HOTSPOT_PASSWORD=dokuwiki
++++ export 'MODULES=base(network,disable-services(auto-hotspot),default-user,dokupi)'
++++ MODULES='base(network,disable-services(auto-hotspot),default-user,dokupi)'
+++ '[' default '!=' default ']'
+++ echo Import the variant config if we have one
Import the variant config if we have one
+++ '[' -n '' ']'
+++ '[' -n '' ']'
+++ '[' -f /distro/config.local ']'
+++ TMP='base,network,disable-services,auto-hotspot),default-user,dokupi)'
+++ TMP='base,network,disable-services,auto-hotspot),default-user,dokupi)'
+++ MODULES_LIST=base,network,disable-services,auto-hotspot,,default-user,dokupi,
++++ echo base,network,disable-services,auto-hotspot,,default-user,dokupi,
++++ tr , '\n'
+++ for module in $(echo "${MODULES_LIST}" | tr "," "\n")
+++ '[' -d /distro/modules/base ']'
+++ '[' -d /CustomPiOS/modules/base ']'
+++ export MODULE_PATH=/CustomPiOS/modules/base
+++ MODULE_PATH=/CustomPiOS/modules/base
+++ echo 'loading base config at /CustomPiOS/modules/base/config'
loading base config at /CustomPiOS/modules/base/config
+++ '[' -f /CustomPiOS/modules/base/config ']'
+++ source /CustomPiOS/modules/base/config
++++ BASE_VERSION=1.5.0
++++ '[' -n '' ']'
++++ BASE_PRESCRIPT=
++++ '[' -n '' ']'
++++ BASE_POSTSCRIPT=
++++ '[' -n '' ']'
++++ BASE_IMAGE_PATH=/distro/image
++++ '[' -n '' ']'
++++ BASE_IMAGE_RASPBIAN=yes
++++ '[' -n '' ']'
++++ BASE_DISTRO=raspbian
++++ '[' raspbian = ubuntu ']'
++++ '[' raspbian = raspios64 ']'
++++ '[' -n '' ']'
+++++ head -n 1
+++++ ls -t '/distro/image/*-raspbian*.zip' '/distro/image/*-raspbian*.7z' '/distro/image/*-raspbian*.xz' '/distro/image/*-raspios*.zip' '/distro/image/*-raspios*.7z' /distro/image/2023-10-10-raspios-bookworm-armhf-lite.img.xz
ls: cannot access '/distro/image/*-raspbian*.zip': No such file or directory
ls: cannot access '/distro/image/*-raspbian*.7z': No such file or directory
ls: cannot access '/distro/image/*-raspbian*.xz': No such file or directory
ls: cannot access '/distro/image/*-raspios*.zip': No such file or directory
ls: cannot access '/distro/image/*-raspios*.7z': No such file or directory
++++ BASE_ZIP_IMG=/distro/image/2023-10-10-raspios-bookworm-armhf-lite.img.xz
++++ '[' -n '' ']'
++++ BASE_USER=pi
++++ '[' -n '' ']'
++++ BASE_ADD_USER=yes
++++ '[' -n '' ']'
++++ BASE_USER_PASSWORD=raspberry
++++ '[' -n '' ']'
++++ BASE_RELEASE_COMPRESS=yes
++++ '[' -n '' ']'
++++ BASE_RELEASE_IMG_NAME=default
++++ '[' -n '' ']'
++++ BASE_RELEASE_ZIP_NAME=default
++++ '[' -n '' ']'
++++ BASE_WORKSPACE=/distro/workspace
++++ '[' -n '' ']'
++++ BASE_MOUNT_PATH=/distro/workspace/mount
++++ '[' raspbian = ubuntu ']'
++++ '[' -n '' ']'
++++ BASE_BOOT_MOUNT_PATH=boot
++++ '[' -n '' ']'
++++ BASE_ROOT_PARTITION=2
++++ '[' -n '' ']'
++++ BASE_IMAGE_ENLARGEROOT=200
++++ '[' -n '' ']'
++++ BASE_IMAGE_RESIZEROOT=200
++++ '[' -n '' ']'
++++ BASE_APT_CACHE=/distro/workspace/aptcache
++++ '[' -n '' ']'
++++ BASE_APT_PROXY=
++++ '[' -n '' ']'
++++ BASE_APT_MIRROR=
++++ '[' -n '' ']'
++++ BASE_PYPI_INDEX=
++++ '[' -n '' ']'
++++ BASE_OVERRIDE_HOSTNAME=dokupi
++++ '[' -n '' ']'
++++ BASE_BUILD_REPO_MIRROR=
++++ '[' -n '' ']'
++++ BASE_SSH_ENABLE=yes
++++ '[' -n '' ']'
+++++ git -C /CustomPiOS rev-parse HEAD
fatal: not a git repository (or any of the parent directories): .git
++++ BASE_COMMIT=
++++ true
++++ '[' -n '' ']'
++++ BASE_CONFIG_MEMSPLIT=default
++++ '[' -n '' ']'
++++ BASE_CONFIG_TIMEZONE=default
++++ '[' -n '' ']'
++++ BASE_CONFIG_LOCALE=default
++++ '[' -n '' ']'
++++ BASE_CONFIG_KEYBOARD=default
++++ '[' -n '' ']'
++++ BASE_ARCH=armv7l
++++ '[' -n '' ']'
++++ BASE_IGNORE_VARIANT_NAME=no
++++ '[' -n '' ']'
++++ BASE_ENABLE_UART=no
++++ : yes
+++ echo ================================================================
================================================================
+++ echo 'Using the following config:'
Using the following config:
+++ module_up=BASE
+++ module_up=BASE_
+++ IFS=
+++ read -r var
++++ compgen -A variable BASE_
+++ export BASE_ADD_USER
+++ echo BASE_ADD_USER
BASE_ADD_USER
+++ IFS=
+++ read -r var
+++ export BASE_APT_CACHE
+++ echo BASE_APT_CACHE
BASE_APT_CACHE
+++ IFS=
+++ read -r var
+++ export BASE_APT_CLEAN
+++ echo BASE_APT_CLEAN
BASE_APT_CLEAN
+++ IFS=
+++ read -r var
+++ export BASE_APT_MIRROR
+++ echo BASE_APT_MIRROR
BASE_APT_MIRROR
+++ IFS=
+++ read -r var
+++ export BASE_APT_PROXY
+++ echo BASE_APT_PROXY
BASE_APT_PROXY
+++ IFS=
+++ read -r var
+++ export BASE_ARCH
+++ echo BASE_ARCH
BASE_ARCH
+++ IFS=
+++ read -r var
+++ export BASE_BOOT_MOUNT_PATH
+++ echo BASE_BOOT_MOUNT_PATH
BASE_BOOT_MOUNT_PATH
+++ IFS=
+++ read -r var
+++ export BASE_BUILD_REPO_MIRROR
+++ echo BASE_BUILD_REPO_MIRROR
BASE_BUILD_REPO_MIRROR
+++ IFS=
+++ read -r var
+++ export BASE_COMMIT
+++ echo BASE_COMMIT
BASE_COMMIT
+++ IFS=
+++ read -r var
+++ export BASE_CONFIG_KEYBOARD
+++ echo BASE_CONFIG_KEYBOARD
BASE_CONFIG_KEYBOARD
+++ IFS=
+++ read -r var
+++ export BASE_CONFIG_LOCALE
+++ echo BASE_CONFIG_LOCALE
BASE_CONFIG_LOCALE
+++ IFS=
+++ read -r var
+++ export BASE_CONFIG_MEMSPLIT
+++ echo BASE_CONFIG_MEMSPLIT
BASE_CONFIG_MEMSPLIT
+++ IFS=
+++ read -r var
+++ export BASE_CONFIG_TIMEZONE
+++ echo BASE_CONFIG_TIMEZONE
BASE_CONFIG_TIMEZONE
+++ IFS=
+++ read -r var
+++ export BASE_DISTRO
+++ echo BASE_DISTRO
BASE_DISTRO
+++ IFS=
+++ read -r var
+++ export BASE_ENABLE_UART
+++ echo BASE_ENABLE_UART
BASE_ENABLE_UART
+++ IFS=
+++ read -r var
+++ export BASE_IGNORE_VARIANT_NAME
+++ echo BASE_IGNORE_VARIANT_NAME
BASE_IGNORE_VARIANT_NAME
+++ IFS=
+++ read -r var
+++ export BASE_IMAGE_ENLARGEROOT
+++ echo BASE_IMAGE_ENLARGEROOT
BASE_IMAGE_ENLARGEROOT
+++ IFS=
+++ read -r var
+++ export BASE_IMAGE_PATH
+++ echo BASE_IMAGE_PATH
BASE_IMAGE_PATH
+++ IFS=
+++ read -r var
+++ export BASE_IMAGE_RASPBIAN
+++ echo BASE_IMAGE_RASPBIAN
BASE_IMAGE_RASPBIAN
+++ IFS=
+++ read -r var
+++ export BASE_IMAGE_RESIZEROOT
+++ echo BASE_IMAGE_RESIZEROOT
BASE_IMAGE_RESIZEROOT
+++ IFS=
+++ read -r var
+++ export BASE_MOUNT_PATH
+++ echo BASE_MOUNT_PATH
BASE_MOUNT_PATH
+++ IFS=
+++ read -r var
+++ export BASE_OVERRIDE_HOSTNAME
+++ echo BASE_OVERRIDE_HOSTNAME
BASE_OVERRIDE_HOSTNAME
+++ IFS=
+++ read -r var
+++ export BASE_POSTSCRIPT
+++ echo BASE_POSTSCRIPT
BASE_POSTSCRIPT
+++ IFS=
+++ read -r var
+++ export BASE_PRESCRIPT
+++ echo BASE_PRESCRIPT
BASE_PRESCRIPT
+++ IFS=
+++ read -r var
+++ export BASE_PYPI_INDEX
+++ echo BASE_PYPI_INDEX
BASE_PYPI_INDEX
+++ IFS=
+++ read -r var
+++ export BASE_RELEASE_COMPRESS
+++ echo BASE_RELEASE_COMPRESS
BASE_RELEASE_COMPRESS
+++ IFS=
+++ read -r var
+++ export BASE_RELEASE_IMG_NAME
+++ echo BASE_RELEASE_IMG_NAME
BASE_RELEASE_IMG_NAME
+++ IFS=
+++ read -r var
+++ export BASE_RELEASE_ZIP_NAME
+++ echo BASE_RELEASE_ZIP_NAME
BASE_RELEASE_ZIP_NAME
+++ IFS=
+++ read -r var
+++ export BASE_ROOT_PARTITION
+++ echo BASE_ROOT_PARTITION
BASE_ROOT_PARTITION
+++ IFS=
+++ read -r var
+++ export BASE_SSH_ENABLE
+++ echo BASE_SSH_ENABLE
BASE_SSH_ENABLE
+++ IFS=
+++ read -r var
+++ export BASE_USER
+++ echo BASE_USER
BASE_USER
+++ IFS=
+++ read -r var
+++ export BASE_USER_PASSWORD
+++ echo BASE_USER_PASSWORD
BASE_USER_PASSWORD
+++ IFS=
+++ read -r var
+++ export BASE_VERSION
+++ echo BASE_VERSION
BASE_VERSION
+++ IFS=
+++ read -r var
+++ export BASE_WORKSPACE
+++ echo BASE_WORKSPACE
BASE_WORKSPACE
+++ IFS=
+++ read -r var
+++ export BASE_ZIP_IMG
+++ echo BASE_ZIP_IMG
BASE_ZIP_IMG
+++ IFS=
+++ read -r var
+++ echo ================================================================
================================================================
+++ for module in $(echo "${MODULES_LIST}" | tr "," "\n")
+++ '[' -d /distro/modules/network ']'
+++ '[' -d /CustomPiOS/modules/network ']'
+++ export MODULE_PATH=/CustomPiOS/modules/network
+++ MODULE_PATH=/CustomPiOS/modules/network
+++ echo 'loading network config at /CustomPiOS/modules/network/config'
loading network config at /CustomPiOS/modules/network/config
+++ '[' -f /CustomPiOS/modules/network/config ']'
+++ source /CustomPiOS/modules/network/config
++++ '[' -n '' ']'
++++ NETWORK_DISABLE_PWRSAVE=yes
++++ '[' -n '' ']'
++++ NETWORK_PWRSAVE_TYPE=udev
+++ echo ================================================================
================================================================
+++ echo 'Using the following config:'
Using the following config:
+++ module_up=NETWORK
+++ module_up=NETWORK_
+++ IFS=
+++ read -r var
++++ compgen -A variable NETWORK_
+++ export NETWORK_DISABLE_PWRSAVE
+++ echo NETWORK_DISABLE_PWRSAVE
NETWORK_DISABLE_PWRSAVE
+++ IFS=
+++ read -r var
+++ export NETWORK_PWRSAVE_TYPE
+++ echo NETWORK_PWRSAVE_TYPE
NETWORK_PWRSAVE_TYPE
+++ IFS=
+++ read -r var
+++ echo ================================================================
================================================================
+++ for module in $(echo "${MODULES_LIST}" | tr "," "\n")
+++ '[' -d /distro/modules/disable-services ']'
+++ '[' -d /CustomPiOS/modules/disable-services ']'
+++ export MODULE_PATH=/CustomPiOS/modules/disable-services
+++ MODULE_PATH=/CustomPiOS/modules/disable-services
+++ echo 'loading disable-services config at /CustomPiOS/modules/disable-services/config'
loading disable-services config at /CustomPiOS/modules/disable-services/config
+++ '[' -f /CustomPiOS/modules/disable-services/config ']'
+++ echo 'WARNING: module disable-services has no config file'
WARNING: module disable-services has no config file
+++ echo ================================================================
================================================================
+++ echo 'Using the following config:'
Using the following config:
+++ module_up=DISABLE-SERVICES
+++ module_up=DISABLE_SERVICES_
++++ compgen -A variable DISABLE_SERVICES_
+++ IFS=
+++ read -r var
+++ echo ================================================================
================================================================
+++ for module in $(echo "${MODULES_LIST}" | tr "," "\n")
+++ '[' -d /distro/modules/auto-hotspot ']'
+++ '[' -d /CustomPiOS/modules/auto-hotspot ']'
+++ export MODULE_PATH=/CustomPiOS/modules/auto-hotspot
+++ MODULE_PATH=/CustomPiOS/modules/auto-hotspot
+++ echo 'loading auto-hotspot config at /CustomPiOS/modules/auto-hotspot/config'
loading auto-hotspot config at /CustomPiOS/modules/auto-hotspot/config
+++ '[' -f /CustomPiOS/modules/auto-hotspot/config ']'
+++ source /CustomPiOS/modules/auto-hotspot/config
++++ '[' -n '' ']'
++++ AUTO_HOTSPOT_NAME=dokupi
++++ '[' -n dokuwiki ']'
++++ '[' -n '' ']'
++++ AUTO_HOTSPOT_CHANNEL=6
+++ echo ================================================================
================================================================
+++ echo 'Using the following config:'
Using the following config:
+++ module_up=AUTO-HOTSPOT
+++ module_up=AUTO_HOTSPOT_
+++ IFS=
+++ read -r var
++++ compgen -A variable AUTO_HOTSPOT_
+++ export AUTO_HOTSPOT_CHANNEL
+++ echo AUTO_HOTSPOT_CHANNEL
AUTO_HOTSPOT_CHANNEL
+++ IFS=
+++ read -r var
+++ export AUTO_HOTSPOT_NAME
+++ echo AUTO_HOTSPOT_NAME
AUTO_HOTSPOT_NAME
+++ IFS=
+++ read -r var
+++ export AUTO_HOTSPOT_PASSWORD
+++ echo AUTO_HOTSPOT_PASSWORD
AUTO_HOTSPOT_PASSWORD
+++ IFS=
+++ read -r var
+++ echo ================================================================
================================================================
+++ for module in $(echo "${MODULES_LIST}" | tr "," "\n")
+++ '[' -d /distro/modules/default-user ']'
+++ '[' -d /CustomPiOS/modules/default-user ']'
+++ echo 'loading default-user config at /CustomPiOS/modules/auto-hotspot/config'
loading default-user config at /CustomPiOS/modules/auto-hotspot/config
+++ '[' -f /CustomPiOS/modules/auto-hotspot/config ']'
+++ source /CustomPiOS/modules/auto-hotspot/config
++++ '[' -n dokupi ']'
++++ '[' -n dokuwiki ']'
++++ '[' -n 6 ']'
+++ echo ================================================================
================================================================
+++ echo 'Using the following config:'
Using the following config:
+++ module_up=DEFAULT-USER
+++ module_up=DEFAULT_USER_
+++ IFS=
+++ read -r var
++++ compgen -A variable DEFAULT_USER_
+++ echo ================================================================
================================================================
+++ for module in $(echo "${MODULES_LIST}" | tr "," "\n")
+++ '[' -d /distro/modules/dokupi ']'
+++ export MODULE_PATH=/distro/modules/dokupi
+++ MODULE_PATH=/distro/modules/dokupi
+++ echo 'loading dokupi config at /distro/modules/dokupi/config'
loading dokupi config at /distro/modules/dokupi/config
+++ '[' -f /distro/modules/dokupi/config ']'
+++ source /distro/modules/dokupi/config
++++ DOKUPI_VAR='This is a module variable'
+++ echo ================================================================
================================================================
+++ echo 'Using the following config:'
Using the following config:
+++ module_up=DOKUPI
+++ module_up=DOKUPI_
+++ IFS=
+++ read -r var
++++ compgen -A variable DOKUPI_
+++ export DOKUPI_VAR
+++ echo DOKUPI_VAR
DOKUPI_VAR
+++ IFS=
+++ read -r var
+++ echo ================================================================
================================================================
++ /CustomPiOS/config_sanity
++ '[' '' == yes ']'
++ source /CustomPiOS/custompios
+++ set -e
+++ export LC_ALL=C
+++ LC_ALL=C
+++ source /CustomPiOS/common.sh
++++ date
+++ echo_green -e '\nBUILD STARTED @ Wed Nov 29 20:12:20 UTC 2023!\n'
+++ echo -e -n '\e[92m'
+++ echo -e '\nBUILD' STARTED @ Wed Nov 29 20:12:20 UTC '2023!\n'

BUILD STARTED @ Wed Nov 29 20:12:20 UTC 2023!

+++ echo -e -n '\e[0m'
+++ '[' -n 200 ']'
+++ which sfdisk
+++ mkdir -p /distro/workspace
+++ mkdir -p /distro/workspace/mount
+++ rm -rf '/distro/workspace/*.tar.gz'
+++ install_cleanup_trap
+++ set -e
+++ trap cleanup SIGINT SIGTERM
+++ install_fail_on_error_trap
+++ set -e
+++ trap 'echo_red "build failed, unmounting image..." && cd $DIST_PATH && ( unmount_image $BASE_MOUNT_PATH force || true ) && echo_red -e "\nBUILD FAILED!\n"' ERR
+++ unmount_image /distro/workspace/mount force
+++ mount_path=/distro/workspace/mount
+++ force=
+++ '[' 2 -gt 1 ']'
+++ force=force
+++ sync
+++ '[' -n force ']'
++++ sudo lsof -t /distro/workspace/mount
++++ sudo mount
++++ grep /distro/workspace/mount
++++ awk -F ' on ' '{print $2}'
++++ awk '{print $1}'
++++ sort -r
+++ pushd /distro/workspace
/distro/workspace /distro
+++ '[' -e '*.img' ']'
+++ '[' '!' -f /distro/image/2023-10-10-raspios-bookworm-armhf-lite.img.xz ']'
+++ '[' /distro/image/2023-10-10-raspios-bookworm-armhf-lite.img.xz == '' ']'
+++ [[ /distro/image/2023-10-10-raspios-bookworm-armhf-lite.img.xz =~ \.img$ ]]
+++ 7za x -aoa /distro/image/2023-10-10-raspios-bookworm-armhf-lite.img.xz

7-Zip (a) [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
p7zip Version 16.02 (locale=C,Utf16=off,HugeFiles=on,64 bits,4 CPUs Intel(R) Core(TM) i5-6600K CPU @ 3.50GHz (506E3),ASM,AES-NI)

Scanning the drive for archives:
1 file, 596013972 bytes (569 MiB)

Extracting archive: /distro/image/2023-10-10-raspios-bookworm-armhf-lite.img.xz
--
Path = /distro/image/2023-10-10-raspios-bookworm-armhf-lite.img.xz
Type = xz
Physical Size = 596013972
Method = LZMA2:26 CRC64
Streams = 1
Blocks = 13

Everything is Ok

Size:       2520776704
Compressed: 596013972
++++ ls
++++ grep '.img$\|.raw$'
++++ head -n 1
+++ BASE_IMG_PATH=2023-10-10-raspios-bookworm-armhf-lite.img
+++ '[' '!' -f 2023-10-10-raspios-bookworm-armhf-lite.img ']'
++++ basename 2023-10-10-raspios-bookworm-armhf-lite.img
+++ export CUSTOM_PI_OS_BUILDBASE=2023-10-10-raspios-bookworm-armhf-lite.img
+++ CUSTOM_PI_OS_BUILDBASE=2023-10-10-raspios-bookworm-armhf-lite.img
+++ '[' -n 200 ']'
+++ enlarge_ext 2023-10-10-raspios-bookworm-armhf-lite.img 2 200
+++ image=2023-10-10-raspios-bookworm-armhf-lite.img
+++ partition=2
+++ size=200
+++ echo_green 'Adding 200 MB to partition 2 of 2023-10-10-raspios-bookworm-armhf-lite.img'
+++ echo -e -n '\e[92m'
+++ echo Adding 200 MB to partition 2 of 2023-10-10-raspios-bookworm-armhf-lite.img
Adding 200 MB to partition 2 of 2023-10-10-raspios-bookworm-armhf-lite.img
+++ echo -e -n '\e[0m'
++++ sfdisk --json 2023-10-10-raspios-bookworm-armhf-lite.img
++++ jq '.partitiontable.partitions[] | select(.node ==  "2023-10-10-raspios-bookworm-armhf-lite.img2").start'
+++ start=1056768
+++ offset=541065216
+++ dd if=/dev/zero bs=1M count=200
200+0 records in
200+0 records out
209715200 bytes (210 MB, 200 MiB) copied, 0.37485 s, 559 MB/s
+++ fdisk 2023-10-10-raspios-bookworm-armhf-lite.img

Welcome to fdisk (util-linux 2.38.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Command (m for help): Disk 2023-10-10-raspios-bookworm-armhf-lite.img: 2.54 GiB, 2730491904 bytes, 5332992 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x7550d926

Device                                      Boot   Start     End Sectors  Size Id Type
2023-10-10-raspios-bookworm-armhf-lite.img1         8192 1056767 1048576  512M  c W95 FAT32 (LBA)
2023-10-10-raspios-bookworm-armhf-lite.img2      1056768 4923391 3866624  1.8G 83 Linux

Command (m for help): Partition number (1,2, default 2): 
Partition 2 has been deleted.

Command (m for help): Partition type
   p   primary (1 primary, 0 extended, 3 free)
   e   extended (container for logical partitions)
Select (default p): Partition number (2-4, default 2): First sector (2048-5332991, default 2048): Last sector, +/-sectors or +/-size{K,M,G,T,P} (1056768-5332991, default 5332991): 
Created a new partition 2 of type 'Linux' and of size 2 GiB.
Partition #2 contains a ext4 signature.

Command (m for help): 
Disk 2023-10-10-raspios-bookworm-armhf-lite.img: 2.54 GiB, 2730491904 bytes, 5332992 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x7550d926

Device                                      Boot   Start     End Sectors  Size Id Type
2023-10-10-raspios-bookworm-armhf-lite.img1         8192 1056767 1048576  512M  c W95 FAT32 (LBA)
2023-10-10-raspios-bookworm-armhf-lite.img2      1056768 5332991 4276224    2G 83 Linux

Command (m for help): The partition table has been altered.
Syncing disks.

+++ detach_all_loopback 2023-10-10-raspios-bookworm-armhf-lite.img
++++ losetup
++++ grep 2023-10-10-raspios-bookworm-armhf-lite.img
++++ awk '{ print $1 }'
+++ test_for_image 2023-10-10-raspios-bookworm-armhf-lite.img
+++ '[' '!' -f 2023-10-10-raspios-bookworm-armhf-lite.img ']'
++++ losetup -f --show -o 541065216 2023-10-10-raspios-bookworm-armhf-lite.img
losetup: 2023-10-10-raspios-bookworm-armhf-lite.img: failed to set up loop device: No such file or directory
+++ LODEV=
+ exit 1
guysoft commented 10 months ago

Duplicate of #55