diff --git a/build-docker.sh b/build-docker.sh index 0329819..b40d56d 100755 --- a/build-docker.sh +++ b/build-docker.sh @@ -8,7 +8,7 @@ DOCKER="docker" # Ensure that any config variables we passed in are written to an env_file # so invocations in subsquent shells preserve these values # Add || true so passing no custom vars doesn't bork up execution -printenv | grep 'FWVERSION=\|SERIAL=\|ROOTUSER\|ROOTUSERPASS' || true > "$DIR/.customvars" +printenv | grep -e FWVERSION -e SERIAL -e ROOTUSER -e ROOTUSERPASS || true > "$DIR/.customvars" if ! ${DOCKER} ps >/dev/null 2>&1; then DOCKER="sudo docker" diff --git a/export-image/prerun.sh b/export-image/prerun.sh index a984c99..587d12a 100755 --- a/export-image/prerun.sh +++ b/export-image/prerun.sh @@ -39,8 +39,27 @@ BOOT_LENGTH=$(echo "$PARTED_OUT" | grep -e '^1:' | cut -d':' -f 4 | tr -d B) ROOT_OFFSET=$(echo "$PARTED_OUT" | grep -e '^2:' | cut -d':' -f 2 | tr -d B) ROOT_LENGTH=$(echo "$PARTED_OUT" | grep -e '^2:' | cut -d':' -f 4 | tr -d B) +# Allow errors, losetup might fail the first time +set +e BOOT_DEV=$(losetup --show -f -o "${BOOT_OFFSET}" --sizelimit "${BOOT_LENGTH}" "${IMG_FILE}") +sleep 5 +set -e + +# Should work now +BOOT_DEV=$(losetup --show -f -o "${BOOT_OFFSET}" --sizelimit "${BOOT_LENGTH}" "${IMG_FILE}") + +# Allow errors, losetup might fail the first time +set +e ROOT_DEV=$(losetup --show -f -o "${ROOT_OFFSET}" --sizelimit "${ROOT_LENGTH}" "${IMG_FILE}") +sleep 5 +set -e + +# Should work now +ROOT_DEV=$(losetup --show -f -o "${ROOT_OFFSET}" --sizelimit "${ROOT_LENGTH}" "${IMG_FILE}") + +# Sleep for a bit for the mounted loop devices to show up +sleep 5 + echo "/boot: offset $BOOT_OFFSET, length $BOOT_LENGTH" echo "/: offset $ROOT_OFFSET, length $ROOT_LENGTH" diff --git a/stage2/04-custom-tweaks/00-packages b/stage2/04-custom-tweaks/00-packages index cfe86da..be6eb10 100644 --- a/stage2/04-custom-tweaks/00-packages +++ b/stage2/04-custom-tweaks/00-packages @@ -1 +1,3 @@ -python3-pip \ No newline at end of file +python3-pip +v4l2loopback-dkms +ffmpeg \ No newline at end of file