From 4869594889d8a203142a9580271b726c51a4b1c4 Mon Sep 17 00:00:00 2001 From: neuronaddict Date: Thu, 2 Sep 2021 22:30:04 +0200 Subject: [PATCH 01/20] rpi3: variable for nameserver --- common.d/variables.sh | 2 ++ rpi3-64.sh | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/common.d/variables.sh b/common.d/variables.sh index 0422642..2d542a1 100644 --- a/common.d/variables.sh +++ b/common.d/variables.sh @@ -46,6 +46,8 @@ basedir=${current_dir}/${hw_model}-${variant} work_dir="${basedir}/kali-${architecture}" # Custom image file name variable - MUST NOT include .img at the end. imagename=${imagename:-"kali-linux-${version}-${hw_model}-${variant}"} +# DNS server +nameserver=${nameserver:-"8.8.8.8"} # workaround for LP: #520465 export MALLOC_CHECK_=0 # Proxy diff --git a/rpi3-64.sh b/rpi3-64.sh index dcfd4da..d3b03d2 100755 --- a/rpi3-64.sh +++ b/rpi3-64.sh @@ -137,7 +137,7 @@ set_locale "$locale" # Clean system include clean_system # Define DNS server after last running systemd-nspawn. -echo "nameserver 8.8.8.8" >"${work_dir}"/etc/resolv.conf +echo "nameserver ${nameserver}" >"${work_dir}"/etc/resolv.conf # Disable the use of http proxy in case it is enabled. disable_proxy # Mirror & suite replacement From 7ddc3c3a50917556a0cdff09dd97266be2ee4a3d Mon Sep 17 00:00:00 2001 From: neuronaddict Date: Sat, 4 Sep 2021 17:16:17 +0200 Subject: [PATCH 02/20] rpi3-nexmon: add files from includes.chroot --- common.d/includes.sh | 14 ++++++++++++++ kali-config/common/includes.chroot/.gitignore | 2 ++ rpi3-nexmon.sh | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 common.d/includes.sh create mode 100644 kali-config/common/includes.chroot/.gitignore diff --git a/common.d/includes.sh b/common.d/includes.sh new file mode 100644 index 0000000..7ae60e3 --- /dev/null +++ b/common.d/includes.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +set -e + +# includes files from workdir +log "Include files on kali-config/common/includes.chroot" green + +if [[ "${debug}" == "true" ]] +then + cp_debug_flag="-v" +fi + +cp -r ${cp_debug_flag} kali-config/common/includes.chroot/* "${work_dir}"/ +[[ -d "kali-config/variant-${desktop}/includes.chroot" ]] && cp -r ${cp_debug_flag} kali-config/variant-"${desktop}"/includes.chroot/* "${work_dir}"/ diff --git a/kali-config/common/includes.chroot/.gitignore b/kali-config/common/includes.chroot/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/kali-config/common/includes.chroot/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/rpi3-nexmon.sh b/rpi3-nexmon.sh index e7a4a63..c97833f 100755 --- a/rpi3-nexmon.sh +++ b/rpi3-nexmon.sh @@ -137,7 +137,7 @@ set_locale "$locale" # Clean system include clean_system # Define DNS server after last running systemd-nspawn. -echo "nameserver 8.8.8.8" >"${work_dir}"/etc/resolv.conf +echo "nameserver ${nameserver}" >"${work_dir}"/etc/resolv.conf # Disable the use of http proxy in case it is enabled. disable_proxy # Reload sources.list From 50bcd62d3ff3fca1d27d896e253400c6a3e91e72 Mon Sep 17 00:00:00 2001 From: neuronaddict Date: Mon, 6 Sep 2021 22:12:11 +0200 Subject: [PATCH 03/20] packages customisation --- common.d/packages.sh | 3 +++ kali-config/common/package-list/.gitignore | 2 ++ 2 files changed, 5 insertions(+) create mode 100644 kali-config/common/package-list/.gitignore diff --git a/common.d/packages.sh b/common.d/packages.sh index 6cd0e68..03d8eee 100644 --- a/common.d/packages.sh +++ b/common.d/packages.sh @@ -48,3 +48,6 @@ if [[ "$variant" == *lite* ]]; then fi third_stage_pkgs="binutils ca-certificates console-common console-setup locales libterm-readline-gnu-perl git wget curl" + +extra+=" $(cat kali-config/common/package-list/*.list.chroot 2>/dev/null)" +extra+=" $(cat kali-config/variant-${desktop}/package-list/*.list.chroot 2>/dev/null)" diff --git a/kali-config/common/package-list/.gitignore b/kali-config/common/package-list/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/kali-config/common/package-list/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore From 162226c3758769fcfcefb373842753fd186befb7 Mon Sep 17 00:00:00 2001 From: neuronaddict Date: Mon, 6 Sep 2021 23:05:59 +0200 Subject: [PATCH 04/20] Revert "rpi3-nexmon: add files from includes.chroot" This reverts commit f6475d11a7a0e448e6b1de4845c8dd11cd7820b5. --- common.d/includes.sh | 14 -------------- kali-config/common/includes.chroot/.gitignore | 2 -- 2 files changed, 16 deletions(-) delete mode 100644 common.d/includes.sh delete mode 100644 kali-config/common/includes.chroot/.gitignore diff --git a/common.d/includes.sh b/common.d/includes.sh deleted file mode 100644 index 7ae60e3..0000000 --- a/common.d/includes.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash - -set -e - -# includes files from workdir -log "Include files on kali-config/common/includes.chroot" green - -if [[ "${debug}" == "true" ]] -then - cp_debug_flag="-v" -fi - -cp -r ${cp_debug_flag} kali-config/common/includes.chroot/* "${work_dir}"/ -[[ -d "kali-config/variant-${desktop}/includes.chroot" ]] && cp -r ${cp_debug_flag} kali-config/variant-"${desktop}"/includes.chroot/* "${work_dir}"/ diff --git a/kali-config/common/includes.chroot/.gitignore b/kali-config/common/includes.chroot/.gitignore deleted file mode 100644 index d6b7ef3..0000000 --- a/kali-config/common/includes.chroot/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore From ffc27b5c5b926f04d849499b84c05899f4273352 Mon Sep 17 00:00:00 2001 From: neuronaddict Date: Mon, 6 Sep 2021 23:19:31 +0200 Subject: [PATCH 05/20] Use a variable to add additionnal packages. --- common.d/packages.sh | 9 ++++----- kali-config/common/package-list/.gitignore | 2 -- 2 files changed, 4 insertions(+), 7 deletions(-) delete mode 100644 kali-config/common/package-list/.gitignore diff --git a/common.d/packages.sh b/common.d/packages.sh index 03d8eee..8628a4f 100644 --- a/common.d/packages.sh +++ b/common.d/packages.sh @@ -38,16 +38,15 @@ rpi_pkgs="fake-hwclock ntpdate u-boot-tools" gpio_pkgs="i2c-tools python3-configobj python3-pip python3-requests python3-rpi.gpio python3-smbus" extra="$custom_kernel_pkgs" -packages="$common_pkgs $cli_tools_pkgs $services" + +# add extra_custom_pkgs, that can be a global variable +packages="$common_pkgs $cli_tools_pkgs $services $extra_custom_pkgs" if [[ "$hw_model" == *rpi* ]]; then extra+=" $gpio_pkgs $rpi_pkgs" fi if [[ "$variant" == *lite* ]]; then - packages="$common_min_pkgs $cli_min_tools $services" + packages="$common_min_pkgs $cli_min_tools $services $extra_custom_pkgs" fi third_stage_pkgs="binutils ca-certificates console-common console-setup locales libterm-readline-gnu-perl git wget curl" - -extra+=" $(cat kali-config/common/package-list/*.list.chroot 2>/dev/null)" -extra+=" $(cat kali-config/variant-${desktop}/package-list/*.list.chroot 2>/dev/null)" diff --git a/kali-config/common/package-list/.gitignore b/kali-config/common/package-list/.gitignore deleted file mode 100644 index d6b7ef3..0000000 --- a/kali-config/common/package-list/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore From 5532a3861613e06dc07c9df72fd481c873b0c074 Mon Sep 17 00:00:00 2001 From: neuronaddict Date: Tue, 7 Sep 2021 01:17:54 +0200 Subject: [PATCH 06/20] change nameserver on rpi1-3 --- rpi1.sh | 2 +- rpi3-64-minimal.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rpi1.sh b/rpi1.sh index 8573fda..e37e027 100755 --- a/rpi1.sh +++ b/rpi1.sh @@ -136,7 +136,7 @@ set_locale "$locale" # Clean system include clean_system # Define DNS server after last running systemd-nspawn. -echo "nameserver 8.8.8.8" >"${work_dir}"/etc/resolv.conf +echo "nameserver ${nameserver}" >"${work_dir}"/etc/resolv.conf # Disable the use of http proxy in case it is enabled. disable_proxy # Mirror & suite replacement diff --git a/rpi3-64-minimal.sh b/rpi3-64-minimal.sh index 8de39e0..94616aa 100755 --- a/rpi3-64-minimal.sh +++ b/rpi3-64-minimal.sh @@ -143,7 +143,7 @@ set_locale "$locale" # Clean system include clean_system # Define DNS server after last running systemd-nspawn. -echo "nameserver 8.8.8.8" >"${work_dir}"/etc/resolv.conf +echo "nameserver ${nameserver}" >"${work_dir}"/etc/resolv.conf # Disable the use of http proxy in case it is enabled. disable_proxy # Mirror & suite replacement From d7b546816b88f5044ecd07d2e28168bf420e1dbe Mon Sep 17 00:00:00 2001 From: neuronaddict Date: Tue, 7 Sep 2021 01:19:32 +0200 Subject: [PATCH 07/20] Use nameserver variable on rpi0* that include variables.sh. --- rpi0w-nexmon-minimal.sh | 2 +- rpi0w-nexmon.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rpi0w-nexmon-minimal.sh b/rpi0w-nexmon-minimal.sh index 1d611d6..a6fad37 100755 --- a/rpi0w-nexmon-minimal.sh +++ b/rpi0w-nexmon-minimal.sh @@ -133,7 +133,7 @@ set_locale "$locale" # Clean system include clean_system # Define DNS server after last running systemd-nspawn. -echo "nameserver 8.8.8.8" >"${work_dir}"/etc/resolv.conf +echo "nameserver ${nameserver}" >"${work_dir}"/etc/resolv.conf # Disable the use of http proxy in case it is enabled. disable_proxy # Mirror & suite replacement diff --git a/rpi0w-nexmon.sh b/rpi0w-nexmon.sh index 0f55196..a839f52 100755 --- a/rpi0w-nexmon.sh +++ b/rpi0w-nexmon.sh @@ -138,7 +138,7 @@ set_locale "$locale" # Clean system include clean_system # Define DNS server after last running systemd-nspawn. -echo "nameserver 8.8.8.8" >"${work_dir}"/etc/resolv.conf +echo "nameserver ${nameserver}" >"${work_dir}"/etc/resolv.conf # Disable the use of http proxy in case it is enabled. disable_proxy # Mirror & suite replacement From 62633e1244adb423741f22a3278781e661c82796 Mon Sep 17 00:00:00 2001 From: neuronaddict Date: Fri, 10 Sep 2021 14:55:50 +0200 Subject: [PATCH 08/20] rpi0-nexmon-p4wp1-aloa.sh: set dns server. --- rpi0w-nexmon-p4wnp1-aloa.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rpi0w-nexmon-p4wnp1-aloa.sh b/rpi0w-nexmon-p4wnp1-aloa.sh index 4790d02..92b78de 100755 --- a/rpi0w-nexmon-p4wnp1-aloa.sh +++ b/rpi0w-nexmon-p4wnp1-aloa.sh @@ -36,6 +36,8 @@ mirror=${mirror:-"http://http.kali.org/kali"} kaligit="https://gitlab.com/kalilinux" # Github raw url githubraw="https://raw.githubusercontent.com" +# dns server +nameserver=${nameserver:-"8.8.8.8"} # Check EUID=0 you can run any binary as root. if [[ $EUID -ne 0 ]]; then @@ -186,7 +188,7 @@ iface eth0 inet dhcp EOF # DNS server -echo "nameserver 8.8.8.8" > ${work_dir}/etc/resolv.conf +echo "nameserver ${nameserver}" > ${work_dir}/etc/resolv.conf # Copy directory bsp into build dir. cp -rp bsp ${work_dir} From 6a56622b67e200485bbdca4734194d1ddb81ba1e Mon Sep 17 00:00:00 2001 From: neuronaddict Date: Fri, 10 Sep 2021 14:57:11 +0200 Subject: [PATCH 09/20] rpi0-nexmon-p4wp1-aloa.sh: fix dns server set after nspawn --- rpi0w-nexmon-p4wnp1-aloa.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpi0w-nexmon-p4wnp1-aloa.sh b/rpi0w-nexmon-p4wnp1-aloa.sh index 92b78de..64169cc 100755 --- a/rpi0w-nexmon-p4wnp1-aloa.sh +++ b/rpi0w-nexmon-p4wnp1-aloa.sh @@ -362,7 +362,7 @@ touch "${work_dir}"/etc/machine-id rm -f "${work_dir}"/var/lib/dbus/machine-id || true # Define DNS server after last running systemd-nspawn. -echo "nameserver 8.8.8.8" > ${work_dir}/etc/resolv.conf +echo "nameserver ${nameserver}" > ${work_dir}/etc/resolv.conf # Disable the use of http proxy in case it is enabled. if [ -n "$proxy_url" ]; then From 501763830f17ef3595ce5aadfa046c49125c5f2a Mon Sep 17 00:00:00 2001 From: neuronaddict Date: Fri, 10 Sep 2021 14:57:28 +0200 Subject: [PATCH 10/20] rpi0-pitail.sh: set dns server --- rpi0w-pitail.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rpi0w-pitail.sh b/rpi0w-pitail.sh index 6cef8d1..7e9ba15 100755 --- a/rpi0w-pitail.sh +++ b/rpi0w-pitail.sh @@ -35,6 +35,8 @@ mirror=${mirror:-"http://http.kali.org/kali"} kaligit="https://gitlab.com/kalilinux" # Github raw url githubraw="https://raw.githubusercontent.com" +# dns server +nameserver=${nameserver:-"8.8.8.8"} # Check EUID=0 you can run any binary as root. if [[ $EUID -ne 0 ]]; then @@ -433,7 +435,7 @@ history -c EOF # Define DNS server after last running systemd-nspawn. -echo "nameserver 8.8.8.8" > ${work_dir}/etc/resolv.conf +echo "nameserver ${nameserver}" > ${work_dir}/etc/resolv.conf # Disable the use of http proxy in case it is enabled. if [ -n "$proxy_url" ]; then From dcb2cff93bae92e25249143b454ba5a90f356747 Mon Sep 17 00:00:00 2001 From: neuronaddict Date: Sun, 12 Sep 2021 21:05:51 +0200 Subject: [PATCH 11/20] rpi0w-nexmon-p4wnp1-aloa.sh: fix nameserver --- rpi0w-nexmon-p4wnp1-aloa.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpi0w-nexmon-p4wnp1-aloa.sh b/rpi0w-nexmon-p4wnp1-aloa.sh index 64169cc..d4a443a 100755 --- a/rpi0w-nexmon-p4wnp1-aloa.sh +++ b/rpi0w-nexmon-p4wnp1-aloa.sh @@ -561,7 +561,7 @@ mount ${bootp} ${basedir}/root/boot # We do this down here to get rid of the build system's resolv.conf after running through the build. cat << EOF > kali-${architecture}/etc/resolv.conf -nameserver 8.8.8.8 +nameserver ${nameserver} EOF # Because of the p4wnp1 script, we set the hostname down here, instead of using the machine name. From e3bce3c9cffc35bebccf1bee94182159ab97569a Mon Sep 17 00:00:00 2001 From: neuronaddict Date: Sun, 12 Sep 2021 23:59:15 +0200 Subject: [PATCH 12/20] rpi0w-nexmon-p4wnp1-aloa.sh: Install sudo before install P4wnP1. --- rpi0w-nexmon-p4wnp1-aloa.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rpi0w-nexmon-p4wnp1-aloa.sh b/rpi0w-nexmon-p4wnp1-aloa.sh index d4a443a..9510021 100755 --- a/rpi0w-nexmon-p4wnp1-aloa.sh +++ b/rpi0w-nexmon-p4wnp1-aloa.sh @@ -294,6 +294,8 @@ mkdir -p /boot echo "dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=$fstype elevator=deadline fsck.repair=yes rootwait" > /boot/cmdline.txt # Install P4wnP1 A.L.O.A. +# p4wnP1 install script need sudo +apt-get install --yes sudo cd /root/P4wnP1 make installkali From a6ad04c50619073024cb5cc8c1885b6e140b5844 Mon Sep 17 00:00:00 2001 From: neuronaddict Date: Mon, 13 Sep 2021 23:19:10 +0200 Subject: [PATCH 13/20] rpi0w-nexmon-p4wnp1-aloa.sh: move sudo on tools packages --- rpi0w-nexmon-p4wnp1-aloa.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/rpi0w-nexmon-p4wnp1-aloa.sh b/rpi0w-nexmon-p4wnp1-aloa.sh index 9510021..4579064 100755 --- a/rpi0w-nexmon-p4wnp1-aloa.sh +++ b/rpi0w-nexmon-p4wnp1-aloa.sh @@ -81,7 +81,7 @@ fi components="main,contrib,non-free" arm="fake-hwclock ntpdate u-boot-tools" tools="aircrack-ng crunch cewl dnsrecon dnsutils ethtool exploitdb hydra medusa metasploit-framework ncrack nmap passing-the-hash proxychains recon-ng sqlmap tcpdump theharvester tor tshark usbutils whois windows-binaries winexe wpscan" -base="apt-transport-https apt-utils console-setup e2fsprogs firmware-linux firmware-realtek firmware-atheros ifupdown initramfs-tools iw kali-defaults man-db mlocate netcat-traditional net-tools parted psmisc rfkill screen snmpd snmp tftp tmux unrar usbutils vim wget zerofree" +base="apt-transport-https apt-utils console-setup e2fsprogs firmware-linux firmware-realtek firmware-atheros ifupdown initramfs-tools iw kali-defaults man-db mlocate netcat-traditional net-tools parted psmisc rfkill screen snmpd snmp sudo tftp tmux unrar usbutils vim wget zerofree" services="apache2 atftpd openssh-server openvpn" # haveged: assure enough entropy data for hostapd on startup # avahi-daemon: allow mDNS resolution (apple bonjour) by remote hosts @@ -294,8 +294,6 @@ mkdir -p /boot echo "dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=$fstype elevator=deadline fsck.repair=yes rootwait" > /boot/cmdline.txt # Install P4wnP1 A.L.O.A. -# p4wnP1 install script need sudo -apt-get install --yes sudo cd /root/P4wnP1 make installkali From 6d8db50727e4d7549b89a4b29b5be49804738bde Mon Sep 17 00:00:00 2001 From: Steev Klimaszewski Date: Wed, 15 Sep 2021 14:58:27 -0500 Subject: [PATCH 14/20] rpi3-64: various fixes to the script --- rpi3-64-minimal.sh | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/rpi3-64-minimal.sh b/rpi3-64-minimal.sh index 94616aa..73b3dc0 100755 --- a/rpi3-64-minimal.sh +++ b/rpi3-64-minimal.sh @@ -12,7 +12,7 @@ hw_model=${hw_model:-"rpi4"} # Architecture architecture=${architecture:-"arm64"} # Variant name for image and dir build -variant=${variant:-"nexmon-${architecture}-lite"} +variant=${variant:-"nexmon-minimal-${architecture}"} # Desktop manager (xfce, gnome, i3, kde, lxde, mate, e17 or none) desktop=${desktop:-"none"} @@ -81,10 +81,6 @@ wget -qO /etc/apt/trusted.gpg.d/kali_pi-archive-keyring.gpg https://re4son-kerne eatmydata apt-get update eatmydata apt-get install -y kalipi-kernel kalipi-bootloader kalipi-re4son-firmware kalipi-kernel-headers firmware-raspberry kalipi-config kalipi-tft-config -# Regenerated the shared-mime-info database on the first boot -# since it fails to do so properly in a chroot. -systemctl enable smi-hack - # Copy script rpi-resizerootfs install -m755 /bsp/scripts/rpi-resizerootfs /usr/sbin/ @@ -107,10 +103,7 @@ cd /root apt download -o APT::Sandbox::User=root ca-certificates 2>/dev/null # Set a REGDOMAIN. This needs to be done or wireless doesn't work correctly on the RPi 3B+ -sed -i -e 's/REGDOM.*/REGDOMAIN=00/g' /etc/default/crda - -# Enable login over serial -echo "T0:23:respawn:/sbin/agetty -L ttyAMA0 115200 vt100" >> /etc/inittab +sed -i -e 's/REGDOM.*/REGDOMAIN=00/g' /etc/default/crda || true # Try and make the console a bit nicer # Set the terminus font for a bit nicer display. @@ -146,10 +139,10 @@ include clean_system echo "nameserver ${nameserver}" >"${work_dir}"/etc/resolv.conf # Disable the use of http proxy in case it is enabled. disable_proxy -# Mirror & suite replacement -restore_mirror # Reload sources.list #include sources.list +# Mirror & suite replacement +restore_mirror # systemd doesn't seem to be generating the fstab properly for some people, so let's create one. cat <"${work_dir}"/etc/fstab From a2cd18e5ff99d1f3c69c0d7c91697fbabb698a62 Mon Sep 17 00:00:00 2001 From: Steev Klimaszewski Date: Wed, 15 Sep 2021 16:57:00 -0500 Subject: [PATCH 15/20] *: Move to nameserver variable. This breaks the un-converted scripts but that gives more reason to move them to the new way over the coming days. --- banana-pi.sh | 2 +- banana-pro.sh | 4 ++-- beaglebone-black.sh | 6 ++---- chromebook-arm-exynos.sh | 6 ++---- chromebook-arm-nyan.sh | 6 ++---- chromebook-arm-veyron.sh | 6 ++---- cubieboard2.sh | 6 ++---- cubietruck.sh | 6 ++---- cubox-i4-pro.sh | 6 ++---- cubox.sh | 6 ++---- gateworks-newport.sh | 2 +- gateworks-ventana.sh | 4 ++-- mini-x.sh | 6 ++---- nanopc-t3.sh | 2 +- nanopi-neo-plus2-minimal.sh | 2 +- nanopi-neo-plus2.sh | 2 +- nanopi2.sh | 6 ++---- odroid-c.sh | 6 ++---- odroid-c2.sh | 2 +- odroid-u2.sh | 6 ++---- odroid-xu3.sh | 8 +++----- pinebook-pro.sh | 2 +- pinebook.sh | 2 +- riotboard.sh | 6 ++---- trimslice.sh | 6 ++---- usb-armory-mk1.sh | 6 ++---- usb-armory-mk2.sh | 4 ++-- utilite-pro.sh | 6 ++---- 28 files changed, 49 insertions(+), 83 deletions(-) diff --git a/banana-pi.sh b/banana-pi.sh index 22c48ff..0f386c8 100755 --- a/banana-pi.sh +++ b/banana-pi.sh @@ -126,7 +126,7 @@ set_locale "$locale" # Clean system include clean_system # Define DNS server after last running systemd-nspawn. -echo "nameserver 8.8.8.8" >"${work_dir}"/etc/resolv.conf +echo "nameserver ${nameserver}" >"${work_dir}"/etc/resolv.conf # Disable the use of http proxy in case it is enabled. disable_proxy # Mirror & suite replacement diff --git a/banana-pro.sh b/banana-pro.sh index 78e2312..f9c59f0 100755 --- a/banana-pro.sh +++ b/banana-pro.sh @@ -126,7 +126,7 @@ set_locale "$locale" # Clean system include clean_system # Define DNS server after last running systemd-nspawn. -echo "nameserver 8.8.8.8" >"${work_dir}"/etc/resolv.conf +echo "nameserver ${nameserver}" >"${work_dir}"/etc/resolv.conf # Disable the use of http proxy in case it is enabled. disable_proxy # Mirror & suite replacement @@ -187,4 +187,4 @@ include compress_img # Clean up all the temporary build stuff and remove the directories. # Comment this out to keep things around if you want to see what may have gone wrong. -clean_build \ No newline at end of file +clean_build diff --git a/beaglebone-black.sh b/beaglebone-black.sh index 8496054..3f64989 100755 --- a/beaglebone-black.sh +++ b/beaglebone-black.sh @@ -182,7 +182,7 @@ iface eth0 inet dhcp EOF # DNS server -echo "nameserver 8.8.8.8" > ${work_dir}/etc/resolv.conf +echo "nameserver ${nameserver}" >"${work_dir}"/etc/resolv.conf # Copy directory bsp into build dir. cp -rp bsp ${work_dir} @@ -485,9 +485,7 @@ mkdir -p "${basedir}"/root/boot mount ${bootp} "${basedir}"/root/boot # We do this down here to get rid of the build system's resolv.conf after running through the build. -cat << EOF > ${work_dir}/etc/resolv.conf -nameserver 8.8.8.8 -EOF +echo "nameserver ${nameserver}" >"${work_dir}"/etc/resolv.conf # Create an fstab so that we don't mount / read-only. UUID=$(blkid -s UUID -o value ${rootp}) diff --git a/chromebook-arm-exynos.sh b/chromebook-arm-exynos.sh index 745b8d4..14dde9f 100755 --- a/chromebook-arm-exynos.sh +++ b/chromebook-arm-exynos.sh @@ -179,7 +179,7 @@ iface lo inet loopback EOF # DNS server -echo "nameserver 8.8.8.8" > ${work_dir}/etc/resolv.conf +echo "nameserver ${nameserver}" >"${work_dir}"/etc/resolv.conf # Copy directory bsp into build dir. cp -rp bsp ${work_dir} @@ -684,9 +684,7 @@ mkdir -p "${basedir}"/root mount ${rootp} "${basedir}"/root # We do this down here to get rid of the build system's resolv.conf after running through the build. -cat << EOF > ${work_dir}/etc/resolv.conf -nameserver 8.8.8.8 -EOF +echo "nameserver ${nameserver}" >"${work_dir}"/etc/resolv.conf # Create an fstab so that we don't mount / read-only. UUID=$(blkid -s UUID -o value ${rootp}) diff --git a/chromebook-arm-nyan.sh b/chromebook-arm-nyan.sh index 8da8c8b..f13f461 100755 --- a/chromebook-arm-nyan.sh +++ b/chromebook-arm-nyan.sh @@ -180,7 +180,7 @@ iface lo inet loopback EOF # DNS server -echo "nameserver 8.8.8.8" > ${work_dir}/etc/resolv.conf +echo "nameserver ${nameserver}" >"${work_dir}"/etc/resolv.conf # Copy directory bsp into build dir. cp -rp bsp ${work_dir} @@ -590,9 +590,7 @@ mkdir -p "${basedir}"/root mount ${rootp} "${basedir}"/root # We do this down here to get rid of the build system's resolv.conf after running through the build. -cat << EOF > ${work_dir}/etc/resolv.conf -nameserver 8.8.8.8 -EOF +echo "nameserver ${nameserver}" >"${work_dir}"/etc/resolv.conf # Create an fstab so that we don't mount / read-only. UUID=$(blkid -s UUID -o value ${rootp}) diff --git a/chromebook-arm-veyron.sh b/chromebook-arm-veyron.sh index 5c4ccbf..9a0fc0f 100755 --- a/chromebook-arm-veyron.sh +++ b/chromebook-arm-veyron.sh @@ -184,7 +184,7 @@ iface eth0 inet dhcp EOF # DNS server -echo "nameserver 8.8.8.8" > ${work_dir}/etc/resolv.conf +echo "nameserver ${nameserver}" >"${work_dir}"/etc/resolv.conf # Copy directory bsp into build dir. cp -rp bsp ${work_dir} @@ -302,9 +302,7 @@ if [[ ! -z "${4}" || ! -z "${5}" ]]; then suite=${5} fi -cat << EOF > ${work_dir}/etc/resolv.conf -nameserver 8.8.8.8 -EOF +echo "nameserver ${nameserver}" >"${work_dir}"/etc/resolv.conf # Define sources.list cat << EOF > ${work_dir}/etc/apt/sources.list diff --git a/cubieboard2.sh b/cubieboard2.sh index 774e53f..5f21e01 100755 --- a/cubieboard2.sh +++ b/cubieboard2.sh @@ -182,7 +182,7 @@ iface eth0 inet dhcp EOF # DNS server -echo "nameserver 8.8.8.8" > ${work_dir}/etc/resolv.conf +echo "nameserver ${nameserver}" >"${work_dir}"/etc/resolv.conf # Copy directory bsp into build dir. cp -rp bsp ${work_dir} @@ -406,9 +406,7 @@ mkdir -p "${basedir}"/root/boot mount ${bootp} "${basedir}"/root/boot # We do this down here to get rid of the build system's resolv.conf after running through the build. -cat << EOF > ${work_dir}/etc/resolv.conf -nameserver 8.8.8.8 -EOF +echo "nameserver ${nameserver}" >"${work_dir}"/etc/resolv.conf # Create an fstab so that we don't mount / read-only. UUID=$(blkid -s UUID -o value ${rootp}) diff --git a/cubietruck.sh b/cubietruck.sh index bfbb1fc..b5fee6f 100755 --- a/cubietruck.sh +++ b/cubietruck.sh @@ -182,7 +182,7 @@ iface eth0 inet dhcp EOF # DNS server -echo "nameserver 8.8.8.8" > ${work_dir}/etc/resolv.conf +echo "nameserver ${nameserver}" >"${work_dir}"/etc/resolv.conf # Copy directory bsp into build dir. cp -rp bsp ${work_dir} @@ -406,9 +406,7 @@ mkdir -p "${basedir}"/root/boot mount ${bootp} "${basedir}"/root/boot # We do this down here to get rid of the build system's resolv.conf after running through the build. -cat << EOF > ${work_dir}/etc/resolv.conf -nameserver 8.8.8.8 -EOF +echo "nameserver ${nameserver}" >"${work_dir}"/etc/resolv.conf # Create an fstab so that we don't mount / read-only. UUID=$(blkid -s UUID -o value ${rootp}) diff --git a/cubox-i4-pro.sh b/cubox-i4-pro.sh index 2713019..a3a9127 100755 --- a/cubox-i4-pro.sh +++ b/cubox-i4-pro.sh @@ -184,7 +184,7 @@ iface eth0 inet dhcp EOF # DNS server -echo "nameserver 8.8.8.8" > ${work_dir}/etc/resolv.conf +echo "nameserver ${nameserver}" >"${work_dir}"/etc/resolv.conf # Copy directory bsp into build dir. cp -rp bsp ${work_dir} @@ -366,9 +366,7 @@ mkdir -p "${basedir}"/root mount ${rootp} "${basedir}"/root # We do this down here to get rid of the build system's resolv.conf after running through the build. -cat << EOF > ${work_dir}/etc/resolv.conf -nameserver 8.8.8.8 -EOF +echo "nameserver ${nameserver}" >"${work_dir}"/etc/resolv.conf # Create an fstab so that we don't mount / read-only. UUID=$(blkid -s UUID -o value ${rootp}) diff --git a/cubox.sh b/cubox.sh index 3e61dc4..006732e 100755 --- a/cubox.sh +++ b/cubox.sh @@ -184,7 +184,7 @@ iface eth0 inet dhcp EOF # DNS server -echo "nameserver 8.8.8.8" > ${work_dir}/etc/resolv.conf +echo "nameserver ${nameserver}" >"${work_dir}"/etc/resolv.conf # Copy directory bsp into build dir. cp -rp bsp ${work_dir} @@ -421,9 +421,7 @@ mkdir -p "${basedir}"/root mount ${rootp} "${basedir}"/root # We do this down here to get rid of the build system's resolv.conf after running through the build. -cat << EOF > ${work_dir}/etc/resolv.conf -nameserver 8.8.8.8 -EOF +echo "nameserver ${nameserver}" >"${work_dir}"/etc/resolv.conf # Create an fstab so that we don't mount / read-only. UUID=$(blkid -s UUID -o value ${rootp}) diff --git a/gateworks-newport.sh b/gateworks-newport.sh index eb4dca8..1aa8b1a 100755 --- a/gateworks-newport.sh +++ b/gateworks-newport.sh @@ -119,7 +119,7 @@ set_locale "$locale" # Clean system include clean_system # Define DNS server after last running systemd-nspawn. -echo "nameserver 8.8.8.8" >"${work_dir}"/etc/resolv.conf +echo "nameserver ${nameserver}" >"${work_dir}"/etc/resolv.conf # Disable the use of http proxy in case it is enabled. disable_proxy # Mirror & suite replacement diff --git a/gateworks-ventana.sh b/gateworks-ventana.sh index f20ca50..5a8a255 100755 --- a/gateworks-ventana.sh +++ b/gateworks-ventana.sh @@ -118,7 +118,7 @@ set_locale "$locale" # Clean system include clean_system # Define DNS server after last running systemd-nspawn. -echo "nameserver 8.8.8.8" >"${work_dir}"/etc/resolv.conf +echo "nameserver ${nameserver}" >"${work_dir}"/etc/resolv.conf # Disable the use of http proxy in case it is enabled. disable_proxy # Mirror & suite replacement @@ -244,4 +244,4 @@ include compress_img # Clean up all the temporary build stuff and remove the directories. # Comment this out to keep things around if you want to see what may have gone wrong. -clean_build \ No newline at end of file +clean_build diff --git a/mini-x.sh b/mini-x.sh index bde0d84..603b625 100755 --- a/mini-x.sh +++ b/mini-x.sh @@ -182,7 +182,7 @@ iface eth0 inet dhcp EOF # DNS server -echo "nameserver 8.8.8.8" > ${work_dir}/etc/resolv.conf +echo "nameserver ${nameserver}" >"${work_dir}"/etc/resolv.conf # Copy directory bsp into build dir. cp -rp bsp ${work_dir} @@ -357,9 +357,7 @@ mkdir -p "${basedir}"/root mount ${rootp} "${basedir}"/root # We do this down here to get rid of the build system's resolv.conf after running through the build. -cat << EOF > ${work_dir}/etc/resolv.conf -nameserver 8.8.8.8 -EOF +echo "nameserver ${nameserver}" >"${work_dir}"/etc/resolv.conf # Create an fstab so that we don't mount / read-only. UUID=$(blkid -s UUID -o value ${rootp}) diff --git a/nanopc-t3.sh b/nanopc-t3.sh index 44a5dbd..85a796a 100755 --- a/nanopc-t3.sh +++ b/nanopc-t3.sh @@ -119,7 +119,7 @@ set_locale "$locale" # Clean system include clean_system # Define DNS server after last running systemd-nspawn. -echo "nameserver 8.8.8.8" >"${work_dir}"/etc/resolv.conf +echo "nameserver ${nameserver}" >"${work_dir}"/etc/resolv.conf # Disable the use of http proxy in case it is enabled. disable_proxy # Mirror & suite replacement diff --git a/nanopi-neo-plus2-minimal.sh b/nanopi-neo-plus2-minimal.sh index a8716aa..9f09b8b 100755 --- a/nanopi-neo-plus2-minimal.sh +++ b/nanopi-neo-plus2-minimal.sh @@ -190,7 +190,7 @@ set_locale "$locale" # Clean system include clean_system # Define DNS server after last running systemd-nspawn. -echo "nameserver 8.8.8.8" >"${work_dir}"/etc/resolv.conf +echo "nameserver ${nameserver}" >"${work_dir}"/etc/resolv.conf # Disable the use of http proxy in case it is enabled. disable_proxy # Mirror & suite replacement diff --git a/nanopi-neo-plus2.sh b/nanopi-neo-plus2.sh index 1953fb0..253cc80 100755 --- a/nanopi-neo-plus2.sh +++ b/nanopi-neo-plus2.sh @@ -204,7 +204,7 @@ set_locale "$locale" # Clean system include clean_system # Define DNS server after last running systemd-nspawn. -echo "nameserver 8.8.8.8" >"${work_dir}"/etc/resolv.conf +echo "nameserver ${nameserver}" >"${work_dir}"/etc/resolv.conf # Disable the use of http proxy in case it is enabled. disable_proxy # Mirror & suite replacement diff --git a/nanopi2.sh b/nanopi2.sh index 602e995..76d1e81 100755 --- a/nanopi2.sh +++ b/nanopi2.sh @@ -191,7 +191,7 @@ alias net-pf-10 off EOF # DNS server -echo "nameserver 8.8.8.8" > ${work_dir}/etc/resolv.conf +echo "nameserver ${nameserver}" >"${work_dir}"/etc/resolv.conf # Copy directory bsp into build dir. cp -rp bsp ${work_dir} @@ -462,9 +462,7 @@ mkdir -p "${basedir}"/root/boot mount ${bootp} "${basedir}"/root/boot # We do this down here to get rid of the build system's resolv.conf after running through the build. -cat << EOF > ${work_dir}/etc/resolv.conf -nameserver 8.8.8.8 -EOF +echo "nameserver ${nameserver}" >"${work_dir}"/etc/resolv.conf # Create an fstab so that we don't mount / read-only. UUID=$(blkid -s UUID -o value ${rootp}) diff --git a/odroid-c.sh b/odroid-c.sh index a8db89d..8225af6 100755 --- a/odroid-c.sh +++ b/odroid-c.sh @@ -185,7 +185,7 @@ iface eth0 inet dhcp EOF # DNS server -echo "nameserver 8.8.8.8" > ${work_dir}/etc/resolv.conf +echo "nameserver ${nameserver}" >"${work_dir}"/etc/resolv.conf # Copy directory bsp into build dir. cp -rp bsp ${work_dir} @@ -605,9 +605,7 @@ mkdir -p "${basedir}"/root/boot mount ${bootp} "${basedir}"/root/boot # We do this down here to get rid of the build system's resolv.conf after running through the build. -cat << EOF > ${work_dir}/etc/resolv.conf -nameserver 8.8.8.8 -EOF +echo "nameserver ${nameserver}" >"${work_dir}"/etc/resolv.conf # Create an fstab so that we don't mount / read-only. UUID=$(blkid -s UUID -o value ${rootp}) diff --git a/odroid-c2.sh b/odroid-c2.sh index b5d8bcd..41679bd 100755 --- a/odroid-c2.sh +++ b/odroid-c2.sh @@ -131,7 +131,7 @@ set_locale "$locale" # Clean system include clean_system # Define DNS server after last running systemd-nspawn. -echo "nameserver 8.8.8.8" >"${work_dir}"/etc/resolv.conf +echo "nameserver ${nameserver}" >"${work_dir}"/etc/resolv.conf # Disable the use of http proxy in case it is enabled. disable_proxy # Mirror & suite replacement diff --git a/odroid-u2.sh b/odroid-u2.sh index e9f7e6a..9811be5 100755 --- a/odroid-u2.sh +++ b/odroid-u2.sh @@ -185,7 +185,7 @@ iface eth0 inet dhcp EOF # DNS server -echo "nameserver 8.8.8.8" > ${work_dir}/etc/resolv.conf +echo "nameserver ${nameserver}" >"${work_dir}"/etc/resolv.conf # Copy directory bsp into build dir. cp -rp bsp ${work_dir} @@ -451,9 +451,7 @@ mkdir -p "${basedir}"/root/boot mount ${bootp} "${basedir}"/root/boot # We do this down here to get rid of the build system's resolv.conf after running through the build. -cat << EOF > ${work_dir}/etc/resolv.conf -nameserver 8.8.8.8 -EOF +echo "nameserver ${nameserver}" >"${work_dir}"/etc/resolv.conf echo "Rsyncing rootfs into image file" rsync -HPavz -q ${work_dir}/ ${basedir}/root/ diff --git a/odroid-xu3.sh b/odroid-xu3.sh index e6b44cd..b42b1af 100755 --- a/odroid-xu3.sh +++ b/odroid-xu3.sh @@ -136,7 +136,7 @@ set_locale "$locale" # Clean system include clean_system # Define DNS server after last running systemd-nspawn. -echo "nameserver 8.8.8.8" >"${work_dir}"/etc/resolv.conf +echo "nameserver ${nameserver}" >"${work_dir}"/etc/resolv.conf # Disable the use of http proxy in case it is enabled. disable_proxy # Mirror & suite replacement @@ -264,9 +264,7 @@ mkdir -p "${basedir}"/root/boot mount "${bootp}" "${basedir}"/root/boot # We do this down here to get rid of the build system's resolv.conf after running through the build. -cat << EOF > ${work_dir}/etc/resolv.conf -nameserver 8.8.8.8 -EOF +echo "nameserver ${nameserver}" >"${work_dir}"/etc/resolv.conf # Create an fstab so that we don't mount / read-only. UUID=$(blkid -s UUID -o value ${rootp}) @@ -302,4 +300,4 @@ include compress_img # Clean up all the temporary build stuff and remove the directories. # Comment this out to keep things around if you want to see what may have gone wrong. -clean_build \ No newline at end of file +clean_build diff --git a/pinebook-pro.sh b/pinebook-pro.sh index bf0eba1..eacc9d1 100755 --- a/pinebook-pro.sh +++ b/pinebook-pro.sh @@ -128,7 +128,7 @@ set_locale "$locale" # Clean system include clean_system # Define DNS server after last running systemd-nspawn. -echo "nameserver 8.8.8.8" >"${work_dir}"/etc/resolv.conf +echo "nameserver ${nameserver}" >"${work_dir}"/etc/resolv.conf # Disable the use of http proxy in case it is enabled. disable_proxy # Mirror & suite replacement diff --git a/pinebook.sh b/pinebook.sh index f05cc42..90201d7 100755 --- a/pinebook.sh +++ b/pinebook.sh @@ -195,7 +195,7 @@ set_locale "$locale" # Clean system include clean_system # Define DNS server after last running systemd-nspawn. -echo "nameserver 8.8.8.8" >"${work_dir}"/etc/resolv.conf +echo "nameserver ${nameserver}" >"${work_dir}"/etc/resolv.conf # Disable the use of http proxy in case it is enabled. disable_proxy # Mirror & suite replacement diff --git a/riotboard.sh b/riotboard.sh index 4ba0640..5f87389 100755 --- a/riotboard.sh +++ b/riotboard.sh @@ -188,7 +188,7 @@ iface eth0 inet dhcp EOF # DNS server -echo "nameserver 8.8.8.8" > ${work_dir}/etc/resolv.conf +echo "nameserver ${nameserver}" >"${work_dir}"/etc/resolv.conf # Copy directory bsp into build dir. cp -rp bsp ${work_dir} @@ -433,9 +433,7 @@ mkdir -p "${basedir}"/root/boot mount ${bootp} "${basedir}"/root/boot # We do this down here to get rid of the build system's resolv.conf after running through the build. -cat << EOF > ${work_dir}/etc/resolv.conf -nameserver 8.8.8.8 -EOF +echo "nameserver ${nameserver}" >"${work_dir}"/etc/resolv.conf # Create an fstab so that we don't mount / read-only. UUID=$(blkid -s UUID -o value ${rootp}) diff --git a/trimslice.sh b/trimslice.sh index bc13df4..51665a4 100755 --- a/trimslice.sh +++ b/trimslice.sh @@ -185,7 +185,7 @@ iface eth0 inet dhcp EOF # DNS server -echo "nameserver 8.8.8.8" > ${work_dir}/etc/resolv.conf +echo "nameserver ${nameserver}" >"${work_dir}"/etc/resolv.conf # Copy directory bsp into build dir. cp -rp bsp ${work_dir} @@ -404,9 +404,7 @@ mkdir -p "${basedir}"/root/boot mount ${bootp} "${basedir}"/root/boot # We do this down here to get rid of the build system's resolv.conf after running through the build. -cat << EOF > ${work_dir}/etc/resolv.conf -nameserver 8.8.8.8 -EOF +echo "nameserver ${nameserver}" >"${work_dir}"/etc/resolv.conf # Create an fstab so that we don't mount / read-only. UUID=$(blkid -s UUID -o value ${rootp}) diff --git a/usb-armory-mk1.sh b/usb-armory-mk1.sh index 85d5ebb..e9fcb02 100755 --- a/usb-armory-mk1.sh +++ b/usb-armory-mk1.sh @@ -182,7 +182,7 @@ iface eth0 inet dhcp EOF # DNS server -echo "nameserver 8.8.8.8" > ${work_dir}/etc/resolv.conf +echo "nameserver ${nameserver}" >"${work_dir}"/etc/resolv.conf # Copy directory bsp into build dir. cp -rp bsp ${work_dir} @@ -536,9 +536,7 @@ mkdir -p "${basedir}"/root mount ${rootp} "${basedir}"/root # We do this down here to get rid of the build system's resolv.conf after running through the build. -cat << EOF > ${work_dir}/etc/resolv.conf -nameserver 8.8.8.8 -EOF +echo "nameserver ${nameserver}" >"${work_dir}"/etc/resolv.conf # Create an fstab so that we don't mount / read-only. UUID=$(blkid -s UUID -o value ${rootp}) diff --git a/usb-armory-mk2.sh b/usb-armory-mk2.sh index 2cc9227..0000c72 100755 --- a/usb-armory-mk2.sh +++ b/usb-armory-mk2.sh @@ -161,7 +161,7 @@ set_locale "$locale" # Clean system include clean_system # Define DNS server after last running systemd-nspawn. -echo "nameserver 8.8.8.8" >"${work_dir}"/etc/resolv.conf +echo "nameserver ${nameserver}" >"${work_dir}"/etc/resolv.conf # Disable the use of http proxy in case it is enabled. disable_proxy # Mirror & suite replacement @@ -261,4 +261,4 @@ include compress_img # Clean up all the temporary build stuff and remove the directories. # Comment this out to keep things around if you want to see what may have gone wrong. -clean_build \ No newline at end of file +clean_build diff --git a/utilite-pro.sh b/utilite-pro.sh index 4095592..69244fa 100755 --- a/utilite-pro.sh +++ b/utilite-pro.sh @@ -186,7 +186,7 @@ iface eth0 inet dhcp EOF # DNS server -echo "nameserver 8.8.8.8" > ${work_dir}/etc/resolv.conf +echo "nameserver ${nameserver}" >"${work_dir}"/etc/resolv.conf # Copy directory bsp into build dir. cp -rp bsp ${work_dir} @@ -447,9 +447,7 @@ mkdir -p "${basedir}"/root/boot mount ${bootp} "${basedir}"/root/boot # We do this down here to get rid of the build system's resolv.conf after running through the build. -cat << EOF > ${work_dir}/etc/resolv.conf -nameserver 8.8.8.8 -EOF +echo "nameserver ${nameserver}" >"${work_dir}"/etc/resolv.conf # Create an fstab so that we don't mount / read-only. UUID=$(blkid -s UUID -o value ${rootp}) From 0866498fea79ccf13474d30b42aa6e41e6b532cf Mon Sep 17 00:00:00 2001 From: Steev Klimaszewski Date: Thu, 16 Sep 2021 14:01:29 -0500 Subject: [PATCH 16/20] rpi3: Attempt to flush the buffers and bytes Lets see if adding the flushing of buffers and bytes assists in getting the build server to not have issues with cleanups. --- rpi3-nexmon.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rpi3-nexmon.sh b/rpi3-nexmon.sh index c97833f..129310f 100755 --- a/rpi3-nexmon.sh +++ b/rpi3-nexmon.sh @@ -187,6 +187,10 @@ rsync -HPavz -q --exclude boot "${work_dir}"/ "${basedir}"/root/ rsync -rtx -q "${work_dir}"/boot "${basedir}"/root sync +# Flush buffers and bytes - this is nicked from the Devuan arm-sdk. +blockdev --flushbufs "${loopdevice}" +python -c 'import os; os.fsync(open("'${loopdevice}'", "r+b"))' + # Umount filesystem umount -l "${bootp}" umount -l "${rootp}" From b93bcc5007e9fadf0df683dc4c6020fb96274e04 Mon Sep 17 00:00:00 2001 From: Steev Klimaszewski Date: Fri, 17 Sep 2021 09:46:40 -0500 Subject: [PATCH 17/20] all: Add buffer and byte flushing --- banana-pi.sh | 7 +++++-- banana-pro.sh | 7 +++++-- gateworks-newport.sh | 7 +++++-- gateworks-ventana.sh | 5 ++++- nanopc-t3.sh | 4 ++++ nanopi-neo-plus2-minimal.sh | 4 ++++ nanopi-neo-plus2.sh | 4 ++++ odroid-c2.sh | 4 ++++ odroid-xu3.sh | 4 ++++ pinebook-pro.sh | 4 ++++ pinebook.sh | 4 ++++ rpi0w-nexmon-p4wnp1-aloa.sh | 4 ++++ rpi0w-nexmon.sh | 6 +++++- rpi0w-pitail.sh | 4 ++++ rpi1.sh | 4 ++++ rpi3-64-minimal.sh | 4 ++++ rpi3-64.sh | 4 ++++ usb-armory-mk2.sh | 5 +++++ 18 files changed, 77 insertions(+), 8 deletions(-) diff --git a/banana-pi.sh b/banana-pi.sh index 0f386c8..6abce19 100755 --- a/banana-pi.sh +++ b/banana-pi.sh @@ -182,9 +182,12 @@ echo "UUID=$UUID / $fstype errors=remount-ro 0 1" >> ${wo echo "Rsyncing rootfs to image file" rsync -HPavz -q ${work_dir}/ ${basedir}/root/ +# Flush buffers and bytes - this is nicked from the Devuan arm-sdk. +blockdev --flushbufs "${loopdevice}" +python -c 'import os; os.fsync(open("'${loopdevice}'", "r+b"))' + # Unmount partitions -sync -umount ${rootp} +umount -l ${rootp} dd if=${work_dir}/usr/lib/u-boot/Bananapi/u-boot-sunxi-with-spl.bin of=${loopdevice} bs=1024 seek=8 diff --git a/banana-pro.sh b/banana-pro.sh index f9c59f0..98e62a1 100755 --- a/banana-pro.sh +++ b/banana-pro.sh @@ -170,9 +170,12 @@ mount ${rootp} "${basedir}"/root echo "Rsyncing rootfs to image file" rsync -HPavz -q ${work_dir}/ ${basedir}/root/ +# Flush buffers and bytes - this is nicked from the Devuan arm-sdk. +blockdev --flushbufs "${loopdevice}" +python -c 'import os; os.fsync(open("'${loopdevice}'", "r+b"))' + # Unmount partitions -sync -umount ${rootp} +umount -l ${rootp} dd if=${work_dir}/usr/lib/u-boot/Bananapro/u-boot-sunxi-with-spl.bin of=${loopdevice} bs=1024 seek=8 diff --git a/gateworks-newport.sh b/gateworks-newport.sh index 1aa8b1a..5cf70b5 100755 --- a/gateworks-newport.sh +++ b/gateworks-newport.sh @@ -212,9 +212,12 @@ echo "UUID=$UUID / $fstype errors=remount-ro 0 1" >> ${wo echo "Rsyncing rootfs into image file" rsync -HPavz -q ${work_dir}/ ${basedir}/root/ +# Flush buffers and bytes - this is nicked from the Devuan arm-sdk. +blockdev --flushbufs "${loopdevice}" +python -c 'import os; os.fsync(open("'${loopdevice}'", "r+b"))' + # Unmount partitions -sync -umount ${rootp} +umount -l ${rootp} kpartx -dv ${loopdevice} losetup -d ${loopdevice} diff --git a/gateworks-ventana.sh b/gateworks-ventana.sh index 5a8a255..fff5d7b 100755 --- a/gateworks-ventana.sh +++ b/gateworks-ventana.sh @@ -227,7 +227,10 @@ EOF log "Rsyncing rootfs into image file" green rsync -HPavz -q "${work_dir}"/ "${basedir}"/root/ -sync + +# Flush buffers and bytes - this is nicked from the Devuan arm-sdk. +blockdev --flushbufs "${loopdevice}" +python -c 'import os; os.fsync(open("'${loopdevice}'", "r+b"))' # Umount filesystem umount -l "${rootp}" diff --git a/nanopc-t3.sh b/nanopc-t3.sh index 85a796a..aa64764 100755 --- a/nanopc-t3.sh +++ b/nanopc-t3.sh @@ -257,6 +257,10 @@ sync cd ${current_dir} +# Flush buffers and bytes - this is nicked from the Devuan arm-sdk. +blockdev --flushbufs "${loopdevice}" +python -c 'import os; os.fsync(open("'${loopdevice}'", "r+b"))' + # Umount filesystem umount -l "${rootp}" diff --git a/nanopi-neo-plus2-minimal.sh b/nanopi-neo-plus2-minimal.sh index 9f09b8b..a6471db 100755 --- a/nanopi-neo-plus2-minimal.sh +++ b/nanopi-neo-plus2-minimal.sh @@ -356,6 +356,10 @@ sync cd ${current_dir} +# Flush buffers and bytes - this is nicked from the Devuan arm-sdk. +blockdev --flushbufs "${loopdevice}" +python -c 'import os; os.fsync(open("'${loopdevice}'", "r+b"))' + # Umount filesystem umount -l "${rootp}" diff --git a/nanopi-neo-plus2.sh b/nanopi-neo-plus2.sh index 253cc80..c7c5520 100755 --- a/nanopi-neo-plus2.sh +++ b/nanopi-neo-plus2.sh @@ -370,6 +370,10 @@ sync cd ${current_dir} +# Flush buffers and bytes - this is nicked from the Devuan arm-sdk. +blockdev --flushbufs "${loopdevice}" +python -c 'import os; os.fsync(open("'${loopdevice}'", "r+b"))' + # Umount filesystem umount -l "${rootp}" diff --git a/odroid-c2.sh b/odroid-c2.sh index 41679bd..e9f72f2 100755 --- a/odroid-c2.sh +++ b/odroid-c2.sh @@ -263,6 +263,10 @@ sync cd ${current_dir} +# Flush buffers and bytes - this is nicked from the Devuan arm-sdk. +blockdev --flushbufs "${loopdevice}" +python -c 'import os; os.fsync(open("'${loopdevice}'", "r+b"))' + # Umount filesystem umount -l "${rootp}" diff --git a/odroid-xu3.sh b/odroid-xu3.sh index b42b1af..f7f5e31 100755 --- a/odroid-xu3.sh +++ b/odroid-xu3.sh @@ -285,6 +285,10 @@ sh sd_fusing.sh ${loopdevice} cd ${current_dir} +# Flush buffers and bytes - this is nicked from the Devuan arm-sdk. +blockdev --flushbufs "${loopdevice}" +python -c 'import os; os.fsync(open("'${loopdevice}'", "r+b"))' + # Umount filesystem umount -l "${rootp}" diff --git a/pinebook-pro.sh b/pinebook-pro.sh index eacc9d1..ad4b39b 100755 --- a/pinebook-pro.sh +++ b/pinebook-pro.sh @@ -312,6 +312,10 @@ dd if=${current_dir}/bsp/bootloader/pinebook-pro/trust.img of=${loopdevice} seek #TARGET="/usr/lib/u-boot/pinebook-pro-rk3399" /usr/bin/u-boot-install-rockchip ${loopdevice} +# Flush buffers and bytes - this is nicked from the Devuan arm-sdk. +blockdev --flushbufs "${loopdevice}" +python -c 'import os; os.fsync(open("'${loopdevice}'", "r+b"))' + # Umount filesystem umount -l "${rootp}" diff --git a/pinebook.sh b/pinebook.sh index 90201d7..3aeded3 100755 --- a/pinebook.sh +++ b/pinebook.sh @@ -268,6 +268,10 @@ sync cd ${current_dir} +# Flush buffers and bytes - this is nicked from the Devuan arm-sdk. +blockdev --flushbufs "${loopdevice}" +python -c 'import os; os.fsync(open("'${loopdevice}'", "r+b"))' + # Umount filesystem umount -l "${rootp}" diff --git a/rpi0w-nexmon-p4wnp1-aloa.sh b/rpi0w-nexmon-p4wnp1-aloa.sh index 4579064..03568ca 100755 --- a/rpi0w-nexmon-p4wnp1-aloa.sh +++ b/rpi0w-nexmon-p4wnp1-aloa.sh @@ -583,6 +583,10 @@ rsync -HPavz -q --exclude boot ${work_dir}/ ${basedir}/root/ rsync -rtx -q ${work_dir}/boot ${basedir}/root sync +# Flush buffers and bytes - this is nicked from the Devuan arm-sdk. +blockdev --flushbufs "${loopdevice}" +python -c 'import os; os.fsync(open("'${loopdevice}'", "r+b"))' + # Unmount partitions umount ${bootp} umount ${rootp} diff --git a/rpi0w-nexmon.sh b/rpi0w-nexmon.sh index a839f52..b1aaf0f 100755 --- a/rpi0w-nexmon.sh +++ b/rpi0w-nexmon.sh @@ -75,7 +75,7 @@ install -m755 /bsp/scripts/monstop /usr/bin/ echo "deb http://http.re4son-kernel.com/re4son kali-pi main" > /etc/apt/sources.list.d/re4son.list wget -qO /etc/apt/trusted.gpg.d/kali_pi-archive-keyring.gpg https://re4son-kernel.com/keys/http/kali_pi-archive-keyring.gpg eatmydata apt-get update -eatmydata apt-get install -y kalipi-kernel kalipi-bootloader kalipi-re4son-firmware kalipi-kernel-headers kalipi-config kalipi-tft-config firmware-raspberry +eatmydata apt-get install -y kalipi-kernel kalipi-bootloader kalipi-re4son-firmware kalipi-kernel-headers kalipi-config kalipi-tft-config firmware-raspberry pi-bluetooth # Copy script rpi-resizerootfs install -m755 /bsp/scripts/rpi-resizerootfs /usr/sbin/ @@ -188,6 +188,10 @@ rsync -HPavz -q --exclude boot "${work_dir}"/ "${basedir}"/root/ rsync -rtx -q "${work_dir}"/boot "${basedir}"/root sync +# Flush buffers and bytes - this is nicked from the Devuan arm-sdk. +blockdev --flushbufs "${loopdevice}" +python -c 'import os; os.fsync(open("'${loopdevice}'", "r+b"))' + # Umount filesystem umount -l "${bootp}" umount -l "${rootp}" diff --git a/rpi0w-pitail.sh b/rpi0w-pitail.sh index 7e9ba15..bf63524 100755 --- a/rpi0w-pitail.sh +++ b/rpi0w-pitail.sh @@ -521,6 +521,10 @@ rsync -HPavz -q --exclude boot ${work_dir}/ ${basedir}/root/ rsync -rtx -q ${work_dir}/boot ${basedir}/root sync +# Flush buffers and bytes - this is nicked from the Devuan arm-sdk. +blockdev --flushbufs "${loopdevice}" +python -c 'import os; os.fsync(open("'${loopdevice}'", "r+b"))' + # Unmount partitions umount -l ${bootp} umount -l ${rootp} diff --git a/rpi1.sh b/rpi1.sh index e37e027..364cdd9 100755 --- a/rpi1.sh +++ b/rpi1.sh @@ -186,6 +186,10 @@ rsync -HPavz -q --exclude boot "${work_dir}"/ "${basedir}"/root/ rsync -rtx -q "${work_dir}"/boot "${basedir}"/root sync +# Flush buffers and bytes - this is nicked from the Devuan arm-sdk. +blockdev --flushbufs "${loopdevice}" +python -c 'import os; os.fsync(open("'${loopdevice}'", "r+b"))' + # Umount filesystem umount -l "${bootp}" umount -l "${rootp}" diff --git a/rpi3-64-minimal.sh b/rpi3-64-minimal.sh index 73b3dc0..a572d8e 100755 --- a/rpi3-64-minimal.sh +++ b/rpi3-64-minimal.sh @@ -186,6 +186,10 @@ rsync -HPavz -q --exclude boot "${work_dir}"/ "${basedir}"/root/ rsync -rtx -q "${work_dir}"/boot "${basedir}"/root sync +# Flush buffers and bytes - this is nicked from the Devuan arm-sdk. +blockdev --flushbufs "${loopdevice}" +python -c 'import os; os.fsync(open("'${loopdevice}'", "r+b"))' + # Umount filesystem umount -l "${bootp}" umount -l "${rootp}" diff --git a/rpi3-64.sh b/rpi3-64.sh index d3b03d2..7c6057f 100755 --- a/rpi3-64.sh +++ b/rpi3-64.sh @@ -187,6 +187,10 @@ rsync -HPavz -q --exclude boot "${work_dir}"/ "${basedir}"/root/ rsync -rtx -q "${work_dir}"/boot "${basedir}"/root sync +# Flush buffers and bytes - this is nicked from the Devuan arm-sdk. +blockdev --flushbufs "${loopdevice}" +python -c 'import os; os.fsync(open("'${loopdevice}'", "r+b"))' + # Umount filesystem umount -l "${bootp}" umount -l "${rootp}" diff --git a/usb-armory-mk2.sh b/usb-armory-mk2.sh index 0000c72..4b28d4a 100755 --- a/usb-armory-mk2.sh +++ b/usb-armory-mk2.sh @@ -247,6 +247,11 @@ make ARCH=arm dd if=u-boot.imx of=${loopdevice} bs=512 seek=2 conv=fsync cd "${current_dir}" + +# Flush buffers and bytes - this is nicked from the Devuan arm-sdk. +blockdev --flushbufs "${loopdevice}" +python -c 'import os; os.fsync(open("'${loopdevice}'", "r+b"))' + # Umount filesystem umount -l "${rootp}" From 9f9cbb6098d6847351716c3e2c1b828534dd6cb1 Mon Sep 17 00:00:00 2001 From: D Date: Fri, 17 Sep 2021 03:52:54 +0000 Subject: [PATCH 18/20] Fixed ext3load to newer ext4load. --- bsp/bootloader/gateworks-ventana/6x_bootscript-ventana.script | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bsp/bootloader/gateworks-ventana/6x_bootscript-ventana.script b/bsp/bootloader/gateworks-ventana/6x_bootscript-ventana.script index 6c38980..0dc3be6 100644 --- a/bsp/bootloader/gateworks-ventana/6x_bootscript-ventana.script +++ b/bsp/bootloader/gateworks-ventana/6x_bootscript-ventana.script @@ -140,11 +140,11 @@ elif itest.s "x${dtype}" == "xmmc" ; then elif itest.s "x${dtype}" == "xusb" ; then echo "Booting from USB Mass Storage..." setenv root "root=/dev/sda1 rootwait" - setenv fsload "ext3load $dtype 0:1" + setenv fsload "ext4load $dtype 0:1" elif itest.s "x${dtype}" == "xsata" ; then echo "Booting from SATA..." setenv root "root=/dev/sda1 rootwait" - setenv fsload "ext3load $dtype 0:1" + setenv fsload "ext4load $dtype 0:1" setenv rd_addr # ramdisk not needed for IMX6 AHCI SATA fi From 78f8c484b4d77aefc3ed003f2af29202639b27ca Mon Sep 17 00:00:00 2001 From: Steev Klimaszewski Date: Fri, 17 Sep 2021 10:33:21 -0500 Subject: [PATCH 19/20] builder.txt: Move it to def and add to gitignore. Let's make the builder.txt be something users can modify without having issues with the git repo complaining about changes locally. Users can cp it to builder.txt and make modifications, or just echo whatever they want to override into it. This also means if it doesn't exist by default, we don't source it, instead of sourcing it like we currently do, even when it's all commented out. --- .gitignore | 1 + builder.txt | 5 ----- builder.txt.def | 56 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+), 5 deletions(-) delete mode 100644 builder.txt create mode 100644 builder.txt.def diff --git a/.gitignore b/.gitignore index b3c668c..ae771a9 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ kali-armhf/ .DS_Store *.img.xz +builder.txt diff --git a/builder.txt b/builder.txt deleted file mode 100644 index 785bfb9..0000000 --- a/builder.txt +++ /dev/null @@ -1,5 +0,0 @@ -#mirror="http://kali.download/kali" -#replace_mirror="http://http.kali.org/kali" -#suite="kali-last-snapshot" -#replace_suite="kali-rolling" -#imagename="kali-linux-nightly-${hw_model}-${variant}-$(date +%F)" diff --git a/builder.txt.def b/builder.txt.def new file mode 100644 index 0000000..db1d5c8 --- /dev/null +++ b/builder.txt.def @@ -0,0 +1,56 @@ +# Version Kali release +#version=${version:-$(cat .release)} + +# Custom hostname variable +#hostname=kali + +# Choose a locale +#locale="en_US.UTF-8" + +# Free space added to the rootfs in MiB +#free_space="300" + +# /boot partition in MiB +#bootsize="128" + +# Select compression, xz or none +#compress="xz" + +# Choose filesystem format to format ( ext3 or ext4 ) +fstype="ext4" + +# Disable IPV6 ( yes or no) +#disable_ipv6="yes" + +# Make SWAP ( yes or no) +#swap="no" + +# DNS server +#nameserver="8.8.8.8" + +# To limit the number of CPU cores to use during compression +# Use 0 for unlimited CPU cores, -1 to subtract 1 cores from the total +#cpu_cores="4" + +# To limit the CPU usage during compression +# 0 or 100 No limit, 10 = percentage use, 50, 75, 90, etc. +#cpu_limit="85" + +# If you have your own preferred mirrors, set them here. +#mirror="http://http.kali.org/kali" +#replace_mirror="http://http.kali.org/kali" + +# Use packages from the listed components of the archive. +#components="main,contrib,non-free" + +# Suite to use, valid options are: +# kali-rolling, kali-dev, kali-dev-only, kali-last-snapshot +#suite="kali-rolling" +#replace_suite="kali-rolling" + +# Default file name +# On the RPi 3 script, this would result in +# "kali-linux-202X-WXX-rpi4-nexmon-arm64" for the default filename. +# For release builds from Kali, the requirements are that it start with kali-linuxi +# and end with the architecture. +#imagename="kali-linux-$(date +%Y)-W$(date +%U)-${hw_model}-${variant}" From d5e67f8b4da6763642bdc0a4bf1cd33b5b797e05 Mon Sep 17 00:00:00 2001 From: Steev Klimaszewski Date: Fri, 17 Sep 2021 16:34:31 -0500 Subject: [PATCH 20/20] compress_img: Use the same cgroup setup with arm64 We can compress just fine on arm64 machines, so lets add that. --- common.d/compress_img.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common.d/compress_img.sh b/common.d/compress_img.sh index fee8a0a..5c23ada 100644 --- a/common.d/compress_img.sh +++ b/common.d/compress_img.sh @@ -2,7 +2,7 @@ if [ "${compress:=}" = xz ]; then log "Compressing file: $(tput sgr0) ${imagename:=}.img" green - if [ "$(arch)" == 'x86_64' ]; then + if [ "$(arch)" == 'x86_64' ] || [ "$(arch)" == 'aarch64' ]; then limit_cpu pixz -p "${num_cores:=}" "${current_dir:=}"/"${imagename}".img # -p NÂș cpu cores use chmod 644 "${current_dir}"/"${imagename}".img.xz else