From 189b8f0400f6f785ebd9b5fcf4ba47862d0d0928 Mon Sep 17 00:00:00 2001 From: rkubes Date: Mon, 14 Jan 2019 17:39:48 -0600 Subject: [PATCH 01/57] Fixed a hard reference to the 'pi' user name --- export-image/04-finalise/01-run.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/export-image/04-finalise/01-run.sh b/export-image/04-finalise/01-run.sh index f5a5fd8..501fef3 100755 --- a/export-image/04-finalise/01-run.sh +++ b/export-image/04-finalise/01-run.sh @@ -8,8 +8,8 @@ on_chroot << EOF hardlink -t /usr/share/doc EOF -if [ -d "${ROOTFS_DIR}/home/pi/.config" ]; then - chmod 700 "${ROOTFS_DIR}/home/pi/.config" +if [ -d "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/.config" ]; then + chmod 700 "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/.config" fi rm -f "${ROOTFS_DIR}/etc/apt/apt.conf.d/51cache" From 3b1d05144fb79a7d57713203c21f147976258a07 Mon Sep 17 00:00:00 2001 From: Mike Roberts <2947595+m-roberts@users.noreply.github.com> Date: Tue, 15 Jan 2019 11:14:45 +0000 Subject: [PATCH 02/57] Fixed another hard reference to the 'pi' user name --- stage4/03-magpi/00-run.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/stage4/03-magpi/00-run.sh b/stage4/03-magpi/00-run.sh index da00ecc..cc5a820 100755 --- a/stage4/03-magpi/00-run.sh +++ b/stage4/03-magpi/00-run.sh @@ -11,6 +11,5 @@ fi file "files/$magpi_latest" | grep -q "PDF document" -install -v -o 1000 -g 1000 -d "${ROOTFS_DIR}/home/pi/MagPi" -install -v -o 1000 -g 1000 -m 644 "files/$magpi_latest" "${ROOTFS_DIR}/home/pi/MagPi/" - +install -v -o 1000 -g 1000 -d "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/MagPi" +install -v -o 1000 -g 1000 -m 644 "files/$magpi_latest" "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/MagPi/" From 640027d5df0ef7eeeabf98fdd327741f4714aeda Mon Sep 17 00:00:00 2001 From: gudata Date: Sun, 20 Jan 2019 21:28:50 +0200 Subject: [PATCH 03/57] build script is build.sh build script is build.sh --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e74aad1..39f6c9b 100755 --- a/README.md +++ b/README.md @@ -102,7 +102,7 @@ IMG_NAME='Raspbian' The config file can also be specified on the command line as an argument the `build.sh` or `build-docker.sh` scripts. ``` -./build -c myconfig +./build.sh -c myconfig ``` This is parsed after `config` so can be used to override values set there. From 21aeca1b0c1ffd4c3336be31da510315714e87a8 Mon Sep 17 00:00:00 2001 From: Hereath Date: Fri, 18 Jan 2019 21:35:54 +0100 Subject: [PATCH 04/57] fixeb package realpath (via coreutils) --- README.md | 2 +- depends | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 39f6c9b..da22352 100755 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ earlier releases of these systems. To install the required dependencies for pi-gen you should run: ```bash -apt-get install quilt parted realpath qemu-user-static debootstrap zerofree pxz zip \ +apt-get install coreutils quilt parted qemu-user-static debootstrap zerofree pxz zip \ dosfstools bsdtar libcap2-bin grep rsync xz-utils file git curl ``` diff --git a/depends b/depends index 80db669..c5308d5 100644 --- a/depends +++ b/depends @@ -1,6 +1,6 @@ quilt parted -realpath +realpath:coreutils qemu-arm-static:qemu-user-static debootstrap zerofree From d88f536536ca3071edb56e85224fdf1c34086a16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C5=82a=C5=BCej=20Sowa?= Date: Mon, 21 Jan 2019 19:42:54 +0100 Subject: [PATCH 05/57] IMG_SUFFIX evaluation in export image (fix #241) --- build.sh | 4 ++-- export-image/03-set-partuuid/00-run.sh | 2 +- export-image/04-finalise/01-run.sh | 8 ++++---- export-image/prerun.sh | 2 +- export-noobs/prerun.sh | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/build.sh b/build.sh index c8bca0d..c3417a1 100755 --- a/build.sh +++ b/build.sh @@ -144,8 +144,8 @@ fi export USE_QEMU="${USE_QEMU:-0}" export IMG_DATE="${IMG_DATE:-"$(date +%Y-%m-%d)"}" -export IMG_FILENAME="${IMG_FILENAME:-"${IMG_DATE}-${IMG_NAME}${IMG_SUFFIX}"}" -export ZIP_FILENAME="${ZIP_FILENAME:-"image_${IMG_DATE}-${IMG_NAME}${IMG_SUFFIX}"}" +export IMG_FILENAME="${IMG_FILENAME:-"${IMG_DATE}-${IMG_NAME}"}" +export ZIP_FILENAME="${ZIP_FILENAME:-"image_${IMG_DATE}-${IMG_NAME}"}" BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" export SCRIPT_DIR="${BASE_DIR}/scripts" diff --git a/export-image/03-set-partuuid/00-run.sh b/export-image/03-set-partuuid/00-run.sh index e166e97..ec4fd8a 100755 --- a/export-image/03-set-partuuid/00-run.sh +++ b/export-image/03-set-partuuid/00-run.sh @@ -1,6 +1,6 @@ #!/bin/bash -e -IMG_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}.img" +IMG_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMX_SUFFIX}.img" IMGID="$(dd if="${IMG_FILE}" skip=440 bs=1 count=4 2>/dev/null | xxd -e | cut -f 2 -d' ')" diff --git a/export-image/04-finalise/01-run.sh b/export-image/04-finalise/01-run.sh index 501fef3..d4788c7 100755 --- a/export-image/04-finalise/01-run.sh +++ b/export-image/04-finalise/01-run.sh @@ -1,7 +1,7 @@ #!/bin/bash -e -IMG_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}.img" -INFO_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}.info" +IMG_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.img" +INFO_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.info" on_chroot << EOF /etc/init.d/fake-hwclock stop @@ -74,10 +74,10 @@ unmount_image "${IMG_FILE}" mkdir -p "${DEPLOY_DIR}" -rm -f "${DEPLOY_DIR}/${ZIP_FILENAME}.zip" +rm -f "${DEPLOY_DIR}/${ZIP_FILENAME}${IMG_SUFFIX}.zip" pushd "${STAGE_WORK_DIR}" > /dev/null -zip "${DEPLOY_DIR}/${ZIP_FILENAME}.zip" \ +zip "${DEPLOY_DIR}/${ZIP_FILENAME}${IMG_SUFFIX}.zip" \ "$(basename "${IMG_FILE}")" popd > /dev/null diff --git a/export-image/prerun.sh b/export-image/prerun.sh index ca13b70..bdf034a 100755 --- a/export-image/prerun.sh +++ b/export-image/prerun.sh @@ -1,6 +1,6 @@ #!/bin/bash -e -IMG_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}.img" +IMG_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.img" unmount_image "${IMG_FILE}" diff --git a/export-noobs/prerun.sh b/export-noobs/prerun.sh index 47a4f9b..6351b2c 100755 --- a/export-noobs/prerun.sh +++ b/export-noobs/prerun.sh @@ -1,11 +1,11 @@ #!/bin/bash -e -IMG_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}.img" +IMG_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.img" NOOBS_DIR="${STAGE_WORK_DIR}/${IMG_DATE}-${IMG_NAME}${IMG_SUFFIX}" unmount_image "${IMG_FILE}" mkdir -p "${STAGE_WORK_DIR}" -cp "${WORK_DIR}/export-image/${IMG_FILENAME}.img" "${STAGE_WORK_DIR}/" +cp "${WORK_DIR}/export-image/${IMG_FILENAME}${IMG_SUFFIX}.img" "${STAGE_WORK_DIR}/" rm -rf "${NOOBS_DIR}" From 9714a11204f2c937a1c8b7d5c654426ed6c6909b Mon Sep 17 00:00:00 2001 From: Sam Tygier Date: Sat, 5 Jan 2019 18:20:36 +0000 Subject: [PATCH 06/57] Add username validation Check that the username is valid before doing any work. Use the default regex from debian's adduser.conf. Will also avoid risk of special characters causing issues. --- build.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build.sh b/build.sh index c3417a1..78f2fb5 100755 --- a/build.sh +++ b/build.sh @@ -189,6 +189,11 @@ source "${SCRIPT_DIR}/common" # shellcheck source=scripts/dependencies_check source "${SCRIPT_DIR}/dependencies_check" +#check username is valid +if [[ ! "$FIRST_USER_NAME" =~ ^[a-z][-a-z0-9_]*$ ]]; then + echo "Invalid FIRST_USER_NAME: $FIRST_USER_NAME" + exit 1 +fi dependencies_check "${BASE_DIR}/depends" From c72f0b47ff01045608bf3ac15c1ab80546d72e1a Mon Sep 17 00:00:00 2001 From: Sam Tygier Date: Sat, 5 Jan 2019 20:34:47 +0000 Subject: [PATCH 07/57] Quote wpa wifi variables Allows essid and passwords with special characters. --- stage2/02-net-tweaks/01-run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stage2/02-net-tweaks/01-run.sh b/stage2/02-net-tweaks/01-run.sh index 2192943..6180ebc 100755 --- a/stage2/02-net-tweaks/01-run.sh +++ b/stage2/02-net-tweaks/01-run.sh @@ -14,6 +14,6 @@ fi if [ -v WPA_ESSID -a -v WPA_PASSWORD ] then on_chroot <> "/etc/wpa_supplicant/wpa_supplicant.conf" +wpa_passphrase "${WPA_ESSID}" "${WPA_PASSWORD}" >> "/etc/wpa_supplicant/wpa_supplicant.conf" EOF fi From d945d422d4e26df6fff7185da28874432a974d78 Mon Sep 17 00:00:00 2001 From: XECDesign Date: Wed, 23 Jan 2019 15:32:08 +0000 Subject: [PATCH 08/57] Update 00-run.sh Fix typo --- export-image/03-set-partuuid/00-run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/export-image/03-set-partuuid/00-run.sh b/export-image/03-set-partuuid/00-run.sh index ec4fd8a..1538c07 100755 --- a/export-image/03-set-partuuid/00-run.sh +++ b/export-image/03-set-partuuid/00-run.sh @@ -1,6 +1,6 @@ #!/bin/bash -e -IMG_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMX_SUFFIX}.img" +IMG_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.img" IMGID="$(dd if="${IMG_FILE}" skip=440 bs=1 count=4 2>/dev/null | xxd -e | cut -f 2 -d' ')" From 61a994c88ceb4a9ded0aca5eeedbe56c801b5acd Mon Sep 17 00:00:00 2001 From: Louis Matthijssen Date: Wed, 30 Jan 2019 19:09:36 +0100 Subject: [PATCH 09/57] Add a DEPLOY_ZIP setting --- README.md | 4 ++++ build.sh | 1 + export-image/04-finalise/01-run.sh | 13 +++++++++---- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index da22352..8a4f64a 100755 --- a/README.md +++ b/README.md @@ -68,6 +68,10 @@ The following environment variables are supported: Output directory for target system images and NOOBS bundles. + * `DEPLOY_ZIP` (Default: `1`) + + Setting to `0` will deploy the actual image (`.img`) instead of a zipped image (`.zip`). + * `USE_QEMU` (Default: `"0"`) Setting to '1' enables the QEMU mode - creating an image that can be mounted via QEMU for an emulated diff --git a/build.sh b/build.sh index 78f2fb5..3e04204 100755 --- a/build.sh +++ b/build.sh @@ -151,6 +151,7 @@ BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" export SCRIPT_DIR="${BASE_DIR}/scripts" export WORK_DIR="${WORK_DIR:-"${BASE_DIR}/work/${IMG_DATE}-${IMG_NAME}"}" export DEPLOY_DIR=${DEPLOY_DIR:-"${BASE_DIR}/deploy"} +export DEPLOY_ZIP="${DEPLOY_ZIP:-1}" export LOG_FILE="${WORK_DIR}/build.log" export FIRST_USER_NAME=${FIRST_USER_NAME:-pi} diff --git a/export-image/04-finalise/01-run.sh b/export-image/04-finalise/01-run.sh index d4788c7..2a84173 100755 --- a/export-image/04-finalise/01-run.sh +++ b/export-image/04-finalise/01-run.sh @@ -75,10 +75,15 @@ unmount_image "${IMG_FILE}" mkdir -p "${DEPLOY_DIR}" rm -f "${DEPLOY_DIR}/${ZIP_FILENAME}${IMG_SUFFIX}.zip" +rm -f "${DEPLOY_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.img" -pushd "${STAGE_WORK_DIR}" > /dev/null -zip "${DEPLOY_DIR}/${ZIP_FILENAME}${IMG_SUFFIX}.zip" \ - "$(basename "${IMG_FILE}")" -popd > /dev/null +if [ "${DEPLOY_ZIP}" == "1" ]; then + pushd "${STAGE_WORK_DIR}" > /dev/null + zip "${DEPLOY_DIR}/${ZIP_FILENAME}${IMG_SUFFIX}.zip" \ + "$(basename "${IMG_FILE}")" + popd > /dev/null +else + cp "$IMG_FILE" "$DEPLOY_DIR" +fi cp "$INFO_FILE" "$DEPLOY_DIR" From 3961bff8a401588d9a5d32066175aad605671768 Mon Sep 17 00:00:00 2001 From: Louis Matthijssen Date: Wed, 30 Jan 2019 21:48:22 +0100 Subject: [PATCH 10/57] Decrease zerofree verbosity Fixes #251 --- export-image/04-finalise/01-run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/export-image/04-finalise/01-run.sh b/export-image/04-finalise/01-run.sh index 2a84173..c33de6d 100755 --- a/export-image/04-finalise/01-run.sh +++ b/export-image/04-finalise/01-run.sh @@ -68,7 +68,7 @@ cp "$ROOTFS_DIR/etc/rpi-issue" "$INFO_FILE" ROOT_DEV="$(mount | grep "${ROOTFS_DIR} " | cut -f1 -d' ')" unmount "${ROOTFS_DIR}" -zerofree -v "${ROOT_DEV}" +zerofree "${ROOT_DEV}" unmount_image "${IMG_FILE}" From 3b90b7ffed64802fdab9de096ded74dbcc909a90 Mon Sep 17 00:00:00 2001 From: Hugo Hromic Date: Fri, 15 Feb 2019 12:49:00 +0000 Subject: [PATCH 11/57] Improve bootstrap() function in common script * Tidy up and simplify function code * Allow to pass extra arguments to debootstrap, e.g. `--variant minbase` * Preserve compatibility with existing function calls --- scripts/common | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/scripts/common b/scripts/common index bdddead..05198b7 100644 --- a/scripts/common +++ b/scripts/common @@ -4,21 +4,22 @@ log (){ export -f log bootstrap(){ - local ARCH - ARCH=$(dpkg --print-architecture) + local BOOTSTRAP_CMD=debootstrap + local BOOTSTRAP_ARGS=() export http_proxy=${APT_PROXY} - if [ "$ARCH" != "armhf" ]; then - local BOOTSTRAP_CMD=qemu-debootstrap - else - local BOOTSTRAP_CMD=debootstrap + if [ "$(dpkg --print-architecture)" != "armhf" ]; then + BOOTSTRAP_CMD=qemu-debootstrap fi - capsh --drop=cap_setfcap -- "${BOOTSTRAP_CMD}" --components=main,contrib,non-free \ - --arch armhf \ - --keyring "${STAGE_DIR}/files/raspberrypi.gpg" \ - "$1" "$2" "$3" || true + BOOTSTRAP_ARGS+=(--arch armhf) + BOOTSTRAP_ARGS+=(--components "main,contrib,non-free") + BOOTSTRAP_ARGS+=(--keyring "${STAGE_DIR}/files/raspberrypi.gpg") + BOOTSTRAP_ARGS+=("$@") + + capsh --drop=cap_setfcap -- "${BOOTSTRAP_CMD}" "${BOOTSTRAP_ARGS[@]}" || true + if [ -d "$2/debootstrap" ]; then rmdir "$2/debootstrap" fi From 9e6af470450abae0499acd521ab8bd40ba65c791 Mon Sep 17 00:00:00 2001 From: Hugo Hromic Date: Fri, 15 Feb 2019 15:25:59 +0000 Subject: [PATCH 12/57] Improve update_issue() function in common script * Allow to customise pi-gen script name and repository in the generated issue file * Preserve compatibility with existing function calls --- build.sh | 3 +++ scripts/common | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 3e04204..5c3539f 100755 --- a/build.sh +++ b/build.sh @@ -137,6 +137,9 @@ do esac done +export PI_GEN=${PI_GEN:-pi-gen} +export PI_GEN_REPO=${PI_GEN_REPO:-https://github.com/RPi-Distro/pi-gen} + if [ -z "${IMG_NAME}" ]; then echo "IMG_NAME not set" 1>&2 exit 1 diff --git a/scripts/common b/scripts/common index 05198b7..9db903e 100644 --- a/scripts/common +++ b/scripts/common @@ -96,7 +96,7 @@ export -f on_chroot update_issue() { local GIT_HASH GIT_HASH=$(git rev-parse HEAD) - echo -e "Raspberry Pi reference ${IMG_DATE}\nGenerated using pi-gen, https://github.com/RPi-Distro/pi-gen, ${GIT_HASH}, ${1}" > "${ROOTFS_DIR}/etc/rpi-issue" + echo -e "Raspberry Pi reference ${IMG_DATE}\nGenerated using ${PI_GEN}, ${PI_GEN_REPO}, ${GIT_HASH}, ${1}" > "${ROOTFS_DIR}/etc/rpi-issue" } export -f update_issue From c147df99bcc3190a31c90faeab858b2e5e0c14e2 Mon Sep 17 00:00:00 2001 From: Sam Tygier Date: Sat, 16 Feb 2019 14:59:32 +0000 Subject: [PATCH 13/57] Ensure extra config file is passed to docker Fixes #253 Rather than use --env-file, which gets overwritten by the regular config file, pass the any arguments to build-docker.sh through to build.sh. --- build-docker.sh | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/build-docker.sh b/build-docker.sh index e56f7d9..45b0d5d 100755 --- a/build-docker.sh +++ b/build-docker.sh @@ -1,5 +1,7 @@ #!/bin/bash -e +BUILD_OPTS="$@" + DOCKER="docker" set +e $DOCKER ps >/dev/null 2>&1 @@ -13,9 +15,7 @@ if ! $DOCKER ps >/dev/null; then fi set -e -config_file=() if [ -f config ]; then - config_file=("--env-file" "$(pwd)/config") source config fi @@ -23,9 +23,7 @@ while getopts "c:" flag do case "$flag" in c) - EXTRA_CONFIG="$OPTARG" - config_file=( "${config_file[@]}" "--env-file" "$(pwd)/${EXTRA_CONFIG}") - source "$EXTRA_CONFIG" + source "$OPTARG" ;; esac done @@ -58,20 +56,17 @@ if [ "$CONTAINER_EXISTS" != "" ]; then trap "echo 'got CTRL+C... please wait 5s'; $DOCKER stop -t 5 ${CONTAINER_NAME}_cont" SIGINT SIGTERM time $DOCKER run --rm --privileged \ --volumes-from="${CONTAINER_NAME}" --name "${CONTAINER_NAME}_cont" \ - -e IMG_NAME="${IMG_NAME}"\ pi-gen \ bash -e -o pipefail -c "dpkg-reconfigure qemu-user-static && - cd /pi-gen; ./build.sh; + cd /pi-gen; ./build.sh ${BUILD_OPTS} ; rsync -av work/*/build.log deploy/" & wait "$!" else trap "echo 'got CTRL+C... please wait 5s'; $DOCKER stop -t 5 ${CONTAINER_NAME}" SIGINT SIGTERM time $DOCKER run --name "${CONTAINER_NAME}" --privileged \ - -e IMG_NAME="${IMG_NAME}"\ - "${config_file[@]}" \ pi-gen \ bash -e -o pipefail -c "dpkg-reconfigure qemu-user-static && - cd /pi-gen; ./build.sh && + cd /pi-gen; ./build.sh ${BUILD_OPTS} && rsync -av work/*/build.log deploy/" & wait "$!" fi From a8eb03a5e4f29ac48bf3fe427c2179f862e0a053 Mon Sep 17 00:00:00 2001 From: Sam Tygier Date: Sat, 16 Feb 2019 17:06:13 +0000 Subject: [PATCH 14/57] Check binfmt_misc module is loaded Give a friendly error message early. --- Dockerfile | 2 +- depends | 1 + scripts/dependencies_check | 9 +++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 22797d5..a3f53ec 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ RUN apt-get -y update && \ apt-get -y install \ git vim parted \ quilt realpath qemu-user-static debootstrap zerofree pxz zip dosfstools \ - bsdtar libcap2-bin rsync grep udev xz-utils curl xxd file \ + bsdtar libcap2-bin rsync grep udev xz-utils curl xxd file kmod\ && rm -rf /var/lib/apt/lists/* COPY . /pi-gen/ diff --git a/depends b/depends index c5308d5..349118e 100644 --- a/depends +++ b/depends @@ -15,3 +15,4 @@ curl xxd file git +lsmod:kmod diff --git a/scripts/dependencies_check b/scripts/dependencies_check index 1b92a9c..9b7725e 100644 --- a/scripts/dependencies_check +++ b/scripts/dependencies_check @@ -27,4 +27,13 @@ dependencies_check() echo "$missing" false fi + + + if ! lsmod | grep binfmt_misc >/dev/null + then + echo "Module binfmt_misc not loaded in host" + echo "Please run:" + echo " sudo modprobe binfmt_misc" + exit 1 + fi } From 82bcfa427ab697b59d1f863a18fc0862ab309876 Mon Sep 17 00:00:00 2001 From: Sam Tygier Date: Sun, 17 Feb 2019 15:29:10 +0000 Subject: [PATCH 15/57] Use different rsync options for boot and root When copying files to boot, options that are not supported on fat32 can cause errors. For example owner, group and xattrs. --- export-image/prerun.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/export-image/prerun.sh b/export-image/prerun.sh index bdf034a..7345792 100755 --- a/export-image/prerun.sh +++ b/export-image/prerun.sh @@ -66,4 +66,5 @@ mount -v "$ROOT_DEV" "${ROOTFS_DIR}" -t ext4 mkdir -p "${ROOTFS_DIR}/boot" mount -v "$BOOT_DEV" "${ROOTFS_DIR}/boot" -t vfat -rsync -aHAXx --exclude var/cache/apt/archives "${EXPORT_ROOTFS_DIR}/" "${ROOTFS_DIR}/" +rsync -aHAXx --exclude /var/cache/apt/archives --exclude /boot "${EXPORT_ROOTFS_DIR}/" "${ROOTFS_DIR}/" +rsync -rtx "${EXPORT_ROOTFS_DIR}/boot/" "${ROOTFS_DIR}/boot/" From 9d38bfac234b149a78b14b8cd10185f230f469ad Mon Sep 17 00:00:00 2001 From: Sam Tygier Date: Sun, 17 Feb 2019 16:27:43 +0000 Subject: [PATCH 16/57] README.md: Add more info on Docker --- README.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8a4f64a..df5d123 100755 --- a/README.md +++ b/README.md @@ -7,7 +7,8 @@ _Tool used to create the raspberrypi.org Raspbian images_ pi-gen runs on Debian based operating systems. Currently it is only supported on either Debian Stretch or Ubuntu Xenial and is known to have issues building on -earlier releases of these systems. +earlier releases of these systems. On other Linux distributions it may be possible +to use the Docker build described below. To install the required dependencies for pi-gen you should run: @@ -158,6 +159,13 @@ It is recommended to examine build.sh for finer details. ## Docker Build +Docker can be used to perform the build inside a container. This partially isolates +the build from the host system, and allows using the script on non-debian based +systems (e.g. Fedora Linux). The isolate is not complete due to the need to use +some kernel level services for arm emulation (binfmt) and loop devices (losetup). + +To build: + ```bash vi config # Edit your config file. See above. ./build-docker.sh @@ -173,6 +181,12 @@ continue: CONTINUE=1 ./build-docker.sh ``` +To examine the container after a failure you can enter a shell within it using: + +```bash +sudo docker run -it --privileged --volumes-from=pigen_work pi-gen /bin/bash +``` + After successful build, the build container is by default removed. This may be undesired when making incremental changes to a customized build. To prevent the build script from remove the container add ```bash From 7068086c94a5c048aad19c412e31a3a56a5c8b78 Mon Sep 17 00:00:00 2001 From: Sam Tygier Date: Sat, 16 Feb 2019 12:15:25 +0000 Subject: [PATCH 17/57] Make sure unmount_image finds stale loop devices Fixes #257 #104 #193 Instead of searching by full path, which is prone to fail, read full list and grep on filename. --- scripts/common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/common b/scripts/common index 9db903e..bb75a7e 100644 --- a/scripts/common +++ b/scripts/common @@ -57,7 +57,7 @@ unmount_image(){ sync sleep 1 local LOOP_DEVICES - LOOP_DEVICES=$(losetup -j "${1}" | cut -f1 -d':') + LOOP_DEVICES=$(losetup --list | grep "$(basename "${1}")" | cut -f1 -d' ') for LOOP_DEV in ${LOOP_DEVICES}; do if [ -n "${LOOP_DEV}" ]; then local MOUNTED_DIR From 564f8ef1b87399c0d4b798baf83f9d2b95ac77b7 Mon Sep 17 00:00:00 2001 From: Hugo Hromic Date: Mon, 18 Feb 2019 12:54:15 +0000 Subject: [PATCH 18/57] Silence shellcheck warnings (#255) * Made more specific shellcheck disables * Fixed variable quoting (SC2086,SC2064) * Use `$*` expansion instead of `$@` when not using arrays (SC2124) * Use cleaner `$()` syntax instead of back quotes (SC2006) * Improved comparator (SC2166) * Minor improvements in coding style Tested clean output using: `find -name "*.sh" | xargs -n1 shellcheck -x`. --- build-docker.sh | 14 ++++++++------ build.sh | 12 ++++++++---- export-noobs/00-release/files/partition_setup.sh | 4 +++- stage2/02-net-tweaks/01-run.sh | 6 ++---- 4 files changed, 21 insertions(+), 15 deletions(-) diff --git a/build-docker.sh b/build-docker.sh index 45b0d5d..c969ba2 100755 --- a/build-docker.sh +++ b/build-docker.sh @@ -1,11 +1,10 @@ #!/bin/bash -e -BUILD_OPTS="$@" +BUILD_OPTS="$*" DOCKER="docker" set +e -$DOCKER ps >/dev/null 2>&1 -if [ $? != 0 ]; then +if ! $DOCKER ps >/dev/null 2>&1; then DOCKER="sudo docker" fi if ! $DOCKER ps >/dev/null; then @@ -23,8 +22,11 @@ while getopts "c:" flag do case "$flag" in c) + # shellcheck disable=SC1090 source "$OPTARG" ;; + *) + ;; esac done @@ -53,7 +55,7 @@ fi $DOCKER build -t pi-gen . if [ "$CONTAINER_EXISTS" != "" ]; then - trap "echo 'got CTRL+C... please wait 5s'; $DOCKER stop -t 5 ${CONTAINER_NAME}_cont" SIGINT SIGTERM + trap 'echo "got CTRL+C... please wait 5s"; $DOCKER stop -t 5 ${CONTAINER_NAME}_cont' SIGINT SIGTERM time $DOCKER run --rm --privileged \ --volumes-from="${CONTAINER_NAME}" --name "${CONTAINER_NAME}_cont" \ pi-gen \ @@ -62,7 +64,7 @@ if [ "$CONTAINER_EXISTS" != "" ]; then rsync -av work/*/build.log deploy/" & wait "$!" else - trap "echo 'got CTRL+C... please wait 5s'; $DOCKER stop -t 5 ${CONTAINER_NAME}" SIGINT SIGTERM + trap 'echo "got CTRL+C... please wait 5s"; $DOCKER stop -t 5 ${CONTAINER_NAME}' SIGINT SIGTERM time $DOCKER run --name "${CONTAINER_NAME}" --privileged \ pi-gen \ bash -e -o pipefail -c "dpkg-reconfigure qemu-user-static && @@ -76,7 +78,7 @@ ls -lah deploy # cleanup if [ "$PRESERVE_CONTAINER" != "1" ]; then - $DOCKER rm -v $CONTAINER_NAME + $DOCKER rm -v "$CONTAINER_NAME" fi echo "Done! Your image(s) should be in deploy/" diff --git a/build.sh b/build.sh index 5c3539f..22d3a90 100755 --- a/build.sh +++ b/build.sh @@ -1,5 +1,5 @@ #!/bin/bash -e -# shellcheck disable=SC2119,SC1091 +# shellcheck disable=SC2119 run_sub_stage() { log "Begin ${SUB_STAGE_DIR}" @@ -102,7 +102,7 @@ run_stage(){ ./prerun.sh log "End ${STAGE_DIR}/prerun.sh" fi - for SUB_STAGE_DIR in ${STAGE_DIR}/*; do + for SUB_STAGE_DIR in "${STAGE_DIR}"/*; do if [ -d "${SUB_STAGE_DIR}" ] && [ ! -f "${SUB_STAGE_DIR}/SKIP" ]; then run_sub_stage @@ -124,6 +124,7 @@ fi if [ -f config ]; then + # shellcheck disable=SC1091 source config fi @@ -132,8 +133,11 @@ do case "$flag" in c) EXTRA_CONFIG="$OPTARG" + # shellcheck disable=SC1090 source "$EXTRA_CONFIG" ;; + *) + ;; esac done @@ -206,8 +210,8 @@ log "Begin ${BASE_DIR}" STAGE_LIST=${STAGE_LIST:-${BASE_DIR}/stage*} -for STAGE_DIR_ in $STAGE_LIST; do - STAGE_DIR=`realpath "${STAGE_DIR_}"` +for STAGE_DIR in $STAGE_LIST; do + STAGE_DIR=$(realpath "${STAGE_DIR}") run_stage done diff --git a/export-noobs/00-release/files/partition_setup.sh b/export-noobs/00-release/files/partition_setup.sh index e41a9d3..0f45f20 100644 --- a/export-noobs/00-release/files/partition_setup.sh +++ b/export-noobs/00-release/files/partition_setup.sh @@ -3,6 +3,7 @@ set -ex +# shellcheck disable=SC2154 if [ -z "$part1" ] || [ -z "$part2" ]; then printf "Error: missing environment variable part1 or part2\n" 1>&2 exit 1 @@ -17,7 +18,8 @@ sed /tmp/1/cmdline.txt -i -e "s|root=[^ ]*|root=${part2}|" sed /tmp/2/etc/fstab -i -e "s|^[^#].* / |${part2} / |" sed /tmp/2/etc/fstab -i -e "s|^[^#].* /boot |${part1} /boot |" -if [ -z $restore ]; then +# shellcheck disable=SC2154 +if [ -z "$restore" ]; then if [ -f /mnt/ssh ]; then cp /mnt/ssh /tmp/1/ fi diff --git a/stage2/02-net-tweaks/01-run.sh b/stage2/02-net-tweaks/01-run.sh index 6180ebc..ce5c73f 100755 --- a/stage2/02-net-tweaks/01-run.sh +++ b/stage2/02-net-tweaks/01-run.sh @@ -6,13 +6,11 @@ install -v -m 644 files/wait.conf "${ROOTFS_DIR}/etc/systemd/system/dhcpcd.serv install -v -d "${ROOTFS_DIR}/etc/wpa_supplicant" install -v -m 600 files/wpa_supplicant.conf "${ROOTFS_DIR}/etc/wpa_supplicant/" -if [ -v WPA_COUNTRY ] -then +if [ -v WPA_COUNTRY ]; then echo "country=${WPA_COUNTRY}" >> "${ROOTFS_DIR}/etc/wpa_supplicant/wpa_supplicant.conf" fi -if [ -v WPA_ESSID -a -v WPA_PASSWORD ] -then +if [ -v WPA_ESSID ] && [ -v WPA_PASSWORD ]; then on_chroot <> "/etc/wpa_supplicant/wpa_supplicant.conf" EOF From b7812278a84da21ffbac9c5ff552b5aff69f842f Mon Sep 17 00:00:00 2001 From: samtygier Date: Mon, 18 Feb 2019 23:41:41 +0000 Subject: [PATCH 19/57] Warn early if proxy not reachable (#262) Avoids a later failure with a less informative message. See #248 --- build.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build.sh b/build.sh index 22d3a90..c41a87f 100755 --- a/build.sh +++ b/build.sh @@ -203,6 +203,11 @@ if [[ ! "$FIRST_USER_NAME" =~ ^[a-z][-a-z0-9_]*$ ]]; then exit 1 fi +if [[ -n "${APT_PROXY}" ]] && ! curl --silent ${APT_PROXY} >/dev/null ; then + echo "Could not reach APT_PROXY server:" ${APT_PROXY} + exit 1 +fi + dependencies_check "${BASE_DIR}/depends" mkdir -p "${WORK_DIR}" From 67241b9626a4d89a8389135caf1330bc7a390081 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Wed, 6 Mar 2019 16:25:42 +0000 Subject: [PATCH 20/57] Handle cases where binfmt_misc is built into the kernel Fixes #264 --- scripts/dependencies_check | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/dependencies_check b/scripts/dependencies_check index 9b7725e..375512b 100644 --- a/scripts/dependencies_check +++ b/scripts/dependencies_check @@ -29,8 +29,7 @@ dependencies_check() fi - if ! lsmod | grep binfmt_misc >/dev/null - then + if ! grep -q "/proc/sys/fs/binfmt_misc" /proc/mounts; then echo "Module binfmt_misc not loaded in host" echo "Please run:" echo " sudo modprobe binfmt_misc" From 91bc38d5102cfada86a1b0a06d41f9826f67ea9b Mon Sep 17 00:00:00 2001 From: XECDesign Date: Mon, 11 Mar 2019 11:14:04 +0000 Subject: [PATCH 21/57] Update Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index a3f53ec..306eea5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ ENV DEBIAN_FRONTEND noninteractive RUN apt-get -y update && \ apt-get -y install \ git vim parted \ - quilt realpath qemu-user-static debootstrap zerofree pxz zip dosfstools \ + quilt coreutils qemu-user-static debootstrap zerofree pxz zip dosfstools \ bsdtar libcap2-bin rsync grep udev xz-utils curl xxd file kmod\ && rm -rf /var/lib/apt/lists/* From fb23b8ba92ffc893fe257375ce79e56d3dbe7504 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Mon, 11 Mar 2019 11:49:04 +0000 Subject: [PATCH 22/57] Replace pxz with xz -T0 --- Dockerfile | 2 +- README.md | 2 +- depends | 2 +- export-noobs/prerun.sh | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 306eea5..23cfd1c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ ENV DEBIAN_FRONTEND noninteractive RUN apt-get -y update && \ apt-get -y install \ git vim parted \ - quilt coreutils qemu-user-static debootstrap zerofree pxz zip dosfstools \ + quilt coreutils qemu-user-static debootstrap zerofree zip dosfstools \ bsdtar libcap2-bin rsync grep udev xz-utils curl xxd file kmod\ && rm -rf /var/lib/apt/lists/* diff --git a/README.md b/README.md index df5d123..a528934 100755 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ to use the Docker build described below. To install the required dependencies for pi-gen you should run: ```bash -apt-get install coreutils quilt parted qemu-user-static debootstrap zerofree pxz zip \ +apt-get install coreutils quilt parted qemu-user-static debootstrap zerofree zip \ dosfstools bsdtar libcap2-bin grep rsync xz-utils file git curl ``` diff --git a/depends b/depends index 349118e..6238eb1 100644 --- a/depends +++ b/depends @@ -4,7 +4,7 @@ realpath:coreutils qemu-arm-static:qemu-user-static debootstrap zerofree -pxz zip +zip mkdosfs:dosfstools capsh:libcap2-bin bsdtar diff --git a/export-noobs/prerun.sh b/export-noobs/prerun.sh index 6351b2c..b4b56b2 100755 --- a/export-noobs/prerun.sh +++ b/export-noobs/prerun.sh @@ -33,8 +33,8 @@ mount "$BOOT_DEV" "${STAGE_WORK_DIR}/rootfs/boot" ln -sv "/lib/systemd/system/apply_noobs_os_config.service" "$ROOTFS_DIR/etc/systemd/system/multi-user.target.wants/apply_noobs_os_config.service" -bsdtar --numeric-owner --format gnutar --use-compress-program pxz -C "${STAGE_WORK_DIR}/rootfs/boot" -cpf "${NOOBS_DIR}/boot.tar.xz" . +bsdtar --numeric-owner --format gnutar -C "${STAGE_WORK_DIR}/rootfs/boot" -cpf - . | xz -T0 > "${NOOBS_DIR}/boot.tar.xz" umount "${STAGE_WORK_DIR}/rootfs/boot" -bsdtar --numeric-owner --format gnutar --use-compress-program pxz -C "${STAGE_WORK_DIR}/rootfs" --one-file-system -cpf "${NOOBS_DIR}/root.tar.xz" . +bsdtar --numeric-owner --format gnutar -C "${STAGE_WORK_DIR}/rootfs" --one-file-system -cpf - . | xz -T0 > "${NOOBS_DIR}/root.tar.xz" unmount_image "${IMG_FILE}" From 30a1528ae13f993291496ac8e73b5ac0a6f82585 Mon Sep 17 00:00:00 2001 From: Andrew Scheller Date: Mon, 18 Mar 2019 14:49:18 +0000 Subject: [PATCH 23/57] Switch to using parted's machine parseable output (#270) --- export-image/prerun.sh | 14 +++++--------- export-noobs/prerun.sh | 14 +++++--------- 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/export-image/prerun.sh b/export-image/prerun.sh index 7345792..7e0d1eb 100755 --- a/export-image/prerun.sh +++ b/export-image/prerun.sh @@ -37,16 +37,12 @@ p w EOF -PARTED_OUT=$(parted -s "${IMG_FILE}" unit b print) -BOOT_OFFSET=$(echo "$PARTED_OUT" | grep -e '^ 1'| xargs echo -n \ -| cut -d" " -f 2 | tr -d B) -BOOT_LENGTH=$(echo "$PARTED_OUT" | grep -e '^ 1'| xargs echo -n \ -| cut -d" " -f 4 | tr -d B) +PARTED_OUT=$(parted -sm "${IMG_FILE}" unit b print) +BOOT_OFFSET=$(echo "$PARTED_OUT" | grep -e '^1:' | cut -d':' -f 2 | tr -d B) +BOOT_LENGTH=$(echo "$PARTED_OUT" | grep -e '^1:' | cut -d':' -f 4 | tr -d B) -ROOT_OFFSET=$(echo "$PARTED_OUT" | grep -e '^ 2'| xargs echo -n \ -| cut -d" " -f 2 | tr -d B) -ROOT_LENGTH=$(echo "$PARTED_OUT" | grep -e '^ 2'| xargs echo -n \ -| 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) BOOT_DEV=$(losetup --show -f -o "${BOOT_OFFSET}" --sizelimit "${BOOT_LENGTH}" "${IMG_FILE}") ROOT_DEV=$(losetup --show -f -o "${ROOT_OFFSET}" --sizelimit "${ROOT_LENGTH}" "${IMG_FILE}") diff --git a/export-noobs/prerun.sh b/export-noobs/prerun.sh index b4b56b2..54e0c59 100755 --- a/export-noobs/prerun.sh +++ b/export-noobs/prerun.sh @@ -9,16 +9,12 @@ cp "${WORK_DIR}/export-image/${IMG_FILENAME}${IMG_SUFFIX}.img" "${STAGE_WORK_DIR rm -rf "${NOOBS_DIR}" -PARTED_OUT=$(parted -s "${IMG_FILE}" unit b print) -BOOT_OFFSET=$(echo "$PARTED_OUT" | grep -e '^ 1'| xargs echo -n \ -| cut -d" " -f 2 | tr -d B) -BOOT_LENGTH=$(echo "$PARTED_OUT" | grep -e '^ 1'| xargs echo -n \ -| cut -d" " -f 4 | tr -d B) +PARTED_OUT=$(parted -sm "${IMG_FILE}" unit b print) +BOOT_OFFSET=$(echo "$PARTED_OUT" | grep -e '^1:' | cut -d':' -f 2 | tr -d B) +BOOT_LENGTH=$(echo "$PARTED_OUT" | grep -e '^1:' | cut -d':' -f 4 | tr -d B) -ROOT_OFFSET=$(echo "$PARTED_OUT" | grep -e '^ 2'| xargs echo -n \ -| cut -d" " -f 2 | tr -d B) -ROOT_LENGTH=$(echo "$PARTED_OUT" | grep -e '^ 2'| xargs echo -n \ -| 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) BOOT_DEV=$(losetup --show -f -o "${BOOT_OFFSET}" --sizelimit "${BOOT_LENGTH}" "${IMG_FILE}") ROOT_DEV=$(losetup --show -f -o "${ROOT_OFFSET}" --sizelimit "${ROOT_LENGTH}" "${IMG_FILE}") From 3e9b176fab620e00bb36b9a94646aaf376160a49 Mon Sep 17 00:00:00 2001 From: XECDesign Date: Fri, 29 Mar 2019 19:45:31 +0000 Subject: [PATCH 24/57] stage2: install rng-tools https://github.com/raspberrypi/linux/issues/2799 --- stage2/01-sys-tweaks/00-packages | 1 + 1 file changed, 1 insertion(+) diff --git a/stage2/01-sys-tweaks/00-packages b/stage2/01-sys-tweaks/00-packages index f058ffb..4a1f3a1 100644 --- a/stage2/01-sys-tweaks/00-packages +++ b/stage2/01-sys-tweaks/00-packages @@ -23,3 +23,4 @@ htop man-db policykit-1 ssh-import-id +rng-tools From ee11b802b556fc43d4998749e75aba6a97257b1a Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Wed, 27 Mar 2019 15:39:56 +0000 Subject: [PATCH 25/57] stage2: ethtool --- stage2/01-sys-tweaks/00-packages | 1 + 1 file changed, 1 insertion(+) diff --git a/stage2/01-sys-tweaks/00-packages b/stage2/01-sys-tweaks/00-packages index 4a1f3a1..b1e1de6 100644 --- a/stage2/01-sys-tweaks/00-packages +++ b/stage2/01-sys-tweaks/00-packages @@ -24,3 +24,4 @@ man-db policykit-1 ssh-import-id rng-tools +ethtool From e910bf55ac92e27c6e77043e8995bcb5e0a2d742 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Tue, 2 Apr 2019 18:52:11 +0100 Subject: [PATCH 26/57] Update release notes --- export-noobs/00-release/files/release_notes.txt | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/export-noobs/00-release/files/release_notes.txt b/export-noobs/00-release/files/release_notes.txt index 3a71c1e..2ebd3f5 100644 --- a/export-noobs/00-release/files/release_notes.txt +++ b/export-noobs/00-release/files/release_notes.txt @@ -1,5 +1,20 @@ UNRELEASED: - * + * Chromium browser updated to version 72 + * VLC media player updated to version 3.0.6 + * RealVNC Server updated to version 6.4.0 + * Flash player updated to version 32.0.0.156 + * Performance improvements to SDL library + * Performance improvements to pixman library + * Option to set display underscan added to startup wizard + * Mounted external drives now displayed on desktop by default + * Network plugin modified for improved compatibility with wpa_passphrase + * SD Card Copier tweaks to reduce copy failures + * Various minor bug fixes and appearance tweaks + * Added ethtool + * Added rng-tools + * Add PINN restore support + * Linux kernel 4.14.98 + * Raspberry Pi firmware f8939644f7bd3065068787f1f92b3f3c79cf3de9 2018-11-13: * Two versions of image created - "base" image has no optional software packages included; "full" image has all optional packages - Removed from "base" image - LibreOffice, Thonny, Scratch, Scratch 2, Sonic Pi, Minecraft, Python Games, SmartSim, SenseHAT Emulator From 042f769edb5b1a8162b5b7bac8f461106d561128 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Wed, 17 Apr 2019 12:49:08 +0100 Subject: [PATCH 27/57] Add new changelog entry --- export-noobs/00-release/files/release_notes.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/export-noobs/00-release/files/release_notes.txt b/export-noobs/00-release/files/release_notes.txt index 2ebd3f5..37ccee0 100644 --- a/export-noobs/00-release/files/release_notes.txt +++ b/export-noobs/00-release/files/release_notes.txt @@ -1,4 +1,6 @@ UNRELEASED: + * +2019-04-08: * Chromium browser updated to version 72 * VLC media player updated to version 3.0.6 * RealVNC Server updated to version 6.4.0 From 407663a57f380bdd779820392210c4309b1e719d Mon Sep 17 00:00:00 2001 From: Hugo Hromic Date: Thu, 25 Apr 2019 10:11:57 +0100 Subject: [PATCH 28/57] Silence shellcheck warnings (#279) * SC1091: the `config` file might not be present, which is normal. * SC2086: Double quote to prevent globbing and word splitting. Tested clean output using: `find -name "*.sh" -exec shellcheck -x {} \;` --- build-docker.sh | 1 + build.sh | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/build-docker.sh b/build-docker.sh index c969ba2..cb30c52 100755 --- a/build-docker.sh +++ b/build-docker.sh @@ -15,6 +15,7 @@ fi set -e if [ -f config ]; then + # shellcheck disable=SC1091 source config fi diff --git a/build.sh b/build.sh index c41a87f..084d5c6 100755 --- a/build.sh +++ b/build.sh @@ -203,8 +203,8 @@ if [[ ! "$FIRST_USER_NAME" =~ ^[a-z][-a-z0-9_]*$ ]]; then exit 1 fi -if [[ -n "${APT_PROXY}" ]] && ! curl --silent ${APT_PROXY} >/dev/null ; then - echo "Could not reach APT_PROXY server:" ${APT_PROXY} +if [[ -n "${APT_PROXY}" ]] && ! curl --silent "${APT_PROXY}" >/dev/null ; then + echo "Could not reach APT_PROXY server: ${APT_PROXY}" exit 1 fi From 8acf95f237d3e0bbc5c698bcae2ad4f99efecccc Mon Sep 17 00:00:00 2001 From: Hugo Hromic Date: Thu, 25 Apr 2019 10:28:48 +0100 Subject: [PATCH 29/57] Do not assume the changelog file is always present for the info file (#280) The `(..)/raspberrypi-kernel/changelog.Debian.gz` file is not guaranteed to be present in the built `ROOTFS_DIR`, for example when building very minimal images without package documentation. In these cases, the `firmware` variable will be left empty and the subsequent calls to `curl` will return large 404 HTML content from GitHub. Instead, simply check if the changelog file exists before using it. --- export-image/04-finalise/01-run.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/export-image/04-finalise/01-run.sh b/export-image/04-finalise/01-run.sh index c33de6d..8a2d249 100755 --- a/export-image/04-finalise/01-run.sh +++ b/export-image/04-finalise/01-run.sh @@ -50,17 +50,19 @@ cp "$ROOTFS_DIR/etc/rpi-issue" "$INFO_FILE" { - firmware=$(zgrep "firmware as of" \ - "$ROOTFS_DIR/usr/share/doc/raspberrypi-kernel/changelog.Debian.gz" | \ - head -n1 | sed -n 's|.* \([^ ]*\)$|\1|p') - printf "\nFirmware: https://github.com/raspberrypi/firmware/tree/%s\n" "$firmware" + if [ -f "$ROOTFS_DIR/usr/share/doc/raspberrypi-kernel/changelog.Debian.gz" ]; then + firmware=$(zgrep "firmware as of" \ + "$ROOTFS_DIR/usr/share/doc/raspberrypi-kernel/changelog.Debian.gz" | \ + head -n1 | sed -n 's|.* \([^ ]*\)$|\1|p') + printf "\nFirmware: https://github.com/raspberrypi/firmware/tree/%s\n" "$firmware" - kernel="$(curl -s -L "https://github.com/raspberrypi/firmware/raw/$firmware/extra/git_hash")" - printf "Kernel: https://github.com/raspberrypi/linux/tree/%s\n" "$kernel" + kernel="$(curl -s -L "https://github.com/raspberrypi/firmware/raw/$firmware/extra/git_hash")" + printf "Kernel: https://github.com/raspberrypi/linux/tree/%s\n" "$kernel" - uname="$(curl -s -L "https://github.com/raspberrypi/firmware/raw/$firmware/extra/uname_string7")" + uname="$(curl -s -L "https://github.com/raspberrypi/firmware/raw/$firmware/extra/uname_string7")" + printf "Uname string: %s\n" "$uname" + fi - printf "Uname string: %s\n" "$uname" printf "\nPackages:\n" dpkg -l --root "$ROOTFS_DIR" } >> "$INFO_FILE" From 4ad51961e944e6124094ae5a217e808e6f50399d Mon Sep 17 00:00:00 2001 From: samtygier Date: Thu, 30 May 2019 12:07:16 +0200 Subject: [PATCH 30/57] Better docs for STAGE_LIST (#289) Note that quotes are needed, see bug #288. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a528934..62e2fb0 100755 --- a/README.md +++ b/README.md @@ -96,7 +96,7 @@ The following environment variables are supported: * `STAGE_LIST` (Default: `stage*`) - If set, then instead of working through the numeric stages in order, this list will be followed. For example setting to `stage0 stage1 mystage stage2` will run the contents of `mystage` before stage2. An absolute or relative path can be given for stages outside the pi-gen directory. + If set, then instead of working through the numeric stages in order, this list will be followed. For example setting to `"stage0 stage1 mystage stage2"` will run the contents of `mystage` before stage2. Note that quotes are needed around the list. An absolute or relative path can be given for stages outside the pi-gen directory. A simple example for building Raspbian: From a90b6bd0943a517efc8720b5097f622d0d7c7e64 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Fri, 7 Jun 2019 15:41:33 +0100 Subject: [PATCH 31/57] build.sh: run quilt upgrade before editing patches --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 084d5c6..5397330 100755 --- a/build.sh +++ b/build.sh @@ -46,11 +46,11 @@ EOF SUB_STAGE_QUILT_PATCH_DIR="$(basename "$SUB_STAGE_DIR")-pc" mkdir -p "$SUB_STAGE_QUILT_PATCH_DIR" ln -snf "$SUB_STAGE_QUILT_PATCH_DIR" .pc + quilt upgrade if [ -e "${SUB_STAGE_DIR}/${i}-patches/EDIT" ]; then echo "Dropping into bash to edit patches..." bash fi - quilt upgrade RC=0 quilt push -a || RC=$? case "$RC" in From 0552ef239b15d18afb497c3b7ce8314ae9970cbd Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Fri, 7 Jun 2019 15:45:15 +0100 Subject: [PATCH 32/57] Update to Buster Remove ui and staging components --- export-image/01-set-sources/00-patches/0-sources.diff | 9 --------- export-image/01-set-sources/00-patches/series | 1 - export-noobs/00-release/files/os.json | 2 +- stage0/00-configure-apt/files/raspi.list | 4 ++-- stage0/00-configure-apt/files/sources.list | 4 ++-- stage0/prerun.sh | 2 +- 6 files changed, 6 insertions(+), 16 deletions(-) delete mode 100644 export-image/01-set-sources/00-patches/0-sources.diff delete mode 100644 export-image/01-set-sources/00-patches/series diff --git a/export-image/01-set-sources/00-patches/0-sources.diff b/export-image/01-set-sources/00-patches/0-sources.diff deleted file mode 100644 index 17badff..0000000 --- a/export-image/01-set-sources/00-patches/0-sources.diff +++ /dev/null @@ -1,9 +0,0 @@ -Index: export-jessie/rootfs/etc/apt/sources.list.d/raspi.list -=================================================================== ---- export-jessie.orig/rootfs/etc/apt/sources.list.d/raspi.list -+++ export-jessie/rootfs/etc/apt/sources.list.d/raspi.list -@@ -1,3 +1,3 @@ --deb http://archive.raspberrypi.org/debian/ stretch main ui staging -+deb http://archive.raspberrypi.org/debian/ stretch main ui - # Uncomment line below then 'apt-get update' to enable 'apt-get source' - #deb-src http://archive.raspberrypi.org/debian/ stretch main ui diff --git a/export-image/01-set-sources/00-patches/series b/export-image/01-set-sources/00-patches/series deleted file mode 100644 index 49ccdbc..0000000 --- a/export-image/01-set-sources/00-patches/series +++ /dev/null @@ -1 +0,0 @@ -0-sources.diff diff --git a/export-noobs/00-release/files/os.json b/export-noobs/00-release/files/os.json index a37e266..f694932 100644 --- a/export-noobs/00-release/files/os.json +++ b/export-noobs/00-release/files/os.json @@ -15,5 +15,5 @@ ], "url": "http://www.raspbian.org/", "username": "pi", - "version": "stretch" + "version": "buster" } diff --git a/stage0/00-configure-apt/files/raspi.list b/stage0/00-configure-apt/files/raspi.list index 656ab48..122287e 100644 --- a/stage0/00-configure-apt/files/raspi.list +++ b/stage0/00-configure-apt/files/raspi.list @@ -1,3 +1,3 @@ -deb http://archive.raspberrypi.org/debian/ stretch main ui staging +deb http://archive.raspberrypi.org/debian/ buster main # Uncomment line below then 'apt-get update' to enable 'apt-get source' -#deb-src http://archive.raspberrypi.org/debian/ stretch main ui +#deb-src http://archive.raspberrypi.org/debian/ buster main diff --git a/stage0/00-configure-apt/files/sources.list b/stage0/00-configure-apt/files/sources.list index 45e5210..61820ac 100644 --- a/stage0/00-configure-apt/files/sources.list +++ b/stage0/00-configure-apt/files/sources.list @@ -1,3 +1,3 @@ -deb http://raspbian.raspberrypi.org/raspbian/ stretch main contrib non-free rpi +deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi # Uncomment line below then 'apt-get update' to enable 'apt-get source' -#deb-src http://raspbian.raspberrypi.org/raspbian/ stretch main contrib non-free rpi +#deb-src http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi diff --git a/stage0/prerun.sh b/stage0/prerun.sh index 7c09b02..9ce3e02 100755 --- a/stage0/prerun.sh +++ b/stage0/prerun.sh @@ -1,5 +1,5 @@ #!/bin/bash -e if [ ! -d "${ROOTFS_DIR}" ]; then - bootstrap stretch "${ROOTFS_DIR}" http://raspbian.raspberrypi.org/raspbian/ + bootstrap buster "${ROOTFS_DIR}" http://raspbian.raspberrypi.org/raspbian/ fi From 22c8878f5d9680ccc0d848487963345c71e31a43 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Fri, 7 Jun 2019 15:49:18 +0100 Subject: [PATCH 33/57] Remove Oracle Java --- export-image/04-finalise/01-run.sh | 2 - export-image/04-finalise/files/LICENSE.oracle | 72 ------------------- stage4/00-install-packages/00-packages | 1 - 3 files changed, 75 deletions(-) delete mode 100644 export-image/04-finalise/files/LICENSE.oracle diff --git a/export-image/04-finalise/01-run.sh b/export-image/04-finalise/01-run.sh index 8a2d249..e0bd17f 100755 --- a/export-image/04-finalise/01-run.sh +++ b/export-image/04-finalise/01-run.sh @@ -43,8 +43,6 @@ rm -f "${ROOTFS_DIR}/etc/vnc/updateid" update_issue "$(basename "${EXPORT_DIR}")" install -m 644 "${ROOTFS_DIR}/etc/rpi-issue" "${ROOTFS_DIR}/boot/issue.txt" -install files/LICENSE.oracle "${ROOTFS_DIR}/boot/" - cp "$ROOTFS_DIR/etc/rpi-issue" "$INFO_FILE" diff --git a/export-image/04-finalise/files/LICENSE.oracle b/export-image/04-finalise/files/LICENSE.oracle deleted file mode 100644 index 00898ca..0000000 --- a/export-image/04-finalise/files/LICENSE.oracle +++ /dev/null @@ -1,72 +0,0 @@ -Taken from http://www.java.com/license - -Oracle Binary Code License Agreement for the Java SE Platform Products and JavaFX - -ORACLE AMERICA, INC. ("ORACLE"), FOR AND ON BEHALF OF ITSELF AND ITS SUBSIDIARIES AND AFFILIATES UNDER COMMON CONTROL, IS WILLING TO LICENSE THE SOFTWARE TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS BINARY CODE LICENSE AGREEMENT AND SUPPLEMENTAL LICENSE TERMS (COLLECTIVELY "AGREEMENT"). PLEASE READ THE AGREEMENT CAREFULLY. BY SELECTING THE "ACCEPT LICENSE AGREEMENT" (OR THE EQUIVALENT) BUTTON AND/OR BY USING THE SOFTWARE YOU ACKNOWLEDGE THAT YOU HAVE READ THE TERMS AND AGREE TO THEM. IF YOU ARE AGREEING TO THESE TERMS ON BEHALF OF A COMPANY OR OTHER LEGAL ENTITY, YOU REPRESENT THAT YOU HAVE THE LEGAL AUTHORITY TO BIND THE LEGAL ENTITY TO THESE TERMS. IF YOU DO NOT HAVE SUCH AUTHORITY, OR IF YOU DO NOT WISH TO BE BOUND BY THE TERMS, THEN SELECT THE "DECLINE LICENSE AGREEMENT" (OR THE EQUIVALENT) BUTTON AND YOU MUST NOT USE THE SOFTWARE ON THIS SITE OR ANY OTHER MEDIA ON WHICH THE SOFTWARE IS CONTAINED. - -1. DEFINITIONS. "Software" means the software identified above in binary form that you selected for download, install or use (in the version You selected for download, install or use) from Oracle or its authorized licensees, any other machine readable materials (including, but not limited to, libraries, source files, header files, and data files), any updates or error corrections provided by Oracle, and any user manuals, programming guides and other documentation provided to you by Oracle under this Agreement. "General Purpose Desktop Computers and Servers" means computers, including desktop and laptop computers, or servers, used for general computing functions under end user control (such as but not specifically limited to email, general purpose Internet browsing, and office suite productivity tools). The use of Software in systems and solutions that provide dedicated functionality (other than as mentioned above) or designed for use in embedded or function-specific software applications, for example but not limited to: Software embedded in or bundled with industrial control systems, wireless mobile telephones, wireless handheld devices, kiosks, TV/STB, Blu-ray Disc devices, telematics and network control switching equipment, printers and storage management systems, and other related systems are excluded from this definition and not licensed under this Agreement. "Programs" means (a) Java technology applets and applications intended to run on the Java Platform, Standard Edition platform on Java-enabled General Purpose Desktop Computers and Servers; and (b) JavaFX technology applications intended to run on the JavaFX Runtime on JavaFX-enabled General Purpose Desktop Computers and Servers. “Commercial Features” means those features identified in Table 1-1 (Commercial Features In Java SE Product Editions) of the Java SE documentation accessible at http://www.oracle.com/technetwork/java/javase/documentation/index.html. “README File” means the README file for the Software accessible at http://www.oracle.com/technetwork/java/javase/documentation/index.html. - -2. LICENSE TO USE. Subject to the terms and conditions of this Agreement including, but not limited to, the Java Technology Restrictions of the Supplemental License Terms, Oracle grants you a non-exclusive, non-transferable, limited license without license fees to reproduce and use internally the Software complete and unmodified for the sole purpose of running Programs. THE LICENSE SET FORTH IN THIS SECTION 2 DOES NOT EXTEND TO THE COMMERCIAL FEATURES. YOUR RIGHTS AND OBLIGATIONS RELATED TO THE COMMERCIAL FEATURES ARE AS SET FORTH IN THE SUPPLEMENTAL TERMS ALONG WITH ADDITIONAL LICENSES FOR DEVELOPERS AND PUBLISHERS. - -3. RESTRICTIONS. Software is copyrighted. Title to Software and all associated intellectual property rights is retained by Oracle and/or its licensors. Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software. You acknowledge that the Software is developed for general use in a variety of information management applications; it is not developed or intended for use in any inherently dangerous applications, including applications that may create a risk of personal injury. If you use the Software in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure its safe use. Oracle disclaims any express or implied warranty of fitness for such uses. No right, title or interest in or to any trademark, service mark, logo or trade name of Oracle or its licensors is granted under this Agreement. Additional restrictions for developers and/or publishers licenses are set forth in the Supplemental License Terms. - -4. DISCLAIMER OF WARRANTY. THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ORACLE FURTHER DISCLAIMS ALL WARRANTIES, EXPRESS AND IMPLIED, INCLUDING WITHOUT LIMITATION, ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. - -5. LIMITATION OF LIABILITY. IN NO EVENT SHALL ORACLE BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL, PUNITIVE OR CONSEQUENTIAL DAMAGES, OR DAMAGES FOR LOSS OF PROFITS, REVENUE, DATA OR DATA USE, INCURRED BY YOU OR ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT, EVEN IF ORACLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. ORACLE'S ENTIRE LIABILITY FOR DAMAGES HEREUNDER SHALL IN NO EVENT EXCEED ONE THOUSAND DOLLARS (U.S. $1,000). - -6. TERMINATION. This Agreement is effective until terminated. You may terminate this Agreement at any time by destroying all copies of Software. This Agreement will terminate immediately without notice from Oracle if you fail to comply with any provision of this Agreement. Either party may terminate this Agreement immediately should any Software become, or in either party's opinion be likely to become, the subject of a claim of infringement of any intellectual property right. Upon termination, you must destroy all copies of Software. - -7. EXPORT REGULATIONS. You agree that U.S. export control laws and other applicable export and import laws govern your use of the Software, including technical data; additional information can be found on Oracle's Global Trade Compliance web site (http://www.oracle.com/products/export). You agree that neither the Software nor any direct product thereof will be exported, directly, or indirectly, in violation of these laws, or will be used for any purpose prohibited by these laws including, without limitation, nuclear, chemical, or biological weapons proliferation. - -8. TRADEMARKS AND LOGOS. You acknowledge and agree as between you -and Oracle that Oracle owns the ORACLE and JAVA trademarks and all ORACLE- and JAVA-related trademarks, service marks, logos and other brand -designations ("Oracle Marks"), and you agree to comply with the Third -Party Usage Guidelines for Oracle Trademarks currently located at -http://www.oracle.com/us/legal/third-party-trademarks/index.html . Any use you make of the Oracle Marks inures to Oracle's benefit. - -9. U.S. GOVERNMENT LICENSE RIGHTS. If Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in Software and accompanying documentation shall be only those set forth in this Agreement. - -10. GOVERNING LAW. This agreement is governed by the substantive and procedural laws of California. You and Oracle agree to submit to the exclusive jurisdiction of, and venue in, the courts of San Francisco, or Santa Clara counties in California in any dispute arising out of or relating to this agreement. - -11. SEVERABILITY. If any provision of this Agreement is held to be unenforceable, this Agreement will remain in effect with the provision omitted, unless omission would frustrate the intent of the parties, in which case this Agreement will immediately terminate. - -12. INTEGRATION. This Agreement is the entire agreement between you and Oracle relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification of this Agreement will be binding, unless in writing and signed by an authorized representative of each party. - -SUPPLEMENTAL LICENSE TERMS - -These Supplemental License Terms add to or modify the terms of the Binary Code License Agreement. Capitalized terms not defined in these Supplemental Terms shall have the same meanings ascribed to them in the Binary Code License Agreement. These Supplemental Terms shall supersede any inconsistent or conflicting terms in the Binary Code License Agreement, or in any license contained within the Software. - -A. COMMERCIAL FEATURES. You may not use the Commercial Features for running Programs, Java applets or applications in your internal business operations or for any commercial or production purpose, or for any purpose other than as set forth in Sections B, C, D and E of these Supplemental Terms. If You want to use the Commercial Features for any purpose other than as permitted in this Agreement, You must obtain a separate license from Oracle. - -B. SOFTWARE INTERNAL USE FOR DEVELOPMENT LICENSE GRANT. Subject to the terms and conditions of this Agreement and restrictions and exceptions set forth in the README File incorporated herein by reference, including, but not limited to the Java Technology Restrictions of these Supplemental Terms, Oracle grants you a non-exclusive, non-transferable, limited license without fees to reproduce internally and use internally the Software complete and unmodified for the purpose of designing, developing, and testing your Programs. - -C. LICENSE TO DISTRIBUTE SOFTWARE. Subject to the terms and conditions of this Agreement and restrictions and exceptions set forth in the README File, including, but not limited to the Java Technology Restrictions and Limitations on Redistribution of these Supplemental Terms, Oracle grants you a non-exclusive, non-transferable, limited license without fees to reproduce and distribute the Software, provided that (i) you distribute the Software complete and unmodified and only bundled as part of, and for the sole purpose of running, your Programs, (ii) the Programs add significant and primary functionality to the Software, (iii) you do not distribute additional software intended to replace any component(s) of the Software, (iv) you do not remove or alter any proprietary legends or notices contained in the Software, (v) you only distribute the Software subject to a license agreement that: (a) is a complete, unmodified reproduction of this Agreement; or (b) protects Oracle's interests consistent with the terms contained in this Agreement and that includes the notice set forth in Section H, and (vi) you agree to defend and indemnify Oracle and its licensors from and against any damages, costs, liabilities, settlement amounts and/or expenses (including attorneys' fees) incurred in connection with any claim, lawsuit or action by any third party that arises or results from the use or distribution of any and all Programs and/or Software. The license set forth in this Section C does not extend to the Software identified in Section G. - -D. LICENSE TO DISTRIBUTE REDISTRIBUTABLES. Subject to the terms and conditions of this Agreement and restrictions and exceptions set forth in the README File, including but not limited to the Java Technology Restrictions and Limitations on Redistribution of these Supplemental Terms, Oracle grants you a non-exclusive, non-transferable, limited license without fees to reproduce and distribute those files specifically identified as redistributable in the README File ("Redistributables") provided that: (i) you distribute the Redistributables complete and unmodified, and only bundled as part of Programs, (ii) the Programs add significant and primary functionality to the Redistributables, (iii) you do not distribute additional software intended to supersede any component(s) of the Redistributables (unless otherwise specified in the applicable README File), (iv) you do not remove or alter any proprietary legends or notices contained in or on the Redistributables, (v) you only distribute the Redistributables pursuant to a license agreement that: (a) is a complete, unmodified reproduction of this Agreement; or (b) protects Oracle's interests consistent with the terms contained in the Agreement and includes the notice set forth in Section H, (vi) you agree to defend and indemnify Oracle and its licensors from and against any damages, costs, liabilities, settlement amounts and/or expenses (including attorneys' fees) incurred in connection with any claim, lawsuit or action by any third party that arises or results from the use or distribution of any and all Programs and/or Software. The license set forth in this Section D does not extend to the Software identified in Section G. - -E. DISTRIBUTION BY PUBLISHERS. This section pertains to your distribution of the JavaTM SE Development Kit Software (“JDK”) with your printed book or magazine (as those terms are commonly used in the industry) relating to Java technology ("Publication"). Subject to and conditioned upon your compliance with the restrictions and obligations contained in the Agreement, Oracle hereby grants to you a non-exclusive, nontransferable limited right to reproduce complete and unmodified copies of the JDK on electronic media (the "Media") for the sole purpose of inclusion and distribution with your Publication(s), subject to the following terms: (i) You may not distribute the JDK on a stand-alone basis; it must be distributed with your Publication(s); (ii) You are responsible for downloading the JDK from the applicable Oracle web site; (iii) You must refer to the JDK as JavaTM SE Development Kit; (iv) The JDK must be reproduced in its entirety and without any modification whatsoever (including with respect to all proprietary notices) and distributed with your Publication subject to a license agreement that is a complete, unmodified reproduction of this Agreement; (v) The Media label shall include the following information: “Copyright [YEAR], Oracle America, Inc. All rights reserved. Use is subject to license terms. ORACLE and JAVA trademarks and all ORACLE- and JAVA-related trademarks, service marks, logos and other brand designations are trademarks or registered trademarks of Oracle in the U.S. and other countries.” [YEAR] is the year of Oracle's release of the Software; the year information can typically be found in the Software’s “About” box or screen. This information must be placed on the Media label in such a manner as to only apply to the JDK; (vi) You must clearly identify the JDK as Oracle's product on the Media holder or Media label, and you may not state or imply that Oracle is responsible for any third-party software contained on the Media; (vii) You may not include any third party software on the Media which is intended to be a replacement or substitute for the JDK; (viii) You agree to defend and indemnify Oracle and its licensors from and against any damages, costs, liabilities, settlement amounts and/or expenses (including attorneys' fees) incurred in connection with any claim, lawsuit or action by any third party that arises or results from the use or distribution of the JDK and/or the Publication; ; and (ix) You shall provide Oracle with a written notice for each Publication; such notice shall include the following information: (1) title of Publication, (2) author(s), (3) date of Publication, and (4) ISBN or ISSN numbers. Such notice shall be sent to Oracle America, Inc., 500 Oracle Parkway, Redwood Shores, California 94065 U.S.A , Attention: General Counsel. - -F. JAVA TECHNOLOGY RESTRICTIONS. You may not create, modify, or change the behavior of, or authorize your licensees to create, modify, or change the behavior of, classes, interfaces, or subpackages that are in any way identified as "java", "javax", "sun", “oracle” or similar convention as specified by Oracle in any naming convention designation. - -G. LIMITATIONS ON REDISTRIBUTION. You may not redistribute or otherwise transfer patches, bug fixes or updates made available by Oracle through Oracle Premier Support, including those made available under Oracle's Java SE Support program. - -H. COMMERCIAL FEATURES NOTICE. For purpose of complying with Supplemental Term Section C.(v)(b) and D.(v)(b), your license agreement shall include the following notice, where the notice is displayed in a manner that anyone using the Software will see the notice: - -Use of the Commercial Features for any commercial or production purpose requires a separate license from Oracle. “Commercial Features” means those features identified Table 1-1 (Commercial Features In Java SE Product Editions) of the Java SE documentation accessible at http://www.oracle.com/technetwork/java/javase/documentation/index.html - - - -I. SOURCE CODE. Software may contain source code that, unless expressly licensed for other purposes, is provided solely for reference purposes pursuant to the terms of this Agreement. Source code may not be redistributed unless expressly provided for in this Agreement. - -J. THIRD PARTY CODE. Additional copyright notices and license terms applicable to portions of the Software are set forth in the THIRDPARTYLICENSEREADME file accessible at http://www.oracle.com/technetwork/java/javase/documentation/index.html. In addition to any terms and conditions of any third party opensource/freeware license identified in the THIRDPARTYLICENSEREADME file, the disclaimer of warranty and limitation of liability provisions in paragraphs 4 and 5 of the Binary Code License Agreement shall apply to all Software in this distribution. - -K. TERMINATION FOR INFRINGEMENT. Either party may terminate this Agreement immediately should any Software become, or in either party's opinion be likely to become, the subject of a claim of infringement of any intellectual property right. - -L. INSTALLATION AND AUTO-UPDATE. The Software's installation and auto-update processes transmit a limited amount of data to Oracle (or its service provider) about those specific processes to help Oracle understand and optimize them. Oracle does not associate the data with personally identifiable information. You can find more information about the data Oracle collects as a result of your Software download at http://www.oracle.com/technetwork/java/javase/documentation/index.html. - -For inquiries please contact: Oracle America, Inc., 500 Oracle Parkway, - -Redwood Shores, California 94065, USA. - -Last updated 02 April 2013 - diff --git a/stage4/00-install-packages/00-packages b/stage4/00-install-packages/00-packages index b0fcf1b..ba5a0d9 100644 --- a/stage4/00-install-packages/00-packages +++ b/stage4/00-install-packages/00-packages @@ -1,4 +1,3 @@ -java-common oracle-java8-jdk python idle python3-pygame python-pygame python-tk python3 idle3 python3-tk python3-pgzero From 0308e92705bc9a22b7574ab5acaa7623e9050b8f Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Fri, 7 Jun 2019 15:51:06 +0100 Subject: [PATCH 34/57] export-image: Set /boot size to 256MB --- export-image/prerun.sh | 6 +++--- export-noobs/00-release/00-run.sh | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/export-image/prerun.sh b/export-image/prerun.sh index 7e0d1eb..ea1e2d6 100755 --- a/export-image/prerun.sh +++ b/export-image/prerun.sh @@ -9,11 +9,11 @@ rm -f "${IMG_FILE}" rm -rf "${ROOTFS_DIR}" mkdir -p "${ROOTFS_DIR}" -BOOT_SIZE=$(du --apparent-size -s "${EXPORT_ROOTFS_DIR}/boot" --block-size=1 | cut -f 1) +BOOT_SIZE="$((256 * 1024 * 1024))" TOTAL_SIZE=$(du --apparent-size -s "${EXPORT_ROOTFS_DIR}" --exclude var/cache/apt/archives --block-size=1 | cut -f 1) ROUND_SIZE="$((4 * 1024 * 1024))" -ROUNDED_ROOT_SECTOR=$(((2 * BOOT_SIZE + ROUND_SIZE) / ROUND_SIZE * ROUND_SIZE / 512 + 8192)) +ROUNDED_ROOT_SECTOR=$(((BOOT_SIZE + ROUND_SIZE) / ROUND_SIZE * ROUND_SIZE / 512 + 8192)) IMG_SIZE=$(((BOOT_SIZE + TOTAL_SIZE + (800 * 1024 * 1024) + ROUND_SIZE - 1) / ROUND_SIZE * ROUND_SIZE)) truncate -s "${IMG_SIZE}" "${IMG_FILE}" @@ -23,7 +23,7 @@ n 8192 -+$((BOOT_SIZE * 2 /512)) ++$((BOOT_SIZE / 512)) p t c diff --git a/export-noobs/00-release/00-run.sh b/export-noobs/00-release/00-run.sh index 85ee454..b5f1272 100755 --- a/export-noobs/00-release/00-run.sh +++ b/export-noobs/00-release/00-run.sh @@ -16,7 +16,7 @@ ROOT_SIZE="$(xz --robot -l "${NOOBS_DIR}/root.tar.xz" | grep totals | cut -f 5) BOOT_SIZE="$(( BOOT_SIZE / 1024 / 1024 + 1))" ROOT_SIZE="$(( ROOT_SIZE / 1024 / 1024 + 1))" -BOOT_NOM="$(( BOOT_SIZE * 3 ))" +BOOT_NOM="256" ROOT_NOM="$(( ROOT_SIZE + 400 ))" mv "${NOOBS_DIR}/OS.png" "${NOOBS_DIR}/${NOOBS_NAME// /_}.png" From d7aa47e41875e5508aac2dd363e4f1218825939c Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Fri, 7 Jun 2019 15:55:54 +0100 Subject: [PATCH 35/57] os_list: add checksums for PINN --- export-noobs/00-release/00-run.sh | 6 ++++++ export-noobs/00-release/files/partitions.json | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/export-noobs/00-release/00-run.sh b/export-noobs/00-release/00-run.sh index b5f1272..1d0b12f 100755 --- a/export-noobs/00-release/00-run.sh +++ b/export-noobs/00-release/00-run.sh @@ -10,6 +10,9 @@ install -v files/release_notes.txt "${NOOBS_DIR}/" tar -v -c -C files/marketing -f "${NOOBS_DIR}/marketing.tar" . +BOOT_SHASUM="$(sha256sum "${NOOBS_DIR}/boot.tar.xz" | cut -f1 -d' ')" +ROOT_SHASUM="$(sha256sum "${NOOBS_DIR}/root.tar.xz" | cut -f1 -d' ')" + BOOT_SIZE="$(xz --robot -l "${NOOBS_DIR}/boot.tar.xz" | grep totals | cut -f 5)" ROOT_SIZE="$(xz --robot -l "${NOOBS_DIR}/root.tar.xz" | grep totals | cut -f 5)" @@ -21,6 +24,9 @@ ROOT_NOM="$(( ROOT_SIZE + 400 ))" mv "${NOOBS_DIR}/OS.png" "${NOOBS_DIR}/${NOOBS_NAME// /_}.png" +sed "${NOOBS_DIR}/partitions.json" -i -e "s|BOOT_SHASUM|${BOOT_SHASUM}|" +sed "${NOOBS_DIR}/partitions.json" -i -e "s|ROOT_SHASUM|${ROOT_SHASUM}|" + sed "${NOOBS_DIR}/partitions.json" -i -e "s|BOOT_SIZE|${BOOT_SIZE}|" sed "${NOOBS_DIR}/partitions.json" -i -e "s|ROOT_SIZE|${ROOT_SIZE}|" diff --git a/export-noobs/00-release/files/partitions.json b/export-noobs/00-release/files/partitions.json index c2e2bcb..3d06017 100644 --- a/export-noobs/00-release/files/partitions.json +++ b/export-noobs/00-release/files/partitions.json @@ -6,7 +6,8 @@ "mkfs_options": "-F 32", "partition_size_nominal": BOOT_NOM, "uncompressed_tarball_size": BOOT_SIZE, - "want_maximised": false + "want_maximised": false, + "sha256sum": "BOOT_SHASUM" }, { "filesystem_type": "ext4", @@ -14,7 +15,8 @@ "mkfs_options": "-O ^huge_file", "partition_size_nominal": ROOT_NOM, "uncompressed_tarball_size": ROOT_SIZE, - "want_maximised": true + "want_maximised": true, + "sha256sum": "ROOT_SHASUM" } ] } From 7e3b160f1c3607854a46f20052ded1def07aa3f4 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Fri, 7 Jun 2019 15:57:47 +0100 Subject: [PATCH 36/57] os_list: add Pi 4 support --- export-noobs/00-release/files/os.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/export-noobs/00-release/files/os.json b/export-noobs/00-release/files/os.json index f694932..4be304f 100644 --- a/export-noobs/00-release/files/os.json +++ b/export-noobs/00-release/files/os.json @@ -11,7 +11,8 @@ "Pi 2", "Pi Zero", "Pi 3", - "Pi Compute Module 3" + "Pi Compute Module 3", + "Pi 4" ], "url": "http://www.raspbian.org/", "username": "pi", From 9005ba070bfc95fd8f03c3a59719be8e4bd32de6 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Fri, 7 Jun 2019 15:58:10 +0100 Subject: [PATCH 37/57] os_list: Bump kernel to 4.19 --- export-noobs/00-release/files/os.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/export-noobs/00-release/files/os.json b/export-noobs/00-release/files/os.json index 4be304f..afa9f9a 100644 --- a/export-noobs/00-release/files/os.json +++ b/export-noobs/00-release/files/os.json @@ -1,7 +1,7 @@ { "description": "NOOBS_DESCRIPTION", "feature_level": 35120124, - "kernel": "4.14", + "kernel": "4.19", "name": "NOOBS_NAME", "password": "raspberry", "release_date": "UNRELEASED", From 17ef7601114693dd0f3fd70440c86dcee988cd4a Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Fri, 7 Jun 2019 15:59:18 +0100 Subject: [PATCH 38/57] config.txt: Enable FKMS and set max_framebuffers=2 in [pi4] --- stage1/00-boot-files/files/config.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/stage1/00-boot-files/files/config.txt b/stage1/00-boot-files/files/config.txt index 06364c5..578d736 100644 --- a/stage1/00-boot-files/files/config.txt +++ b/stage1/00-boot-files/files/config.txt @@ -54,3 +54,11 @@ # Enable audio (loads snd_bcm2835) dtparam=audio=on + +[pi4] +# Enable DRM VC4 V3D driver on top of the dispmanx display stack +dtoverlay=vc4-fkms-v3d +max_framebuffers=2 + +[all] +#dtoverlay=vc4-fkms-v3d From 33dfe5404cb3330cfb688d9b3c261e1a0a0b2b02 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Fri, 7 Jun 2019 16:01:16 +0100 Subject: [PATCH 39/57] stage4: remove timidity --- stage4/00-install-packages/00-packages-nr | 1 - 1 file changed, 1 deletion(-) diff --git a/stage4/00-install-packages/00-packages-nr b/stage4/00-install-packages/00-packages-nr index 9e19f6c..b904b80 100644 --- a/stage4/00-install-packages/00-packages-nr +++ b/stage4/00-install-packages/00-packages-nr @@ -1,3 +1,2 @@ -timidity pi-package realvnc-vnc-server From ba8909f05dca5347252e47afc2e23ca8296d7437 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Fri, 7 Jun 2019 16:03:27 +0100 Subject: [PATCH 40/57] partition_setup.sh: Fix cmdline.txt handling Add sdhci.debug_quirks2=4 to cmdline.txt when resizing Only remove 'quiet' from cmdline if splash screen is off --- export-noobs/00-release/files/partition_setup.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/export-noobs/00-release/files/partition_setup.sh b/export-noobs/00-release/files/partition_setup.sh index 0f45f20..851290e 100644 --- a/export-noobs/00-release/files/partition_setup.sh +++ b/export-noobs/00-release/files/partition_setup.sh @@ -33,7 +33,12 @@ if [ -z "$restore" ]; then fi if ! grep -q resize /proc/cmdline; then - sed -i 's| init=/usr/lib/raspi-config/init_resize.sh||;s| quiet||2g' /tmp/1/cmdline.txt + if ! grep -q splash /tmp/1/cmdline.txt; then + sed -i "s| quiet||g" /tmp/1/cmdline.txt + fi + sed -i 's| init=/usr/lib/raspi-config/init_resize.sh||' /tmp/1/cmdline.txt + else + sed -i '1 s|.*|& sdhci.debug_quirks2=4|' /tmp/1/cmdline.txt fi fi From e14a4035331f23a73cc8ee99d0ffa7bba58e915f Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Fri, 7 Jun 2019 16:21:03 +0100 Subject: [PATCH 41/57] stage2: Disable wifi on 5GHz models --- stage2/02-net-tweaks/01-run.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stage2/02-net-tweaks/01-run.sh b/stage2/02-net-tweaks/01-run.sh index ce5c73f..3ba2ef9 100755 --- a/stage2/02-net-tweaks/01-run.sh +++ b/stage2/02-net-tweaks/01-run.sh @@ -15,3 +15,8 @@ on_chroot <> "/etc/wpa_supplicant/wpa_supplicant.conf" EOF fi + +# Disable wifi on 5GHz models +mkdir -p "${ROOTFS_DIR}/var/lib/systemd/rfkill/" +echo 1 > "${ROOTFS_DIR}/var/lib/systemd/rfkill/platform-3f300000.mmc:wlan" +echo 1 > "${ROOTFS_DIR}/var/lib/systemd/rfkill/platform-fe300000.mmc:wlan" From f86cb0d54a597cf18032cb013f404c77f9ef90dd Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Fri, 7 Jun 2019 16:34:17 +0100 Subject: [PATCH 42/57] script/common: Handle aarch64 host builds --- scripts/common | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/common b/scripts/common index bb75a7e..f264755 100644 --- a/scripts/common +++ b/scripts/common @@ -9,7 +9,7 @@ bootstrap(){ export http_proxy=${APT_PROXY} - if [ "$(dpkg --print-architecture)" != "armhf" ]; then + if [ "$(dpkg --print-architecture)" != "armhf" ] && [ "$(dpkg --print-architecture)" != "aarch64" ]; then BOOTSTRAP_CMD=qemu-debootstrap fi @@ -18,7 +18,7 @@ bootstrap(){ BOOTSTRAP_ARGS+=(--keyring "${STAGE_DIR}/files/raspberrypi.gpg") BOOTSTRAP_ARGS+=("$@") - capsh --drop=cap_setfcap -- "${BOOTSTRAP_CMD}" "${BOOTSTRAP_ARGS[@]}" || true + setarch linux32 capsh --drop=cap_setfcap -- "${BOOTSTRAP_CMD}" "${BOOTSTRAP_ARGS[@]}" || true if [ -d "$2/debootstrap" ]; then rmdir "$2/debootstrap" @@ -89,7 +89,7 @@ on_chroot() { mount --bind /sys "${ROOTFS_DIR}/sys" fi - capsh --drop=cap_setfcap "--chroot=${ROOTFS_DIR}/" -- -e "$@" + setarch linux32 capsh --drop=cap_setfcap "--chroot=${ROOTFS_DIR}/" -- -e "$@" } export -f on_chroot From 0b4d95c4a2c983423768913ee0624191c6bb0212 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Fri, 7 Jun 2019 16:43:42 +0100 Subject: [PATCH 43/57] stage4: enable xcompmgr --- stage4/04-enable-xcompmgr/00-run.sh | 5 +++++ 1 file changed, 5 insertions(+) create mode 100755 stage4/04-enable-xcompmgr/00-run.sh diff --git a/stage4/04-enable-xcompmgr/00-run.sh b/stage4/04-enable-xcompmgr/00-run.sh new file mode 100755 index 0000000..ad6298d --- /dev/null +++ b/stage4/04-enable-xcompmgr/00-run.sh @@ -0,0 +1,5 @@ +#!/bin/bash -e + +on_chroot << EOF + raspi-config nonint do_xcompmgr 0 +EOF From 3682a747bdf319a34fcce7cad9771a1a3ead34ec Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Fri, 7 Jun 2019 16:45:25 +0100 Subject: [PATCH 44/57] Java 8 workaround Java 8 segfaults during install. Installing OpenJDK 11 first prevents Java 8 from running. --- stage5/00-install-extras/00-run.sh | 8 ++++++++ stage5/00-install-extras/{00-packages => 01-packages} | 0 2 files changed, 8 insertions(+) create mode 100755 stage5/00-install-extras/00-run.sh rename stage5/00-install-extras/{00-packages => 01-packages} (100%) diff --git a/stage5/00-install-extras/00-run.sh b/stage5/00-install-extras/00-run.sh new file mode 100755 index 0000000..f102311 --- /dev/null +++ b/stage5/00-install-extras/00-run.sh @@ -0,0 +1,8 @@ +#!/bin/bash -e + +on_chroot << EOF +apt-get install openjdk-11-jre-headless -y --no-install-recommends +#update-binfmts --package openjdk-11 --remove jar /usr/bin/jexec +apt-get purge openjdk-11-jre-headless openjdk-8-jre-headless+ -y +apt-mark auto openjdk-8-jre-headless +EOF diff --git a/stage5/00-install-extras/00-packages b/stage5/00-install-extras/01-packages similarity index 100% rename from stage5/00-install-extras/00-packages rename to stage5/00-install-extras/01-packages From a3c76f303870d81e975967d806a230595fd0d886 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Fri, 7 Jun 2019 16:53:45 +0100 Subject: [PATCH 45/57] Replace IDLE with Thonny in stage 4 and add Mu to stage 5 --- stage4/00-install-packages/00-packages | 4 ++-- stage5/00-install-extras/01-packages | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/stage4/00-install-packages/00-packages b/stage4/00-install-packages/00-packages index ba5a0d9..8584adb 100644 --- a/stage4/00-install-packages/00-packages +++ b/stage4/00-install-packages/00-packages @@ -1,5 +1,5 @@ -python idle python3-pygame python-pygame python-tk -python3 idle3 python3-tk +python python3-pygame python-pygame python-tk +python3 python3-tk python3-thonny python3-pgzero python-serial python3-serial python-picamera python3-picamera diff --git a/stage5/00-install-extras/01-packages b/stage5/00-install-extras/01-packages index 23e682c..ca351ea 100644 --- a/stage5/00-install-extras/01-packages +++ b/stage5/00-install-extras/01-packages @@ -1,4 +1,4 @@ -python3-thonny +mu-editor sonic-pi scratch nuscratch scratch2 smartsim From 6b78e86a2f83e3a40ff64e168bf408fd5530fcab Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Fri, 7 Jun 2019 16:54:36 +0100 Subject: [PATCH 46/57] stage3: include arandr --- stage3/00-install-packages/00-packages | 1 + 1 file changed, 1 insertion(+) diff --git a/stage3/00-install-packages/00-packages b/stage3/00-install-packages/00-packages index 61c652f..eac74ea 100644 --- a/stage3/00-install-packages/00-packages +++ b/stage3/00-install-packages/00-packages @@ -12,3 +12,4 @@ gldriver-test fonts-droid-fallback fonts-liberation2 obconf +arandr From 1ffc374ebffca47f5b1a8ead89b46c14f8465ca7 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Fri, 7 Jun 2019 16:56:37 +0100 Subject: [PATCH 47/57] Fix Buster packages --- stage3/00-install-packages/00-packages-nr | 4 ++-- stage4/00-install-packages/00-packages | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/stage3/00-install-packages/00-packages-nr b/stage3/00-install-packages/00-packages-nr index 3915e3a..c015287 100644 --- a/stage3/00-install-packages/00-packages-nr +++ b/stage3/00-install-packages/00-packages-nr @@ -1,6 +1,6 @@ xserver-xorg-video-fbdev xserver-xorg xinit xserver-xorg-video-fbturbo epiphany-browser -lxde lxtask menu-xdg gksu -netsurf-gtk zenity xdg-utils +lxde lxtask menu-xdg +zenity xdg-utils gvfs-backends gvfs-fuse lightdm gnome-themes-standard-data gnome-icon-theme diff --git a/stage4/00-install-packages/00-packages b/stage4/00-install-packages/00-packages index 8584adb..aac5493 100644 --- a/stage4/00-install-packages/00-packages +++ b/stage4/00-install-packages/00-packages @@ -10,7 +10,7 @@ python3-numpy pypy alacarte rc-gui sense-hat tree -libgl1-mesa-dri libgles1-mesa libgles2-mesa xcompmgr +libgl1-mesa-dri libgles1 libgles2-mesa xcompmgr geany piclone wiringpi pigpio python-pigpio python3-pigpio raspi-gpio python-gpiozero python3-gpiozero python3-rpi.gpio @@ -22,5 +22,5 @@ python-picraft python3-picraft pprompt piwiz rp-prefapps -libav-tools +ffmpeg vlc From 73fc1462fdf2edf1627867ac4a10ab70d54561f6 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Fri, 7 Jun 2019 16:57:54 +0100 Subject: [PATCH 48/57] stage5: Remove wolfram-engine until Buster version is available --- stage5/00-install-extras/01-packages | 1 - 1 file changed, 1 deletion(-) diff --git a/stage5/00-install-extras/01-packages b/stage5/00-install-extras/01-packages index ca351ea..064997a 100644 --- a/stage5/00-install-extras/01-packages +++ b/stage5/00-install-extras/01-packages @@ -6,7 +6,6 @@ smartsim minecraft-pi python-minecraftpi python-sense-emu sense-emu-tools python-sense-emu-doc -wolfram-engine claws-mail greenfoot bluej nodered From 265f342310a3cacfc0c772f6b7d6eff10d6b39f8 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Fri, 7 Jun 2019 17:01:59 +0100 Subject: [PATCH 49/57] stage4: fix autologin --- stage4/01-console-autologin/00-run.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/stage4/01-console-autologin/00-run.sh b/stage4/01-console-autologin/00-run.sh index 2189bef..665dcdb 100755 --- a/stage4/01-console-autologin/00-run.sh +++ b/stage4/01-console-autologin/00-run.sh @@ -1,4 +1,5 @@ #!/bin/bash -e -ln -sf /etc/systemd/system/autologin@.service \ - "${ROOTFS_DIR}/etc/systemd/system/getty.target.wants/getty@tty1.service" +on_chroot << EOF + SUDO_USER="${FIRST_USER_NAME}" raspi-config nonint do_boot_behaviour B4 +EOF From afeea46a39af3a03bfe9b9a6c68d7ff379ecea01 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Fri, 7 Jun 2019 17:27:13 +0100 Subject: [PATCH 50/57] export-image: remove /etc/network/interfaces.dpkg-old --- export-image/04-finalise/01-run.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/export-image/04-finalise/01-run.sh b/export-image/04-finalise/01-run.sh index e0bd17f..093291d 100755 --- a/export-image/04-finalise/01-run.sh +++ b/export-image/04-finalise/01-run.sh @@ -15,6 +15,8 @@ fi rm -f "${ROOTFS_DIR}/etc/apt/apt.conf.d/51cache" rm -f "${ROOTFS_DIR}/usr/bin/qemu-arm-static" +rm -f "${ROOTFS_DIR}/etc/network/interfaces.dpkg-old" + rm -f "${ROOTFS_DIR}/etc/apt/sources.list~" rm -f "${ROOTFS_DIR}/etc/apt/trusted.gpg~" From 0cdec860269dc3e10aad086a27191a1911d1579e Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Fri, 7 Jun 2019 17:30:05 +0100 Subject: [PATCH 51/57] Disable ld.so.preload while building --- export-image/00-allow-rerun/00-run.sh | 4 ++++ export-image/04-finalise/01-run.sh | 6 ++++++ stage2/00-copies-and-fills/02-run.sh | 3 +++ 3 files changed, 13 insertions(+) create mode 100755 stage2/00-copies-and-fills/02-run.sh diff --git a/export-image/00-allow-rerun/00-run.sh b/export-image/00-allow-rerun/00-run.sh index f7c5b4e..dd67f4c 100755 --- a/export-image/00-allow-rerun/00-run.sh +++ b/export-image/00-allow-rerun/00-run.sh @@ -3,3 +3,7 @@ if [ ! -x "${ROOTFS_DIR}/usr/bin/qemu-arm-static" ]; then cp /usr/bin/qemu-arm-static "${ROOTFS_DIR}/usr/bin/" fi + +if [ -e "${ROOTFS_DIR}/etc/ld.so.preload" ]; then + mv "${ROOTFS_DIR}/etc/ld.so.preload" "${ROOTFS_DIR}/etc/ld.so.preload.disabled" +fi diff --git a/export-image/04-finalise/01-run.sh b/export-image/04-finalise/01-run.sh index 093291d..9215dec 100755 --- a/export-image/04-finalise/01-run.sh +++ b/export-image/04-finalise/01-run.sh @@ -15,6 +15,12 @@ fi rm -f "${ROOTFS_DIR}/etc/apt/apt.conf.d/51cache" rm -f "${ROOTFS_DIR}/usr/bin/qemu-arm-static" +if [ "${USE_QEMU}" != "1" ]; then + if [ -e "${ROOTFS_DIR}/etc/ld.so.preload.disabled" ]; then + mv "${ROOTFS_DIR}/etc/ld.so.preload.disabled" "${ROOTFS_DIR}/etc/ld.so.preload" + fi +fi + rm -f "${ROOTFS_DIR}/etc/network/interfaces.dpkg-old" rm -f "${ROOTFS_DIR}/etc/apt/sources.list~" diff --git a/stage2/00-copies-and-fills/02-run.sh b/stage2/00-copies-and-fills/02-run.sh new file mode 100755 index 0000000..a7ab5ec --- /dev/null +++ b/stage2/00-copies-and-fills/02-run.sh @@ -0,0 +1,3 @@ +#!/bin/bash -e + +mv "${ROOTFS_DIR}/etc/ld.so.preload" "${ROOTFS_DIR}/etc/ld.so.preload.disabled" From d942d5487c035ecd568c1a3049d8b00b14132678 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Fri, 7 Jun 2019 17:33:11 +0100 Subject: [PATCH 52/57] export-noobs: update OS.png --- export-noobs/00-release/files/OS.png | Bin 1662 -> 1399 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/export-noobs/00-release/files/OS.png b/export-noobs/00-release/files/OS.png index 10ecc62a8a4f5ec5770c996edc970c7637dc708b..02b67cf7e9fa5352b828649bb11f5a135a0e91f0 100644 GIT binary patch delta 1391 zcmV-#1(5pw4EG9<8Gix*000A=FFF7K010qNS#tmY4s-wj4s-!)B(v54000McNliru z;{^^5Aqf28ixdC=1r|v}K~z}7?N}{%BRLFxz3+gA*(`>JQVW7TW{UpY-pp$$j4~IkB;2J%3AnlI+?0`ST}!h5UwJ zB)<&!_rIU62E)etAQG7YD5WW*OsU)DVpHv8Sb67?NW)A-L>T~W)a`Qlk>$OQ&iG_l zEf;r!K$gfr+YEq2Bu>!_nEJ!P`0}zk9JsZM5>!rlKcfx+NQ1CU0K~)QcD7h-;qlt7 zU{Zc;w0$*05P$GOZYI}6)G$*ob<5Xk_J~qMQ;VCr?Lr+nP>u(40tld@^Wdj1u!9%87(iI1&5^JYcfrQw*SEJ@=kb%ARwwm*1`;#W5QKG# zD*=!b8Gix`oCp9iFbA3pxK7bYp69dWV)x1gz`M1Gs-pm`MUI_svwGxs?75Dz z7Fmi+nt1Gdhu}p{oM!=mBco#sqtnw}&bVPFKm*ezPB?TGom;(66o6?H&-_Dz9x0mU zHUkoH)5K%vN7j^z0N}mY`~z@3uOT8pf8`_4S9E4gJEeisj*2PGqvS-R$MFoPI?528 zd4IM90IS9F`{?Z3_JiJ?@~W@>xPZ-pTMTuS(0 zPXG*|uc%@EEN}=he{@m+e$V<12LN>xet$!tfagK0v%t+~fhnUWKCVUPQNl}wS&Vgj z&=`5YIh%kfho@YR0VHhFvglH}7SUU1k{=ww-wQYXuijA8ZI91j#}AONc0K)7>Wl?f90=$svRT#! zk_C4mctKxLt}_=>9fg!$^8M~tpXUeM>MlN}(=@l{&DnkRd=~|PGP>v000IHNklj$xD0x<#9kOpXgAWBkb+8`VegD6S^Z5}F6L{Xbo4S%gt1tmmEf*PcX0x1O& zwb1Y(B%%cIs1j2su1Xrf)K(3cwK2B$h4(Q#bNgYfrOU3p<438_x4m=soc}$~|GknB zLNLZ6Vg`~;853Q$(JBc2wFTe1$1r;Qs1r)DfAwC}VmGE~BKjjZ=1oD;)VmKb@Iezj zTMrUG`>!GQDSvrR+~1i`-s*(_sMRG%+13F|!wqq?)q`jCHbS3W9MQoX^QKVt>*vU- zD<5NkhDq0k9r*U2#Ps*4e9o#XM|L|T5>PB!2~-)!XpxJ)T&ST@LClZbvD|P1!D|(-HaS6+|eCZ}-szIOo@=QFG$e(SaMt z+tO{{N1af5+Yx~f-W^BMZchtPyT6*y=}UC~d~c#PeCZEAL3TODWID(WjpEJA6TfRe z+luUV4ll&lo_vMi$LGkZE2p+;D{`*glJWi%pMMi-x`Y|%M=5sWUioO+&|#QduK6y; zO+T(>k5IB@6}Iw%%#%dF(hYiy;E`qkT+8QL0vGf2($TmTDO<($)NGs!rXh5lz=2QE zrqp16_`Z~0=v*)r|9hwC|H~IBc{$cbomyE)&ua(36i7A&cjKJQd9NFEJpDTP&pnQ- zF@L!l?GN9F2t^TLJ!Qmc^|ipMxC3kom;z)e!z@;00*9L7y{=&v>OEx{0p9rWZgQ8* zOaYh3BYRfb^{fHidRyl}a!MA8LS; zh3t*@*qlWVVk^lT20$S|k+BuIGFvrGqL(@>v7r<*10HlW%tl0G!}Flxc7P&hX1o;z zL@r#l#JrQ(j$slw)Pz##!nydtxKpeG6owfuc?;rPFpd7>=ZSTBhuoJvy)KzFynnox z@Y&1ctyzfd&<4F0qy;FcHq2o7b`lS1_#Uz*SJC~`J;{fR==k@aB-?`C80+#9 zICL8K%J~#-T8cD8q|$z|mAVlzgWyMJGZ)GEcFNy*k>KGo^ld+U`;eN7t8q^9_!5H1 z7guS2^d%%sCI7|6$PO(n(H)vB)PL8;(`10j3?=G>QlxB^@*QjGdHo<=8+T&*Qm+I? zZ-CC{xAX6r8_B9Eq59}6X!lo->`vm{`DZ#`*p91l4i&rBTgt^-$NoX&?`?SB{RE@S zi*w<0)aqhHL??8*g~;da$ZjVE8=j=#g+-PMaL{X~eP(>H2R}TE;k|{D=YPyxEb|{g zttujR(~nwRjOpu-6A!?-U@AqwSdMc}y=7oS(=8!ro4$_d#cN2}DwV(ANX|EBSXLVA z>?3^UGD=}Ca()h36Dvmi(jX7Udh^#jmT0EF_f8J)HJ~h?oF^W_K5G)%q^eOpgAD3# z*NS<_&g=x+5HW-QhsZ-cS$`C){}uq@bFGBWwT>@<0EItVn&5+d?|eA^07}^^WpAzl zNg{CIQ^L({;|m~wbK!J~ezpvu8(e?p%|z=MHvj>OUU~}GvPXzsyvB`9yY8+Fg+(#L zQE~0**Te;FiMZPEs?fXo#N7~vwc9X7=epmB3)&LVI`s!a_wf6#bt8lt%i9ZuAD}-nPp0zyO^L=nmLiSzmEY(M;@f+i@R=60 z2PR;DXd?C*Umo->eAfZqc`?#EdXN+uTV>&xsQeH3-29a$-SM#i0000 Date: Mon, 17 Jun 2019 10:32:06 +0100 Subject: [PATCH 53/57] stage5: install greenfoot-unbundled --- stage5/00-install-extras/01-packages | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stage5/00-install-extras/01-packages b/stage5/00-install-extras/01-packages index 064997a..5eb164e 100644 --- a/stage5/00-install-extras/01-packages +++ b/stage5/00-install-extras/01-packages @@ -7,7 +7,7 @@ minecraft-pi python-minecraftpi python-sense-emu sense-emu-tools python-sense-emu-doc claws-mail -greenfoot bluej +greenfoot-unbundled bluej nodered realvnc-vnc-viewer From 150e25c4f8123a4c9c63e8dca1b4737fa6c1135c Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Mon, 17 Jun 2019 10:32:11 +0100 Subject: [PATCH 54/57] Revert "Java 8 workaround" This reverts commit 3682a747bdf319a34fcce7cad9771a1a3ead34ec. --- stage5/00-install-extras/{01-packages => 00-packages} | 0 stage5/00-install-extras/00-run.sh | 8 -------- 2 files changed, 8 deletions(-) rename stage5/00-install-extras/{01-packages => 00-packages} (100%) delete mode 100755 stage5/00-install-extras/00-run.sh diff --git a/stage5/00-install-extras/01-packages b/stage5/00-install-extras/00-packages similarity index 100% rename from stage5/00-install-extras/01-packages rename to stage5/00-install-extras/00-packages diff --git a/stage5/00-install-extras/00-run.sh b/stage5/00-install-extras/00-run.sh deleted file mode 100755 index f102311..0000000 --- a/stage5/00-install-extras/00-run.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -e - -on_chroot << EOF -apt-get install openjdk-11-jre-headless -y --no-install-recommends -#update-binfmts --package openjdk-11 --remove jar /usr/bin/jexec -apt-get purge openjdk-11-jre-headless openjdk-8-jre-headless+ -y -apt-mark auto openjdk-8-jre-headless -EOF From a4be08e275129aea19ba47dd9ff791e1a0037132 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Fri, 21 Jun 2019 14:20:14 +0100 Subject: [PATCH 55/57] Update release notes --- .../00-release/files/release_notes.txt | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/export-noobs/00-release/files/release_notes.txt b/export-noobs/00-release/files/release_notes.txt index 37ccee0..5fe21e0 100644 --- a/export-noobs/00-release/files/release_notes.txt +++ b/export-noobs/00-release/files/release_notes.txt @@ -1,5 +1,33 @@ UNRELEASED: * +2019-06-20: + * Based on Debian Buster + * Support for Raspberry Pi 4 hardware + * FKMS OpenGL desktop graphics driver and xcompmgr compositing window manager used when running on Raspberry Pi 4 + * Screen Configuration application added for use with FKMS driver + * Raspberry Pi 4 video output options added to Raspberry Pi Configuration + * Uses new PiXflat UI theme for GTK and Openbox + * CPU activity gauge plugin no longer shown on taskbar by default + * CPU temperature gauge plugin added (not shown by default) + * USB ejecter and Bluetooth taskbar icons hidden when not appropriate + * Version 74.0.3729.157 of Chromium web browser included + * Version 32.0.0.207 of Flash player included + * IDLE Python IDE removed + * Wolfram Mathematica removed temporarily due to incompatibility with Buster + * Display of package sizes removed from Recommended Software + * Appearance Settings modified to support independent settings for two monitors + * Oracle Java 7 and 8 replaced with OpenJDK 11 + * Miscellaneous small bug fixes + * On-board 5GHz WiFi blocked by rfkill by default + The block is removed when taking one of the following actions: + - Selecting a locale in the first run wizard + - Setting the WiFi country in the Raspberry Pi Configuration tool or the Network Settings applet + - Setting the WiFi country in raspi-config + - Providing a wpa_supplicant.conf file through the boot partition + - Running 'rfkill unblock wifi' + * Boot partition size set to 256M + * Linux kernel 4.19.50 + * Raspberry Pi firmware 88ca9081f5e51cdedd16d5dbc85ed12a25123201 2019-04-08: * Chromium browser updated to version 72 * VLC media player updated to version 3.0.6 From cf50ff26d2d3f73e995b72b0dae670e702508b6c Mon Sep 17 00:00:00 2001 From: Hugo Hromic Date: Thu, 27 Jun 2019 11:47:23 +0100 Subject: [PATCH 56/57] Update Dockerfile base image to Debian Buster (#295) With the Qemu version shipped with Debian Stretch, the `man-db` package being installed for Buster in the image triggers many of these errors: qemu: Unsupported syscall: 383 This is a manifestation of the following bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=891109 This is resolved in the current Qemu version shipped with Debian Buster. --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 23cfd1c..706a5fb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:stretch +FROM debian:buster ENV DEBIAN_FRONTEND noninteractive From 3c559aeb5654b64c1de7d6aa3dd0e3e6fc40a7be Mon Sep 17 00:00:00 2001 From: Ryan Walmsley Date: Fri, 28 Jun 2019 12:40:06 +0100 Subject: [PATCH 57/57] 64 bit message (#298) Added a handy message to make it clear that compiling on a 64 bit OS is causing issues. After spending over an hour of troubleshooting think it should be made clearer as it'll affect quite a few users. --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 62e2fb0..9fe12c9 100755 --- a/README.md +++ b/README.md @@ -295,6 +295,9 @@ follows: # Troubleshooting +## `64 Bit Systems` +Please note there is currently an issue when compiling with a 64 Bit OS. See https://github.com/RPi-Distro/pi-gen/issues/271 + ## `binfmt_misc` Linux is able execute binaries from other architectures, meaning that it should be