++++ 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 ++ pushd /CustomPiOS /CustomPiOS /distro +++ git rev-parse HEAD fatal: not a git repository (or any of the parent directories): .git ++ export OCTOPI_COMMIT= ++ OCTOPI_COMMIT= ++ popd /distro ++ source /CustomPiOS/config +++++ realpath -s /CustomPiOS/config ++++ dirname /CustomPiOS/config +++ CONFIG_DIR=/CustomPiOS +++ export BUILD_VARIANT=default +++ BUILD_VARIANT=default +++ BUILD_FLAVOR=default +++ WORKSPACE_POSTFIX= +++ '[' 0 -gt 0 ']' +++ '[' 0 -gt 1 ']' +++ echo -e '--> Building VARIANT default, FLAVOR default' --> Building VARIANT default, FLAVOR default +++ '[' -f /CustomPiOS/config.local ']' +++ source /distro/config ++++ export DIST_NAME=ZynthianOS ++++ DIST_NAME=ZynthianOS ++++ export DIST_VERSION=1.0.0 ++++ DIST_VERSION=1.0.0 ++++ export 'MODULES=base(network, disable-services(zynthianos))' ++++ MODULES='base(network, disable-services(zynthianos))' ++++ export BASE_OVERRIDE_HOSTNAME=zynthian ++++ BASE_OVERRIDE_HOSTNAME=zynthian ++++ export BASE_IMAGE_ENLARGEROOT=14000 ++++ BASE_IMAGE_ENLARGEROOT=14000 ++++ export BASE_IMAGE_RESIZEROOT=200 ++++ BASE_IMAGE_RESIZEROOT=200 ++++ BASE_APT_CACHE=/distro/aptcache +++ '[' 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,zynthianos))' +++ TMP='base,network,disable-services,zynthianos))' +++ MODULES_LIST=base,network,disable-services,zynthianos,, ++++ tr , '\n' ++++ echo base,network,disable-services,zynthianos,, +++ 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.3.0 ++++ '[' -n '' ']' ++++ BASE_PRESCRIPT= ++++ '[' -n '' ']' ++++ BASE_POSTSCRIPT= ++++ '[' -n '' ']' ++++ BASE_IMAGE_PATH=/distro/image ++++ '[' -n '' ']' ++++ BASE_IMAGE_RASPBIAN=yes ++++ '[' -n '' ']' +++++ ls -t /distro/image/2019-07-10-raspbian-buster-lite.zip +++++ head -n 1 ++++ BASE_ZIP_IMG=/distro/image/2019-07-10-raspbian-buster-lite.zip ++++ '[' -n '' ']' ++++ BASE_WORKSPACE=/distro/workspace ++++ '[' -n '' ']' ++++ BASE_MOUNT_PATH=/distro/workspace/mount ++++ '[' -n '' ']' ++++ BASE_ROOT_PARTITION=2 ++++ '[' -n 14000 ']' ++++ '[' -n 200 ']' ++++ '[' -n /distro/aptcache ']' ++++ '[' -n '' ']' ++++ BASE_APT_PROXY= ++++ '[' -n '' ']' ++++ BASE_PYPI_INDEX= ++++ '[' -n zynthian ']' ++++ '[' -n '' ']' ++++ BASE_BUILD_REPO_MIRROR= ++++ '[' -n '' ']' ++++ BASE_SSH_ENABLE=yes ++++ '[' -n '' ']' +++++ pushd /CustomPiOS +++++ git rev-parse HEAD fatal: not a git repository (or any of the parent directories): .git +++++ popd ++++ BASE_COMMIT= ++++ '[' -n '' ']' ++++ BASE_CONFIG_MEMSPLIT=default ++++ '[' -n '' ']' ++++ BASE_CONFIG_TIMEZONE=default ++++ '[' -n '' ']' ++++ BASE_CONFIG_LOCALE=default ++++ '[' -n '' ']' ++++ BASE_CONFIG_KEYBOARD=default +++ 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_APT_CACHE +++ echo BASE_APT_CACHE BASE_APT_CACHE +++ IFS= +++ read -r var +++ export BASE_APT_PROXY +++ echo BASE_APT_PROXY BASE_APT_PROXY +++ 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_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_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_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 +++ echo ================================================================ ================================================================ +++ echo 'Using the following config:' Using the following config: +++ module_up=NETWORK +++ module_up=NETWORK_ +++ IFS= +++ read -r var ++++ compgen -A variable NETWORK_ +++ 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_ +++ IFS= +++ read -r var ++++ compgen -A variable DISABLE_SERVICES_ +++ echo ================================================================ ================================================================ +++ for module in $(echo "${MODULES_LIST}" | tr "," "\n") +++ '[' -d /distro/modules/zynthianos ']' +++ export MODULE_PATH=/distro/modules/zynthianos +++ MODULE_PATH=/distro/modules/zynthianos +++ echo loading zynthianos config at /distro/modules/zynthianos/config loading zynthianos config at /distro/modules/zynthianos/config +++ '[' -f /distro/modules/zynthianos/config ']' +++ source /distro/modules/zynthianos/config ++++ '[' -n /distro/image/2019-07-10-raspbian-buster-lite.zip ']' ++++ '[' -n '' ']' ++++ ZYNTHIANOS_SYS_REPO_SHIP=https://github.com/zynthian/zynthian-sys.git ++++ '[' -n '' ']' ++++ ZYNTHIANOS_SYS_REPO_BUILD= ++++ '[' -n '' ']' ++++ ZYNTHIANOS_SYS_REPO_BRANCH=master +++ echo ================================================================ ================================================================ +++ echo 'Using the following config:' Using the following config: +++ module_up=ZYNTHIANOS +++ module_up=ZYNTHIANOS_ +++ IFS= +++ read -r var ++++ compgen -A variable ZYNTHIANOS_ +++ export ZYNTHIANOS_SYS_REPO_BRANCH +++ echo ZYNTHIANOS_SYS_REPO_BRANCH ZYNTHIANOS_SYS_REPO_BRANCH +++ IFS= +++ read -r var +++ export ZYNTHIANOS_SYS_REPO_BUILD +++ echo ZYNTHIANOS_SYS_REPO_BUILD ZYNTHIANOS_SYS_REPO_BUILD +++ IFS= +++ read -r var +++ export ZYNTHIANOS_SYS_REPO_SHIP +++ echo ZYNTHIANOS_SYS_REPO_SHIP ZYNTHIANOS_SYS_REPO_SHIP +++ 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 +++ 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 +++ '[' -n force ']' ++++ sudo lsof /distro/workspace/mount ++++ awk '{print $2}' ++++ 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/2019-07-10-raspbian-buster-lite.zip ']' +++ '[' /distro/image/2019-07-10-raspbian-buster-lite.zip == '' ']' +++ 7za x -aoa /distro/image/2019-07-10-raspbian-buster-lite.zip 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,2 CPUs Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz (406E3),ASM,AES-NI) Scanning the drive for archives: 1 file, 426250971 bytes (407 MiB) Extracting archive: /distro/image/2019-07-10-raspbian-buster-lite.zip -- Path = /distro/image/2019-07-10-raspbian-buster-lite.zip Type = zip Physical Size = 426250971 Everything is Ok Size: 2197815296 Compressed: 426250971 ++++ ls ++++ head -n 1 ++++ grep '.img$\|.raw$' +++ BASE_IMG_PATH=2019-07-10-raspbian-buster-lite.img +++ '[' '!' -f 2019-07-10-raspbian-buster-lite.img ']' ++++ basename 2019-07-10-raspbian-buster-lite.img +++ export CUSTOM_PI_OS_BUILDBASE=2019-07-10-raspbian-buster-lite.img +++ CUSTOM_PI_OS_BUILDBASE=2019-07-10-raspbian-buster-lite.img +++ '[' -n 14000 ']' +++ enlarge_ext 2019-07-10-raspbian-buster-lite.img 2 14000 +++ image=2019-07-10-raspbian-buster-lite.img +++ partition=2 +++ size=14000 +++ echo 'Adding 14000 MB to partition 2 of 2019-07-10-raspbian-buster-lite.img' Adding 14000 MB to partition 2 of 2019-07-10-raspbian-buster-lite.img ++++ sfdisk -d 2019-07-10-raspbian-buster-lite.img ++++ awk '{print $4-0}' ++++ grep 2019-07-10-raspbian-buster-lite.img2 +++ start=540672 +++ offset=276824064 +++ dd if=/dev/zero bs=1M count=14000 14000+0 records in 14000+0 records out 14680064000 bytes (15 GB, 14 GiB) copied, 23.66 s, 620 MB/s +++ fdisk 2019-07-10-raspbian-buster-lite.img Welcome to fdisk (util-linux 2.33.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 2019-07-10-raspbian-buster-lite.img: 15.7 GiB, 16877879296 bytes, 32964608 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: 0x17869b7d Device Boot Start End Sectors Size Id Type 2019-07-10-raspbian-buster-lite.img1 8192 532480 524289 256M c W95 FAT32 (LBA) 2019-07-10-raspbian-buster-lite.img2 540672 4292607 3751936 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-32964607, default 2048): Last sector, +/-sectors or +/-size{K,M,G,T,P} (540672-32964607, default 32964607): Created a new partition 2 of type 'Linux' and of size 15.5 GiB. Partition #2 contains a ext4 signature. Command (m for help): Disk 2019-07-10-raspbian-buster-lite.img: 15.7 GiB, 16877879296 bytes, 32964608 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: 0x17869b7d Device Boot Start End Sectors Size Id Type 2019-07-10-raspbian-buster-lite.img1 8192 532480 524289 256M c W95 FAT32 (LBA) 2019-07-10-raspbian-buster-lite.img2 540672 32964607 32423936 15.5G 83 Linux Command (m for help): The partition table has been altered. Syncing disks. +++ detach_all_loopback 2019-07-10-raspbian-buster-lite.img ++++ losetup ++++ grep 2019-07-10-raspbian-buster-lite.img ++++ awk '{ print $1 }' ++++ losetup -f --show -o 276824064 2019-07-10-raspbian-buster-lite.img +++ LODEV=/dev/loop8 +++ trap 'losetup -d $LODEV' EXIT +++ e2fsck -fy /dev/loop8 e2fsck 1.44.5 (15-Dec-2018) Pass 1: Checking inodes, blocks, and sizes Pass 2: Checking directory structure Pass 3: Checking directory connectivity Pass 4: Checking reference counts Pass 5: Checking group summary information rootfs: 42162/117360 files (0.1% non-contiguous), 270342/468992 blocks +++ resize2fs -p /dev/loop8 resize2fs 1.44.5 (15-Dec-2018) Resizing the filesystem on /dev/loop8 to 4052992 (4k) blocks. Begin pass 1 (max = 109) Extending the inode table ----------------------------------------XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX The filesystem on /dev/loop8 is now 4052992 (4k) blocks long. +++ losetup -d /dev/loop8 +++ trap - EXIT +++ echo 'Resized parition 2 of 2019-07-10-raspbian-buster-lite.img to +14000 MB' Resized parition 2 of 2019-07-10-raspbian-buster-lite.img to +14000 MB +++ mount_image 2019-07-10-raspbian-buster-lite.img 2 /distro/workspace/mount +++ image_path=2019-07-10-raspbian-buster-lite.img +++ root_partition=2 +++ mount_path=/distro/workspace/mount +++ echo 2 2 +++ boot_partition=1 ++++ sfdisk -d 2019-07-10-raspbian-buster-lite.img +++ fdisk_output='label: dos label-id: 0x17869b7d device: 2019-07-10-raspbian-buster-lite.img unit: sectors 2019-07-10-raspbian-buster-lite.img1 : start= 8192, size= 524289, type=c 2019-07-10-raspbian-buster-lite.img2 : start= 540672, size= 32423936, type=83' ++++ awk '{print $4-0}' ++++ grep 2019-07-10-raspbian-buster-lite.img1 ++++ echo 'label: dos label-id: 0x17869b7d device: 2019-07-10-raspbian-buster-lite.img unit: sectors 2019-07-10-raspbian-buster-lite.img1 : start= 8192, size= 524289, type=c 2019-07-10-raspbian-buster-lite.img2 : start= 540672, size= 32423936, type=83' +++ boot_offset=4194304 ++++ awk '{print $4-0}' ++++ echo 'label: dos label-id: 0x17869b7d device: 2019-07-10-raspbian-buster-lite.img unit: sectors 2019-07-10-raspbian-buster-lite.img1 : start= 8192, size= 524289, type=c ++++ grep 2019-07-10-raspbian-buster-lite.img2 2019-07-10-raspbian-buster-lite.img2 : start= 540672, size= 32423936, type=83' +++ root_offset=276824064 +++ echo 'Mounting image 2019-07-10-raspbian-buster-lite.img on /distro/workspace/mount, offset for boot partition is 4194304, offset for root partition is 276824064' Mounting image 2019-07-10-raspbian-buster-lite.img on /distro/workspace/mount, offset for boot partition is 4194304, offset for root partition is 276824064 +++ detach_all_loopback 2019-07-10-raspbian-buster-lite.img ++++ awk '{ print $1 }' ++++ grep 2019-07-10-raspbian-buster-lite.img ++++ losetup +++ sudo losetup -f /dev/loop8 +++ sudo mount -o loop,offset=276824064 2019-07-10-raspbian-buster-lite.img /distro/workspace/mount/ +++ [[ 1 != \2 ]] +++ sudo losetup -f /dev/loop9 ++++ expr 276824064 - 4194304 +++ sudo mount -o loop,offset=4194304,sizelimit=272629760 2019-07-10-raspbian-buster-lite.img /distro/workspace/mount/boot mount: /distro/workspace/mount/boot: failed to setup loop device for /distro/workspace/2019-07-10-raspbian-buster-lite.img.