From 94b7d877a6d578908653f9ad01b69f9acafc9940 Mon Sep 17 00:00:00 2001 From: Zaephor Date: Sun, 4 Aug 2019 14:48:18 -0700 Subject: [PATCH 01/10] build: resolve SC2207 in build.sh (#173) --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 428a2a9a..94ba76c1 100755 --- a/build.sh +++ b/build.sh @@ -68,7 +68,7 @@ function check_dependencies { # iterate over the passed modules for mod in "${mods[@]}"; do # find the module's dependencies, convert into array - deps=($(grep "^${mod}" "${depmod_file}" | cut -d':' -f2)) + IFS=" " read -r -a deps <<< "$(grep "^${mod}" "${depmod_file}" | cut -d':' -f2)" # iterate over the found dependencies for dep in "${deps[@]}"; do # check if the dependency is in $modules, if not, add to temp array From dd2730d40cb59f536b0d84a0b35f9e921a6083b6 Mon Sep 17 00:00:00 2001 From: FooDeas Date: Mon, 5 Aug 2019 20:50:06 +0200 Subject: [PATCH 02/10] installer: initial update to buster --- build.sh | 43 +++++------ doc/INSTALL_CUSTOM.md | 2 +- scripts/opt/raspberrypi-ua-netinst/install.sh | 76 +++++++++---------- update.sh | 18 +++-- 4 files changed, 69 insertions(+), 70 deletions(-) diff --git a/build.sh b/build.sh index 94ba76c1..d5b1bfc3 100755 --- a/build.sh +++ b/build.sh @@ -216,7 +216,7 @@ function create_cpio { sed -i "s/__VERSION__/${version_info}/" rootfs/opt/raspberrypi-ua-netinst/install.sh sed -i "s/__DATE__/$(date)/" rootfs/opt/raspberrypi-ua-netinst/install.sh - # btrfs-tools components + # btrfs-progs components cp --preserve=xattr,timestamps tmp/bin/mkfs.btrfs rootfs/bin/ cp --preserve=xattr,timestamps tmp/usr/lib/*/libbtrfs.so.0 rootfs/lib/ @@ -306,7 +306,7 @@ function create_cpio { cd ../../.. touch rootfs/var/lib/dpkg/status - # e2fslibs components + # libext2fs2 components cp --preserve=xattr,timestamps tmp/lib/*/libe2p.so.2.* rootfs/lib/libe2p.so.2 cp --preserve=xattr,timestamps tmp/lib/*/libext2fs.so.2.* rootfs/lib/libext2fs.so.2 @@ -340,8 +340,8 @@ 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 + # libf2fs5 components + cp --preserve=xattr,timestamps tmp/lib/*/libf2fs.so.5.* rootfs/lib/libf2fs.so.5 # f2fs-tools components cp --preserve=xattr,timestamps tmp/sbin/mkfs.f2fs rootfs/sbin/ @@ -351,13 +351,7 @@ function create_cpio { # ifupdown components cp --preserve=xattr,timestamps tmp/etc/default/networking rootfs/etc/default/ - cp --preserve=xattr,timestamps tmp/etc/init/network-interface-container.conf rootfs/etc/init/ - cp --preserve=xattr,timestamps tmp/etc/init/network-interface-security.conf rootfs/etc/init/ - cp --preserve=xattr,timestamps tmp/etc/init/network-interface.conf rootfs/etc/init/ - cp --preserve=xattr,timestamps tmp/etc/init/networking.conf rootfs/etc/init/ cp --preserve=xattr,timestamps tmp/etc/init.d/networking rootfs/etc/init.d/ - cp --preserve=xattr,timestamps tmp/etc/network/if-down.d/upstart rootfs/etc/network/if-down.d/ - cp --preserve=xattr,timestamps tmp/etc/network/if-up.d/upstart rootfs/etc/network/if-up.d/ cp --preserve=xattr,timestamps tmp/lib/ifupdown/settle-dad.sh rootfs/lib/ifupdown/ cp --preserve=xattr,timestamps tmp/sbin/ifup rootfs/sbin/ cd rootfs/sbin @@ -415,9 +409,7 @@ function create_cpio { # ntpdate components cp --preserve=xattr,timestamps tmp/etc/default/ntpdate rootfs/etc/default/ - # don't use /etc/ntp.conf since we don't have it sed -i s/NTPDATE_USE_NTP_CONF=yes/NTPDATE_USE_NTP_CONF=no/ rootfs/etc/default/ntpdate - cp --preserve=xattr,timestamps tmp/etc/network/if-up.d/ntpdate rootfs/etc/network/if-up.d/ cp --preserve=xattr,timestamps tmp/usr/sbin/ntpdate rootfs/usr/sbin/ cp --preserve=xattr,timestamps tmp/usr/sbin/ntpdate-debian rootfs/usr/sbin/ @@ -440,10 +432,12 @@ function create_cpio { cp --preserve=xattr,timestamps tmp/usr/sbin/rmt-tar rootfs/usr/sbin/ cp --preserve=xattr,timestamps tmp/usr/sbin/tarcat rootfs/usr/sbin/ + # fdisk components + cp --preserve=xattr,timestamps tmp/sbin/fdisk rootfs/sbin/ + # util-linux components cp --preserve=xattr,timestamps tmp/sbin/blkid rootfs/sbin/ cp --preserve=xattr,timestamps tmp/sbin/blockdev rootfs/sbin/ - cp --preserve=xattr,timestamps tmp/sbin/fdisk rootfs/sbin/ cp --preserve=xattr,timestamps tmp/sbin/fsck rootfs/sbin/ cp --preserve=xattr,timestamps tmp/sbin/mkswap rootfs/sbin/ cp --preserve=xattr,timestamps tmp/sbin/swaplabel rootfs/sbin/ @@ -453,13 +447,13 @@ function create_cpio { cp --preserve=xattr,timestamps -r tmp/etc/wpa_supplicant rootfs/etc/wpa_supplicant # libacl1 components - cp --preserve=xattr,timestamps tmp/lib/*/libacl.so.1.* rootfs/lib/libacl.so.1 + cp --preserve=xattr,timestamps tmp/usr/lib/*/libacl.so.1.* rootfs/usr/lib/libacl.so.1 # libatm1 components cp --preserve=xattr,timestamps tmp/lib/*/libatm.so.1.* rootfs/lib/libatm.so.1 # libattr1 components - cp --preserve=xattr,timestamps tmp/lib/*/libattr.so.1.* rootfs/lib/libattr.so.1 + cp --preserve=xattr,timestamps tmp/usr/lib/*/libattr.so.1.* rootfs/usr/lib/libattr.so.1 # libaudit-common components cp --preserve=xattr,timestamps tmp/etc/libaudit.conf rootfs/etc/ @@ -471,7 +465,7 @@ function create_cpio { cp --preserve=xattr,timestamps tmp/lib/*/libblkid.so.1.* rootfs/lib/libblkid.so.1 # libbsd0 components - cp --preserve=xattr,timestamps tmp/lib/*/libbsd.so.0.* rootfs/lib/libbsd.so.0 + cp --preserve=xattr,timestamps tmp/usr/lib/*/libbsd.so.0.* rootfs/usr/lib/libbsd.so.0 # libbz2-1.0 components cp --preserve=xattr,timestamps tmp/lib/*/libbz2.so.1.0.* rootfs/lib/libbz2.so.1.0 @@ -506,7 +500,6 @@ function create_cpio { cp --preserve=xattr,timestamps tmp/lib/*/libanl-*.so rootfs/lib/libanl.so.1 cp --preserve=xattr,timestamps tmp/lib/*/libBrokenLocale-*.so rootfs/lib/libBrokenLocale.so.1 cp --preserve=xattr,timestamps tmp/lib/*/libc-*.so rootfs/lib/libc.so.6 - cp --preserve=xattr,timestamps tmp/lib/*/libcidn-*.so rootfs/lib/libcidn.so.1 cp --preserve=xattr,timestamps tmp/lib/*/libcrypt-*.so rootfs/lib/libcrypt.so.1 cp --preserve=xattr,timestamps tmp/lib/*/libdl-*.so rootfs/lib/libdl.so.2 cp --preserve=xattr,timestamps tmp/lib/*/libm-*.so rootfs/lib/libm.so.6 @@ -528,7 +521,7 @@ function create_cpio { # libcap2 components cp --preserve=xattr,timestamps tmp/lib/*/libcap.so.2.* rootfs/lib/libcap.so.2 - # libcomerr2 components + # libcom-err2 components cp --preserve=xattr,timestamps tmp/lib/*/libcom_err.so.2.* rootfs/lib/libcom_err.so.2 # libdb5.3 components @@ -538,6 +531,9 @@ 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 + # libelf1 components + cp --preserve=xattr,timestamps tmp/usr/lib/*/libelf.so.1 rootfs/usr/lib/libelf.so.1 + # libfdisk1 components cp --no-dereference --preserve=xattr,timestamps tmp/lib/*/libfdisk.so.1.* rootfs/lib/libfdisk.so.1 @@ -563,6 +559,9 @@ function create_cpio { # libmount1 components cp --preserve=xattr,timestamps tmp/lib/*/libmount.so.1.* rootfs/lib/libmount.so.1 + # libmnl0 components + cp --preserve=xattr,timestamps tmp/lib/*/libmnl.so.0.* rootfs/lib/libmnl.so.0 + # libncurses5 components cp --preserve=xattr,timestamps tmp/lib/*/libncurses.so.5.* rootfs/lib/libncurses.so.5 cp --preserve=xattr,timestamps tmp/usr/lib/*/libform.so.5.* rootfs/usr/lib/libform.so.5 @@ -621,9 +620,9 @@ function create_cpio { # 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 + # libtinfo6 components + cp --preserve=xattr,timestamps tmp/lib/*/libtinfo.so.6.* rootfs/lib/libtinfo.so.6 + cp --preserve=xattr,timestamps tmp/usr/lib/*/libtic.so.6.* rootfs/usr/lib/libtinfo.so.6 # libuuid1 components cp --preserve=xattr,timestamps tmp/lib/*/libuuid.so.1.* rootfs/lib/libuuid.so.1 @@ -679,7 +678,7 @@ function create_cpio { 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/*/libunistring.so.2.* rootfs/lib/arm-linux-gnueabihf/libunistring.so.2 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 diff --git a/doc/INSTALL_CUSTOM.md b/doc/INSTALL_CUSTOM.md index a4a57050..ee240b55 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` | `stretch` | | Raspbian release name | +| `release` | `buster` | | Raspbian release name | ### Description: Presets diff --git a/scripts/opt/raspberrypi-ua-netinst/install.sh b/scripts/opt/raspberrypi-ua-netinst/install.sh index b5c7d0e8..4bd26605 100644 --- a/scripts/opt/raspberrypi-ua-netinst/install.sh +++ b/scripts/opt/raspberrypi-ua-netinst/install.sh @@ -129,7 +129,7 @@ variables_set_defaults() { # set config defaults variable_set "preset" "server" variable_set "mirror" "http://mirrordirector.raspbian.org/raspbian/" - variable_set "release" "stretch" + variable_set "release" "buster" variable_set "hostname" "pi" variable_set "rootpw" "raspbian" variable_set "root_ssh_pwlogin" "1" @@ -1068,7 +1068,6 @@ case "${rootfstype}" in rootfs_mount_options="noatime" ;; "ext4") - kernel_module=true if [ -z "${rootfs_mkfs_options}" ]; then if [ -n "${root_volume_label}" ]; then rootfs_mkfs_options="-L ${root_volume_label}" @@ -1080,12 +1079,11 @@ case "${rootfstype}" in rootfs_mount_options="errors=remount-ro,noatime" ;; "f2fs") - kernel_module=true if [ -z "${rootfs_mkfs_options}" ]; then if [ -n "${root_volume_label}" ]; then - rootfs_mkfs_options="-l ${root_volume_label}" + rootfs_mkfs_options="-l ${root_volume_label} -f" else - rootfs_mkfs_options= + rootfs_mkfs_options="-f" fi fi rootfs_install_mount_options="noatime" @@ -1117,7 +1115,7 @@ fi # determine available releases mirror_base=http://archive.raspberrypi.org/debian/dists/ -release_fallback=stretch +release_fallback=buster release_base="${release}" release_raspbian="${release}" if ! wget --spider "${mirror_base}/${release}/" &> /dev/null; then @@ -1529,7 +1527,7 @@ rm -rf "${tmp_bootfs:?}"/ || fail echo "OK" if [ "${kernel_module}" = true ]; then - if [ "${rootfstype}" != "ext4" ]; then + if [ "${rootfstype}" != "ext4" ] && [ "${rootfstype}" != "f2fs" ]; then echo -n "Loading ${rootfstype} module... " modprobe "${rootfstype}" &> /dev/null || fail echo "OK" @@ -1569,7 +1567,7 @@ else fi if [ "${kernel_module}" = true ]; then - if [ "${rootfstype}" != "ext4" ]; then + if [ "${rootfstype}" != "ext4" ] && [ "${rootfstype}" != "f2fs" ]; then mkdir -p /rootfs/etc/initramfs-tools echo "${rootfstype}" >> /rootfs/etc/initramfs-tools/modules fi @@ -2081,46 +2079,44 @@ for i in $(seq 1 "${installer_pkg_updateretries}"); do done # kernel and firmware package can't be installed during cdebootstrap phase, so do so now -if [ "${kernel_module}" = true ]; then - if [ -n "${packages_postinstall}" ]; then - convert_listvariable packages_postinstall - fi - - DEBIAN_FRONTEND=noninteractive - export DEBIAN_FRONTEND +if [ -n "${packages_postinstall}" ]; then + convert_listvariable packages_postinstall +fi - echo - echo "Downloading packages..." - for i in $(seq 1 "${installer_pkg_downloadretries}"); do - if [ -z "${mirror_cache}" ]; then - eval chroot /rootfs /usr/bin/apt-get -y -d install "${packages_postinstall}" 2>&1 | output_filter - else - eval chroot /rootfs /usr/bin/apt-get -o Acquire::http::Proxy=http://"${mirror_cache}" -y -d install "${packages_postinstall}" 2>&1 | output_filter - fi - download_exitcode="${PIPESTATUS[0]}" - if [ "${download_exitcode}" -eq 0 ]; then - echo "OK" - break - elif [ "${i}" -eq "${installer_pkg_downloadretries}" ]; then - echo "ERROR: ${download_exitcode}, FAILED !" - fail - else - echo -n "ERROR: ${download_exitcode}, trying again ($((i+1))/${installer_pkg_downloadretries})... " - fi - done +DEBIAN_FRONTEND=noninteractive +export DEBIAN_FRONTEND - echo - echo "Installing kernel, bootloader (=firmware) and user packages..." - eval chroot /rootfs /usr/bin/apt-get -y install "${packages_postinstall}" 2>&1 | output_filter - if [ "${PIPESTATUS[0]}" -eq 0 ]; then +echo +echo "Downloading packages..." +for i in $(seq 1 "${installer_pkg_downloadretries}"); do + if [ -z "${mirror_cache}" ]; then + eval chroot /rootfs /usr/bin/apt-get -y -d upgrade "${packages_postinstall}" 2>&1 | output_filter + else + eval chroot /rootfs /usr/bin/apt-get -o Acquire::http::Proxy=http://"${mirror_cache}" -y -d upgrade "${packages_postinstall}" 2>&1 | output_filter + fi + download_exitcode="${PIPESTATUS[0]}" + if [ "${download_exitcode}" -eq 0 ]; then echo "OK" + break + elif [ "${i}" -eq "${installer_pkg_downloadretries}" ]; then + echo "ERROR: ${download_exitcode}, FAILED !" + fail else - echo "FAILED !" + echo -n "ERROR: ${download_exitcode}, trying again ($((i+1))/${installer_pkg_downloadretries})... " fi +done - unset DEBIAN_FRONTEND +echo +echo "Installing kernel, bootloader (=firmware) and user packages..." +eval chroot /rootfs /usr/bin/apt-get -y upgrade "${packages_postinstall}" 2>&1 | output_filter +if [ "${PIPESTATUS[0]}" -eq 0 ]; then + echo "OK" +else + echo "FAILED !" fi +unset DEBIAN_FRONTEND + # remove cdebootstrap-helper-rc.d which prevents rc.d scripts from running echo -n "Removing cdebootstrap-helper-rc.d... " chroot /rootfs /usr/bin/dpkg -r cdebootstrap-helper-rc.d &> /dev/null || fail diff --git a/update.sh b/update.sh index cdfda43a..d81e8578 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=stretch +release=buster packages=() @@ -25,6 +25,7 @@ packages+=("raspberrypi-bootloader") packages+=("raspberrypi-kernel") packages+=("firmware-brcm80211") packages+=("btrfs-progs") +packages+=("libbtrfs0") packages+=("busybox") packages+=("bash-static") packages+=("cdebootstrap-static") @@ -32,7 +33,7 @@ packages+=("coreutils") packages+=("diffutils") packages+=("dosfstools") packages+=("dpkg") -packages+=("e2fslibs") +packages+=("libext2fs2") packages+=("e2fsprogs") packages+=("f2fs-tools") packages+=("gpgv") @@ -45,6 +46,7 @@ packages+=("ntpdate") packages+=("raspbian-archive-keyring") packages+=("rng-tools") packages+=("tar") +packages+=("fdisk") packages+=("util-linux") packages+=("wpasupplicant") packages+=("libraspberrypi-bin") @@ -63,11 +65,12 @@ packages+=("libbz2-1.0") packages+=("libc-bin") packages+=("libc6") packages+=("libcap2") -packages+=("libcomerr2") -packages+=("libcurl3") +packages+=("libcom-err2") +packages+=("libcurl4") packages+=("libdb5.3") packages+=("libdbus-1-3") -packages+=("libf2fs0") +packages+=("libelf1") +packages+=("libf2fs5") packages+=("libfdisk1") packages+=("libffi6") packages+=("libgcc1") @@ -88,6 +91,7 @@ packages+=("liblz4-1") packages+=("liblzma5") packages+=("liblzo2-2") packages+=("libmount1") +packages+=("libmnl0") packages+=("libncurses5") packages+=("libnettle6") packages+=("libnghttp2-14") @@ -109,9 +113,9 @@ packages+=("libssl1.1") packages+=("libssl1.0.2") packages+=("libsystemd0") packages+=("libtasn1-6") +packages+=("libtinfo6") packages+=("libudev1") -packages+=("libtinfo5") -packages+=("libunistring0") +packages+=("libunistring2") packages+=("libuuid1") packages+=("zlib1g") From 0b978150f79c3ed4c85c166aa6b8532829165514 Mon Sep 17 00:00:00 2001 From: FooDeas Date: Mon, 5 Aug 2019 20:57:23 +0200 Subject: [PATCH 03/10] installer: add version 4 model B --- README.md | 4 ++-- scripts/opt/raspberrypi-ua-netinst/install.sh | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 605e20b3..f043e546 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, 3B+ and 0W) +- completely unattended, you only need a working internet connection through the ethernet port or use the onboard wireless LAN (supported on model 3B, 3B+, 4B and 0W) - DHCP and static IP configuration (DHCP is the default) - always installs the latest version of Raspbian - configurable default settings @@ -45,7 +45,7 @@ The installer with the default settings configures eth0 with DHCP to get interne ## Requirements -- a Raspberry Pi (from model 1B up to 3B, 3A+, 3B+ or Zero including Zero W) +- a Raspberry Pi (from model 1B up to 4B, 3A+, 3B+ or Zero including Zero W) - SD card with at least 1GB, or at least 128MB for USB root install (without customization) - ethernet or wireless LAN with a working internet connection diff --git a/scripts/opt/raspberrypi-ua-netinst/install.sh b/scripts/opt/raspberrypi-ua-netinst/install.sh index 4bd26605..1d477dcf 100644 --- a/scripts/opt/raspberrypi-ua-netinst/install.sh +++ b/scripts/opt/raspberrypi-ua-netinst/install.sh @@ -661,6 +661,9 @@ case "${rpi_hardware}" in "a32082") rpi_hardware_version="3 Model B" ;; "a020d3") rpi_hardware_version="3 Model B+" ;; "9020e0") rpi_hardware_version="3 Model A+" ;; + "a03111") rpi_hardware_version="4 Model B" ;; + "b03111") rpi_hardware_version="4 Model B" ;; + "c03111") rpi_hardware_version="4 Model B" ;; *) rpi_hardware_version="unknown (${rpi_hardware})" ;; esac From d7d8f070f1a7bcbdd19f7b7e6ae9d6bd73c9ab4f Mon Sep 17 00:00:00 2001 From: FooDeas Date: Mon, 5 Aug 2019 20:57:47 +0200 Subject: [PATCH 04/10] doc: update changelog --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a1bd65b..ca7ab010 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## raspberrypi-ua-netinst v2.4.0 + +- support for version 4 model B +- support for Debian 10 (buster) +- added or changed configuration variables: + - `release` is set to "buster" by default + ## raspberrypi-ua-netinst v2.3.0 - support for version 3 model A+ From 373e493f342e8a750d4e02e647901f4f43ad14af Mon Sep 17 00:00:00 2001 From: FooDeas Date: Sun, 11 Aug 2019 21:15:32 +0200 Subject: [PATCH 05/10] installer: fix WiFi --- build.sh | 3 +++ update.sh | 1 + 2 files changed, 4 insertions(+) diff --git a/build.sh b/build.sh index d5b1bfc3..34dec2d3 100755 --- a/build.sh +++ b/build.sh @@ -574,6 +574,9 @@ function create_cpio { # libnl-genl-3-200 components cp --preserve=xattr,timestamps tmp/lib/*/libnl-genl-3.so.200 rootfs/lib/libnl-genl-3.so.200 + # libnl-route-3-200 components + cp --preserve=xattr,timestamps tmp/usr/lib/*/libnl-route-3.so.200.* rootfs/usr/lib/libnl-route-3.so.200 + # libpam0g components cp --preserve=xattr,timestamps tmp/lib/*/libpam.so.0.* rootfs/lib/libpam.so.0 cp --preserve=xattr,timestamps tmp/lib/*/libpam_misc.so.0.* rootfs/lib/libpam_misc.so.0 diff --git a/update.sh b/update.sh index d81e8578..0328d576 100755 --- a/update.sh +++ b/update.sh @@ -97,6 +97,7 @@ packages+=("libnettle6") packages+=("libnghttp2-14") packages+=("libnl-3-200") packages+=("libnl-genl-3-200") +packages+=("libnl-route-3-200") packages+=("libpam0g") packages+=("libpcre3") packages+=("libpcsclite1") From e4edaed6259047ca31670929cba1a89722a97f32 Mon Sep 17 00:00:00 2001 From: FooDeas Date: Sun, 11 Aug 2019 21:16:00 +0200 Subject: [PATCH 06/10] installer: remove special sysvinit handling --- scripts/opt/raspberrypi-ua-netinst/install.sh | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/scripts/opt/raspberrypi-ua-netinst/install.sh b/scripts/opt/raspberrypi-ua-netinst/install.sh index 1d477dcf..a53f27e2 100644 --- a/scripts/opt/raspberrypi-ua-netinst/install.sh +++ b/scripts/opt/raspberrypi-ua-netinst/install.sh @@ -1133,12 +1133,7 @@ if [ -z "${cdebootstrap_cmdline}" ]; then # from small to large: base, minimal, server # not very logical that minimal > base, but that's how it was historically defined - init_system="" - if [ "${release}" = "wheezy" ]; then - init_system="sysvinit" - else - init_system="systemd" - fi + init_system="systemd" # always add packages if requested or needed if [ "${firmware_packages}" = "1" ]; then @@ -1150,7 +1145,7 @@ if [ -z "${cdebootstrap_cmdline}" ]; then if [ -n "${keyboard_layout}" ] && [ "${keyboard_layout}" != "us" ]; then custom_packages="${custom_packages},console-setup" fi - if [ "${watchdog_enable}" = "1" ] && [ "${init_system}" = "sysvinit" ]; then + if [ "${watchdog_enable}" = "1" ] && [ "${init_system}" != "systemd" ]; then custom_packages="${custom_packages},watchdog" fi if [ "${sound_usb_enable}" = "1" ]; then @@ -2239,7 +2234,9 @@ if [ "${watchdog_enable}" = "1" ]; then sed -i "s/^\(dtparam=watchdog=.*\)/#\1/" /rootfs/boot/config.txt echo "dtparam=watchdog=on" >> /rootfs/boot/config.txt fi - if [ "${init_system}" = "sysvinit" ]; then + if [ "${init_system}" = "systemd" ]; then + sed -i 's/^.*RuntimeWatchdogSec=.*$/RuntimeWatchdogSec=14s/' /rootfs/etc/systemd/system.conf + else sed -i "s/^\(#\)*\(max-load-1\t\t= \)\S\+/\224/" /rootfs/etc/watchdog.conf || fail sed -i "s/^\(#\)*\(watchdog-device\t\)\(= \)\S\+/\2\t\3\/dev\/watchdog/" /rootfs/etc/watchdog.conf || fail if [ "$(grep -c "^\(#\)*watchdog-timeout" /etc/watchdog.conf)" -eq 1 ]; then @@ -2247,8 +2244,6 @@ if [ "${watchdog_enable}" = "1" ]; then else echo -e "watchdog-timeout\t= 14" >> /rootfs/etc/watchdog.conf || fail fi - elif [ "${init_system}" = "systemd" ]; then - sed -i 's/^.*RuntimeWatchdogSec=.*$/RuntimeWatchdogSec=14s/' /rootfs/etc/systemd/system.conf fi fi From 9fbd27fe71bae838d11229939fa75c4712db622f Mon Sep 17 00:00:00 2001 From: FooDeas Date: Sun, 11 Aug 2019 21:16:13 +0200 Subject: [PATCH 07/10] doc: update changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ca7ab010..6893652f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,14 @@ - support for version 4 model B - support for Debian 10 (buster) +- removed handling of Debian 7 (wheezy) because it is no longer available in Raspbian repository - added or changed configuration variables: - `release` is set to "buster" by default +**Bugfixes:** + +- upgrade initial packages + ## raspberrypi-ua-netinst v2.3.0 - support for version 3 model A+ From 4b4930fab99b201fd58ccd090ce94f137dcadc1b Mon Sep 17 00:00:00 2001 From: FooDeas Date: Sun, 11 Aug 2019 21:16:19 +0200 Subject: [PATCH 08/10] installer: fix unmount on finish --- scripts/opt/raspberrypi-ua-netinst/install.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/opt/raspberrypi-ua-netinst/install.sh b/scripts/opt/raspberrypi-ua-netinst/install.sh index a53f27e2..5a11d45c 100644 --- a/scripts/opt/raspberrypi-ua-netinst/install.sh +++ b/scripts/opt/raspberrypi-ua-netinst/install.sh @@ -286,6 +286,7 @@ fail() { # if we mounted /boot in the fail command, unmount it. if [ "${fail_boot_mounted}" = true ]; then + sync umount /boot fi @@ -788,6 +789,7 @@ unset preinstall_reboot echo echo -n "Unmounting boot partition... " +sync umount /boot || fail echo "OK" @@ -941,7 +943,7 @@ fi if [ "${ip_addr}" = "dhcp" ]; then echo -n "Configuring ${ifname} with DHCP... " - if udhcpc -i "${ifname}" &> /dev/null; then + if udhcpc -R -i "${ifname}" &> /dev/null; then ifconfig "${ifname}" | grep -F addr: | awk '{print $2}' | cut -d: -f2 else echo "FAILED" @@ -2408,7 +2410,7 @@ fi if [ "${final_action}" != "console" ]; then echo -n "Unmounting filesystems... " - for sysfolder in /dev/pts /proc /sys; do + for sysfolder in /sys /proc /dev/pts /dev; do umount "/rootfs${sysfolder}" done sync From 7a8434dd251ed2f165398226e04f5c9a11ddbd05 Mon Sep 17 00:00:00 2001 From: FooDeas Date: Sun, 11 Aug 2019 21:16:30 +0200 Subject: [PATCH 09/10] installer: backup kernel7l.img for reinstallation --- scripts/opt/raspberrypi-ua-netinst/install.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/opt/raspberrypi-ua-netinst/install.sh b/scripts/opt/raspberrypi-ua-netinst/install.sh index 5a11d45c..87ee6ebb 100644 --- a/scripts/opt/raspberrypi-ua-netinst/install.sh +++ b/scripts/opt/raspberrypi-ua-netinst/install.sh @@ -708,10 +708,11 @@ preinstall_reboot=0 echo echo "Checking if config.txt needs to be modified before starting installation..." # Reinstallation -if [ -e "/boot/raspberrypi-ua-netinst/reinstall/kernel.img" ] && [ -e "/boot/raspberrypi-ua-netinst/reinstall/kernel7.img" ] ; then +if [ -e "/boot/raspberrypi-ua-netinst/reinstall/kernel.img" ] && [ -e "/boot/raspberrypi-ua-netinst/reinstall/kernel7.img" ] && [ -e "/boot/raspberrypi-ua-netinst/reinstall/kernel7l.img" ] ; then echo -n " Reinstallation requested! Restoring files... " mv /boot/raspberrypi-ua-netinst/reinstall/kernel.img /boot/kernel.img mv /boot/raspberrypi-ua-netinst/reinstall/kernel7.img /boot/kernel7.img + mv /boot/raspberrypi-ua-netinst/reinstall/kernel7l.img /boot/kernel7l.img echo "OK" preinstall_reboot=1 fi @@ -881,6 +882,8 @@ if [ ! -e "/lib/modules/$(uname -r)" ]; then echo "Kernel modules for the kernel version \"$(uname -r)\" could not be found. Searching for alternatives..." if [[ "$(uname -r)" =~ -v7\+$ ]]; then kernel_modulepath="$(find /lib/modules/ -maxdepth 1 -type d ! -path /lib/modules/ | grep -e "[^/]\+-v7+$" | head -1)" + elif [[ "$(uname -r)" =~ -v7l\+$ ]]; then + kernel_modulepath="$(find /lib/modules/ -maxdepth 1 -type d ! -path /lib/modules/ | grep -e "[^/]\+-v7l+$" | head -1)" else kernel_modulepath="$(find /lib/modules/ -maxdepth 1 -type d ! -path /lib/modules/ | grep -ve "[^/]\+-v7+$" | head -1)" fi @@ -2127,6 +2130,7 @@ mkdir -p /rootfs/boot/raspberrypi-ua-netinst/reinstall cp /rootfs/boot/config.txt /rootfs/boot/raspberrypi-ua-netinst/reinstall/config.txt cp /rootfs/boot/kernel.img /rootfs/boot/raspberrypi-ua-netinst/reinstall/kernel.img cp /rootfs/boot/kernel7.img /rootfs/boot/raspberrypi-ua-netinst/reinstall/kernel7.img +cp /rootfs/boot/kernel7l.img /rootfs/boot/raspberrypi-ua-netinst/reinstall/kernel7l.img echo "Configuring bootloader to start the installed system..." if [ -e "/rootfs/boot/raspberrypi-ua-netinst/config/boot/config.txt" ]; then cp /rootfs/boot/raspberrypi-ua-netinst/config/boot/config.txt /rootfs/boot/config.txt @@ -2409,6 +2413,12 @@ if [ "${cleanup}" = "1" ]; then fi if [ "${final_action}" != "console" ]; then + if [ "${ip_addr}" = "dhcp" ]; then + echo -n "Releasing IP... " + killall -q udhcpc + echo "OK" + fi + echo -n "Unmounting filesystems... " for sysfolder in /sys /proc /dev/pts /dev; do umount "/rootfs${sysfolder}" From 436cb74e264b07a831374a23708d8635d21a4e03 Mon Sep 17 00:00:00 2001 From: FooDeas Date: Sun, 11 Aug 2019 21:41:23 +0200 Subject: [PATCH 10/10] installer: improve log output --- scripts/opt/raspberrypi-ua-netinst/install.sh | 33 ++++++++++++------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/scripts/opt/raspberrypi-ua-netinst/install.sh b/scripts/opt/raspberrypi-ua-netinst/install.sh index 87ee6ebb..81244f4c 100644 --- a/scripts/opt/raspberrypi-ua-netinst/install.sh +++ b/scripts/opt/raspberrypi-ua-netinst/install.sh @@ -930,15 +930,20 @@ if [ "${ifname}" != "eth0" ]; then sed -i "s/PEERDNS_IF=.*/PEERDNS_IF=${ifname}/g" /etc/udhcpc/default.script # wlan* is a wireless interface and wpa_supplicant must connect to wlan if echo "${ifname}" | grep -q "wlan"; then - echo -n "Starting wpa_supplicant... " + echo "Starting wpa_supplicant..." if [ -e "${wlan_configfile}" ]; then - if wpa_supplicant -B -Dnl80211 -c"${wlan_configfile}" -i"${ifname}"; then - echo "OK" - else - echo "nl80211 driver didn't work. Trying generic driver (wext)..." - wpa_supplicant -B -Dwext -c"${wlan_configfile}" -i"${ifname}" || fail - echo "OK" + wpa_supplicant -B -Dnl80211 -c"${wlan_configfile}" -i"${ifname}" | sed 's/^/ /' + if [ "${PIPESTATUS[0]}" -ne 0 ]; then + echo " nl80211 driver didn't work. Trying generic driver (wext)..." + wpa_supplicant -B -Dwext -c"${wlan_configfile}" -i"${ifname}" | sed 's/^/ /' + if [ "${PIPESTATUS[0]}" -ne 0 ]; then + fail + fi fi + echo "OK" + else + echo " wpa_supplicant.conf could not be found." + fail fi fi fi @@ -1543,7 +1548,6 @@ eval mkfs."${rootfstype}" "${rootfs_mkfs_options}" "${rootpartition}" | sed 's/^ if [ "${PIPESTATUS[0]}" -ne 0 ]; then fail fi - echo "OK" echo -n "Mounting new filesystems... " @@ -1597,6 +1601,7 @@ for i in $(seq 1 "${installer_pkg_downloadretries}"); do fi fi done +echo "OK" echo echo "Configuring installed system:" @@ -1825,6 +1830,8 @@ if echo "${cdebootstrap_cmdline} ${packages_postinstall}" | grep -q "ifupdown"; ln -s /dev/null /rootfs/etc/udev/rules.d/75-persistent-net-generator.rules fi + echo "OK" + # copy resolv.conf echo -n " Configuring nameserver... " if [ -e "/etc/resolv.conf" ]; then @@ -1838,8 +1845,6 @@ if echo "${cdebootstrap_cmdline} ${packages_postinstall}" | grep -q "ifupdown"; echo "MISSING !" fail fi - - echo "OK" fi # set timezone and reconfigure tzdata package @@ -2119,19 +2124,22 @@ else fi unset DEBIAN_FRONTEND +echo # remove cdebootstrap-helper-rc.d which prevents rc.d scripts from running echo -n "Removing cdebootstrap-helper-rc.d... " chroot /rootfs /usr/bin/dpkg -r cdebootstrap-helper-rc.d &> /dev/null || fail echo "OK" -echo "Preserving original config.txt and kernels..." +echo -n "Preserving original config.txt and kernels... " mkdir -p /rootfs/boot/raspberrypi-ua-netinst/reinstall cp /rootfs/boot/config.txt /rootfs/boot/raspberrypi-ua-netinst/reinstall/config.txt cp /rootfs/boot/kernel.img /rootfs/boot/raspberrypi-ua-netinst/reinstall/kernel.img cp /rootfs/boot/kernel7.img /rootfs/boot/raspberrypi-ua-netinst/reinstall/kernel7.img cp /rootfs/boot/kernel7l.img /rootfs/boot/raspberrypi-ua-netinst/reinstall/kernel7l.img -echo "Configuring bootloader to start the installed system..." +echo "OK" + +echo -n "Configuring bootloader to start the installed system..." if [ -e "/rootfs/boot/raspberrypi-ua-netinst/config/boot/config.txt" ]; then cp /rootfs/boot/raspberrypi-ua-netinst/config/boot/config.txt /rootfs/boot/config.txt else @@ -2145,6 +2153,7 @@ fi if [ "${usbboot}" = "1" ]; then touch /rootfs/boot/TIMEOUT fi +echo "OK" # create cmdline.txt echo -n "Creating cmdline.txt... "