From d00f3c9900a989e0aaf1d6b692fc68bd6f2642a5 Mon Sep 17 00:00:00 2001 From: FooDeas Date: Sun, 18 Jun 2017 23:06:41 +0200 Subject: [PATCH 01/28] installer: implement usb boot, separate usb root --- build.sh | 8 +- config/installer-retries.txt | 2 +- scripts/opt/raspberrypi-ua-netinst/install.sh | 98 ++++++++++--------- 3 files changed, 55 insertions(+), 53 deletions(-) diff --git a/build.sh b/build.sh index ad20cf07..3c0e54ef 100755 --- a/build.sh +++ b/build.sh @@ -673,14 +673,14 @@ mv raspberrypi-ua-netinst.cpio.gz bootfs/raspberrypi-ua-netinst/ echo "initramfs raspberrypi-ua-netinst/raspberrypi-ua-netinst.cpio.gz" echo "[pi3]" echo "enable_uart=1" - echo "" - echo "# Only for RPi model 3: The following line enables the ability to boot from USB." - echo "# Notice: This flag will be written to OTP and is permanent." - echo "#program_usb_boot_mode=1" } >> bootfs/config.txt echo "dwc_otg.lpm_enable=0 consoleblank=0 console=serial0,115200 console=tty1 elevator=deadline rootwait" > bootfs/cmdline.txt +if [ ! -f bootfs/TIMEOUT ] ; then + touch bootfs/TIMEOUT +fi + # prepare config content mkdir -p bootfs/raspberrypi-ua-netinst/config mkdir -p bootfs/raspberrypi-ua-netinst/config/apt diff --git a/config/installer-retries.txt b/config/installer-retries.txt index 3f18b63f..57d89a45 100644 --- a/config/installer-retries.txt +++ b/config/installer-retries.txt @@ -1 +1 @@ -installer_retries="3" +installer_retries=3 diff --git a/scripts/opt/raspberrypi-ua-netinst/install.sh b/scripts/opt/raspberrypi-ua-netinst/install.sh index a774e63a..b91089d1 100644 --- a/scripts/opt/raspberrypi-ua-netinst/install.sh +++ b/scripts/opt/raspberrypi-ua-netinst/install.sh @@ -14,6 +14,7 @@ variables_reset() { rootpartition= wlan_configfile= installer_retries= + installer_fail_blocking= cmdline_custom= # config variables @@ -211,6 +212,11 @@ inputfile_sanitize() { fi } +fail_blocking() { + installer_fail_blocking=1 + fail +} + fail() { local fail_boot_mounted echo @@ -224,7 +230,7 @@ fail() { fi cp "${logfile}" "/boot/raspberrypi-ua-netinst/error-$(date +%Y%m%dT%H%M%S).log" sync - + if [ -e "/boot/raspberrypi-ua-netinst/config/installer-retries.txt" ]; then inputfile_sanitize /boot/raspberrypi-ua-netinst/config/installer-retries.txt # shellcheck disable=SC1091 @@ -236,9 +242,11 @@ fail() { echo "installer_retries=${installer_retries}" > /boot/raspberrypi-ua-netinst/config/installer-retries.txt sync fi - if [ "${installer_retries}" -le "0" ]; then - echo " The maximum number of retries is reached!" - echo " Check the logfiles for errors. Then delete or edit \"installer-retries.txt\" in installer config folder to (re)set the counter." + if [ "${installer_retries}" -le "0" ] || [ "${installer_fail_blocking}" = "1" ]; then + if [ "${installer_retries}" -le "0" ]; then + echo " The maximum number of retries is reached!" + echo " Check the logfiles for errors. Then delete or edit \"installer-retries.txt\" in installer config folder to (re)set the counter." + fi echo " The system is stopped to prevent an infinite loop." while true; do led_sos @@ -681,6 +689,26 @@ if [ -n "${rtc}" ] ; then fi echo "OK" fi +# MSD boot +if [ "${usbboot}" = "1" ] ; then + echo -n " Checking USB boot flag... " + msd_boot_enabled="$(vcgencmd otp_dump | grep 17: | cut -b 4-5)" + msd_boot_enabled="$(printf "%s" "${msd_boot_enabled}" | xxd -r -p | xxd -b | cut -d' ' -f2 | cut -b 3)" + if [ "${msd_boot_enabled}" = "0" ]; then + if ! config_check "/boot/config.txt" "program_usb_boot_mode" "1"; then + echo -e "\n Set flag to allow USB boot on next reboot. " + config_set "/boot/config.txt" "program_usb_boot_mode" "1" + preinstall_reboot=1; + else + echo -e "\n Enabling USB boot flag failed!" + echo " Your device does not allow booting from USB. Disable booting from USB in installer-config.txt to proceed." + fail_blocking + fi + else + sed -i "/^program_usb_boot_mode=1/d" "/boot/config.txt" + fi + echo "OK" +fi echo "OK" # Reboot if needed if [ "${preinstall_reboot}" = "1" ]; then @@ -1051,57 +1079,31 @@ else preset=none fi -if [ "${usbboot}" != "1" ]; then - bootdev=/dev/mmcblk0 - bootpartition=/dev/mmcblk0p1 -else - msd_boot_enabled="$(vcgencmd otp_dump | grep 17: | cut -b 4-5)" - msd_boot_enabled="$(printf "%s" "${msd_boot_enabled}" | xxd -r -p | xxd -b | cut -d' ' -f2 | cut -b 3)" - - if [ "${msd_boot_enabled}" != "1" ]; then - echo "================================================================" - echo " !!! IMPORTANT NOTICE !!!" - echo "Booting from USB mass storage device is disabled!" - echo "Read the manual to enable it in \"config.txt\"." +if [ "${usbboot}" = "1" ]; then + if [ "${bootdev}" = "/dev/mmcblk0" ]; then echo - echo "For this reason, only the system is installed on the USB device!" + echo "=============================================================================================" + echo " !!! IMPORTANT NOTICE !!!" + echo "Because you are installing from SD card and want to boot from USB," + echo "the system will POWERED OFF after installation." + echo "After finishing the installation, you must REMOVE the SD card and reboot the system MANUALLY." echo echo "The installation will continue in 15 seconds..." - echo "================================================================" - usbboot=0 + echo "=============================================================================================" sleep 15s - else - echo "Booting from USB mass storage device is enabled." - if [ "${bootdev}" = "/dev/mmcblk0" ]; then - echo - echo "=============================================================================================" - echo " !!! IMPORTANT NOTICE !!!" - echo "Because you are installing from SD card and want to boot from USB," - echo "the system will POWERED OFF after installation." - echo "After finishing the installation, you must REMOVE the SD card and reboot the system MANUALLY." - echo - echo "The installation will continue in 15 seconds..." - echo "=============================================================================================" - sleep 15s - final_action=halt - fi - bootdev=/dev/sda - bootpartition=/dev/sda1 + final_action=halt fi - echo - usbroot=1 -fi - -if [ "${usbroot}" = "1" ]; then - rootdev=/dev/sda + bootdev=/dev/sda + bootpartition=/dev/sda1 fi if [ -z "${rootpartition}" ]; then - if [ "${rootdev}" = "/dev/sda" ]; then - if [ "${usbboot}" != "1" ]; then - rootpartition=/dev/sda1 - else + if [ "${usbroot}" = "1" ]; then + rootdev=/dev/sda + if [ "${usbboot}" = "1" ]; then rootpartition=/dev/sda2 + else + rootpartition=/dev/sda1 fi else rootpartition=/dev/mmcblk0p2 @@ -1345,9 +1347,9 @@ mdev -s echo -n "Initializing /boot as vfat... " if [ -z "${boot_volume_label}" ]; then - mkfs.vfat "${bootpartition}" &>/dev/null || fail + mkfs.vfat "${bootpartition}" &>/dev/null || fail else - mkfs.vfat -n "${boot_volume_label}" "${bootpartition}" &>/dev/null || fail + mkfs.vfat -n "${boot_volume_label}" "${bootpartition}" &>/dev/null || fail fi echo "OK" From 7ff846f086ffaffa1678633a157bfc704edb1be4 Mon Sep 17 00:00:00 2001 From: FooDeas Date: Mon, 19 Jun 2017 01:48:07 +0200 Subject: [PATCH 02/28] installer: fix activity led if usbroot is set --- doc/INSTALL_CUSTOM.md | 3 ++- scripts/opt/raspberrypi-ua-netinst/install.sh | 15 +++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/doc/INSTALL_CUSTOM.md b/doc/INSTALL_CUSTOM.md index 926436bd..10d246e8 100644 --- a/doc/INSTALL_CUSTOM.md +++ b/doc/INSTALL_CUSTOM.md @@ -107,8 +107,9 @@ ## Partitioning / Filesystem | Parameter | Default | Options | Description | -|-------------------|---------|-----------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +|---------------------|---------|---------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `usbroot` | `0` | `0`/`1` | Set to "1" to install to first USB disk. | +| `usbboot` | `0` | `0`/`1` | Set to "1" to boot from first USB disk. This is usually used with 'usbroot=1' and works with model 3 (BCM2837) only. If this is used for the first time, it has to be done from SD-card and the system will shut down after success. Then the SD-card has to be removed before rebooting. | | `rootfstype` | f2fs | `ext4`/ `f2fs`/ `btrfs` | Sets the file system of the root partition. | | `boot_volume_label` | | | Sets the volume name of the boot partition. The volume name can be up to 11 characters long. The label is used by most OSes (Windows, Mac OSX and Linux) to identify the SD-card on the desktop and can be useful when using multiple SD-cards. | | `bootsize` | `+128M` | | /boot partition size in megabytes, provide it in the form '+\M' (without quotes) | diff --git a/scripts/opt/raspberrypi-ua-netinst/install.sh b/scripts/opt/raspberrypi-ua-netinst/install.sh index b91089d1..20db8173 100644 --- a/scripts/opt/raspberrypi-ua-netinst/install.sh +++ b/scripts/opt/raspberrypi-ua-netinst/install.sh @@ -418,9 +418,15 @@ config_set() { dtoverlay_enable() { local configfile="${1}" local dtoverlay="${2}" - sed -i "s/^#\(dtoverlay=${dtoverlay}\)/\1/" "${configfile}" + local value="${3}" + sed -i "s/^#\(dtoverlay=${dtoverlay}=${value}\)/\1/" "${configfile}" if [ "$(grep -c "^dtoverlay=${dtoverlay}" "${configfile}")" -ne 1 ]; then - echo "dtoverlay=${dtoverlay}" >> "${configfile}" + sed -i "s/^\(dtoverlay=${dtoverlay}\)/#\1/" "${configfile}" + if [ -z "${value}" ]; then + echo "dtoverlay=${dtoverlay}" >> "${configfile}" + else + echo "dtoverlay=${dtoverlay}=${value}" >> "${configfile}" + fi fi } @@ -2103,6 +2109,11 @@ if [ "${sound_enable}" = "1" ] && [ "${sound_usb_enable}" = "1" ] && [ "${sound_ } > /etc/asound.conf fi +# set mmc1 (USB) as default trigger for activity led +if [ "${usbroot}" = "1" ]; then + dtoverlay_enable "/rootfs/boot/config.txt" "act_led_trigger" "mmc1" +fi + # iterate through all the file lists and call the install_files method for them old_dir=$(pwd) cd /rootfs/boot/raspberrypi-ua-netinst/config/files/ || fail From 0c7986251450a8915be1b6e225d206c6aa30a0c2 Mon Sep 17 00:00:00 2001 From: dinosore Date: Fri, 28 Jul 2017 11:33:03 +0100 Subject: [PATCH 03/28] installer: correct SOS flashing for Pi Zero and Pi Zero W (#85) --- README.md | 7 ++-- scripts/opt/raspberrypi-ua-netinst/install.sh | 35 ++++++++++++------- 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 694a72c6..5dd88d57 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ The installer with the default settings configures eth0 with DHCP to get interne ### Features -- completely unattended, you only need a working internet connection through the ethernet port or use the onboard wireless LAN (supported on model 3B) +- completely unattended, you only need a working internet connection through the ethernet port or use the onboard wireless LAN (supported on model 3B and 0W) - DHCP and static IP configuration (DHCP is the default) - always installs the latest version of Raspbian - configurable default settings @@ -72,7 +72,10 @@ Under normal circumstances, you can just power on your Pi and cross your fingers If you don't have a display attached, you can monitor the ethernet card LEDs to guess the activity status. When it finally reboots after installing everything you will see them illuminate on and off a few times when Raspbian configures on boot. -If you do have a display, you can follow the progress and catch any possible errors in the default configuration or your own modifications. +If the installation process fails, you will see **SOS** in Morse code (... --- ...) on an led. In this case, power off the Pi and check the log on the sd card. + +If you do have a display, you can follow the progress and catch any possible errors in the default configuration or your own modifications. + If you have a serial cable connected, installer output can be followed there, too. If 'console=tty1' at then end of the `cmdline.txt` file is removed, you have access to the console in case of problems. ## Installer customization diff --git a/scripts/opt/raspberrypi-ua-netinst/install.sh b/scripts/opt/raspberrypi-ua-netinst/install.sh index 20db8173..5971d654 100644 --- a/scripts/opt/raspberrypi-ua-netinst/install.sh +++ b/scripts/opt/raspberrypi-ua-netinst/install.sh @@ -165,33 +165,42 @@ variables_set_defaults() { led_sos() { local led0=/sys/class/leds/led0 # Power LED local led1=/sys/class/leds/led1 # Activity LED + local led_on=1 + local led_off=0 + +# Setting leds on and off works the other way round on Pi Zero and Pi Zero W +# Also led0 (the only led on the Zeros) is the activity led +if [ ${rpi_hardware_version:0:4} = "Zero" ]; then + led_on=0 + led_off=1 +fi if [ -e /sys/class/leds/led0 ]; then (echo none > /sys/class/leds/led0/trigger) &> /dev/null; else led0=; fi if [ -e /sys/class/leds/led1 ]; then (echo none > /sys/class/leds/led1/trigger) &> /dev/null; else led1=; fi for i in $(seq 1 3); do - if [ -n "$led0" ]; then (echo 1 > "${led0}"/brightness) &> /dev/null; fi - if [ -n "$led1" ]; then (echo 1 > "${led1}"/brightness) &> /dev/null; fi + if [ -n "$led0" ]; then (echo $led_on > "${led0}"/brightness) &> /dev/null; fi + if [ -n "$led1" ]; then (echo $led_on > "${led1}"/brightness) &> /dev/null; fi sleep 0.3s; - if [ -n "$led0" ]; then (echo 0 > "${led0}"/brightness) &> /dev/null; fi - if [ -n "$led1" ]; then (echo 0 > "${led1}"/brightness) &> /dev/null; fi + if [ -n "$led0" ]; then (echo $led_off > "${led0}"/brightness) &> /dev/null; fi + if [ -n "$led1" ]; then (echo $led_off > "${led1}"/brightness) &> /dev/null; fi sleep 0.2s; done sleep 0.1s; for i in $(seq 1 3); do - if [ -n "$led0" ]; then (echo 1 > "${led0}"/brightness) &> /dev/null; fi - if [ -n "$led1" ]; then (echo 1 > "${led1}"/brightness) &> /dev/null; fi + if [ -n "$led0" ]; then (echo $led_on > "${led0}"/brightness) &> /dev/null; fi + if [ -n "$led1" ]; then (echo $led_on > "${led1}"/brightness) &> /dev/null; fi sleep 0.8s; - if [ -n "$led0" ]; then (echo 0 > "${led0}"/brightness) &> /dev/null; fi - if [ -n "$led1" ]; then (echo 0 > "${led1}"/brightness) &> /dev/null; fi + if [ -n "$led0" ]; then (echo $led_off > "${led0}"/brightness) &> /dev/null; fi + if [ -n "$led1" ]; then (echo $led_off > "${led1}"/brightness) &> /dev/null; fi sleep 0.2s; done sleep 0.1s; for i in $(seq 1 3); do - if [ -n "$led0" ]; then (echo 1 > "${led0}"/brightness) &> /dev/null; fi - if [ -n "$led1" ]; then (echo 1 > "${led1}"/brightness) &> /dev/null; fi + if [ -n "$led0" ]; then (echo $led_on > "${led0}"/brightness) &> /dev/null; fi + if [ -n "$led1" ]; then (echo $led_on > "${led1}"/brightness) &> /dev/null; fi sleep 0.3s; - if [ -n "$led0" ]; then (echo 0 > "${led0}"/brightness) &> /dev/null; fi - if [ -n "$led1" ]; then (echo 0 > "${led1}"/brightness) &> /dev/null; fi + if [ -n "$led0" ]; then (echo $led_off > "${led0}"/brightness) &> /dev/null; fi + if [ -n "$led1" ]; then (echo $led_off > "${led1}"/brightness) &> /dev/null; fi sleep 0.2s; done sleep 1.5s; @@ -603,6 +612,8 @@ case "${rpi_hardware}" in *) rpi_hardware_version="unknown (${rpi_hardware})" ;; esac + + echo echo "==================================================" echo "raspberrypi-ua-netinst" From d01fd04af1816261d7a03d805fdce244599226cb Mon Sep 17 00:00:00 2001 From: FooDeas Date: Fri, 28 Jul 2017 12:39:33 +0200 Subject: [PATCH 04/28] installer: code formatting --- scripts/opt/raspberrypi-ua-netinst/install.sh | 38 +++++++++---------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/scripts/opt/raspberrypi-ua-netinst/install.sh b/scripts/opt/raspberrypi-ua-netinst/install.sh index 5971d654..b48a27ae 100644 --- a/scripts/opt/raspberrypi-ua-netinst/install.sh +++ b/scripts/opt/raspberrypi-ua-netinst/install.sh @@ -168,39 +168,39 @@ led_sos() { local led_on=1 local led_off=0 -# Setting leds on and off works the other way round on Pi Zero and Pi Zero W -# Also led0 (the only led on the Zeros) is the activity led -if [ ${rpi_hardware_version:0:4} = "Zero" ]; then - led_on=0 - led_off=1 -fi + # Setting leds on and off works the other way round on Pi Zero and Pi Zero W + # Also led0 (the only led on the Zeros) is the activity led + if [ ${rpi_hardware_version:0:4} = "Zero" ]; then + led_on=0 + led_off=1 + fi if [ -e /sys/class/leds/led0 ]; then (echo none > /sys/class/leds/led0/trigger) &> /dev/null; else led0=; fi if [ -e /sys/class/leds/led1 ]; then (echo none > /sys/class/leds/led1/trigger) &> /dev/null; else led1=; fi for i in $(seq 1 3); do - if [ -n "$led0" ]; then (echo $led_on > "${led0}"/brightness) &> /dev/null; fi - if [ -n "$led1" ]; then (echo $led_on > "${led1}"/brightness) &> /dev/null; fi + if [ -n "$led0" ]; then (echo ${led_on} > "${led0}"/brightness) &> /dev/null; fi + if [ -n "$led1" ]; then (echo ${led_on} > "${led1}"/brightness) &> /dev/null; fi sleep 0.3s; - if [ -n "$led0" ]; then (echo $led_off > "${led0}"/brightness) &> /dev/null; fi - if [ -n "$led1" ]; then (echo $led_off > "${led1}"/brightness) &> /dev/null; fi + if [ -n "$led0" ]; then (echo ${led_off} > "${led0}"/brightness) &> /dev/null; fi + if [ -n "$led1" ]; then (echo ${led_off} > "${led1}"/brightness) &> /dev/null; fi sleep 0.2s; done sleep 0.1s; for i in $(seq 1 3); do - if [ -n "$led0" ]; then (echo $led_on > "${led0}"/brightness) &> /dev/null; fi - if [ -n "$led1" ]; then (echo $led_on > "${led1}"/brightness) &> /dev/null; fi + if [ -n "$led0" ]; then (echo ${led_on} > "${led0}"/brightness) &> /dev/null; fi + if [ -n "$led1" ]; then (echo ${led_on} > "${led1}"/brightness) &> /dev/null; fi sleep 0.8s; - if [ -n "$led0" ]; then (echo $led_off > "${led0}"/brightness) &> /dev/null; fi - if [ -n "$led1" ]; then (echo $led_off > "${led1}"/brightness) &> /dev/null; fi + if [ -n "$led0" ]; then (echo ${led_off} > "${led0}"/brightness) &> /dev/null; fi + if [ -n "$led1" ]; then (echo ${led_off} > "${led1}"/brightness) &> /dev/null; fi sleep 0.2s; done sleep 0.1s; for i in $(seq 1 3); do - if [ -n "$led0" ]; then (echo $led_on > "${led0}"/brightness) &> /dev/null; fi - if [ -n "$led1" ]; then (echo $led_on > "${led1}"/brightness) &> /dev/null; fi + if [ -n "$led0" ]; then (echo ${led_on} > "${led0}"/brightness) &> /dev/null; fi + if [ -n "$led1" ]; then (echo ${led_on} > "${led1}"/brightness) &> /dev/null; fi sleep 0.3s; - if [ -n "$led0" ]; then (echo $led_off > "${led0}"/brightness) &> /dev/null; fi - if [ -n "$led1" ]; then (echo $led_off > "${led1}"/brightness) &> /dev/null; fi + if [ -n "$led0" ]; then (echo ${led_off} > "${led0}"/brightness) &> /dev/null; fi + if [ -n "$led1" ]; then (echo ${led_off} > "${led1}"/brightness) &> /dev/null; fi sleep 0.2s; done sleep 1.5s; @@ -612,8 +612,6 @@ case "${rpi_hardware}" in *) rpi_hardware_version="unknown (${rpi_hardware})" ;; esac - - echo echo "==================================================" echo "raspberrypi-ua-netinst" From 1476b68e664c56a10513db94482164e64998c7bc Mon Sep 17 00:00:00 2001 From: FooDeas Date: Sat, 30 Sep 2017 18:40:36 +0200 Subject: [PATCH 05/28] installer: fix SOS led variables --- scripts/opt/raspberrypi-ua-netinst/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/opt/raspberrypi-ua-netinst/install.sh b/scripts/opt/raspberrypi-ua-netinst/install.sh index b48a27ae..55a7b43a 100644 --- a/scripts/opt/raspberrypi-ua-netinst/install.sh +++ b/scripts/opt/raspberrypi-ua-netinst/install.sh @@ -170,7 +170,7 @@ led_sos() { # Setting leds on and off works the other way round on Pi Zero and Pi Zero W # Also led0 (the only led on the Zeros) is the activity led - if [ ${rpi_hardware_version:0:4} = "Zero" ]; then + if [ "${rpi_hardware_version:0:4}" = "Zero" ]; then led_on=0 led_off=1 fi From 2c1b8747f5aa9e8d612c3731eca32e7bbf65b1d5 Mon Sep 17 00:00:00 2001 From: malignus Date: Sat, 30 Sep 2017 13:21:55 +0200 Subject: [PATCH 06/28] build: update to stretch --- build.sh | 73 ++++++++++++++++++++++++++++++++++++++++--------------- update.sh | 35 ++++++++++++++++++++++++-- 2 files changed, 86 insertions(+), 22 deletions(-) diff --git a/build.sh b/build.sh index 3c0e54ef..2b8b1f0b 100755 --- a/build.sh +++ b/build.sh @@ -125,7 +125,7 @@ function create_cpio { mkdir -p rootfs/sbin/ mkdir -p rootfs/usr/bin/ mkdir -p rootfs/usr/lib/mime/packages/ - mkdir -p rootfs/usr/lib/openssl-1.0.0/engines/ + mkdir -p rootfs/usr/lib/openssl-1.0.2/engines/ mkdir -p rootfs/usr/lib/{tar,tc} mkdir -p rootfs/usr/sbin/ mkdir -p rootfs/usr/share/{dpkg,keyrings,libc-bin} @@ -213,7 +213,7 @@ function create_cpio { sed -i "s/__DATE__/$(date)/" rootfs/opt/raspberrypi-ua-netinst/install.sh # btrfs-tools components - cp --preserve=xattr,timestamps tmp/sbin/mkfs.btrfs rootfs/sbin/ + cp --preserve=xattr,timestamps tmp/bin/mkfs.btrfs rootfs/bin/ cp --preserve=xattr,timestamps tmp/usr/lib/*/libbtrfs.so.0 rootfs/lib/ # busybox components @@ -294,7 +294,7 @@ function create_cpio { cp --preserve=xattr,timestamps tmp/usr/share/dpkg/abitable rootfs/usr/share/dpkg/ cp --preserve=xattr,timestamps tmp/usr/share/dpkg/cputable rootfs/usr/share/dpkg/ cp --preserve=xattr,timestamps tmp/usr/share/dpkg/ostable rootfs/usr/share/dpkg/ - cp --preserve=xattr,timestamps tmp/usr/share/dpkg/triplettable rootfs/usr/share/dpkg/ + cp --preserve=xattr,timestamps tmp/usr/share/dpkg/tupletable rootfs/usr/share/dpkg/ cd rootfs/usr/sbin ln -s ../bin/dpkg-divert dpkg-divert ln -s ../bin/dpkg-statoverride dpkg-statoverride @@ -338,7 +338,7 @@ function create_cpio { # f2fs-tools components cp --preserve=xattr,timestamps tmp/sbin/mkfs.f2fs rootfs/sbin/ - cp --preserve=xattr,timestamps tmp/lib/*/libf2fs.so.0 rootfs/lib/ + cp --preserve=xattr,timestamps tmp/lib/*/libf2fs.so.1 rootfs/lib/ # gpgv components cp --preserve=xattr,timestamps tmp/usr/bin/gpgv rootfs/usr/bin/ @@ -471,7 +471,6 @@ function create_cpio { cp --preserve=xattr,timestamps tmp/etc/gai.conf rootfs/etc/ cp --preserve=xattr,timestamps tmp/etc/ld.so.conf rootfs/etc/ cp --preserve=xattr,timestamps tmp/sbin/ldconfig rootfs/sbin/ - cp --preserve=xattr,timestamps tmp/sbin/ldconfig.real rootfs/sbin/ cp --preserve=xattr,timestamps tmp/usr/bin/catchsegv rootfs/usr/bin/ cp --preserve=xattr,timestamps tmp/usr/bin/getconf rootfs/usr/bin/ cp --preserve=xattr,timestamps tmp/usr/bin/getent rootfs/usr/bin/ @@ -573,21 +572,21 @@ function create_cpio { # libsmartcols1 components cp --preserve=xattr,timestamps tmp/lib/*/libsmartcols.so.1.* rootfs/lib/libsmartcols.so.1 - # libssl1.0.0 components - cp --preserve=xattr,timestamps tmp/usr/lib/*/libcrypto.so.1.0.0 rootfs/usr/lib/ - cp --preserve=xattr,timestamps tmp/usr/lib/*/libssl.so.1.0.0 rootfs/usr/lib/ - cp --preserve=xattr,timestamps tmp/usr/lib/*/openssl-1.0.0/engines/lib4758cca.so rootfs/usr/lib/openssl-1.0.0/engines/ - cp --preserve=xattr,timestamps tmp/usr/lib/*/openssl-1.0.0/engines/libaep.so rootfs/usr/lib/openssl-1.0.0/engines/ - cp --preserve=xattr,timestamps tmp/usr/lib/*/openssl-1.0.0/engines/libatalla.so rootfs/usr/lib/openssl-1.0.0/engines/ - cp --preserve=xattr,timestamps tmp/usr/lib/*/openssl-1.0.0/engines/libcapi.so rootfs/usr/lib/openssl-1.0.0/engines/ - cp --preserve=xattr,timestamps tmp/usr/lib/*/openssl-1.0.0/engines/libchil.so rootfs/usr/lib/openssl-1.0.0/engines/ - cp --preserve=xattr,timestamps tmp/usr/lib/*/openssl-1.0.0/engines/libcswift.so rootfs/usr/lib/openssl-1.0.0/engines/ - cp --preserve=xattr,timestamps tmp/usr/lib/*/openssl-1.0.0/engines/libgmp.so rootfs/usr/lib/openssl-1.0.0/engines/ - cp --preserve=xattr,timestamps tmp/usr/lib/*/openssl-1.0.0/engines/libgost.so rootfs/usr/lib/openssl-1.0.0/engines/ - cp --preserve=xattr,timestamps tmp/usr/lib/*/openssl-1.0.0/engines/libnuron.so rootfs/usr/lib/openssl-1.0.0/engines/ - cp --preserve=xattr,timestamps tmp/usr/lib/*/openssl-1.0.0/engines/libpadlock.so rootfs/usr/lib/openssl-1.0.0/engines/ - cp --preserve=xattr,timestamps tmp/usr/lib/*/openssl-1.0.0/engines/libsureware.so rootfs/usr/lib/openssl-1.0.0/engines/ - cp --preserve=xattr,timestamps tmp/usr/lib/*/openssl-1.0.0/engines/libubsec.so rootfs/usr/lib/openssl-1.0.0/engines/ + # libssl1.0.2 components + cp --preserve=xattr,timestamps tmp/usr/lib/*/libcrypto.so.1.0.2 rootfs/usr/lib/ + cp --preserve=xattr,timestamps tmp/usr/lib/*/libssl.so.1.0.2 rootfs/usr/lib/ + cp --preserve=xattr,timestamps tmp/usr/lib/*/openssl-1.0.2/engines/lib4758cca.so rootfs/usr/lib/openssl-1.0.2/engines/ + cp --preserve=xattr,timestamps tmp/usr/lib/*/openssl-1.0.2/engines/libaep.so rootfs/usr/lib/openssl-1.0.2/engines/ + cp --preserve=xattr,timestamps tmp/usr/lib/*/openssl-1.0.2/engines/libatalla.so rootfs/usr/lib/openssl-1.0.2/engines/ + cp --preserve=xattr,timestamps tmp/usr/lib/*/openssl-1.0.2/engines/libcapi.so rootfs/usr/lib/openssl-1.0.2/engines/ + cp --preserve=xattr,timestamps tmp/usr/lib/*/openssl-1.0.2/engines/libchil.so rootfs/usr/lib/openssl-1.0.2/engines/ + cp --preserve=xattr,timestamps tmp/usr/lib/*/openssl-1.0.2/engines/libcswift.so rootfs/usr/lib/openssl-1.0.2/engines/ + cp --preserve=xattr,timestamps tmp/usr/lib/*/openssl-1.0.2/engines/libgmp.so rootfs/usr/lib/openssl-1.0.2/engines/ + cp --preserve=xattr,timestamps tmp/usr/lib/*/openssl-1.0.2/engines/libgost.so rootfs/usr/lib/openssl-1.0.2/engines/ + cp --preserve=xattr,timestamps tmp/usr/lib/*/openssl-1.0.2/engines/libnuron.so rootfs/usr/lib/openssl-1.0.2/engines/ + cp --preserve=xattr,timestamps tmp/usr/lib/*/openssl-1.0.2/engines/libpadlock.so rootfs/usr/lib/openssl-1.0.2/engines/ + cp --preserve=xattr,timestamps tmp/usr/lib/*/openssl-1.0.2/engines/libsureware.so rootfs/usr/lib/openssl-1.0.2/engines/ + cp --preserve=xattr,timestamps tmp/usr/lib/*/openssl-1.0.2/engines/libubsec.so rootfs/usr/lib/openssl-1.0.2/engines/ # libtinfo5 components cp --preserve=xattr,timestamps tmp/lib/*/libtinfo.so.5.* rootfs/lib/libtinfo.so.5 @@ -628,6 +627,40 @@ function create_cpio { (cd ../"${resources_dir}"/initramfs/ && find . -type d -exec echo rootfs/opt/raspberrypi-ua-netinst/res/{} \;) | xargs chmod +rx (cd ../"${resources_dir}"/initramfs/ && find . -type f -exec echo rootfs/opt/raspberrypi-ua-netinst/res/{} \;) | xargs chmod +r + # curl + cp --preserve=xattr,timestamps tmp/usr/bin/curl rootfs/usr/bin/ + cp --preserve=xattr,timestamps tmp/usr/lib/*/libcurl.so.4 rootfs/lib/arm-linux-gnueabihf/libcurl.so.4 + cp --preserve=xattr,timestamps tmp/usr/lib/*/libnghttp2.so.14 rootfs/lib/arm-linux-gnueabihf/libnghttp2.so.14 + cp --preserve=xattr,timestamps tmp/usr/lib/*/libidn2.so.0 rootfs/lib/arm-linux-gnueabihf/libidn2.so.0 + cp --preserve=xattr,timestamps tmp/usr/lib/*/librtmp.so.1 rootfs/lib/arm-linux-gnueabihf/librtmp.so.1 + cp --preserve=xattr,timestamps tmp/usr/lib/*/libssh2.so.1 rootfs/lib/arm-linux-gnueabihf/libssh2.so.1 + cp --preserve=xattr,timestamps tmp/usr/lib/*/libpsl.so.5 rootfs/lib/arm-linux-gnueabihf/libpsl.so.5 + cp --preserve=xattr,timestamps tmp/usr/lib/*/libgssapi_krb5.so.2 rootfs/lib/arm-linux-gnueabihf/libgssapi_krb5.so.2 + cp --preserve=xattr,timestamps tmp/usr/lib/*/libkrb5.so.3 rootfs/lib/arm-linux-gnueabihf/libkrb5.so.3 + cp --preserve=xattr,timestamps tmp/usr/lib/*/libk5crypto.so.3 rootfs/lib/arm-linux-gnueabihf/libk5crypto.so.3 + cp --preserve=xattr,timestamps tmp/usr/lib/*/liblber-2.4.so.2 rootfs/lib/arm-linux-gnueabihf/liblber-2.4.so.2 + cp --preserve=xattr,timestamps tmp/usr/lib/*/libldap_r-2.4.so.2 rootfs/lib/arm-linux-gnueabihf/libldap_r-2.4.so.2 + cp --preserve=xattr,timestamps tmp/usr/lib/*/libunistring.so.0 rootfs/lib/arm-linux-gnueabihf/libunistring.so.0 + cp --preserve=xattr,timestamps tmp/usr/lib/*/libgnutls.so.30 rootfs/lib/arm-linux-gnueabihf/libgnutls.so.30 + cp --preserve=xattr,timestamps tmp/usr/lib/*/libhogweed.so.4 rootfs/lib/arm-linux-gnueabihf/libhogweed.so.4 + cp --preserve=xattr,timestamps tmp/usr/lib/*/libnettle.so.6 rootfs/lib/arm-linux-gnueabihf/libnettle.so.6 + cp --preserve=xattr,timestamps tmp/usr/lib/*/libgmp.so.10 rootfs/lib/arm-linux-gnueabihf/libgmp.so.10 + cp --preserve=xattr,timestamps tmp/lib/*/libgcrypt.so.20 rootfs/lib/arm-linux-gnueabihf/libgcrypt.so.20 + cp --preserve=xattr,timestamps tmp/usr/lib/*/libkrb5support.so.0 rootfs/lib/arm-linux-gnueabihf/libkrb5support.so.0 + cp --preserve=xattr,timestamps tmp/lib/*/libkeyutils.so.1 rootfs/lib/arm-linux-gnueabihf/libkeyutils.so.1 + cp --preserve=xattr,timestamps tmp/usr/lib/*/libsasl2.so.2 rootfs/lib/arm-linux-gnueabihf/libsasl2.so.2 + cp --preserve=xattr,timestamps tmp/usr/lib/*/libp11-kit.so.0 rootfs/lib/arm-linux-gnueabihf/libp11-kit.so.0 + cp --preserve=xattr,timestamps tmp/lib/*/libidn.so.11 rootfs/lib/arm-linux-gnueabihf/libidn.so.11 + cp --preserve=xattr,timestamps tmp/usr/lib/*/libtasn1.so.6 rootfs/lib/arm-linux-gnueabihf/libtasn1.so.6 + cp --preserve=xattr,timestamps tmp/lib/*/libgpg-error.so.0 rootfs/lib/arm-linux-gnueabihf/libgpg-error.so.0 + cp --preserve=xattr,timestamps tmp/usr/lib/*/libffi.so.6 rootfs/lib/arm-linux-gnueabihf/libffi.so.6 + + # libudev + cp --preserve=xattr,timestamps tmp/lib/*/libudev.so.1 rootfs/lib/arm-linux-gnueabihf/libudev.so.1 + + # libfdisk + cp --preserve=xattr,timestamps tmp/lib/*/libfdisk.so.1 rootfs/lib/arm-linux-gnueabihf/libfdisk.so.1 + INITRAMFS="../raspberrypi-ua-netinst.cpio.gz" (cd rootfs && find . | cpio -H newc -ov | gzip --best > $INITRAMFS) diff --git a/update.sh b/update.sh index 863d910b..78e78a98 100755 --- a/update.sh +++ b/update.sh @@ -16,7 +16,7 @@ mirror_raspbian=http://mirrordirector.raspbian.org/raspbian mirror_raspberrypi=http://archive.raspberrypi.org/debian declare mirror_raspbian_cache declare mirror_raspberrypi_cache -release=jessie +release=stretch packages=() @@ -25,6 +25,7 @@ packages+=("raspberrypi-bootloader") packages+=("raspberrypi-kernel") packages+=("firmware-brcm80211") packages+=("btrfs-tools") +packages+=("btrfs-progs") packages+=("busybox") packages+=("bash-static") packages+=("cdebootstrap-static") @@ -48,6 +49,9 @@ packages+=("util-linux") packages+=("wpasupplicant") packages+=("libraspberrypi-bin") packages+=("vim-common") +packages+=("xxd") +packages+=("udev") +packages+=("curl") # libraries packages+=("libacl1") @@ -76,11 +80,38 @@ packages+=("libpcsclite1") packages+=("libselinux1") packages+=("libslang2") packages+=("libsmartcols1") -packages+=("libssl1.0.0") +packages+=("libssl1.0.2") packages+=("libtinfo5") packages+=("libuuid1") packages+=("zlib1g") packages+=("libraspberrypi0") +packages+=("libf2fs0") +packages+=("libfdisk1") +packages+=("libudev1") +packages+=("libcurl3") +packages+=("libnghttp2-14") +packages+=("libidn2-0") +packages+=("librtmp1") +packages+=("libssh2-1") +packages+=("libpsl5") +packages+=("libgssapi-krb5-2") +packages+=("libkrb5-3") +packages+=("libk5crypto3") +packages+=("libldap-2.4-2") +packages+=("libunistring0") +packages+=("libgnutls30") +packages+=("libhogweed4") +packages+=("libnettle6") +packages+=("libgmp10") +packages+=("libgcrypt20") +packages+=("libkrb5support0") +packages+=("libkeyutils1") +packages+=("libsasl2-2") +packages+=("libp11-kit0") +packages+=("libidn11") +packages+=("libtasn1-6") +packages+=("libgpg-error0") +packages+=("libffi6") packages_debs= packages_sha256= From 6ba24c2ff22255ea17622db5f8025c9b10a77a52 Mon Sep 17 00:00:00 2001 From: FooDeas Date: Sat, 30 Sep 2017 18:48:34 +0200 Subject: [PATCH 07/28] installer: update to stretch --- scripts/opt/raspberrypi-ua-netinst/install.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/opt/raspberrypi-ua-netinst/install.sh b/scripts/opt/raspberrypi-ua-netinst/install.sh index 55a7b43a..6eeb9149 100644 --- a/scripts/opt/raspberrypi-ua-netinst/install.sh +++ b/scripts/opt/raspberrypi-ua-netinst/install.sh @@ -121,7 +121,7 @@ variables_set_defaults() { # set config defaults variable_set "preset" "server" variable_set "mirror" "http://mirrordirector.raspbian.org/raspbian/" - variable_set "release" "jessie" + variable_set "release" "stretch" variable_set "hostname" "pi" variable_set "rootpw" "raspbian" variable_set "root_ssh_pwlogin" "1" @@ -972,7 +972,7 @@ fi # determine available releases mirror_base=http://archive.raspberrypi.org/debian/dists/ -release_fallback=jessie +release_fallback=stretch release_base="${release}" release_raspbian="${release}" if ! wget --spider "${mirror_base}/${release}/" &> /dev/null; then @@ -2190,6 +2190,7 @@ if [ "${final_action}" != "console" ]; then for sysfolder in /dev/pts /proc /sys; do umount "/rootfs${sysfolder}" done + sync umount /rootfs/boot umount /rootfs echo "OK" From 08eaf50a9832f8bae91a27f40986e4d15ba217c2 Mon Sep 17 00:00:00 2001 From: FooDeas Date: Sat, 30 Sep 2017 22:54:46 +0200 Subject: [PATCH 08/28] doc: update default release to stretch --- doc/INSTALL_CUSTOM.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/INSTALL_CUSTOM.md b/doc/INSTALL_CUSTOM.md index 10d246e8..7daf10d7 100644 --- a/doc/INSTALL_CUSTOM.md +++ b/doc/INSTALL_CUSTOM.md @@ -19,7 +19,7 @@ | `firmware_packages` | `0` | `0`/`1` | Set to "1" to install common firmware packages (Atheros, Broadcom, Libertas, Ralink and Realtek). | | `mirror` | `http:// mirrordirector.raspbian.org/ raspbian/` | | | | `mirror_cache` | | | Set address and port for HTTP apt-cacher or apt-cacher-ng (e.g. "192.168.0.1:3142"). If set, the cacher will be used to cache packages during installation downloaded from the repository set in `mirror` as well as "http://archive.raspberrypi.org/debian". | -| `release` | `jessie` | | Raspbian release name | +| `release` | `stretch` | | Raspbian release name | ### Description: Presets From cf9ed16202ed6217fc2836f61aa8280d86e8409c Mon Sep 17 00:00:00 2001 From: FooDeas Date: Sat, 30 Sep 2017 18:37:39 +0200 Subject: [PATCH 09/28] build: stretch fixes --- build.sh | 31 ++++++++++++++++++++++----- update.sh | 63 ++++++++++++++++++++++++++++--------------------------- 2 files changed, 58 insertions(+), 36 deletions(-) diff --git a/build.sh b/build.sh index 2b8b1f0b..d028809b 100755 --- a/build.sh +++ b/build.sh @@ -126,6 +126,7 @@ function create_cpio { mkdir -p rootfs/usr/bin/ mkdir -p rootfs/usr/lib/mime/packages/ mkdir -p rootfs/usr/lib/openssl-1.0.2/engines/ + mkdir -p rootfs/usr/lib/engines-1.1/ mkdir -p rootfs/usr/lib/{tar,tc} mkdir -p rootfs/usr/sbin/ mkdir -p rootfs/usr/share/{dpkg,keyrings,libc-bin} @@ -336,9 +337,11 @@ function create_cpio { ln -s mke2fs mkfs.ext4dev cd ../.. + # libf2fs0 components + cp --preserve=xattr,timestamps tmp/lib/*/libf2fs.so.1.* rootfs/lib/libf2fs.so.1 + # f2fs-tools components cp --preserve=xattr,timestamps tmp/sbin/mkfs.f2fs rootfs/sbin/ - cp --preserve=xattr,timestamps tmp/lib/*/libf2fs.so.1 rootfs/lib/ # gpgv components cp --preserve=xattr,timestamps tmp/usr/bin/gpgv rootfs/usr/bin/ @@ -526,10 +529,22 @@ function create_cpio { cp --preserve=xattr,timestamps tmp/lib/*/libdbus-1.so.3 rootfs/lib/libdbus-1.so.3 cp --preserve=xattr,timestamps tmp/lib/*/libdl.so.2 rootfs/lib/libdl.so.2 + # libfdisk1 components + cp --no-dereference --preserve=xattr,timestamps tmp/lib/*/libfdisk.so.1.* rootfs/lib/libfdisk.so.1 + # libgcc1 components cp --preserve=xattr,timestamps tmp/lib/*/libgcc_s.so.1 rootfs/lib/ cp --preserve=xattr,timestamps tmp/lib/*/librt.so.1 rootfs/lib/ + # libgcrypt20 components + cp --no-dereference --preserve=xattr,timestamps tmp/lib/*/libgcrypt.so.20.* rootfs/lib/libgcrypt.so.20 + + # libgpg-error0 components + cp --no-dereference --preserve=xattr,timestamps tmp/lib/*/libgpg-error.so.0.* rootfs/lib/libgpg-error.so.0 + + # liblz4-1 components + cp --no-dereference --preserve=xattr,timestamps tmp/usr/lib/*/liblz4.so.1.* rootfs/usr/lib/liblz4.so.1 + # liblzma5 components cp --preserve=xattr,timestamps tmp/lib/*/liblzma.so.5.* rootfs/lib/liblzma.so.5 @@ -588,6 +603,15 @@ function create_cpio { cp --preserve=xattr,timestamps tmp/usr/lib/*/openssl-1.0.2/engines/libsureware.so rootfs/usr/lib/openssl-1.0.2/engines/ cp --preserve=xattr,timestamps tmp/usr/lib/*/openssl-1.0.2/engines/libubsec.so rootfs/usr/lib/openssl-1.0.2/engines/ + # libssl1.1 components + cp --preserve=xattr,timestamps tmp/usr/lib/*/libcrypto.so.1.1 rootfs/usr/lib/ + cp --preserve=xattr,timestamps tmp/usr/lib/*/libssl.so.1.1 rootfs/usr/lib/ + cp --preserve=xattr,timestamps tmp/usr/lib/*/engines-1.1/capi.so rootfs/usr/lib/engines-1.1/ + cp --preserve=xattr,timestamps tmp/usr/lib/*/engines-1.1/padlock.so rootfs/usr/lib/engines-1.1/ + + # libsystemd0 components + cp --no-dereference --preserve=xattr,timestamps tmp/lib/*/libsystemd.so* rootfs/lib/ + # libtinfo5 components cp --preserve=xattr,timestamps tmp/lib/*/libtinfo.so.5.* rootfs/lib/libtinfo.so.5 cp --preserve=xattr,timestamps tmp/usr/lib/*/libtic.so.5.* rootfs/usr/lib/libtinfo.so.5 @@ -611,7 +635,7 @@ function create_cpio { ln -s /opt/vc/bin/vcgencmd rootfs/usr/bin/vcgencmd cp --preserve=xattr,timestamps tmp/usr/share/doc/libraspberrypi-bin/LICENCE rootfs/opt/vc/ ## libraspberrypi0 - mkdir -p rootfs/etc + mkdir -p rootfs/etc/ld.so.conf.d cp --preserve=xattr,timestamps tmp/etc/ld.so.conf.d/00-vmcs.conf rootfs/etc/ld.so.conf.d/ mkdir -p rootfs/opt/vc/lib cp --preserve=xattr,timestamps tmp/opt/vc/lib/libvcos.so rootfs/opt/vc/lib/ @@ -658,9 +682,6 @@ function create_cpio { # libudev cp --preserve=xattr,timestamps tmp/lib/*/libudev.so.1 rootfs/lib/arm-linux-gnueabihf/libudev.so.1 - # libfdisk - cp --preserve=xattr,timestamps tmp/lib/*/libfdisk.so.1 rootfs/lib/arm-linux-gnueabihf/libfdisk.so.1 - INITRAMFS="../raspberrypi-ua-netinst.cpio.gz" (cd rootfs && find . | cpio -H newc -ov | gzip --best > $INITRAMFS) diff --git a/update.sh b/update.sh index 78e78a98..79ae5af8 100755 --- a/update.sh +++ b/update.sh @@ -24,7 +24,6 @@ packages=() packages+=("raspberrypi-bootloader") packages+=("raspberrypi-kernel") packages+=("firmware-brcm80211") -packages+=("btrfs-tools") packages+=("btrfs-progs") packages+=("busybox") packages+=("bash-static") @@ -48,9 +47,7 @@ packages+=("tar") packages+=("util-linux") packages+=("wpasupplicant") packages+=("libraspberrypi-bin") -packages+=("vim-common") packages+=("xxd") -packages+=("udev") packages+=("curl") # libraries @@ -65,53 +62,57 @@ packages+=("libc-bin") packages+=("libc6") packages+=("libcap2") packages+=("libcomerr2") +packages+=("libcurl3") packages+=("libdb5.3") packages+=("libdbus-1-3") +packages+=("libf2fs0") +packages+=("libfdisk1") +packages+=("libffi6") packages+=("libgcc1") +packages+=("libgcrypt20") +packages+=("libgmp10") +packages+=("libgnutls30") +packages+=("libgpg-error0") +packages+=("libgssapi-krb5-2") +packages+=("libhogweed4") +packages+=("libidn11") +packages+=("libidn2-0") +packages+=("libk5crypto3") +packages+=("libkeyutils1") +packages+=("libkrb5-3") +packages+=("libkrb5support0") +packages+=("libldap-2.4-2") +packages+=("liblz4-1") packages+=("liblzma5") packages+=("liblzo2-2") packages+=("libmount1") packages+=("libncurses5") +packages+=("libnettle6") +packages+=("libnghttp2-14") packages+=("libnl-3-200") packages+=("libnl-genl-3-200") packages+=("libpam0g") packages+=("libpcre3") packages+=("libpcsclite1") +packages+=("libp11-kit0") +packages+=("libpsl5") +packages+=("libraspberrypi0") +packages+=("librtmp1") +packages+=("libsasl2-2") packages+=("libselinux1") packages+=("libslang2") packages+=("libsmartcols1") +packages+=("libssh2-1") +packages+=("libssl1.1") packages+=("libssl1.0.2") +packages+=("libsystemd0") +packages+=("libtasn1-6") +packages+=("libudev1") packages+=("libtinfo5") +packages+=("libunistring0") packages+=("libuuid1") packages+=("zlib1g") -packages+=("libraspberrypi0") -packages+=("libf2fs0") -packages+=("libfdisk1") -packages+=("libudev1") -packages+=("libcurl3") -packages+=("libnghttp2-14") -packages+=("libidn2-0") -packages+=("librtmp1") -packages+=("libssh2-1") -packages+=("libpsl5") -packages+=("libgssapi-krb5-2") -packages+=("libkrb5-3") -packages+=("libk5crypto3") -packages+=("libldap-2.4-2") -packages+=("libunistring0") -packages+=("libgnutls30") -packages+=("libhogweed4") -packages+=("libnettle6") -packages+=("libgmp10") -packages+=("libgcrypt20") -packages+=("libkrb5support0") -packages+=("libkeyutils1") -packages+=("libsasl2-2") -packages+=("libp11-kit0") -packages+=("libidn11") -packages+=("libtasn1-6") -packages+=("libgpg-error0") -packages+=("libffi6") + packages_debs= packages_sha256= From 7275f19f6d1d24c9403fa0a08e14670871efbff0 Mon Sep 17 00:00:00 2001 From: FooDeas Date: Sat, 30 Sep 2017 22:52:06 +0200 Subject: [PATCH 10/28] installer: fix stretch init system, timezone --- doc/INSTALL_CUSTOM.md | 2 +- scripts/opt/raspberrypi-ua-netinst/install.sh | 28 ++++++++++++++----- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/doc/INSTALL_CUSTOM.md b/doc/INSTALL_CUSTOM.md index 7daf10d7..38778063 100644 --- a/doc/INSTALL_CUSTOM.md +++ b/doc/INSTALL_CUSTOM.md @@ -27,7 +27,7 @@ |---------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `base` | _\,apt,cpufrequtils,kmod,raspbian-archive-keyring_ | | `minimal` | _\,fake-hwclock,ifupdown,net-tools,ntp,openssh-server,dosfstools,raspberrypi-sys-mods_ | -| `server` | _\,vim-tiny,iputils-ping,wget,ca-certificates,rsyslog,cron,dialog,locales,less,man-db,logrotate,bash-completion,console-setup,apt-utils,libraspberrypi-bin,raspi-copies-and-fills_ | +| `server` | _\,vim-tiny,iputils-ping,wget,ca-certificates,rsyslog,cron,dialog,locales,tzdata,less,man-db,logrotate,bash-completion,console-setup,apt-utils,libraspberrypi-bin,raspi-copies-and-fills_ | ## Device / peripheral diff --git a/scripts/opt/raspberrypi-ua-netinst/install.sh b/scripts/opt/raspberrypi-ua-netinst/install.sh index 6eeb9149..ea0ceeb4 100644 --- a/scripts/opt/raspberrypi-ua-netinst/install.sh +++ b/scripts/opt/raspberrypi-ua-netinst/install.sh @@ -1050,9 +1050,12 @@ if [ -z "${cdebootstrap_cmdline}" ]; then fi # server - server_packages="vim-tiny,iputils-ping,wget,ca-certificates,rsyslog,cron,dialog,locales,less,man-db,logrotate,bash-completion,console-setup,apt-utils" + server_packages="vim-tiny,iputils-ping,wget,ca-certificates,rsyslog,cron,dialog,locales,tzdata,less,man-db,logrotate,bash-completion,console-setup,apt-utils" server_packages_postinstall="libraspberrypi-bin,raspi-copies-and-fills" server_packages_postinstall="${minimal_packages_postinstall},${server_packages_postinstall}" + if [ "${init_system}" = "systemd" ]; then + server_packages="${server_packages},systemd-sysv" + fi # cleanup package variables used by cdebootstrap_cmdline variable_sanitize base_packages @@ -1420,6 +1423,11 @@ echo "Configuring installed system:" for sysfolder in /dev /dev/pts /proc /sys; do mount --bind "${sysfolder}" "/rootfs${sysfolder}" done +# set init system +if [ "${init_system}" = "systemd" ]; then + ln -s /lib/systemd/systemd /rootfs/sbin/init +fi + # configure root login if [ -n "${rootpw}" ]; then echo -n " Setting root password... " @@ -1643,12 +1651,18 @@ fi echo "OK" # set timezone and reconfigure tzdata package -echo -n " Configuring tzdata, setting timezone to ${timezone}... " -echo "${timezone}" > /rootfs/etc/timezone -if chroot /rootfs /usr/sbin/dpkg-reconfigure -f noninteractive tzdata &> /dev/null; then - echo "OK" -else - echo "FAILED !" +if [ -n "${timezone}" ]; then + echo -n " Configuring tzdata (timezone \"${timezone}\")... " + if [ -e "/rootfs/usr/share/zoneinfo/${timezone}" ]; then + ln -sf "/usr/share/zoneinfo/${timezone}" /rootfs/etc/localtime + if chroot /rootfs /usr/sbin/dpkg-reconfigure -f noninteractive tzdata &> /dev/null; then + echo "OK" + else + echo "FAILED !" + fi + else + echo "INVALID !" + fi fi # generate locale data From a9ef7d7fef62bba02707e92d8b8cfd69114af98a Mon Sep 17 00:00:00 2001 From: FooDeas Date: Sat, 30 Sep 2017 23:22:58 +0200 Subject: [PATCH 11/28] installer: code improvement --- scripts/opt/raspberrypi-ua-netinst/install.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/opt/raspberrypi-ua-netinst/install.sh b/scripts/opt/raspberrypi-ua-netinst/install.sh index 55a7b43a..9fdf3ff8 100644 --- a/scripts/opt/raspberrypi-ua-netinst/install.sh +++ b/scripts/opt/raspberrypi-ua-netinst/install.sh @@ -165,12 +165,15 @@ variables_set_defaults() { led_sos() { local led0=/sys/class/leds/led0 # Power LED local led1=/sys/class/leds/led1 # Activity LED - local led_on=1 - local led_off=0 + local led_on + local led_off # Setting leds on and off works the other way round on Pi Zero and Pi Zero W # Also led0 (the only led on the Zeros) is the activity led - if [ "${rpi_hardware_version:0:4}" = "Zero" ]; then + if [ "${rpi_hardware_version:0:4}" != "Zero" ]; then + led_on=1 + led_off=0 + else led_on=0 led_off=1 fi From 19430c7232e5b95bee73a77f419514712f4d7d78 Mon Sep 17 00:00:00 2001 From: FooDeas Date: Sun, 1 Oct 2017 12:55:22 +0200 Subject: [PATCH 12/28] doc: add changelog for v2.0.0 --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d4391af..743ddd8a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## raspberrypi-ua-netinst v2.0.0 + +- support for Debian 9 (stretch) - used by default +- support boot or/and install from USB mass storage + +**Bugfixes:** + +- visual LED notification on Raspberry Pi Zero (W) + ## raspberrypi-ua-netinst v1.5.2 - support for Raspberry Pi Zero W From eeb9a032ed2c616b1e7df612045b554d9ae4f4bd Mon Sep 17 00:00:00 2001 From: FooDeas Date: Wed, 4 Oct 2017 23:54:36 +0200 Subject: [PATCH 13/28] doc: update changelog --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 743ddd8a..9f49cad9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,10 @@ ## raspberrypi-ua-netinst v2.0.0 -- support for Debian 9 (stretch) - used by default +- support for Debian 9 (stretch) - support boot or/and install from USB mass storage +- added or changed configuration variables + - `release` is set to "stretch" by default **Bugfixes:** From 76681d97b3d069be1673dcf87cb256b55dd34e05 Mon Sep 17 00:00:00 2001 From: dinosore Date: Fri, 6 Oct 2017 22:37:55 +0100 Subject: [PATCH 14/28] installer: don't override consoleblank=0 on cmdline.txt (#93) Install can take over an hour when using slow sd cards. Leave screen on if so set on cmdline.txt. --- scripts/opt/raspberrypi-ua-netinst/install.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/opt/raspberrypi-ua-netinst/install.sh b/scripts/opt/raspberrypi-ua-netinst/install.sh index 9fdf3ff8..8b857e2a 100644 --- a/scripts/opt/raspberrypi-ua-netinst/install.sh +++ b/scripts/opt/raspberrypi-ua-netinst/install.sh @@ -455,10 +455,6 @@ rootdev=/dev/mmcblk0 wlan_configfile=/bootfs/raspberrypi-ua-netinst/config/wpa_supplicant.conf final_action=reboot -# set screen blank period to an hour -# hopefully the install should be done by then -echo -en '\033[9;60]' - mkdir -p /proc mkdir -p /sys mkdir -p /boot @@ -491,6 +487,12 @@ mdev -s klogd -c 1 sleep 3s +# set screen blank period to an hour unless consoleblank=0 on cmdline +# hopefully the install should be done by then +if grep -qv "consoleblank=0" /proc/cmdline; then + echo -en '\033[9;60]' +fi + # Config serial output device echo echo -n "Waiting for serial device... " From a4425b981deebdd7909c76d67f01c56bd385f68d Mon Sep 17 00:00:00 2001 From: dinosore Date: Fri, 6 Oct 2017 22:40:39 +0100 Subject: [PATCH 15/28] installer: SOS flash a bit quicker (#94) --- scripts/opt/raspberrypi-ua-netinst/install.sh | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/scripts/opt/raspberrypi-ua-netinst/install.sh b/scripts/opt/raspberrypi-ua-netinst/install.sh index 8b857e2a..88cc79fb 100644 --- a/scripts/opt/raspberrypi-ua-netinst/install.sh +++ b/scripts/opt/raspberrypi-ua-netinst/install.sh @@ -178,35 +178,35 @@ led_sos() { led_off=1 fi - if [ -e /sys/class/leds/led0 ]; then (echo none > /sys/class/leds/led0/trigger) &> /dev/null; else led0=; fi - if [ -e /sys/class/leds/led1 ]; then (echo none > /sys/class/leds/led1/trigger) &> /dev/null; else led1=; fi + if [ -e /sys/class/leds/led0 ]; then (echo none > /sys/class/leds/led0/trigger || true) &> /dev/null; else led0=; fi + if [ -e /sys/class/leds/led1 ]; then (echo none > /sys/class/leds/led1/trigger || true) &> /dev/null; else led1=; fi for i in $(seq 1 3); do - if [ -n "$led0" ]; then (echo ${led_on} > "${led0}"/brightness) &> /dev/null; fi - if [ -n "$led1" ]; then (echo ${led_on} > "${led1}"/brightness) &> /dev/null; fi - sleep 0.3s; - if [ -n "$led0" ]; then (echo ${led_off} > "${led0}"/brightness) &> /dev/null; fi - if [ -n "$led1" ]; then (echo ${led_off} > "${led1}"/brightness) &> /dev/null; fi - sleep 0.2s; + if [ -n "$led0" ]; then (echo ${led_on} > "${led0}"/brightness || true) &> /dev/null; fi + if [ -n "$led1" ]; then (echo ${led_on} > "${led1}"/brightness || true) &> /dev/null; fi + sleep 0.225s; + if [ -n "$led0" ]; then (echo ${led_off} > "${led0}"/brightness || true) &> /dev/null; fi + if [ -n "$led1" ]; then (echo ${led_off} > "${led1}"/brightness || true) &> /dev/null; fi + sleep 0.15s; done - sleep 0.1s; + sleep 0.075s; for i in $(seq 1 3); do - if [ -n "$led0" ]; then (echo ${led_on} > "${led0}"/brightness) &> /dev/null; fi - if [ -n "$led1" ]; then (echo ${led_on} > "${led1}"/brightness) &> /dev/null; fi - sleep 0.8s; - if [ -n "$led0" ]; then (echo ${led_off} > "${led0}"/brightness) &> /dev/null; fi - if [ -n "$led1" ]; then (echo ${led_off} > "${led1}"/brightness) &> /dev/null; fi - sleep 0.2s; + if [ -n "$led0" ]; then (echo ${led_on} > "${led0}"/brightness || true) &> /dev/null; fi + if [ -n "$led1" ]; then (echo ${led_on} > "${led1}"/brightness || true) &> /dev/null; fi + sleep 0.6s; + if [ -n "$led0" ]; then (echo ${led_off} > "${led0}"/brightness || true) &> /dev/null; fi + if [ -n "$led1" ]; then (echo ${led_off} > "${led1}"/brightness || true) &> /dev/null; fi + sleep 0.15s; done - sleep 0.1s; + sleep 0.075s; for i in $(seq 1 3); do - if [ -n "$led0" ]; then (echo ${led_on} > "${led0}"/brightness) &> /dev/null; fi - if [ -n "$led1" ]; then (echo ${led_on} > "${led1}"/brightness) &> /dev/null; fi - sleep 0.3s; - if [ -n "$led0" ]; then (echo ${led_off} > "${led0}"/brightness) &> /dev/null; fi - if [ -n "$led1" ]; then (echo ${led_off} > "${led1}"/brightness) &> /dev/null; fi - sleep 0.2s; + if [ -n "$led0" ]; then (echo ${led_on} > "${led0}"/brightness || true) &> /dev/null; fi + if [ -n "$led1" ]; then (echo ${led_on} > "${led1}"/brightness || true) &> /dev/null; fi + sleep 0.225s; + if [ -n "$led0" ]; then (echo ${led_off} > "${led0}"/brightness || true) &> /dev/null; fi + if [ -n "$led1" ]; then (echo ${led_off} > "${led1}"/brightness || true) &> /dev/null; fi + sleep 0.15s; done - sleep 1.5s; + sleep 1.225s; } inputfile_sanitize() { From 09a38c368a47855542bbe1ebb59eb388d86ffd60 Mon Sep 17 00:00:00 2001 From: dinosore Date: Sun, 8 Oct 2017 12:50:47 +0100 Subject: [PATCH 16/28] installer: fix output chopping --- scripts/opt/raspberrypi-ua-netinst/install.sh | 24 +++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/scripts/opt/raspberrypi-ua-netinst/install.sh b/scripts/opt/raspberrypi-ua-netinst/install.sh index 88cc79fb..e02e7c1b 100644 --- a/scripts/opt/raspberrypi-ua-netinst/install.sh +++ b/scripts/opt/raspberrypi-ua-netinst/install.sh @@ -361,13 +361,27 @@ output_filter() { filterstring+="|^debconf: delaying package configuration, since apt-utils is not installed$" filterstring+="|^\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*$" filterstring+="|^All rc\.d operations denied by policy$" - filterstring+="|^E: Can not write log \(Is \/dev\/pts mounted\?\) - posix_openpt \(2: No such file or directory\)$" + filterstring+="|^[:space:]*E[:space:]*$" + filterstring+="|^[:space:]*:[:space:]*$" + filterstring+="|Can not write log \(Is \/dev\/pts mounted\?\) - posix_openpt \(19: No such device\)$" + filterstring+="|Can not write log \(Is \/dev\/pts mounted\?\) - posix_openpt \(2: No such file or directory\)$" filterstring+="|^update-rc\.d: warning: start and stop actions are no longer supported; falling back to defaults$" filterstring+="|^invoke-rc\.d: policy-rc\.d denied execution of start\.$" filterstring+="|^Failed to set capabilities on file \`\S.*' \(Invalid argument\)$" filterstring+="|^The value of the capability argument is not permitted for a file\. Or the file is not a regular \(non-symlink\) file$" filterstring+="|^Failed to read \S.*\. Ignoring: No such file or directory$" - grep -Ev "${filterstring}" + filterstring+="|\(Reading database \.\.\. $" + filterstring+="|\(Reading database \.\.\. [0..9]{1,3}\%" + filterstring+="|^E$" + filterstring+="|^: $" + + while IFS= read -r line ; do + if [[ "$line" =~ "${filterstring}" ]] ; then + : + else + echo " $line" + fi + done } line_add() { @@ -1410,7 +1424,7 @@ echo "Starting install process..." if [ -n "${mirror_cache}" ]; then export http_proxy="http://${mirror_cache}/" fi -eval cdebootstrap-static --arch=armhf "${cdebootstrap_cmdline}" "${release_raspbian}" /rootfs "${mirror}" --keyring=/usr/share/keyrings/raspbian-archive-keyring.gpg 2>&1 | output_filter | sed 's/^/ /' +eval cdebootstrap-static --arch=armhf "${cdebootstrap_cmdline}" "${release_raspbian}" /rootfs "${mirror}" --keyring=/usr/share/keyrings/raspbian-archive-keyring.gpg 2>&1 | output_filter cdebootstrap_exitcode="${PIPESTATUS[0]}" unset http_proxy if [ "${cdebootstrap_exitcode}" -ne 0 ]; then @@ -1886,7 +1900,7 @@ if [ "${kernel_module}" = true ]; then echo echo "Downloading packages..." for i in $(seq 1 3); do - eval chroot /rootfs /usr/bin/apt-get -o Acquire::http::Proxy=http://"${mirror_cache}" -y -d install "${packages_postinstall}" 2>&1 | output_filter | sed 's/^/ /' + eval chroot /rootfs /usr/bin/apt-get -o Acquire::http::Proxy=http://"${mirror_cache}" -y -d install "${packages_postinstall}" 2>&1 | output_filter download_exitcode="${PIPESTATUS[0]}" if [ "${download_exitcode}" -eq 0 ]; then echo "OK" @@ -1903,7 +1917,7 @@ if [ "${kernel_module}" = true ]; then echo echo "Installing kernel, bootloader (=firmware) and user packages..." - eval chroot /rootfs /usr/bin/apt-get -o Acquire::http::Proxy=http://"${mirror_cache}" -y install "${packages_postinstall}" 2>&1 | output_filter | sed 's/^/ /' + eval chroot /rootfs /usr/bin/apt-get -o Acquire::http::Proxy=http://"${mirror_cache}" -y install "${packages_postinstall}" 2>&1 | output_filter if [ "${PIPESTATUS[0]}" -eq 0 ]; then echo "OK" else From 7dfca88b4836695d0576fc3187b07f50a30f9e14 Mon Sep 17 00:00:00 2001 From: FooDeas Date: Sun, 8 Oct 2017 14:02:59 +0200 Subject: [PATCH 17/28] installer: add init system check --- scripts/opt/raspberrypi-ua-netinst/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/opt/raspberrypi-ua-netinst/install.sh b/scripts/opt/raspberrypi-ua-netinst/install.sh index a6c85cf5..ce40ecd8 100644 --- a/scripts/opt/raspberrypi-ua-netinst/install.sh +++ b/scripts/opt/raspberrypi-ua-netinst/install.sh @@ -1443,7 +1443,7 @@ for sysfolder in /dev /dev/pts /proc /sys; do mount --bind "${sysfolder}" "/rootfs${sysfolder}" done # set init system -if [ "${init_system}" = "systemd" ]; then +if [ "${init_system}" = "systemd" ] && [ ! -e /rootfs/sbin/init ]; then ln -s /lib/systemd/systemd /rootfs/sbin/init fi From e9aa6356d3eb866c024b7ef8d89f2c5af54e44f5 Mon Sep 17 00:00:00 2001 From: FooDeas Date: Thu, 5 Oct 2017 00:15:01 +0200 Subject: [PATCH 18/28] installer: add disable IPv6 --- CHANGELOG.md | 1 + doc/INSTALL_CUSTOM.md | 1 + scripts/opt/raspberrypi-ua-netinst/install.sh | 9 +++++++++ 3 files changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f49cad9..73cd6a69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - support boot or/and install from USB mass storage - added or changed configuration variables - `release` is set to "stretch" by default + - disable IPv6 **Bugfixes:** diff --git a/doc/INSTALL_CUSTOM.md b/doc/INSTALL_CUSTOM.md index 38778063..5d482804 100644 --- a/doc/INSTALL_CUSTOM.md +++ b/doc/INSTALL_CUSTOM.md @@ -82,6 +82,7 @@ | `ip_broadcast` | `0.0.0.0` | | Broadcast address | | `ip_gateway` | `0.0.0.0` | | Gateway address (e.g. 192.168.2.1) | | `ip_nameservers` | | | DNS nameservers (e.g. 8.8.8.8) | +| `ip_ipv6` | `1` | `0`/`1` | Set to "0" to disable IPv6. | ## Localization diff --git a/scripts/opt/raspberrypi-ua-netinst/install.sh b/scripts/opt/raspberrypi-ua-netinst/install.sh index ce40ecd8..3d2f756f 100644 --- a/scripts/opt/raspberrypi-ua-netinst/install.sh +++ b/scripts/opt/raspberrypi-ua-netinst/install.sh @@ -62,6 +62,7 @@ variables_reset() { ip_broadcast= ip_gateway= ip_nameservers= + ip_ipv6= drivers_to_load= online_config= gpu_mem= @@ -137,6 +138,7 @@ variables_set_defaults() { variable_set "ip_netmask" "0.0.0.0" variable_set "ip_broadcast" "0.0.0.0" variable_set "ip_gateway" "0.0.0.0" + variable_set "ip_ipv6" "1" variable_set "hdmi_tv_res" "1080p" variable_set "hdmi_monitor_res" "1024x768" variable_set "hdmi_disable_overscan" "0" @@ -1202,6 +1204,7 @@ echo " keyboard_layout = ${keyboard_layout}" echo " locales = ${locales}" echo " system_default_locale = ${system_default_locale}" echo " wlan_country = ${wlan_country}" +echo " ip_ipv6 = ${ip_ipv6}" echo " cmdline = ${cmdline}" echo " drivers_to_load = ${drivers_to_load}" echo " gpu_mem = ${gpu_mem}" @@ -1614,6 +1617,12 @@ echo "OK" # networking echo -n " Configuring network settings... " + +if [ "${ip_ipv6}" = "0" ]; then + mkdir -p /rootfs/etc/sysctl.d + echo "net.ipv6.conf.all.disable_ipv6 = 1" > /rootfs/etc/sysctl.d/01-disable-ipv6.conf +fi + touch /rootfs/etc/network/interfaces || fail # lo interface may already be there, so first check for it if ! grep -q "auto lo" /rootfs/etc/network/interfaces; then From 301a46697eee7e512c790314acd18c32f56ed93f Mon Sep 17 00:00:00 2001 From: FooDeas Date: Sun, 8 Oct 2017 14:38:55 +0200 Subject: [PATCH 19/28] doc: update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 73cd6a69..28dae94d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ **Bugfixes:** - visual LED notification on Raspberry Pi Zero (W) +- fix log output chopping +- leave screen always on during installation ## raspberrypi-ua-netinst v1.5.2 From e015ab5855982b66768b5bb4dba6e8f0c3d7e2a7 Mon Sep 17 00:00:00 2001 From: Thijs Triemstra Date: Tue, 10 Oct 2017 04:45:27 +0200 Subject: [PATCH 20/28] doc: update changelog --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 28dae94d..e7e4a72a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,9 @@ - support for Debian 9 (stretch) - support boot or/and install from USB mass storage -- added or changed configuration variables +- added or changed configuration variables: - `release` is set to "stretch" by default - - disable IPv6 + - ability to disable IPv6 **Bugfixes:** From 3150de45deeb91a0a3c4c982c8288b96059f449f Mon Sep 17 00:00:00 2001 From: Bengt <32734566+bengtfredh@users.noreply.github.com> Date: Fri, 13 Oct 2017 13:37:32 +0200 Subject: [PATCH 21/28] installer: support root_ssh_pwlogin=1 in stretch --- scripts/opt/raspberrypi-ua-netinst/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/opt/raspberrypi-ua-netinst/install.sh b/scripts/opt/raspberrypi-ua-netinst/install.sh index 3d2f756f..8a1593c6 100644 --- a/scripts/opt/raspberrypi-ua-netinst/install.sh +++ b/scripts/opt/raspberrypi-ua-netinst/install.sh @@ -1481,7 +1481,7 @@ if [ "${root_ssh_pwlogin}" = "1" ]; then if [ "${release_raspbian}" != "wheezy" ]; then if [ -f /rootfs/etc/ssh/sshd_config ]; then echo -n " Allowing root to login with password... " - sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /rootfs/etc/ssh/sshd_config || fail + sed -i '/PermitRootLogin/s/.*/PermitRootLogin yes/' /rootfs/etc/ssh/sshd_config || fail echo "OK" fi fi From d138ea7f761eb1b4dd522a6835685b971a521ef5 Mon Sep 17 00:00:00 2001 From: FooDeas Date: Sun, 15 Oct 2017 16:26:18 +0200 Subject: [PATCH 22/28] installer: fix regex with quotes --- scripts/opt/raspberrypi-ua-netinst/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/opt/raspberrypi-ua-netinst/install.sh b/scripts/opt/raspberrypi-ua-netinst/install.sh index 8a1593c6..4cd67db8 100644 --- a/scripts/opt/raspberrypi-ua-netinst/install.sh +++ b/scripts/opt/raspberrypi-ua-netinst/install.sh @@ -378,7 +378,7 @@ output_filter() { filterstring+="|^: $" while IFS= read -r line ; do - if [[ "$line" =~ "${filterstring}" ]] ; then + if [[ "$line" =~ ${filterstring} ]] ; then : else echo " $line" From 56347dd2be5cc5cf271d1256d18bae7e681b4d0e Mon Sep 17 00:00:00 2001 From: FooDeas Date: Sun, 15 Oct 2017 16:29:32 +0200 Subject: [PATCH 23/28] installer: increase package download retries before fail to 5 (#83) --- scripts/opt/raspberrypi-ua-netinst/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/opt/raspberrypi-ua-netinst/install.sh b/scripts/opt/raspberrypi-ua-netinst/install.sh index 4cd67db8..64d3db1e 100644 --- a/scripts/opt/raspberrypi-ua-netinst/install.sh +++ b/scripts/opt/raspberrypi-ua-netinst/install.sh @@ -1922,7 +1922,7 @@ if [ "${kernel_module}" = true ]; then echo echo "Downloading packages..." - for i in $(seq 1 3); do + for i in $(seq 1 5); do eval chroot /rootfs /usr/bin/apt-get -o Acquire::http::Proxy=http://"${mirror_cache}" -y -d install "${packages_postinstall}" 2>&1 | output_filter download_exitcode="${PIPESTATUS[0]}" if [ "${download_exitcode}" -eq 0 ]; then From 098462dc4250e1d7ad386d03650e6ddb92de047e Mon Sep 17 00:00:00 2001 From: FooDeas Date: Sun, 15 Oct 2017 16:33:31 +0200 Subject: [PATCH 24/28] installer: increase network interface configuration timeout to 15 seconds --- scripts/opt/raspberrypi-ua-netinst/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/opt/raspberrypi-ua-netinst/install.sh b/scripts/opt/raspberrypi-ua-netinst/install.sh index 64d3db1e..996d0b87 100644 --- a/scripts/opt/raspberrypi-ua-netinst/install.sh +++ b/scripts/opt/raspberrypi-ua-netinst/install.sh @@ -813,7 +813,7 @@ if [ -n "${drivers_to_load}" ]; then fi echo -n "Waiting for ${ifname}... " -for i in $(seq 1 10); do +for i in $(seq 1 15); do if ifconfig "${ifname}" &>/dev/null; then break fi From 90f1b83d44dbcba460f57addee458b74a408a83d Mon Sep 17 00:00:00 2001 From: FooDeas Date: Sun, 15 Oct 2017 16:57:19 +0200 Subject: [PATCH 25/28] installer: improve apt-key log output --- scripts/opt/raspberrypi-ua-netinst/install.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/opt/raspberrypi-ua-netinst/install.sh b/scripts/opt/raspberrypi-ua-netinst/install.sh index 996d0b87..9d99495d 100644 --- a/scripts/opt/raspberrypi-ua-netinst/install.sh +++ b/scripts/opt/raspberrypi-ua-netinst/install.sh @@ -1865,8 +1865,11 @@ done for keyfile in ./*.key do if [ -e "${keyfile}" ]; then - echo -n " Adding key '${keyfile}' to apt." - (chroot /rootfs /usr/bin/apt-key add -) < "${keyfile}" || fail + echo " Adding key '${keyfile}' to apt..." + (chroot /rootfs /usr/bin/apt-key add - 2>&1) < "${keyfile}" | sed 's/^/ /' + if [ "${PIPESTATUS[0]}" -ne 0 ]; then + fail + fi echo "OK" fi done @@ -1986,8 +1989,8 @@ fi # enable spi if specified in the configuration file if [ "${spi_enable}" = "1" ]; then - sed -i "s/^#\(dtparam=spi=on\)/\1/" /rootfs/boot/config.txt if [ "$(grep -c "^dtparam=spi=.*" /rootfs/boot/config.txt)" -ne 1 ]; then + sed -i "s/^#\(dtparam=spi=on\)/\1/" /rootfs/boot/config.txt sed -i "s/^\(dtparam=spi=.*\)/#\1/" /rootfs/boot/config.txt echo "dtparam=spi=on" >> /rootfs/boot/config.txt fi From d244f5a5c41d051d398db1244c0a02f7c7190728 Mon Sep 17 00:00:00 2001 From: FooDeas Date: Sun, 15 Oct 2017 17:15:33 +0200 Subject: [PATCH 26/28] installer: add debootstrap retries (#83) --- scripts/opt/raspberrypi-ua-netinst/install.sh | 35 ++++++++++++------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/scripts/opt/raspberrypi-ua-netinst/install.sh b/scripts/opt/raspberrypi-ua-netinst/install.sh index 9d99495d..0258cf85 100644 --- a/scripts/opt/raspberrypi-ua-netinst/install.sh +++ b/scripts/opt/raspberrypi-ua-netinst/install.sh @@ -1427,17 +1427,26 @@ fi echo echo "Starting install process..." -if [ -n "${mirror_cache}" ]; then - export http_proxy="http://${mirror_cache}/" -fi -eval cdebootstrap-static --arch=armhf "${cdebootstrap_cmdline}" "${release_raspbian}" /rootfs "${mirror}" --keyring=/usr/share/keyrings/raspbian-archive-keyring.gpg 2>&1 | output_filter -cdebootstrap_exitcode="${PIPESTATUS[0]}" -unset http_proxy -if [ "${cdebootstrap_exitcode}" -ne 0 ]; then - echo - echo " ERROR: ${cdebootstrap_exitcode}" - fail -fi +for i in $(seq 1 3); do + if [ -n "${mirror_cache}" ]; then + export http_proxy="http://${mirror_cache}/" + fi + eval cdebootstrap-static --arch=armhf "${cdebootstrap_cmdline}" "${release_raspbian}" /rootfs "${mirror}" --keyring=/usr/share/keyrings/raspbian-archive-keyring.gpg 2>&1 | output_filter + cdebootstrap_exitcode="${PIPESTATUS[0]}" + if [ "${cdebootstrap_exitcode}" -eq 0 ]; then + unset http_proxy + break + else + unset http_proxy + if [ "${i}" -eq 3 ]; then + echo + echo " ERROR: ${cdebootstrap_exitcode}" + fail + else + echo " ERROR: ${cdebootstrap_exitcode}, trying again ($((i+1))/3)..." + fi + fi +done echo echo "Configuring installed system:" @@ -1900,7 +1909,7 @@ cd "${old_dir}" || fail echo echo -n "Updating package lists... " for i in $(seq 1 3); do - if chroot /rootfs /usr/bin/apt-get -o Acquire::http::Proxy=http://"${mirror_cache}" update &>/dev/null ; then + if chroot /rootfs /usr/bin/apt-get -o Acquire::http::Proxy=http://"${mirror_cache}" update &>/dev/null; then echo "OK" break else @@ -1936,7 +1945,7 @@ if [ "${kernel_module}" = true ]; then echo "ERROR: ${download_exitcode}, FAILED !" fail else - echo -n "ERROR: ${download_exitcode}, trying again ($((i+1))/3)... " + echo -n "ERROR: ${download_exitcode}, trying again ($((i+1))/5)... " fi fi done From e0e02b5ec3293ffa3dd5e9c731eb8331bfb436de Mon Sep 17 00:00:00 2001 From: FooDeas Date: Sun, 15 Oct 2017 17:15:58 +0200 Subject: [PATCH 27/28] doc: update changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e7e4a72a..99caa58a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ - added or changed configuration variables: - `release` is set to "stretch" by default - ability to disable IPv6 +- retry debootstrap 3 times +- increased network configuration timeout to 15 seconds +- increased package download retries to 5 **Bugfixes:** From 48cbae98c4ce9db2639c7d7f58e5ee048bbb221c Mon Sep 17 00:00:00 2001 From: FooDeas Date: Mon, 16 Oct 2017 01:55:11 +0200 Subject: [PATCH 28/28] installer: fix unneeded /sbin/init creation (#98) --- scripts/opt/raspberrypi-ua-netinst/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/opt/raspberrypi-ua-netinst/install.sh b/scripts/opt/raspberrypi-ua-netinst/install.sh index 0258cf85..b3a8037f 100644 --- a/scripts/opt/raspberrypi-ua-netinst/install.sh +++ b/scripts/opt/raspberrypi-ua-netinst/install.sh @@ -1455,7 +1455,7 @@ for sysfolder in /dev /dev/pts /proc /sys; do mount --bind "${sysfolder}" "/rootfs${sysfolder}" done # set init system -if [ "${init_system}" = "systemd" ] && [ ! -e /rootfs/sbin/init ]; then +if [ "${init_system}" = "systemd" ] && [ ! -f /rootfs/sbin/init ] && [ ! -h /rootfs/sbin/init ]; then ln -s /lib/systemd/systemd /rootfs/sbin/init fi