From 3441133d1c77f377871798dffd1795e319d82486 Mon Sep 17 00:00:00 2001 From: TJ Rana Date: Thu, 27 Jul 2017 06:11:07 -0400 Subject: [PATCH 01/48] Corrected various typos (#91) * Rename License.md to LICENSE * Correct typos * Clean up code layout Organize layout with extra lines --- License.md => LICENSE | 0 README.md | 4 ++-- build-docker.sh | 1 + depends | 2 +- export-image/00-allow-rerun/files/policy-rc.d | 1 + export-image/02-network/01-run.sh | 2 +- export-image/03-set-partuuid/00-run.sh | 1 + export-image/prerun.sh | 1 + scripts/dependencies_check | 4 ++-- stage0/prerun.sh | 1 + stage1/01-sys-tweaks/files/policy-rc.d | 1 + stage1/prerun.sh | 1 + stage2/prerun.sh | 1 + stage3/00-install-packages/01-run.sh | 1 - stage3/prerun.sh | 1 + stage4/prerun.sh | 1 + stage5/prerun.sh | 1 + 17 files changed, 17 insertions(+), 7 deletions(-) rename License.md => LICENSE (100%) diff --git a/License.md b/LICENSE similarity index 100% rename from License.md rename to LICENSE diff --git a/README.md b/README.md index 2b0f439..385f1a9 100755 --- a/README.md +++ b/README.md @@ -132,11 +132,11 @@ maintenance and allows for more easy customization. standard console hardware permission groups. There are a few tools that may not make a whole lot of sense here for - development purposes on a minimal system such as basic python and lua + development purposes on a minimal system such as basic Python and Lua packages as well as the `build-essential` package. They are lumped right in with more essential packages presently, though they need not be with pi-gen. These are understandable for Raspbian's target audience, but if - you were looking for something between truly minimal and Raspbian-lite, + you were looking for something between truly minimal and Raspbian-Lite, here's where you start trimming. - **Stage 3** - desktop system. Here's where you get the full desktop system diff --git a/build-docker.sh b/build-docker.sh index 5e3c5ff..c5db00f 100755 --- a/build-docker.sh +++ b/build-docker.sh @@ -1,4 +1,5 @@ #!/bin/bash -e + DOCKER="docker" set +e $DOCKER ps >/dev/null 2>&1 diff --git a/depends b/depends index c453281..fa2110b 100644 --- a/depends +++ b/depends @@ -9,4 +9,4 @@ mkdosfs:dosfstools capsh:libcap2-bin bsdtar grep -rsync \ No newline at end of file +rsync diff --git a/export-image/00-allow-rerun/files/policy-rc.d b/export-image/00-allow-rerun/files/policy-rc.d index 0b1556d..1924710 100644 --- a/export-image/00-allow-rerun/files/policy-rc.d +++ b/export-image/00-allow-rerun/files/policy-rc.d @@ -1,2 +1,3 @@ #!/bin/sh + exit 101 diff --git a/export-image/02-network/01-run.sh b/export-image/02-network/01-run.sh index 9026a1f..e21b791 100755 --- a/export-image/02-network/01-run.sh +++ b/export-image/02-network/01-run.sh @@ -1,3 +1,3 @@ -#/bin/bash -e +#!/bin/bash -e install -m 644 files/resolv.conf ${ROOTFS_DIR}/etc/ diff --git a/export-image/03-set-partuuid/00-run.sh b/export-image/03-set-partuuid/00-run.sh index f19884e..dccc55e 100755 --- a/export-image/03-set-partuuid/00-run.sh +++ b/export-image/03-set-partuuid/00-run.sh @@ -1,4 +1,5 @@ #!/bin/bash -e + IMG_FILE="${STAGE_WORK_DIR}/${IMG_DATE}-${IMG_NAME}${IMG_SUFFIX}.img" IMGID="$(fdisk -l ${IMG_FILE} | sed -n 's/Disk identifier: 0x\([^ ]*\)/\1/p')" diff --git a/export-image/prerun.sh b/export-image/prerun.sh index 67da3da..7acfedc 100755 --- a/export-image/prerun.sh +++ b/export-image/prerun.sh @@ -1,4 +1,5 @@ #!/bin/bash -e + IMG_FILE="${STAGE_WORK_DIR}/${IMG_DATE}-${IMG_NAME}${IMG_SUFFIX}.img" unmount_image ${IMG_FILE} diff --git a/scripts/dependencies_check b/scripts/dependencies_check index 4817561..d649f0c 100644 --- a/scripts/dependencies_check +++ b/scripts/dependencies_check @@ -1,5 +1,5 @@ # dependencies_check -# $@ Dependnecy files to check +# $@ Dependency files to check # # Each dependency is in the form of a tool to test for, optionally followed by # a : and the name of a package if the package on a Debian-ish system is not @@ -21,7 +21,7 @@ dependencies_check() done if [[ "$missing" ]]; then - echo "Reqired dependencies not installed" + echo "Required dependencies not installed" echo echo "This can be resolved on Debian/Raspbian systems by installing:" echo "$missing" diff --git a/stage0/prerun.sh b/stage0/prerun.sh index d2bce14..74ec2a0 100755 --- a/stage0/prerun.sh +++ b/stage0/prerun.sh @@ -1,4 +1,5 @@ #!/bin/bash -e + if [ ! -d ${ROOTFS_DIR} ]; then bootstrap jessie ${ROOTFS_DIR} http://mirrordirector.raspbian.org/raspbian/ fi diff --git a/stage1/01-sys-tweaks/files/policy-rc.d b/stage1/01-sys-tweaks/files/policy-rc.d index 0b1556d..1924710 100755 --- a/stage1/01-sys-tweaks/files/policy-rc.d +++ b/stage1/01-sys-tweaks/files/policy-rc.d @@ -1,2 +1,3 @@ #!/bin/sh + exit 101 diff --git a/stage1/prerun.sh b/stage1/prerun.sh index a5ea5f4..ebb5d35 100755 --- a/stage1/prerun.sh +++ b/stage1/prerun.sh @@ -1,4 +1,5 @@ #!/bin/bash -e + if [ ! -d ${ROOTFS_DIR} ]; then copy_previous fi diff --git a/stage2/prerun.sh b/stage2/prerun.sh index a5ea5f4..ebb5d35 100755 --- a/stage2/prerun.sh +++ b/stage2/prerun.sh @@ -1,4 +1,5 @@ #!/bin/bash -e + if [ ! -d ${ROOTFS_DIR} ]; then copy_previous fi diff --git a/stage3/00-install-packages/01-run.sh b/stage3/00-install-packages/01-run.sh index 871f4bc..d768747 100755 --- a/stage3/00-install-packages/01-run.sh +++ b/stage3/00-install-packages/01-run.sh @@ -6,4 +6,3 @@ update-alternatives --install /usr/bin/x-www-browser \ update-alternatives --install /usr/bin/gnome-www-browser \ gnome-www-browser /usr/bin/chromium-browser 86 EOF - diff --git a/stage3/prerun.sh b/stage3/prerun.sh index a5ea5f4..ebb5d35 100755 --- a/stage3/prerun.sh +++ b/stage3/prerun.sh @@ -1,4 +1,5 @@ #!/bin/bash -e + if [ ! -d ${ROOTFS_DIR} ]; then copy_previous fi diff --git a/stage4/prerun.sh b/stage4/prerun.sh index a5ea5f4..ebb5d35 100755 --- a/stage4/prerun.sh +++ b/stage4/prerun.sh @@ -1,4 +1,5 @@ #!/bin/bash -e + if [ ! -d ${ROOTFS_DIR} ]; then copy_previous fi diff --git a/stage5/prerun.sh b/stage5/prerun.sh index a5ea5f4..ebb5d35 100755 --- a/stage5/prerun.sh +++ b/stage5/prerun.sh @@ -1,4 +1,5 @@ #!/bin/bash -e + if [ ! -d ${ROOTFS_DIR} ]; then copy_previous fi From 68cdf34cb44e23b9076d7796147070bc3cc0a51f Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Fri, 28 Jul 2017 13:16:05 +0100 Subject: [PATCH 02/48] Add xz-utils dependency Closes #90 --- Dockerfile | 2 +- README.md | 2 +- depends | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1b2979c..c51a968 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,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 \ + bsdtar libcap2-bin rsync grep udev xz-utils \ && rm -rf /var/lib/apt/lists/* COPY . /pi-gen/ diff --git a/README.md b/README.md index 385f1a9..bc7b4ce 100755 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ On Debian-based systems: ```bash apt-get install quilt parted realpath qemu-user-static debootstrap zerofree pxz zip \ -dosfstools bsdtar libcap2-bin grep rsync +dosfstools bsdtar libcap2-bin grep rsync xz-utils ``` The file `depends` contains a list of tools needed. The format of this diff --git a/depends b/depends index fa2110b..f61fcd3 100644 --- a/depends +++ b/depends @@ -10,3 +10,4 @@ capsh:libcap2-bin bsdtar grep rsync +xz:xz-utils From 8f361a1c38f0cc00d7a04486a93b2fe29f67ee5c Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Mon, 17 Jul 2017 14:15:48 +0100 Subject: [PATCH 03/48] Switch to Stretch --- .../01-set-sources/00-patches/0-sources.diff | 6 +++--- 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 +- .../00-patches/02-persistant-net.diff | 13 ------------ stage1/02-net-tweaks/00-patches/series | 1 - stage1/02-net-tweaks/00-run.sh | 1 - stage2/01-sys-tweaks/00-packages | 2 +- stage2/01-sys-tweaks/00-patches/series | 1 - stage2/01-sys-tweaks/01-run.sh | 2 ++ stage2/01-sys-tweaks/files/rc.local | 20 +++++++++++++++++++ stage2/EXPORT_NOOBS | 2 +- stage4/00-install-packages/00-packages | 4 +--- stage5/EXPORT_NOOBS | 2 +- 15 files changed, 35 insertions(+), 31 deletions(-) delete mode 100644 stage1/02-net-tweaks/00-patches/02-persistant-net.diff create mode 100755 stage2/01-sys-tweaks/files/rc.local diff --git a/export-image/01-set-sources/00-patches/0-sources.diff b/export-image/01-set-sources/00-patches/0-sources.diff index d46afe6..17badff 100644 --- a/export-image/01-set-sources/00-patches/0-sources.diff +++ b/export-image/01-set-sources/00-patches/0-sources.diff @@ -3,7 +3,7 @@ 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/ jessie main ui staging -+deb http://archive.raspberrypi.org/debian/ jessie main ui +-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/ jessie main ui + #deb-src http://archive.raspberrypi.org/debian/ stretch main ui diff --git a/export-noobs/00-release/files/os.json b/export-noobs/00-release/files/os.json index 46e1634..b2c578d 100644 --- a/export-noobs/00-release/files/os.json +++ b/export-noobs/00-release/files/os.json @@ -14,5 +14,5 @@ ], "url": "http://www.raspbian.org/", "username": "pi", - "version": "jessie" + "version": "stretch" } diff --git a/stage0/00-configure-apt/files/raspi.list b/stage0/00-configure-apt/files/raspi.list index e1f3b41..656ab48 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/ jessie main ui staging +deb http://archive.raspberrypi.org/debian/ stretch main ui staging # Uncomment line below then 'apt-get update' to enable 'apt-get source' -#deb-src http://archive.raspberrypi.org/debian/ jessie main ui +#deb-src http://archive.raspberrypi.org/debian/ stretch main ui diff --git a/stage0/00-configure-apt/files/sources.list b/stage0/00-configure-apt/files/sources.list index 014f732..f13c50c 100644 --- a/stage0/00-configure-apt/files/sources.list +++ b/stage0/00-configure-apt/files/sources.list @@ -1,3 +1,3 @@ -deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-free rpi +deb http://mirrordirector.raspbian.org/raspbian/ stretch main contrib non-free rpi # Uncomment line below then 'apt-get update' to enable 'apt-get source' -#deb-src http://archive.raspbian.org/raspbian/ jessie main contrib non-free rpi +#deb-src http://archive.raspbian.org/raspbian/ stretch main contrib non-free rpi diff --git a/stage0/prerun.sh b/stage0/prerun.sh index 74ec2a0..14c09c3 100755 --- a/stage0/prerun.sh +++ b/stage0/prerun.sh @@ -1,5 +1,5 @@ #!/bin/bash -e if [ ! -d ${ROOTFS_DIR} ]; then - bootstrap jessie ${ROOTFS_DIR} http://mirrordirector.raspbian.org/raspbian/ + bootstrap stretch ${ROOTFS_DIR} http://mirrordirector.raspbian.org/raspbian/ fi diff --git a/stage1/02-net-tweaks/00-patches/02-persistant-net.diff b/stage1/02-net-tweaks/00-patches/02-persistant-net.diff deleted file mode 100644 index 1e6a975..0000000 --- a/stage1/02-net-tweaks/00-patches/02-persistant-net.diff +++ /dev/null @@ -1,13 +0,0 @@ -Index: jessie-stage1/rootfs/lib/udev/rules.d/75-persistent-net-generator.rules -=================================================================== ---- jessie-stage1.orig/rootfs/lib/udev/rules.d/75-persistent-net-generator.rules -+++ jessie-stage1/rootfs/lib/udev/rules.d/75-persistent-net-generator.rules -@@ -22,7 +22,7 @@ IMPORT{cmdline}="net.ifnames" - ENV{net.ifnames}=="1", GOTO="persistent_net_generator_end" - - # device name whitelist --KERNEL!="eth*|ath*|wlan*[0-9]|msh*|ra*|sta*|ctc*|lcs*|hsi*", \ -+KERNEL!="ath*|msh*|ra*|sta*|ctc*|lcs*|hsi*", \ - GOTO="persistent_net_generator_end" - - # ignore Xen virtual interfaces diff --git a/stage1/02-net-tweaks/00-patches/series b/stage1/02-net-tweaks/00-patches/series index 5299ca1..3dc19a2 100644 --- a/stage1/02-net-tweaks/00-patches/series +++ b/stage1/02-net-tweaks/00-patches/series @@ -1,2 +1 @@ 01-hosts.diff -02-persistant-net.diff diff --git a/stage1/02-net-tweaks/00-run.sh b/stage1/02-net-tweaks/00-run.sh index 85b528f..8d3b131 100755 --- a/stage1/02-net-tweaks/00-run.sh +++ b/stage1/02-net-tweaks/00-run.sh @@ -1,7 +1,6 @@ #!/bin/bash -e install -m 644 files/ipv6.conf ${ROOTFS_DIR}/etc/modprobe.d/ipv6.conf -install -m 644 files/interfaces ${ROOTFS_DIR}/etc/network/interfaces install -m 644 files/hostname ${ROOTFS_DIR}/etc/hostname on_chroot << EOF diff --git a/stage2/01-sys-tweaks/00-packages b/stage2/01-sys-tweaks/00-packages index 1f26b57..8b6173f 100644 --- a/stage2/01-sys-tweaks/00-packages +++ b/stage2/01-sys-tweaks/00-packages @@ -1,4 +1,4 @@ -ssh less fbset sudo psmisc strace module-init-tools ed ncdu crda +ssh less fbset sudo psmisc strace ed ncdu crda console-setup keyboard-configuration debconf-utils parted unzip build-essential manpages-dev python bash-completion gdb pkg-config python-rpi.gpio v4l-utils diff --git a/stage2/01-sys-tweaks/00-patches/series b/stage2/01-sys-tweaks/00-patches/series index 8273f0c..aee0402 100644 --- a/stage2/01-sys-tweaks/00-patches/series +++ b/stage2/01-sys-tweaks/00-patches/series @@ -2,5 +2,4 @@ 02-swap.diff 04-inputrc.diff 05-path.diff -06-rc_local.diff 07-resize-init.diff diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index c10705c..e92ceff 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -11,6 +11,8 @@ install -m 644 files/50raspi ${ROOTFS_DIR}/etc/apt/apt.conf.d/ install -m 644 files/console-setup ${ROOTFS_DIR}/etc/default/ +install -m 755 files/rc.local ${ROOTFS_DIR}/etc/ + on_chroot << EOF systemctl disable hwclock.sh systemctl disable nfs-common diff --git a/stage2/01-sys-tweaks/files/rc.local b/stage2/01-sys-tweaks/files/rc.local new file mode 100755 index 0000000..7d39ed7 --- /dev/null +++ b/stage2/01-sys-tweaks/files/rc.local @@ -0,0 +1,20 @@ +#!/bin/sh -e +# +# rc.local +# +# This script is executed at the end of each multiuser runlevel. +# Make sure that the script will "exit 0" on success or any other +# value on error. +# +# In order to enable or disable this script just change the execution +# bits. +# +# By default this script does nothing. + +# Print the IP address +_IP=$(hostname -I) || true +if [ "$_IP" ]; then + printf "My IP address is %s\n" "$_IP" +fi + +exit 0 diff --git a/stage2/EXPORT_NOOBS b/stage2/EXPORT_NOOBS index cc925cd..b741334 100644 --- a/stage2/EXPORT_NOOBS +++ b/stage2/EXPORT_NOOBS @@ -1,2 +1,2 @@ NOOBS_NAME="Raspbian Lite" -NOOBS_DESCRIPTION="A port of Debian jessie for the Raspberry Pi (minimal version)" +NOOBS_DESCRIPTION="A port of Debian Stretch for the Raspberry Pi (minimal version)" diff --git a/stage4/00-install-packages/00-packages b/stage4/00-install-packages/00-packages index e84df51..f88c549 100644 --- a/stage4/00-install-packages/00-packages +++ b/stage4/00-install-packages/00-packages @@ -8,11 +8,10 @@ python-serial python3-serial python-picamera python3-picamera debian-reference-en dillo x2x raspberrypi-net-mods raspberrypi-ui-mods -smartsim penguinspuzzle +smartsim python-pip python3-pip python3-numpy pypy -python3-pifacecommon python3-pifacedigitalio python3-pifacedigital-scratch-handler python-pifacecommon python-pifacedigitalio minecraft-pi python-minecraftpi alacarte rc-gui sense-hat claws-mail @@ -30,7 +29,6 @@ python-twython python3-twython python-smbus python3-smbus python-flask python3-flask python-picraft python3-picraft -python3-codebug-tether python3-codebug-i2c-tether python-sense-emu python3-sense-emu sense-emu-tools python-sense-emu-doc pprompt scratch2 diff --git a/stage5/EXPORT_NOOBS b/stage5/EXPORT_NOOBS index 908acc8..4823501 100644 --- a/stage5/EXPORT_NOOBS +++ b/stage5/EXPORT_NOOBS @@ -1,2 +1,2 @@ NOOBS_NAME="Raspbian" -NOOBS_DESCRIPTION="A port of Debian jessie for the Raspberry Pi (full desktop version)" +NOOBS_DESCRIPTION="A port of Debian Stretch for the Raspberry Pi (full desktop version)" From 036e5242b3df88370b6fe666b14881f3942a8df8 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Mon, 10 Jul 2017 14:20:18 +0100 Subject: [PATCH 04/48] stage2: Add libmtp-runtime and rsync --- stage2/01-sys-tweaks/00-packages | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stage2/01-sys-tweaks/00-packages b/stage2/01-sys-tweaks/00-packages index 8b6173f..dffb1e9 100644 --- a/stage2/01-sys-tweaks/00-packages +++ b/stage2/01-sys-tweaks/00-packages @@ -17,3 +17,5 @@ usb-modeswitch apt-transport-https libpam-chksshpwd rpi-update +libmtp-runtime +rsync From 19fc4a367e56680673fe03f62688fcb95f8008dd Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Mon, 10 Jul 2017 14:20:35 +0100 Subject: [PATCH 05/48] stage2: Add htop --- 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 dffb1e9..7ddb939 100644 --- a/stage2/01-sys-tweaks/00-packages +++ b/stage2/01-sys-tweaks/00-packages @@ -19,3 +19,4 @@ libpam-chksshpwd rpi-update libmtp-runtime rsync +htop From 0f5f10d92564211b65ebc66473d5f60db348cfe2 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Mon, 10 Jul 2017 15:24:58 +0100 Subject: [PATCH 06/48] stage4: install liberation2 font --- stage4/00-install-packages/00-packages | 1 + 1 file changed, 1 insertion(+) diff --git a/stage4/00-install-packages/00-packages b/stage4/00-install-packages/00-packages index f88c549..3fe5027 100644 --- a/stage4/00-install-packages/00-packages +++ b/stage4/00-install-packages/00-packages @@ -8,6 +8,7 @@ python-serial python3-serial python-picamera python3-picamera debian-reference-en dillo x2x raspberrypi-net-mods raspberrypi-ui-mods +fonts-liberation2 smartsim python-pip python3-pip python3-numpy From 6618df4b08b6e547df43f8c7e43cd736e03bbf35 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Tue, 11 Jul 2017 13:28:07 +0100 Subject: [PATCH 07/48] stage2: update wait.conf --- stage2/02-net-tweaks/files/wait.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stage2/02-net-tweaks/files/wait.conf b/stage2/02-net-tweaks/files/wait.conf index 30aa48c..595cc2d 100644 --- a/stage2/02-net-tweaks/files/wait.conf +++ b/stage2/02-net-tweaks/files/wait.conf @@ -1,3 +1,3 @@ [Service] ExecStart= -ExecStart=/sbin/dhcpcd -q -w +ExecStart=/usr/lib/dhcpcd5/dhcpcd -q -w From c77669ad9fa11907c623e69a5cb0a5e55001b2b3 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Tue, 11 Jul 2017 13:32:28 +0100 Subject: [PATCH 08/48] stage2: firmware-ralink renamed to firmware-misc-nonfree --- stage2/02-net-tweaks/00-packages | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stage2/02-net-tweaks/00-packages b/stage2/02-net-tweaks/00-packages index 0c1ff68..3eef223 100644 --- a/stage2/02-net-tweaks/00-packages +++ b/stage2/02-net-tweaks/00-packages @@ -1,3 +1,3 @@ -wpasupplicant wireless-tools firmware-atheros firmware-brcm80211 firmware-libertas firmware-ralink firmware-realtek +wpasupplicant wireless-tools firmware-atheros firmware-brcm80211 firmware-libertas firmware-misc-nonfree firmware-realtek raspberrypi-net-mods dhcpcd5 From 207003b5edfa33795a9886a5cb434b5079c9817b Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Tue, 11 Jul 2017 16:26:52 +0100 Subject: [PATCH 09/48] stage2: Move ssh host key regen and NOOBS config scripts to raspberrypi-sys-mods --- stage2/01-sys-tweaks/01-run.sh | 2 -- .../01-sys-tweaks/files/apply_noobs_os_config | 31 ------------------- .../files/regenerate_ssh_host_keys.service | 11 ------- 3 files changed, 44 deletions(-) delete mode 100644 stage2/01-sys-tweaks/files/apply_noobs_os_config delete mode 100644 stage2/01-sys-tweaks/files/regenerate_ssh_host_keys.service diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index e92ceff..f24d529 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -1,7 +1,5 @@ #!/bin/bash -e -install -m 644 files/regenerate_ssh_host_keys.service ${ROOTFS_DIR}/lib/systemd/system/ -install -m 755 files/apply_noobs_os_config ${ROOTFS_DIR}/etc/init.d/ install -m 755 files/resize2fs_once ${ROOTFS_DIR}/etc/init.d/ install -d ${ROOTFS_DIR}/etc/systemd/system/rc-local.service.d diff --git a/stage2/01-sys-tweaks/files/apply_noobs_os_config b/stage2/01-sys-tweaks/files/apply_noobs_os_config deleted file mode 100644 index c9afe7d..0000000 --- a/stage2/01-sys-tweaks/files/apply_noobs_os_config +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: apply_noobs_os_config -# Required-Start: -# Required-Stop: -# Default-Start: 2 -# Default-Stop: -# Short-Description: Apply config from /boot/os_config.json -# Description: -### END INIT INFO - -. /lib/lsb/init-functions - -set -e - -case "$1" in - start) - log_daemon_msg "Applying config from /boot/os_config.json (if it exists)" - if raspi-config --apply-os-config; then - update-rc.d apply_noobs_os_config remove - rm /etc/init.d/apply_noobs_os_config - log_end_msg 0 - else - log_end_msg 1 - fi - ;; - *) - echo "Usage: $0 start" >&2 - exit 3 - ;; -esac diff --git a/stage2/01-sys-tweaks/files/regenerate_ssh_host_keys.service b/stage2/01-sys-tweaks/files/regenerate_ssh_host_keys.service deleted file mode 100644 index a2d1571..0000000 --- a/stage2/01-sys-tweaks/files/regenerate_ssh_host_keys.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=Regenerate SSH host keys - -[Service] -Type=oneshot -ExecStartPre=/bin/sh -c "if [ -e /dev/hwrng ]; then dd if=/dev/hwrng of=/dev/urandom count=1 bs=4096; fi" -ExecStart=/usr/bin/ssh-keygen -A -ExecStartPost=/bin/rm /lib/systemd/system/regenerate_ssh_host_keys.service ; /usr/sbin/update-rc.d regenerate_ssh_host_keys remove - -[Install] -WantedBy=multi-user.target From 7149e20f2d919efdafc325602c373aee35b27023 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Wed, 12 Jul 2017 12:29:57 +0100 Subject: [PATCH 10/48] export-image: generate .info file --- export-image/04-finalise/01-run.sh | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/export-image/04-finalise/01-run.sh b/export-image/04-finalise/01-run.sh index cc69dec..fefed50 100755 --- a/export-image/04-finalise/01-run.sh +++ b/export-image/04-finalise/01-run.sh @@ -1,6 +1,7 @@ #!/bin/bash -e IMG_FILE="${STAGE_WORK_DIR}/${IMG_DATE}-${IMG_NAME}${IMG_SUFFIX}.img" +INFO_FILE="${STAGE_WORK_DIR}/${IMG_DATE}-${IMG_NAME}${IMG_SUFFIX}.info" on_chroot << EOF /etc/init.d/fake-hwclock stop @@ -47,6 +48,24 @@ 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" + +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" >> "$INFO_FILE" + +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" >> "$INFO_FILE" + +uname=$(curl -s -L "https://github.com/raspberrypi/firmware/raw/$firmware/extra/uname_string7") +printf "Uname string: %s\n" "$uname" >> "$INFO_FILE" + +printf "\nPackages:\n">> "$INFO_FILE" +dpkg -l --root "$ROOTFS_DIR" >> "$INFO_FILE" + ROOT_DEV=$(mount | grep "${ROOTFS_DIR} " | cut -f1 -d' ') unmount ${ROOTFS_DIR} @@ -58,7 +77,8 @@ mkdir -p ${DEPLOY_DIR} rm -f ${DEPLOY_DIR}/image_${IMG_DATE}-${IMG_NAME}${IMG_SUFFIX}.zip -echo zip ${DEPLOY_DIR}/image_${IMG_DATE}-${IMG_NAME}${IMG_SUFFIX}.zip ${IMG_FILE} pushd ${STAGE_WORK_DIR} > /dev/null zip ${DEPLOY_DIR}/image_${IMG_DATE}-${IMG_NAME}${IMG_SUFFIX}.zip $(basename ${IMG_FILE}) popd > /dev/null + +cp "$INFO_FILE" "$DEPLOY_DIR" From f2060a8ee2cfd5a7a6c26e96e48ac363e327af1a Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Wed, 12 Jul 2017 12:33:57 +0100 Subject: [PATCH 11/48] export-noobs: enable NOOBS config script here instead of stage2 --- export-noobs/prerun.sh | 2 ++ stage2/01-sys-tweaks/01-run.sh | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/export-noobs/prerun.sh b/export-noobs/prerun.sh index a3bb29f..61a26d5 100755 --- a/export-noobs/prerun.sh +++ b/export-noobs/prerun.sh @@ -31,6 +31,8 @@ mkdir -p ${NOOBS_DIR} mount $ROOT_DEV ${STAGE_WORK_DIR}/rootfs 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 --format gnutar --use-compress-program pxz -C ${STAGE_WORK_DIR}/rootfs/boot -cpf ${NOOBS_DIR}/boot.tar.xz . umount ${STAGE_WORK_DIR}/rootfs/boot bsdtar --format gnutar --use-compress-program pxz -C ${STAGE_WORK_DIR}/rootfs --one-file-system -cpf ${NOOBS_DIR}/root.tar.xz . diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index f24d529..4c72d85 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -17,7 +17,6 @@ systemctl disable nfs-common systemctl disable rpcbind systemctl disable ssh systemctl enable regenerate_ssh_host_keys -systemctl enable apply_noobs_os_config systemctl enable resize2fs_once EOF From 178b1e404b2243f292a5c5f2752bac843558bc38 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Mon, 17 Jul 2017 13:14:03 +0100 Subject: [PATCH 12/48] Remove NTP in favour of systemd-timesyncd --- stage2/01-sys-tweaks/00-packages | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stage2/01-sys-tweaks/00-packages b/stage2/01-sys-tweaks/00-packages index 7ddb939..fb9d18e 100644 --- a/stage2/01-sys-tweaks/00-packages +++ b/stage2/01-sys-tweaks/00-packages @@ -6,7 +6,7 @@ avahi-daemon lua5.1 luajit hardlink ca-certificates curl -fake-hwclock ntp nfs-common usbutils +fake-hwclock nfs-common usbutils libraspberrypi-dev libraspberrypi-doc libfreetype6-dev dosfstools dphys-swapfile From 8d40bc1bb45c43cd9268e6852d1d3c2761c46220 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Tue, 18 Jul 2017 16:08:58 +0100 Subject: [PATCH 13/48] stage3: Add gldriver-test --- 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 4b979cc..ef93661 100644 --- a/stage3/00-install-packages/00-packages +++ b/stage3/00-install-packages/00-packages @@ -8,3 +8,4 @@ policykit-1 gvfs rfkill chromium-browser rpi-chromium-mods +gldriver-test From 3fe8d799479017c119e76ea96ded66cf246c00f9 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Thu, 20 Jul 2017 10:55:04 +0100 Subject: [PATCH 14/48] Remove pulseaudio --- stage4/00-install-packages/00-packages | 1 - 1 file changed, 1 deletion(-) diff --git a/stage4/00-install-packages/00-packages b/stage4/00-install-packages/00-packages index 3fe5027..9535a56 100644 --- a/stage4/00-install-packages/00-packages +++ b/stage4/00-install-packages/00-packages @@ -23,7 +23,6 @@ nodered libgl1-mesa-dri libgles1-mesa libgles2-mesa xcompmgr geany piclone -pulseaudio-module-bluetooth wiringpi pigpio python-pigpio python3-pigpio raspi-gpio python-gpiozero python3-gpiozero python3-rpi.gpio python-spidev python3-spidev python-twython python3-twython From c2db8285a16d1057c63d8ec660eff4118d8f594c Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Thu, 10 Aug 2017 15:53:18 +0100 Subject: [PATCH 15/48] Disable 64bit filesystem feature --- export-image/prerun.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/export-image/prerun.sh b/export-image/prerun.sh index 7acfedc..f687785 100755 --- a/export-image/prerun.sh +++ b/export-image/prerun.sh @@ -52,9 +52,11 @@ echo "/boot: offset $BOOT_OFFSET, length $BOOT_LENGTH" echo "/: offset $ROOT_OFFSET, length $ROOT_LENGTH" ROOT_FEATURES="^huge_file" -if grep -q "metadata_csum" /etc/mke2fs.conf; then - ROOT_FEATURES="^metadata_csum,$ROOT_FEATURES" -fi +for FEATURE in metadata_csum 64bit; do + if grep -q "$FEATURE" /etc/mke2fs.conf; then + ROOT_FEATURES="^$FEATURE,$ROOT_FEATURES" + fi +done mkdosfs -n boot -F 32 -v $BOOT_DEV > /dev/null mkfs.ext4 -O $ROOT_FEATURES $ROOT_DEV > /dev/null From aaaf0aea13f1e4f0375c31c87d7389299228598d Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Mon, 14 Aug 2017 15:33:06 +0100 Subject: [PATCH 16/48] Update release notes --- export-noobs/00-release/files/release_notes.txt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/export-noobs/00-release/files/release_notes.txt b/export-noobs/00-release/files/release_notes.txt index 1d82bbc..f4b5574 100644 --- a/export-noobs/00-release/files/release_notes.txt +++ b/export-noobs/00-release/files/release_notes.txt @@ -1,5 +1,16 @@ UNRELEASED: - * + * Based on Raspbian Stretch (Debian version 9) + * Version 60 of Chromium browser included + * Version 3.0.1 of Sonic Pi included + * Version 6.1.1 of RealVNC included + * Version 0.17.4 of NodeRED included + * Bluetooth audio routed via ALSA rather than Pulseaudio + * SenseHAT extension added to Scratch 2 + * Various desktop applications modified to prompt for sudo password if needed + * lxinput control options for mouse speed simplified + * lxpanel plugins moved into separate packages + * Latest kernel and firmware + * Various small tweaks, bug fixes and theme modifications 2017-07-05: * New kernel and firmware * Filesystem created without the metadata_csum feature From 4dc1e1670ed0f30668863b35b8696b5179a728b5 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Thu, 17 Aug 2017 14:46:35 +0100 Subject: [PATCH 17/48] Update release notes --- export-noobs/00-release/files/release_notes.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/export-noobs/00-release/files/release_notes.txt b/export-noobs/00-release/files/release_notes.txt index f4b5574..f5b17f3 100644 --- a/export-noobs/00-release/files/release_notes.txt +++ b/export-noobs/00-release/files/release_notes.txt @@ -1,4 +1,6 @@ UNRELEASED: + * +2017-08-16: * Based on Raspbian Stretch (Debian version 9) * Version 60 of Chromium browser included * Version 3.0.1 of Sonic Pi included @@ -9,6 +11,7 @@ UNRELEASED: * Various desktop applications modified to prompt for sudo password if needed * lxinput control options for mouse speed simplified * lxpanel plugins moved into separate packages + * Wireless firmware for Pi 3 and Pi 0W modified to address Broadpwn exploit * Latest kernel and firmware * Various small tweaks, bug fixes and theme modifications 2017-07-05: From 3cc13f2aa28cb5a1d55339fd0932333c4863c17a Mon Sep 17 00:00:00 2001 From: Russ K Date: Mon, 21 Aug 2017 03:48:55 -0500 Subject: [PATCH 18/48] Check for curl as a dependency for export-image (#95) * Check for curl as a dependency for export-image * Add curl to the Dockerfile --- Dockerfile | 2 +- depends | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index c51a968..2085b7c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,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 \ + bsdtar libcap2-bin rsync grep udev xz-utils curl \ && rm -rf /var/lib/apt/lists/* COPY . /pi-gen/ diff --git a/depends b/depends index f61fcd3..b9d0d44 100644 --- a/depends +++ b/depends @@ -11,3 +11,4 @@ bsdtar grep rsync xz:xz-utils +curl From ce46fac1d40b1387ee4f7e78a4e1d079e546471a Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Mon, 21 Aug 2017 10:15:08 +0100 Subject: [PATCH 19/48] Disable predictable network interface names --- stage1/02-net-tweaks/00-run.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/stage1/02-net-tweaks/00-run.sh b/stage1/02-net-tweaks/00-run.sh index 8d3b131..88fb857 100755 --- a/stage1/02-net-tweaks/00-run.sh +++ b/stage1/02-net-tweaks/00-run.sh @@ -3,6 +3,4 @@ install -m 644 files/ipv6.conf ${ROOTFS_DIR}/etc/modprobe.d/ipv6.conf install -m 644 files/hostname ${ROOTFS_DIR}/etc/hostname -on_chroot << EOF -dpkg-divert --add --local /lib/udev/rules.d/75-persistent-net-generator.rules -EOF +ln -s /dev/null ${ROOTFS_DIR}/etc/systemd/network/99-default.link From fcb8cca6ce6ba80bf35160ca4bb5cf48b06c2d05 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Tue, 22 Aug 2017 13:03:21 +0100 Subject: [PATCH 20/48] NOOBS: bsdtar with --numeric-owner --- export-noobs/prerun.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/export-noobs/prerun.sh b/export-noobs/prerun.sh index 61a26d5..dafe654 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 --format gnutar --use-compress-program pxz -C ${STAGE_WORK_DIR}/rootfs/boot -cpf ${NOOBS_DIR}/boot.tar.xz . +bsdtar --numeric-owner --format gnutar --use-compress-program pxz -C ${STAGE_WORK_DIR}/rootfs/boot -cpf ${NOOBS_DIR}/boot.tar.xz . umount ${STAGE_WORK_DIR}/rootfs/boot -bsdtar --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 --use-compress-program pxz -C ${STAGE_WORK_DIR}/rootfs --one-file-system -cpf ${NOOBS_DIR}/root.tar.xz . unmount_image ${IMG_FILE} From dc0fb57fb943300902e908bc707a8829f9c1e582 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Thu, 24 Aug 2017 16:31:15 +0100 Subject: [PATCH 21/48] stage2: install net-tools explicitly --- stage2/02-net-tweaks/00-packages | 1 + 1 file changed, 1 insertion(+) diff --git a/stage2/02-net-tweaks/00-packages b/stage2/02-net-tweaks/00-packages index 3eef223..cc4a68e 100644 --- a/stage2/02-net-tweaks/00-packages +++ b/stage2/02-net-tweaks/00-packages @@ -1,3 +1,4 @@ wpasupplicant wireless-tools firmware-atheros firmware-brcm80211 firmware-libertas firmware-misc-nonfree firmware-realtek raspberrypi-net-mods dhcpcd5 +net-tools From c0513c547adf7bb85d91ccea97453d7d91ce0c60 Mon Sep 17 00:00:00 2001 From: James Ruan Date: Thu, 31 Aug 2017 18:22:33 +0800 Subject: [PATCH 22/48] export-image: when work in a non-English locale environment the PARTUUID will silently fail, resulting to an unbootable image file. (#96) * use dd and xxd to get disk identifier * add xxd as dependency --- Dockerfile | 2 +- depends | 1 + export-image/03-set-partuuid/00-run.sh | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2085b7c..d37d6a9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,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 \ + bsdtar libcap2-bin rsync grep udev xz-utils curl xxd \ && rm -rf /var/lib/apt/lists/* COPY . /pi-gen/ diff --git a/depends b/depends index b9d0d44..d516533 100644 --- a/depends +++ b/depends @@ -12,3 +12,4 @@ grep rsync xz:xz-utils curl +xxd diff --git a/export-image/03-set-partuuid/00-run.sh b/export-image/03-set-partuuid/00-run.sh index dccc55e..4b18405 100755 --- a/export-image/03-set-partuuid/00-run.sh +++ b/export-image/03-set-partuuid/00-run.sh @@ -2,7 +2,7 @@ IMG_FILE="${STAGE_WORK_DIR}/${IMG_DATE}-${IMG_NAME}${IMG_SUFFIX}.img" -IMGID="$(fdisk -l ${IMG_FILE} | sed -n 's/Disk identifier: 0x\([^ ]*\)/\1/p')" +IMGID="$(dd if=${IMG_FILE} skip=440 bs=1 count=4 2>/dev/null | xxd -e | cut -f 2 -d' ')" BOOT_PARTUUID="${IMGID}-01" ROOT_PARTUUID="${IMGID}-02" From b8c94731c5e9630a934e27c9e089b62fa2907fa2 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Thu, 31 Aug 2017 11:24:01 +0100 Subject: [PATCH 23/48] stage1: fix symlink creation Fixes #100 --- stage1/02-net-tweaks/00-run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stage1/02-net-tweaks/00-run.sh b/stage1/02-net-tweaks/00-run.sh index 88fb857..174b9f8 100755 --- a/stage1/02-net-tweaks/00-run.sh +++ b/stage1/02-net-tweaks/00-run.sh @@ -3,4 +3,4 @@ install -m 644 files/ipv6.conf ${ROOTFS_DIR}/etc/modprobe.d/ipv6.conf install -m 644 files/hostname ${ROOTFS_DIR}/etc/hostname -ln -s /dev/null ${ROOTFS_DIR}/etc/systemd/network/99-default.link +ln -sf /dev/null ${ROOTFS_DIR}/etc/systemd/network/99-default.link From 05b31b287d54eaf6269a233997eb97770ec7eed3 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Thu, 31 Aug 2017 11:27:33 +0100 Subject: [PATCH 24/48] Dockerfile: set DEBIAN_FRONTEND noninteractive --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index d37d6a9..4e4264f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,7 @@ FROM debian:stretch +ENV DEBIAN_FRONTEND noninteractive + RUN apt-get -y update && \ apt-get -y install \ git vim parted \ From 2f032b1d19ffd985546ab9344ad46d317ab375bf Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Mon, 4 Sep 2017 09:39:04 +0100 Subject: [PATCH 25/48] Update README.md Fixes #105 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bc7b4ce..3a02095 100755 --- a/README.md +++ b/README.md @@ -166,7 +166,7 @@ from `./stage2` (if building a minimal system). # Example for building a lite system echo "IMG_NAME='Raspbian'" > config touch ./stage3/SKIP ./stage4/SKIP ./stage5/SKIP -rm stage4/EXPORT* +rm stage4/EXPORT* stage5/EXPORT* sudo ./build.sh # or ./build-docker.sh ``` From 63c312d1fe4bf09ceb429c7bdb0f1e46d3bed503 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Mon, 4 Sep 2017 12:17:34 +0100 Subject: [PATCH 26/48] Update release notes --- export-noobs/00-release/files/release_notes.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/export-noobs/00-release/files/release_notes.txt b/export-noobs/00-release/files/release_notes.txt index f5b17f3..6b55eb4 100644 --- a/export-noobs/00-release/files/release_notes.txt +++ b/export-noobs/00-release/files/release_notes.txt @@ -1,5 +1,12 @@ UNRELEASED: - * + * Disable predictable network interface names for Ethernet devices + * Bug fix for keyboard settings dialog in Raspberry Pi Configuration + * Bug fix for crash on some videos and animations in Chromium + * Bug fix for taskbar crash when running RealVNC server + * Bug fix for reloading projects with extensions in Scratch 2 + * Bug fix for MAC address problem in Bluetooth + * New icons in Thonny + * New Japanese translations in Raspberry Pi Configuration 2017-08-16: * Based on Raspbian Stretch (Debian version 9) * Version 60 of Chromium browser included From e64ea5bce4abbeb7fff727c439fb35a7b3190646 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Mon, 4 Sep 2017 14:06:23 +0100 Subject: [PATCH 27/48] stage3: install fonts-droid-fallback --- export-noobs/00-release/files/release_notes.txt | 1 + stage3/00-install-packages/00-packages | 1 + 2 files changed, 2 insertions(+) diff --git a/export-noobs/00-release/files/release_notes.txt b/export-noobs/00-release/files/release_notes.txt index 6b55eb4..5de2319 100644 --- a/export-noobs/00-release/files/release_notes.txt +++ b/export-noobs/00-release/files/release_notes.txt @@ -7,6 +7,7 @@ UNRELEASED: * Bug fix for MAC address problem in Bluetooth * New icons in Thonny * New Japanese translations in Raspberry Pi Configuration + * Install fonts-droid-fallback for international fonts 2017-08-16: * Based on Raspbian Stretch (Debian version 9) * Version 60 of Chromium browser included diff --git a/stage3/00-install-packages/00-packages b/stage3/00-install-packages/00-packages index ef93661..d1e2049 100644 --- a/stage3/00-install-packages/00-packages +++ b/stage3/00-install-packages/00-packages @@ -9,3 +9,4 @@ gvfs rfkill chromium-browser rpi-chromium-mods gldriver-test +fonts-droid-fallback From 727db0ed63cc0e11e2be54137ce1ef2124387f22 Mon Sep 17 00:00:00 2001 From: Jacen Date: Thu, 31 Aug 2017 13:51:08 +0200 Subject: [PATCH 28/48] [fixing] docker parts --- build-docker.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/build-docker.sh b/build-docker.sh index c5db00f..eabc8f7 100755 --- a/build-docker.sh +++ b/build-docker.sh @@ -13,7 +13,6 @@ if ! $DOCKER ps >/dev/null; then fi set -e - config_mount=() if [ -f config ]; then config_mount=("-v" "$(pwd)/config:/pi-gen/config:ro") @@ -47,13 +46,13 @@ fi if [ "$CONTAINER_EXISTS" != "" ] && [ "$CONTINUE" != "1" ]; then echo "Container $CONTAINER_NAME already exists and you did not specify CONTINUE=1. Aborting." echo "You can delete the existing container like this:" - echo " docker rm -v $CONTAINER_NAME" + echo " $DOCKER rm -v $CONTAINER_NAME" exit 1 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" \ -e IMG_NAME=${IMG_NAME}\ @@ -63,8 +62,8 @@ 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 - $DOCKER run --name "${CONTAINER_NAME}" --privileged \ + 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}\ -v "$(pwd)/deploy:/pi-gen/deploy" \ "${config_mount[@]}" \ @@ -73,5 +72,6 @@ else cd /pi-gen; ./build.sh && rsync -av work/*/build.log deploy/" & wait + $DOCKER rm -v $CONTAINER_NAME fi echo "Done! Your image(s) should be in deploy/" From 5024709d70a8556b4eb7f1b03c207f11a8a26222 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Tue, 5 Sep 2017 12:36:15 +0100 Subject: [PATCH 29/48] Update release notes --- export-noobs/00-release/files/release_notes.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/export-noobs/00-release/files/release_notes.txt b/export-noobs/00-release/files/release_notes.txt index 5de2319..e38cd8a 100644 --- a/export-noobs/00-release/files/release_notes.txt +++ b/export-noobs/00-release/files/release_notes.txt @@ -5,7 +5,7 @@ UNRELEASED: * Bug fix for taskbar crash when running RealVNC server * Bug fix for reloading projects with extensions in Scratch 2 * Bug fix for MAC address problem in Bluetooth - * New icons in Thonny + * Simple mode and new icons in Thonny * New Japanese translations in Raspberry Pi Configuration * Install fonts-droid-fallback for international fonts 2017-08-16: From e7e04fcde3ec4cd3b7d79a6c33fd68ee9be7ebfb Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Tue, 5 Sep 2017 14:29:33 +0100 Subject: [PATCH 30/48] stage2: install fdisk --- 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 fb9d18e..314a33e 100644 --- a/stage2/01-sys-tweaks/00-packages +++ b/stage2/01-sys-tweaks/00-packages @@ -20,3 +20,4 @@ rpi-update libmtp-runtime rsync htop +fdisk From 496e41575eeb9fa13f394ffb407b7bc1d00b21c2 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Tue, 5 Sep 2017 14:34:19 +0100 Subject: [PATCH 31/48] Revert "stage2: install fdisk" This reverts commit e7e04fcde3ec4cd3b7d79a6c33fd68ee9be7ebfb. --- stage2/01-sys-tweaks/00-packages | 1 - 1 file changed, 1 deletion(-) diff --git a/stage2/01-sys-tweaks/00-packages b/stage2/01-sys-tweaks/00-packages index 314a33e..fb9d18e 100644 --- a/stage2/01-sys-tweaks/00-packages +++ b/stage2/01-sys-tweaks/00-packages @@ -20,4 +20,3 @@ rpi-update libmtp-runtime rsync htop -fdisk From 26fcf59f3f36973f7ad6163867c235291343aa64 Mon Sep 17 00:00:00 2001 From: Jacen Date: Thu, 7 Sep 2017 23:47:35 +0200 Subject: [PATCH 32/48] [adding] qemu emulation layout to test images with qemu --- README.md | 4 ++++ build.sh | 12 ++++++++---- export-image/04-finalise/01-run.sh | 6 ++++-- stage2/01-sys-tweaks/01-run.sh | 20 ++++++++++++++++++++ stage2/01-sys-tweaks/files/90-qemu.rules | 3 +++ stage2/EXPORT_IMAGE | 3 +++ stage4/EXPORT_IMAGE | 3 +++ stage5/EXPORT_IMAGE | 3 +++ 8 files changed, 48 insertions(+), 6 deletions(-) create mode 100644 stage2/01-sys-tweaks/files/90-qemu.rules diff --git a/README.md b/README.md index 3a02095..f0a794d 100755 --- a/README.md +++ b/README.md @@ -66,6 +66,10 @@ The following environment variables are supported: Output directory for target system images and NOOBS bundles. + * `USE_QEMU` (Default: `"0"`) + + This enable the Qemu mode and set filesystem and image suffix if set to 1. + A simple example for building Raspbian: diff --git a/build.sh b/build.sh index 06d9abc..8b3c82e 100755 --- a/build.sh +++ b/build.sh @@ -119,6 +119,7 @@ if [ "$(id -u)" != "0" ]; then exit 1 fi + if [ -f config ]; then source config fi @@ -128,6 +129,7 @@ if [ -z "${IMG_NAME}" ]; then exit 1 fi +export USE_QEMU=${USE_QEMU:-0} export IMG_DATE=${IMG_DATE:-"$(date +%Y-%m-%d)"} export BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" @@ -177,10 +179,12 @@ for EXPORT_DIR in ${EXPORT_DIRS}; do source "${EXPORT_DIR}/EXPORT_IMAGE" EXPORT_ROOTFS_DIR=${WORK_DIR}/$(basename ${EXPORT_DIR})/rootfs run_stage - if [ -e ${EXPORT_DIR}/EXPORT_NOOBS ]; then - source ${EXPORT_DIR}/EXPORT_NOOBS - STAGE_DIR=${BASE_DIR}/export-noobs - run_stage + if [ "${USE_QEMU}" != "1" ]; then + if [ -e ${EXPORT_DIR}/EXPORT_NOOBS ]; then + source ${EXPORT_DIR}/EXPORT_NOOBS + STAGE_DIR=${BASE_DIR}/export-noobs + run_stage + fi fi done diff --git a/export-image/04-finalise/01-run.sh b/export-image/04-finalise/01-run.sh index fefed50..80fd954 100755 --- a/export-image/04-finalise/01-run.sh +++ b/export-image/04-finalise/01-run.sh @@ -15,8 +15,10 @@ fi rm -f ${ROOTFS_DIR}/etc/apt/apt.conf.d/51cache rm -f ${ROOTFS_DIR}/usr/sbin/policy-rc.d rm -f ${ROOTFS_DIR}/usr/bin/qemu-arm-static -if [ -e ${ROOTFS_DIR}/etc/ld.so.preload.disabled ]; then - mv ${ROOTFS_DIR}/etc/ld.so.preload.disabled ${ROOTFS_DIR}/etc/ld.so.preload +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/apt/sources.list~ diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index 4c72d85..b735f58 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -17,8 +17,28 @@ systemctl disable nfs-common systemctl disable rpcbind systemctl disable ssh systemctl enable regenerate_ssh_host_keys +EOF + +if [ "${USE_QEMU}" = "1" ]; then + echo "enter QEMU mode" + install -m 644 files/90-qemu.rules ${ROOTFS_DIR}/etc/udev/rules.d/ + if [ -e ${ROOTFS_DIR}/etc/ld.so.preload.disabled ]; then + rm ${ROOTFS_DIR}/etc/ld.so.preload.disabled + touch ${ROOTFS_DIR}/etc/ld.so.preload.disabled + fi + if [ -e ${ROOTFS_DIR}/etc/ld.so.preload ]; then + rm ${ROOTFS_DIR}/etc/ld.so.preload + touch ${ROOTFS_DIR}/etc/ld.so.preload + fi + on_chroot << EOF +systemctl disable resize2fs_once +EOF + echo "leaving QEMU mode" +else + on_chroot << EOF systemctl enable resize2fs_once EOF +fi on_chroot << \EOF for GRP in input spi i2c gpio; do diff --git a/stage2/01-sys-tweaks/files/90-qemu.rules b/stage2/01-sys-tweaks/files/90-qemu.rules new file mode 100644 index 0000000..cfe8998 --- /dev/null +++ b/stage2/01-sys-tweaks/files/90-qemu.rules @@ -0,0 +1,3 @@ +KERNEL=="sda", SYMLINK+="mmcblk0" +KERNEL=="sda?", SYMLINK+="mmcblk0p%n" +KERNEL=="sda2", SYMLINK+="root" diff --git a/stage2/EXPORT_IMAGE b/stage2/EXPORT_IMAGE index 8ef6ebe..aa8f936 100644 --- a/stage2/EXPORT_IMAGE +++ b/stage2/EXPORT_IMAGE @@ -1 +1,4 @@ IMG_SUFFIX="-lite" +if [ "${USE_QEMU}" = "1" ]; then + export IMG_SUFFIX="${IMG_SUFFIX}-qemu" +fi diff --git a/stage4/EXPORT_IMAGE b/stage4/EXPORT_IMAGE index ee20363..1f1bd4f 100644 --- a/stage4/EXPORT_IMAGE +++ b/stage4/EXPORT_IMAGE @@ -1 +1,4 @@ IMG_SUFFIX="-4GB" +if [ "${USE_QEMU}" = "1" ]; then + export IMG_SUFFIX="${IMG_SUFFIX}-qemu" +fi diff --git a/stage5/EXPORT_IMAGE b/stage5/EXPORT_IMAGE index 2b0f09d..79ec11a 100644 --- a/stage5/EXPORT_IMAGE +++ b/stage5/EXPORT_IMAGE @@ -1 +1,4 @@ IMG_SUFFIX="" +if [ "${USE_QEMU}" = "1" ]; then + export IMG_SUFFIX="${IMG_SUFFIX}-qemu" +fi From 9aa87dbfb4a9d6ec3e5796d8275a45e2d685e8d6 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Thu, 21 Sep 2017 12:45:05 +0100 Subject: [PATCH 33/48] Fix font packages --- stage3/00-install-packages/00-packages | 2 ++ stage4/00-install-packages/00-packages | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/stage3/00-install-packages/00-packages b/stage3/00-install-packages/00-packages index d1e2049..974e969 100644 --- a/stage3/00-install-packages/00-packages +++ b/stage3/00-install-packages/00-packages @@ -10,3 +10,5 @@ rfkill chromium-browser rpi-chromium-mods gldriver-test fonts-droid-fallback +fonts-arkpandora +fonts-liberation2 diff --git a/stage4/00-install-packages/00-packages b/stage4/00-install-packages/00-packages index 9535a56..d3f40ef 100644 --- a/stage4/00-install-packages/00-packages +++ b/stage4/00-install-packages/00-packages @@ -8,7 +8,6 @@ python-serial python3-serial python-picamera python3-picamera debian-reference-en dillo x2x raspberrypi-net-mods raspberrypi-ui-mods -fonts-liberation2 smartsim python-pip python3-pip python3-numpy From 732a87415d58705b6fac268e98ee9e5b0329f76e Mon Sep 17 00:00:00 2001 From: Claus Strasburger Date: Thu, 31 Aug 2017 19:26:05 +0200 Subject: [PATCH 34/48] Docker-Build enhancements - don't use any volume mounts anymore to allow using docker-in-docker (with docker.sock mounted) - smaller Docker build context by ignoring some files --- .dockerignore | 2 ++ build-docker.sh | 17 ++++++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.dockerignore b/.dockerignore index 4b019f9..e7f7a4a 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,5 @@ output/ work/ deploy/ +apt-cacher-ng/ +.git/objects/* diff --git a/build-docker.sh b/build-docker.sh index eabc8f7..64bb120 100755 --- a/build-docker.sh +++ b/build-docker.sh @@ -13,9 +13,9 @@ if ! $DOCKER ps >/dev/null; then fi set -e -config_mount=() +config_file=() if [ -f config ]; then - config_mount=("-v" "$(pwd)/config:/pi-gen/config:ro") + config_file=("--env-file" "$(pwd)/config") source config fi @@ -24,7 +24,7 @@ CONTINUE=${CONTINUE:-0} if [ "$*" != "" ] || [ -z "${IMG_NAME}" ]; then if [ -z "${IMG_NAME}" ]; then - echo "IMG_NAME not set in 'build'" 1>&2 + echo "IMG_NAME not set in 'config'" 1>&2 echo 1>&2 fi cat >&2 < Date: Thu, 21 Sep 2017 15:19:29 +0200 Subject: [PATCH 35/48] fix docker-in-docker copying when not doing CONTINUE=1 --- build-docker.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-docker.sh b/build-docker.sh index 64bb120..e39a3eb 100755 --- a/build-docker.sh +++ b/build-docker.sh @@ -71,10 +71,10 @@ else cd /pi-gen; ./build.sh && rsync -av work/*/build.log deploy/" & wait "$!" - $DOCKER rm -v $CONTAINER_NAME fi echo "copying results from deploy/" $DOCKER cp "${CONTAINER_NAME}":/pi-gen/deploy . ls -lah deploy +$DOCKER rm -v $CONTAINER_NAME echo "Done! Your image(s) should be in deploy/" From 9f2941954f64d70c0df0de1923c57bf0ef96ceca Mon Sep 17 00:00:00 2001 From: Rick Date: Thu, 28 Sep 2017 22:29:04 +1000 Subject: [PATCH 36/48] Add caution about WORK_DIR filesystem --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index f0a794d..3008140 100755 --- a/README.md +++ b/README.md @@ -61,6 +61,8 @@ The following environment variables are supported: be built and cached. Note, `WORK_DIR` stores a complete copy of the target system for each build stage, amounting to tens of gigabytes in the case of Raspbian. + + **CAUTION**: If your working directory is on an NTFS partition you probably won't be able to build. Make sure this is a proper Linux filesystem. * `DEPLOY_DIR` (Default: `"$BASE_DIR/deploy"`) From 90adfb155185909d4555dce673fafc260f33f2ab Mon Sep 17 00:00:00 2001 From: XECDesign Date: Mon, 6 Nov 2017 10:53:05 +0000 Subject: [PATCH 37/48] Label root partition Fixes #131 --- export-image/prerun.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/export-image/prerun.sh b/export-image/prerun.sh index f687785..e2979cf 100755 --- a/export-image/prerun.sh +++ b/export-image/prerun.sh @@ -58,7 +58,7 @@ for FEATURE in metadata_csum 64bit; do fi done mkdosfs -n boot -F 32 -v $BOOT_DEV > /dev/null -mkfs.ext4 -O $ROOT_FEATURES $ROOT_DEV > /dev/null +mkfs.ext4 -L rootfs-O $ROOT_FEATURES $ROOT_DEV > /dev/null mount -v $ROOT_DEV ${ROOTFS_DIR} -t ext4 mkdir -p ${ROOTFS_DIR}/boot From 31fcc809538fda3459efcc953929103aca888122 Mon Sep 17 00:00:00 2001 From: XECDesign Date: Tue, 7 Nov 2017 05:43:01 +0000 Subject: [PATCH 38/48] Fix typo in export-image Fixes #132 --- export-image/prerun.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/export-image/prerun.sh b/export-image/prerun.sh index e2979cf..8104f45 100755 --- a/export-image/prerun.sh +++ b/export-image/prerun.sh @@ -58,7 +58,7 @@ for FEATURE in metadata_csum 64bit; do fi done mkdosfs -n boot -F 32 -v $BOOT_DEV > /dev/null -mkfs.ext4 -L rootfs-O $ROOT_FEATURES $ROOT_DEV > /dev/null +mkfs.ext4 -L rootfs -O $ROOT_FEATURES $ROOT_DEV > /dev/null mount -v $ROOT_DEV ${ROOTFS_DIR} -t ext4 mkdir -p ${ROOTFS_DIR}/boot From 35994f5d9cc0d6765c7bae558ad0a0203b04223e Mon Sep 17 00:00:00 2001 From: Andrew Wedgbury Date: Tue, 21 Nov 2017 22:04:33 +0000 Subject: [PATCH 39/48] Remove /etc/vnc/updateid when finalising --- export-image/04-finalise/01-run.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/export-image/04-finalise/01-run.sh b/export-image/04-finalise/01-run.sh index 80fd954..f04c7ee 100755 --- a/export-image/04-finalise/01-run.sh +++ b/export-image/04-finalise/01-run.sh @@ -45,6 +45,7 @@ for _FILE in $(find ${ROOTFS_DIR}/var/log/ -type f); do done rm -f "${ROOTFS_DIR}/root/.vnc/private.key" +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 From 5c44fc727e6eed8563c088a4e07cd2fb9d559d26 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Thu, 28 Sep 2017 13:45:50 +0100 Subject: [PATCH 40/48] stage2: install man-db --- 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 fb9d18e..a111ba6 100644 --- a/stage2/01-sys-tweaks/00-packages +++ b/stage2/01-sys-tweaks/00-packages @@ -20,3 +20,4 @@ rpi-update libmtp-runtime rsync htop +man-db From 53259b48d3053d135f6a2eacdbe245d6d2c01b53 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Fri, 3 Nov 2017 17:51:13 +0000 Subject: [PATCH 41/48] Remove fonts-arkpandora --- stage3/00-install-packages/00-packages | 1 - 1 file changed, 1 deletion(-) diff --git a/stage3/00-install-packages/00-packages b/stage3/00-install-packages/00-packages index 974e969..9e4d84c 100644 --- a/stage3/00-install-packages/00-packages +++ b/stage3/00-install-packages/00-packages @@ -10,5 +10,4 @@ rfkill chromium-browser rpi-chromium-mods gldriver-test fonts-droid-fallback -fonts-arkpandora fonts-liberation2 From aa8731012ea96de610aa51c42462d2a7b2a020d0 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Fri, 24 Nov 2017 07:33:03 +0000 Subject: [PATCH 42/48] Round image size up to nearest 4M block --- 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 8104f45..cec133c 100755 --- a/export-image/prerun.sh +++ b/export-image/prerun.sh @@ -12,7 +12,8 @@ mkdir -p ${ROOTFS_DIR} BOOT_SIZE=$(du --apparent-size -s ${EXPORT_ROOTFS_DIR}/boot --block-size=1 | cut -f 1) TOTAL_SIZE=$(du --apparent-size -s ${EXPORT_ROOTFS_DIR} --exclude var/cache/apt/archives --block-size=1 | cut -f 1) -IMG_SIZE=$((BOOT_SIZE + TOTAL_SIZE + (800 * 1024 * 1024))) +ROUND_SIZE="$((4 * 1024 * 1024))" +IMG_SIZE=$(((BOOT_SIZE + TOTAL_SIZE + (800 * 1024 * 1024) + ROUND_SIZE) / ROUND_SIZE * ROUND_SIZE)) truncate -s ${IMG_SIZE} ${IMG_FILE} fdisk -H 255 -S 63 ${IMG_FILE} < Date: Fri, 24 Nov 2017 07:48:05 +0000 Subject: [PATCH 43/48] Update release notes --- export-noobs/00-release/files/release_notes.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/export-noobs/00-release/files/release_notes.txt b/export-noobs/00-release/files/release_notes.txt index e38cd8a..2177cfe 100644 --- a/export-noobs/00-release/files/release_notes.txt +++ b/export-noobs/00-release/files/release_notes.txt @@ -1,4 +1,11 @@ UNRELEASED: + * Added battery monitor plugin for taskbar - works on x86 images or first-generation Pi-Top + * Added cutdown mode to PCManFM file manager to reduce complexity + * Added ability to rename files in PCManFM by clicking name when selected + * Bug fix in Bluetooth ALSA module to reduce truncation of audio at end of playback + * Various small tweaks, bug fixes and theme modifications + * New kernel and firmware +2017-09-07: * Disable predictable network interface names for Ethernet devices * Bug fix for keyboard settings dialog in Raspberry Pi Configuration * Bug fix for crash on some videos and animations in Chromium From b71bf3179310aadf9aaf2ffcdf094a88e488dce8 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Fri, 24 Nov 2017 08:00:36 +0000 Subject: [PATCH 44/48] Update os.json --- 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 b2c578d..e48dcb8 100644 --- a/export-noobs/00-release/files/os.json +++ b/export-noobs/00-release/files/os.json @@ -10,7 +10,8 @@ "Pi Model", "Pi 2", "Pi Zero", - "Pi 3" + "Pi 3", + "Pi Compute Module 3" ], "url": "http://www.raspbian.org/", "username": "pi", From 13185c82247bc612213361952f18efa5c87455af Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Wed, 13 Dec 2017 11:17:58 +0000 Subject: [PATCH 45/48] stage2: install policykit-1 Closes #116 --- 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 a111ba6..f792f37 100644 --- a/stage2/01-sys-tweaks/00-packages +++ b/stage2/01-sys-tweaks/00-packages @@ -21,3 +21,4 @@ libmtp-runtime rsync htop man-db +policykit-1 From 6e3256941564a97dc1cb563bb2667caef7e7a0ce Mon Sep 17 00:00:00 2001 From: Ben Pirt Date: Fri, 15 Dec 2017 11:31:40 +0000 Subject: [PATCH 46/48] Update README with some information on how the build works (#136) --- README.md | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 65 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 3008140..7a73c77 100755 --- a/README.md +++ b/README.md @@ -3,13 +3,13 @@ _Tool used to create the raspberrypi.org Raspbian images_ -### TODO -1. Documentation - - ## Dependencies -On Debian-based systems: +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. + +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 \ @@ -80,6 +80,48 @@ IMG_NAME='Raspbian' ``` +## How the build process works + +The following process is followed to build images: + + * Loop through all of the stage directories in alphanumeric order + + * Move on to the next directory if this stage directory contains a file called + "SKIP" + + * Run the script ```prerun.sh``` which is generally just used to copy the build + directory between stages. + + * In each stage directory loop through each subdirectory and then run each of the + install scripts it contains, again in alphanumeric order. These need to be named + with a two digit padded number at the beginning. + There are a number of different files and directories which can be used to + control different parts of the build process: + + - **00-run.sh** - A unix shell script. Needs to be made executable for it to run + + - **00-run-chroot.sh** - A unix shell script which will be run in the chroot + of the image build directory. Needs to be made executable for it to run. + + - **00-debconf** - Contents of this file are passed to debconf-set-selections + to configure things like locale, etc. + + - **00-packages** - A list of packages to install. Can have more than one, space + separated, per line. + + - **00-packages-nr** - As 00-packages, except these will be installed using + the ```--no-install-recommends -y``` parameters to apt-get + + - **00-patches** - A directory containing patch files to be applied + + * If the stage directory contains files called "EXPORT_NOOBS" or "EXPORT_IMAGE" then + add this stage to a list of images to generate + + * Generate the images for any stages that have specified them + +It is recommended to examine build.sh for finer details. + + ## Docker Build ```bash @@ -179,3 +221,21 @@ sudo ./build.sh # or ./build-docker.sh If you wish to build further configurations upon (for example) the lite system, you can also delete the contents of `./stage3` and `./stage4` and replace with your own contents in the same format. + + +## Skipping stages to speed up development + +If you're working on a specific stage the recommended development process is as +follows: + + * Remove the EXPORT_IMAGE and EXPORT_NOOBS files until you're ready to actually + generate an image + * Add SKIP files to the stages you don't want to build. For example, if you're + basing your image on the lite image you would add these to stages 3, 4 and 5. + * Run build.sh to build all stages + * Add SKIP files to the earlier successfully built stages + * Modify the last stage + * Rebuild just the last stage using ```sudo CLEAN=1 ./build.sh``` + * Once you're happy with the image you can add the EXPORT files back in and + export your image to test + From 40e5dae8190cd76aa2fc2461adc217e802083b0f Mon Sep 17 00:00:00 2001 From: andig Date: Tue, 2 Jan 2018 19:17:07 +0100 Subject: [PATCH 47/48] Correct help text (#145) --- build-docker.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-docker.sh b/build-docker.sh index e39a3eb..e0a9b90 100755 --- a/build-docker.sh +++ b/build-docker.sh @@ -32,7 +32,7 @@ Usage: build-docker.sh [options] Optional environment arguments: ( = ) CONTAINER_NAME=pigen_work set a name for the build container - CONTINUE=0 continue from a previously started container + CONTINUE=1 continue from a previously started container EOF exit 1 fi From 066eb03d52868290661e813738a9a66eda263aa9 Mon Sep 17 00:00:00 2001 From: Ben Pirt Date: Wed, 3 Jan 2018 12:48:31 +0000 Subject: [PATCH 48/48] Allow image building to be skipped for stages (#137) --- .gitignore | 1 + README.md | 6 +++--- build.sh | 6 ++++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 9f385f6..a6883c2 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ work/* config postrun.sh SKIP +SKIP_IMAGES .pc *-pc apt-cacher-ng/ diff --git a/README.md b/README.md index 7a73c77..1e2453b 100755 --- a/README.md +++ b/README.md @@ -228,14 +228,14 @@ replace with your own contents in the same format. If you're working on a specific stage the recommended development process is as follows: - * Remove the EXPORT_IMAGE and EXPORT_NOOBS files until you're ready to actually - generate an image + * Add a file called SKIP_IMAGES into the directories containing EXPORT_* files + (currently stage2, stage4 and stage5) * Add SKIP files to the stages you don't want to build. For example, if you're basing your image on the lite image you would add these to stages 3, 4 and 5. * Run build.sh to build all stages * Add SKIP files to the earlier successfully built stages * Modify the last stage * Rebuild just the last stage using ```sudo CLEAN=1 ./build.sh``` - * Once you're happy with the image you can add the EXPORT files back in and + * Once you're happy with the image you can remove the SKIP_IMAGES files and export your image to test diff --git a/build.sh b/build.sh index 8b3c82e..d72d4f5 100755 --- a/build.sh +++ b/build.sh @@ -85,8 +85,10 @@ run_stage(){ unmount ${WORK_DIR}/${STAGE} STAGE_WORK_DIR=${WORK_DIR}/${STAGE} ROOTFS_DIR=${STAGE_WORK_DIR}/rootfs - if [ -f ${STAGE_DIR}/EXPORT_IMAGE ]; then - EXPORT_DIRS="${EXPORT_DIRS} ${STAGE_DIR}" + if [ ! -f SKIP_IMAGES ]; then + if [ -f ${STAGE_DIR}/EXPORT_IMAGE ]; then + EXPORT_DIRS="${EXPORT_DIRS} ${STAGE_DIR}" + fi fi if [ ! -f SKIP ]; then if [ "${CLEAN}" = "1" ]; then