diff --git a/Dockerfile b/Dockerfile index 706a5fb5a3..2e53149b52 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,10 +3,11 @@ FROM debian:buster ENV DEBIAN_FRONTEND noninteractive RUN apt-get -y update && \ - apt-get -y install \ + apt-get -y install --no-install-recommends \ git vim parted \ quilt coreutils qemu-user-static debootstrap zerofree zip dosfstools \ - bsdtar libcap2-bin rsync grep udev xz-utils curl xxd file kmod\ + bsdtar libcap2-bin rsync grep udev xz-utils curl xxd file kmod bc\ + binfmt-support ca-certificates \ && rm -rf /var/lib/apt/lists/* COPY . /pi-gen/ diff --git a/README.md b/README.md index 8bdacda697..1688228fbf 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,6 @@ FIRST_USER_PASS="********" Config written to ./config Skipping stage3 to stage 5 - ``` ## Usage diff --git a/build-docker.sh b/build-docker.sh index 79b68d45e1..b6a9ea3d81 100755 --- a/build-docker.sh +++ b/build-docker.sh @@ -32,7 +32,7 @@ done # Ensure that the configuration file is an absolute path if test -x /usr/bin/realpath; then - CONFIG_FILE=$(realpath -s "$CONFIG_FILE") + CONFIG_FILE=$(realpath -s "$CONFIG_FILE" || realpath "$CONFIG_FILE") fi # Ensure that the confguration file is present @@ -41,7 +41,7 @@ if test -z "${CONFIG_FILE}"; then exit 1 else # shellcheck disable=SC1090 - source "${CONFIG_FILE}" + source ${CONFIG_FILE} fi CONTAINER_NAME=${CONTAINER_NAME:-pigen_work} diff --git a/build.sh b/build.sh index 9e78728ad4..a8247ab040 100755 --- a/build.sh +++ b/build.sh @@ -20,7 +20,7 @@ EOF PACKAGES="$(sed -f "${SCRIPT_DIR}/remove-comments.sed" < "${i}-packages-nr")" if [ -n "$PACKAGES" ]; then on_chroot << EOF -apt-get install --no-install-recommends -y $PACKAGES +apt-get -o APT::Acquire::Retries=3 install --no-install-recommends -y $PACKAGES EOF fi log "End ${SUB_STAGE_DIR}/${i}-packages-nr" @@ -30,7 +30,7 @@ EOF PACKAGES="$(sed -f "${SCRIPT_DIR}/remove-comments.sed" < "${i}-packages")" if [ -n "$PACKAGES" ]; then on_chroot << EOF -apt-get install -y $PACKAGES +apt-get -o APT::Acquire::Retries=3 install -y $PACKAGES EOF fi log "End ${SUB_STAGE_DIR}/${i}-packages" @@ -162,10 +162,11 @@ export DEPLOY_DIR=${DEPLOY_DIR:-"${BASE_DIR}/deploy"} export DEPLOY_ZIP="${DEPLOY_ZIP:-1}" export LOG_FILE="${WORK_DIR}/build.log" -export HOSTNAME=${HOSTNAME:-raspberrypi} +export TARGET_HOSTNAME=${TARGET_HOSTNAME:-raspberrypi} export FIRST_USER_NAME=${FIRST_USER_NAME:-pi} export FIRST_USER_PASS=${FIRST_USER_PASS:-raspberry} +export RELEASE=${RELEASE:-buster} export WPA_ESSID export WPA_PASSWORD export WPA_COUNTRY diff --git a/depends b/depends index 6238eb1eed..a86bc82123 100644 --- a/depends +++ b/depends @@ -16,3 +16,4 @@ xxd file git lsmod:kmod +bc diff --git a/export-image/prerun.sh b/export-image/prerun.sh index cecde32bed..8bbc566e06 100755 --- a/export-image/prerun.sh +++ b/export-image/prerun.sh @@ -18,7 +18,7 @@ ALIGN="$((4 * 1024 * 1024))" # some overhead (since actual space usage is usually rounded up to the # filesystem block size) and gives some free space on the resulting # image. -ROOT_MARGIN=$((800*1024*1024)) +ROOT_MARGIN="$(echo "($ROOT_SIZE * 0.2 + 200 * 1024 * 1024) / 1" | bc)" BOOT_PART_START=$((ALIGN)) BOOT_PART_SIZE=$(((BOOT_SIZE + ALIGN - 1) / ALIGN * ALIGN)) diff --git a/export-noobs/00-release/00-run.sh b/export-noobs/00-release/00-run.sh index 1d0b12f175..18a3a5dcd6 100755 --- a/export-noobs/00-release/00-run.sh +++ b/export-noobs/00-release/00-run.sh @@ -36,6 +36,7 @@ sed "${NOOBS_DIR}/partitions.json" -i -e "s|ROOT_NOM|${ROOT_NOM}|" sed "${NOOBS_DIR}/os.json" -i -e "s|UNRELEASED|${IMG_DATE}|" sed "${NOOBS_DIR}/os.json" -i -e "s|NOOBS_NAME|${NOOBS_NAME}|" sed "${NOOBS_DIR}/os.json" -i -e "s|NOOBS_DESCRIPTION|${NOOBS_DESCRIPTION}|" +sed "${NOOBS_DIR}/os.json" -i -e "s|RELEASE|${RELEASE}|" sed "${NOOBS_DIR}/release_notes.txt" -i -e "s|UNRELEASED|${IMG_DATE}|" diff --git a/export-noobs/00-release/files/os.json b/export-noobs/00-release/files/os.json index afa9f9a8fc..e231238be6 100644 --- a/export-noobs/00-release/files/os.json +++ b/export-noobs/00-release/files/os.json @@ -16,5 +16,5 @@ ], "url": "http://www.raspbian.org/", "username": "pi", - "version": "buster" + "version": "RELEASE" } diff --git a/export-noobs/00-release/files/release_notes.txt b/export-noobs/00-release/files/release_notes.txt index 45e8576fc6..bde0861e8a 100644 --- a/export-noobs/00-release/files/release_notes.txt +++ b/export-noobs/00-release/files/release_notes.txt @@ -1,5 +1,74 @@ UNRELEASED: * +2020-05-27 + * Added Bookshelf application + * Added Raspberry Pi Diagnostics application + * Added magnifier plugin to taskbar - needs magnifier application installed from Recommended Software to enable + * Added Magnifier application to Recommended Software + * Added marketing questionnaire as initial Chromium tab + * Version 0.25 of Scratch 2 included - uses external application to access IMU on SenseHAT + * Version 1.0.5 of Scratch 3 included - uses external application to access IMU on SenseHAT + * Version 32.0.0.371 of Flash player included + * Version 1.0.6 of Node-RED included + * Version 6.7.1 of VNC Server included + * Version 6.20.113 of VNC Client included + * Internal audio outputs enabled as separate ALSA devices + * MagPi preinstall removed and replaced with Beginner’s Guide + * MagPi weblink removed from main menu + * Chromium made default application for PDF files + * Common icon loading code for lxpanel plugins used + * Italian translations added + * Initial move of mouse pointer to menu button disabled + * Padding at left of menu button removed + * Focus behaviour changed so that focus moves to desktop if no windows are opened - improves reliability of Orca screen reader + * Bug fix - focus bug in volume plugin + * Bug fix - keyboard repeat interval bug in Mouse & Keyboard Settings + * Bug fix - battery detection bug in battery plugin + * Bug fix - spurious active areas on taskbar when plugins are hidden + * Bug fix - occasional crash in file manager on file selection + * Disk ID is now regenerated on first boot + * Updated udev rules + - Remove unused argon rule + - Add vcsm-cma to video group + - Add pwm to gpio group + * i2cprobe: More flexible I2C/SPI alias mapping + * Raspberry Pi firmware 21e1fe3477ffb708a5736ed61a924fd650031136 + * Linux kernel 4.19.118 +2020-02-13: + * Raspberry Pi Configuration - screen blanking setting disabled if Xscreensaver is installed + * Bug fix - switch to turn off VNC server in Raspberry Pi Configuration has no effect + * Bug fix - fix %20 characters in file names + * Linux kernel 4.19.97 + * Raspberry Pi firmware 9a34efbf2fc6a27231607ce91a7cb6bf3bdbc0c5 + - gencmd: Fix measure_clock name for CLOCK_OUTPUT_108 + - mmal isp: Remote alignment requirements for RGB24 formats + - Add missing flags for VC_IMAGE_PROP_YUVUV_4K_CHROMA_ALIGN + - platform: Compromise on gpu overclock settings +2020-02-05: + * Version 3.2.6 of Thonny included - significant improvements in speed, particularly when debugging + * Version 1.0.4 of Scratch 3 included - adds new "display stage" and "display sprite" blocks to SenseHAT extension, and loading of files from command line + * Version 32.0.0.314 of Flash player included + * Version 1.0.3 of NodeRED included + * Version 6.6.0 of RealVNC Server and version 6.19.923 of RealVNC Viewer included - adds support for audio + * Version 78.0.3904.108 of Chromium included + * Mesa updated to 19.3.2 for OpenGL ES 3.1 conformance + * Pixel doubling option added in Raspberry Pi Configuration on platforms using FKMS display driver + * Orca screen reader added to Recommended Software + * Code The Classics Python games added to Recommended Software + * File manager - new "places" pane added at top of sidebar to show mounted drives in simplified view; "new folder" icon added to taskbar; expanders in directory browser now correctly show state of subfolders + * Multiple monitor support improved - alignment of icons on second desktop corrected, Appearance Settings opens on correct tab when launched from context menu + * Raspberry Pi Touchscreen correctly aligned with display + * System clock synchronised before installing new packages in startup wizard and Recommended Software + * Mixer dialogs added to taskbar volume plugin; separate Audio Preferences application removed + * Raspberry Pi Configuration - separate tab added for display options; screen blanking control added + * Volume taskbar plugin and raspi-config modified to support separate ALSA devices for internal audio outputs (analogue and HDMI 1 and 2) + * Robustness improvements in volume, ejecter and battery taskbar plugins + * Movement of mouse pointer to menu button on startup now controlled by point_at_menu parameter in Global section of lxpanel configuration file + * Ctrl-Alt-Del and Ctrl-Alt-End shortcuts added to open shutdown options box + * Ctrl-Shift-Esc shortcut added to open task manager + * Enabled NEON routines in OpenSSL + * Linux kernel 4.19.97 + * Raspberry Pi firmware 149cd7f0487e08e148efe604f8d4d359541cecf4 2019-09-26: * rpi-eeprom included - This will automatically update the SPI EEPROM on the Raspberry Pi 4 to the latest stable version. diff --git a/stage0/00-configure-apt/00-run.sh b/stage0/00-configure-apt/00-run.sh index 9d21ffba2b..d10a49f174 100755 --- a/stage0/00-configure-apt/00-run.sh +++ b/stage0/00-configure-apt/00-run.sh @@ -2,6 +2,8 @@ install -m 644 files/sources.list "${ROOTFS_DIR}/etc/apt/" install -m 644 files/raspi.list "${ROOTFS_DIR}/etc/apt/sources.list.d/" +sed -i "s/RELEASE/${RELEASE}/g" "${ROOTFS_DIR}/etc/apt/sources.list" +sed -i "s/RELEASE/${RELEASE}/g" "${ROOTFS_DIR}/etc/apt/sources.list.d/raspi.list" if [ -n "$APT_PROXY" ]; then install -m 644 files/51cache "${ROOTFS_DIR}/etc/apt/apt.conf.d/51cache" diff --git a/stage0/00-configure-apt/files/raspi.list b/stage0/00-configure-apt/files/raspi.list index 122287e1d5..41c5a70755 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/ buster main +deb http://archive.raspberrypi.org/debian/ RELEASE main # Uncomment line below then 'apt-get update' to enable 'apt-get source' -#deb-src http://archive.raspberrypi.org/debian/ buster main +#deb-src http://archive.raspberrypi.org/debian/ RELEASE main diff --git a/stage0/00-configure-apt/files/sources.list b/stage0/00-configure-apt/files/sources.list index 61820ac04e..4a5dd8a9fd 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/ buster main contrib non-free rpi +deb http://raspbian.raspberrypi.org/raspbian/ RELEASE main contrib non-free rpi # Uncomment line below then 'apt-get update' to enable 'apt-get source' -#deb-src http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi +#deb-src http://raspbian.raspberrypi.org/raspbian/ RELEASE main contrib non-free rpi diff --git a/stage0/prerun.sh b/stage0/prerun.sh index 9ce3e0227f..3b257836b8 100755 --- a/stage0/prerun.sh +++ b/stage0/prerun.sh @@ -1,5 +1,5 @@ #!/bin/bash -e if [ ! -d "${ROOTFS_DIR}" ]; then - bootstrap buster "${ROOTFS_DIR}" http://raspbian.raspberrypi.org/raspbian/ + bootstrap ${RELEASE} "${ROOTFS_DIR}" http://raspbian.raspberrypi.org/raspbian/ fi diff --git a/stage1/02-net-tweaks/00-run.sh b/stage1/02-net-tweaks/00-run.sh index fc9e7638ee..4943cabf0d 100755 --- a/stage1/02-net-tweaks/00-run.sh +++ b/stage1/02-net-tweaks/00-run.sh @@ -1,6 +1,6 @@ #!/bin/bash -e -echo "${HOSTNAME}" > "${ROOTFS_DIR}/etc/hostname" -echo "127.0.1.1 ${HOSTNAME}" >> "${ROOTFS_DIR}/etc/hosts" +echo "${TARGET_HOSTNAME}" > "${ROOTFS_DIR}/etc/hostname" +echo "127.0.1.1 ${TARGET_HOSTNAME}" >> "${ROOTFS_DIR}/etc/hosts" ln -sf /dev/null "${ROOTFS_DIR}/etc/systemd/network/99-default.link" diff --git a/stage2/01-sys-tweaks/00-packages b/stage2/01-sys-tweaks/00-packages index 16b9350f36..83ec74ce53 100644 --- a/stage2/01-sys-tweaks/00-packages +++ b/stage2/01-sys-tweaks/00-packages @@ -28,3 +28,4 @@ vl805fw ntfs-3g pciutils rpi-eeprom +raspinfo diff --git a/stage2/02-net-tweaks/01-run.sh b/stage2/02-net-tweaks/01-run.sh index 63fbff71cd..092975531f 100755 --- a/stage2/02-net-tweaks/01-run.sh +++ b/stage2/02-net-tweaks/01-run.sh @@ -27,5 +27,5 @@ 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" +echo 1 > "${ROOTFS_DIR}/var/lib/systemd/rfkill/platform-3f300000.mmcnr:wlan" +echo 1 > "${ROOTFS_DIR}/var/lib/systemd/rfkill/platform-fe300000.mmcnr:wlan" diff --git a/stage4/03-bookshelf/00-run.sh b/stage4/03-bookshelf/00-run.sh new file mode 100755 index 0000000000..5bd9885ddd --- /dev/null +++ b/stage4/03-bookshelf/00-run.sh @@ -0,0 +1,15 @@ +#!/bin/sh -e + +BOOKSHELF_URL="https://magpi.raspberrypi.org/bookshelf.xml" +GUIDE_URL="$(curl -s "$BOOKSHELF_URL" | awk -F '[<>]' "/Raspberry Pi Beginner's Guide v3<\/TITLE>/ {f=1; next} f==1 && /PDF/ {print \$3; exit}")" +OUTPUT="$(basename "$GUIDE_URL" | cut -f1 -d'?')" + +if [ ! -f "files/$OUTPUT" ]; then + rm files/*.pdf -f + curl -s "$GUIDE_URL" -o "files/$OUTPUT" +fi + +file "files/$OUTPUT" | grep -q "PDF document" + +install -v -o 1000 -g 1000 -d "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/Bookshelf" +install -v -o 1000 -g 1000 -m 644 "files/$OUTPUT" "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/Bookshelf/" diff --git a/stage4/03-magpi/files/.gitignore b/stage4/03-bookshelf/files/.gitignore similarity index 100% rename from stage4/03-magpi/files/.gitignore rename to stage4/03-bookshelf/files/.gitignore diff --git a/stage4/03-magpi/00-run.sh b/stage4/03-magpi/00-run.sh deleted file mode 100755 index cc5a820817..0000000000 --- a/stage4/03-magpi/00-run.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -e - -magpi_regex="MagPi[[:digit:]]*.pdf" -magpi_loc="https://www.raspberrypi.org/magpi-issues" -magpi_latest="$(curl "$magpi_loc/?C=M;O=D" -s | grep "$magpi_regex" -m 1 -o | head -n 1)" - -if [ ! -f "files/$magpi_latest" ]; then - find files/ -regextype grep -regex "files/$magpi_regex" -delete - wget "$magpi_loc/$magpi_latest" -O "files/$magpi_latest" -fi - -file "files/$magpi_latest" | grep -q "PDF document" - -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/" diff --git a/stage5/00-install-extras/00-packages b/stage5/00-install-extras/00-packages index afe5aeef57..609e718125 100644 --- a/stage5/00-install-extras/00-packages +++ b/stage5/00-install-extras/00-packages @@ -13,3 +13,4 @@ nodered realvnc-vnc-viewer python-games +code-the-classics