1. Try a fix for losetup/mkfs.ext4 errors

2. Add a couple of useful packages
3. Change grep to use -e syntax
pull/408/head
Ani Balasubramaniam 2020-04-06 12:47:39 -07:00
parent d32139d790
commit 1d0c0a0d4c
3 changed files with 23 additions and 2 deletions

View File

@ -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"

View File

@ -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"

View File

@ -1 +1,3 @@
python3-pip
python3-pip
v4l2loopback-dkms
ffmpeg