Skip to content

Commit

Permalink
v8.25
Browse files Browse the repository at this point in the history
- General | Follow symlink with all sed calls on files. This is required for the new RPi firmware packages which have /boot/config.txt etc symlinks to /boot/firmware/config.txt. But it is generally useful and the expected behaviour.
  • Loading branch information
MichaIng committed Dec 7, 2023
1 parent d41e825 commit ea5384b
Show file tree
Hide file tree
Showing 30 changed files with 517 additions and 517 deletions.
8 changes: 4 additions & 4 deletions .build/images/dietpi-build
Original file line number Diff line number Diff line change
Expand Up @@ -595,10 +595,10 @@ _EOF_
G_CONFIG_INJECT 'AUTO_SETUP_AUTOSTART_TARGET_INDEX=' 'AUTO_SETUP_AUTOSTART_TARGET_INDEX=0' rootfs/boot/dietpi.txt

# Force ARMv6 arch on Raspbian
(( $HW_ARCH == 1 )) && echo 'sed -i -e '\''/^G_HW_ARCH=/c\G_HW_ARCH=1'\'' -e '\''/^G_HW_ARCH_NAME=/c\G_HW_ARCH_NAME=armv6l'\'' /boot/dietpi/.hw_model' > rootfs/boot/Automation_Custom_PreScript.sh
(( $HW_ARCH == 1 )) && echo 'sed --follow-symlinks -i -e '\''/^G_HW_ARCH=/c\G_HW_ARCH=1'\'' -e '\''/^G_HW_ARCH_NAME=/c\G_HW_ARCH_NAME=armv6l'\'' /boot/dietpi/.hw_model' > rootfs/boot/Automation_Custom_PreScript.sh

# Temporary fix for failing NAA Daemon install on Trixie
(( $DISTRO == 8 )) && G_EXEC sed -i '\|www.signalyst.eu|s|bookworm/bullseye|trixie/bullseye|' rootfs/boot/dietpi/dietpi-software
(( $DISTRO == 8 )) && G_EXEC sed --follow-symlinks -i '\|www.signalyst.eu|s|bookworm/bullseye|trixie/bullseye|' rootfs/boot/dietpi/dietpi-software

# Skip filesystem expansion
G_EXEC rm rootfs/etc/systemd/system/local-fs.target.wants/dietpi-fs_partition_resize.service
Expand Down Expand Up @@ -627,7 +627,7 @@ then
systemctl mask serial-getty@ttyS0
/boot/dietpi/func/dietpi-set_hardware serialconsole 1 serial0
G_CONFIG_INJECT 'temp_limit=' 'temp_limit=75' /boot/config.txt # since most RPis are now RPi 4 and Allo ships the CM3 with USBridge Sig and Allo GUI image
G_EXEC sed -Ei 's/^(arm_freq|over_voltage)=/#\1=/' /boot/config.txt
G_EXEC sed --follow-symlinks -Ei 's/^(arm_freq|over_voltage)=/#\1=/' /boot/config.txt
fi
# FirstBoot
Expand Down Expand Up @@ -658,7 +658,7 @@ G_EXEC rm /etc/bashrc.d/00-dietpi-build.sh /boot/Automation_Custom_Script.sh
poweroff
}
_EOF_
(( $HW_ARCH == 1 )) && G_EXEC sed -i 's/Custom_Script/Custom_{Pre,}Script/' rootfs/boot/Automation_Custom_Script.sh
(( $HW_ARCH == 1 )) && G_EXEC sed --follow-symlinks -i 's/Custom_Script/Custom_{Pre,}Script/' rootfs/boot/Automation_Custom_Script.sh

# Start container
# - Bind mounts required to allow container reading its own drive info, /dev/disk for GRUB and probably other tools to detect UUIDs
Expand Down
6 changes: 3 additions & 3 deletions .build/images/dietpi-imager
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ _EOF_
sed '/^menuentry /,$d' tmpiso/boot/grub/clonezilla.cfg > tmpiso/boot/grub/grub.cfg
sed -n '/menuentry .*Safe graphic/,/}/s/^ //p' tmpiso/boot/grub/clonezilla.cfg >> tmpiso/boot/grub/grub.cfg
# shellcheck disable=SC2016
sed -i -e '/^set timeout=/c\set timeout="-1"' -e '/^set pref=/a\set theme=\$pref/theme.txt' -e '/^menuentry /c\menuentry "Install DietPi" {' \
sed --follow-symlinks -i -e '/^set timeout=/c\set timeout="-1"' -e '/^set pref=/a\set theme=\$pref/theme.txt' -e '/^menuentry /c\menuentry "Install DietPi" {' \
-e 's/locales= /locales=C.UTF-8 /' -e 's/keyboard-layouts= /keyboard-layouts=gb /' -e 's/ocs-live-general/ocs-live-restore/' \
-e "s|ocs_live_extra_param=\"\"|ocs_live_extra_param=\"-icds -k1 -r -e2 -j2 -b -p poweroff restoredisk $OUTPUT_IMG_NAME ask_user\"|" \
-e 's/ocs_live_batch="no"/ocs_live_batch="yes"/' tmpiso/boot/grub/grub.cfg
Expand All @@ -680,10 +680,10 @@ _EOF_
G_EXEC curl -sSf "$DIETPI_REPO/.build/images/Clonezilla/dietpi-background_480p.png" -o tmpiso/syslinux/dietpibg.png
G_EXEC cp /usr/lib/syslinux/modules/bios/poweroff.c32 tmpiso/syslinux/
G_EXEC mv tmpiso/syslinux/{syslinux,clonezilla}.cfg
sed -i '/^MENU TITLE/c\MENU TITLE Clonezilla live' tmpiso/syslinux/clonezilla.cfg
sed --follow-symlinks -i '/^MENU TITLE/c\MENU TITLE Clonezilla live' tmpiso/syslinux/clonezilla.cfg
sed '/^label /,$d' tmpiso/syslinux/clonezilla.cfg > tmpiso/syslinux/syslinux.cfg
sed -n '/^label .*framebuffer/,/ENDTEXT/p' tmpiso/syslinux/clonezilla.cfg >> tmpiso/syslinux/syslinux.cfg
sed -i -e '/^timeout /c\timeout 0' -e 's|\(MENU BACKGROUND\) .*|\1 dietpibg.png|' -e '/^MENU TITLE /c\MENU TABMSG' \
sed --follow-symlinks -i -e '/^timeout /c\timeout 0' -e 's|\(MENU BACKGROUND\) .*|\1 dietpibg.png|' -e '/^MENU TITLE /c\MENU TABMSG' \
-e '/menu title/d' -e '/^say /d' -e '/MENU MARGIN/a\MENU HSHIFT 80\n MENU COLOR BORDER 0 #00000000 #00000000 none' \
-e '/^label /c\label Install DietPi' -e '/^ MENU LABEL /c\ MENU LABEL Install DietPi' -e '/^ TEXT HELP/,/^ ENDTEXT/d' \
-e 's/locales= /locales=C.UTF-8 /' -e 's/keyboard-layouts= /keyboard-layouts=gb /' -e 's/ocs-live-general/ocs-live-restore/' \
Expand Down
74 changes: 37 additions & 37 deletions .build/images/dietpi-installer
Original file line number Diff line number Diff line change
Expand Up @@ -578,13 +578,13 @@ _EOF_
local model='OdroidC1'
(( $G_HW_MODEL == 11 )) && model='OdroidXU4'
G_EXEC mv "DietPi-$G_GITBRANCH/.build/images/$model/boot.ini" /boot/boot.ini
G_EXEC sed -i "s/root=[^[:blank:]]*/root=UUID=$(findmnt -Ufnro UUID -M /)/" /boot/boot.ini
G_EXEC sed -i "s/rootfstype=[^[:blank:]]*/rootfstype=$(findmnt -Ufnro FSTYPE -M /)/" /boot/boot.ini
G_EXEC sed --follow-symlinks -i "s/root=[^[:blank:]]*/root=UUID=$(findmnt -Ufnro UUID -M /)/" /boot/boot.ini
G_EXEC sed --follow-symlinks -i "s/rootfstype=[^[:blank:]]*/rootfstype=$(findmnt -Ufnro FSTYPE -M /)/" /boot/boot.ini
G_EXEC mkdir -p /etc/kernel/post{inst,rm}.d /etc/initramfs/post-update.d
G_EXEC mv "DietPi-$G_GITBRANCH/.build/images/U-Boot/dietpi-initramfs_cleanup" /etc/kernel/postinst.d/dietpi-initramfs_cleanup
G_EXEC ln -sf /etc/kernel/post{inst,rm}.d/dietpi-initramfs_cleanup
G_EXEC mv "DietPi-$G_GITBRANCH/.build/images/U-Boot/99-dietpi-uboot" /etc/initramfs/post-update.d/99-dietpi-uboot
G_EXEC sed -i 's/arm64/arm/' /etc/initramfs/post-update.d/99-dietpi-uboot
G_EXEC sed --follow-symlinks -i 's/arm64/arm/' /etc/initramfs/post-update.d/99-dietpi-uboot

elif [[ $G_HW_MODEL =~ ^(12|15|16|40|42|43|44|45|46|47|48|52|54|55|56|57|58|59|60|62|63|64|65|66|67|68|72|73|74|77|78|80|82|83|85|86)$ ]]
then
Expand All @@ -600,36 +600,36 @@ _EOF_
# Odroid C2: Fix USB device detection: https://github.com/MichaIng/DietPi/issues/5963
if (( $G_HW_MODEL == 12 ))
then
G_EXEC sed -i 's/coherent_pool=2M/coherent_pool=2M usbcore.autosuspend=-1/' /boot/boot.cmd
G_EXEC sed --follow-symlinks -i 's/coherent_pool=2M/coherent_pool=2M usbcore.autosuspend=-1/' /boot/boot.cmd

# Odroid N2/HC4
elif [[ $G_HW_MODEL =~ ^(15|16)$ ]]
then
# Enable USB boot via petitboot support: https://github.com/MichaIng/DietPi/issues/5634
G_EXEC sed -i '1i[main]' /boot/dietpiEnv.txt
G_EXEC sed --follow-symlinks -i '1i[main]' /boot/dietpiEnv.txt
# shellcheck disable=SC2016
(( $G_HW_MODEL == 15 )) && G_EXEC sed -i '/^setenv overlay_error/a\
(( $G_HW_MODEL == 15 )) && G_EXEC sed --follow-symlinks -i '/^setenv overlay_error/a\
\n# petitboot workarounds\
if test "${variant}" = "n2_plus"; then setenv variant "n2-plus"; fi\
setenv fdtfile "amlogic/meson-g12b-odroid-${variant}.dtb"\
setenv rootuuid "true"' /boot/boot.cmd
# shellcheck disable=SC2016
(( $G_HW_MODEL == 16 )) && G_EXEC sed -i '/^setenv overlay_error/a\
(( $G_HW_MODEL == 16 )) && G_EXEC sed --follow-symlinks -i '/^setenv overlay_error/a\
\n# petitboot workarounds\
setenv fdtfile "amlogic/meson-sm1-odroid-${variant}.dtb"\
setenv rootuuid "true"' /boot/boot.cmd
# shellcheck disable=SC2016
G_EXEC sed -i '/env import/c\ ini main ${scriptaddr} || env import -t ${scriptaddr} ${filesize}' /boot/boot.cmd
G_EXEC sed --follow-symlinks -i '/env import/c\ ini main ${scriptaddr} || env import -t ${scriptaddr} ${filesize}' /boot/boot.cmd
# shellcheck disable=SC2016
G_EXEC sed -i '/test -e/s/fixup.scr;/fixup.scr || test "${petitboot_active}" = "1";/' /boot/boot.cmd
G_EXEC sed --follow-symlinks -i '/test -e/s/fixup.scr;/fixup.scr || test "${petitboot_active}" = "1";/' /boot/boot.cmd

# Odroid N2: Assure that hardware random generator driver is loaded as early as possible to prevent rngd failures: https://github.com/MichaIng/DietPi/issues/6483
(( $G_HW_MODEL == 15 )) && G_EXEC eval 'echo '\''meson_rng'\'' > /etc/modules-load.d/dietpi-hwrng.conf'

# Rockchip 64-bit (configs work with Amlogic OOTB)
elif [[ $G_HW_MODEL =~ ^(42|43|46|47|55|56|58|68|72|73|77|78|80|82|85|86)$ ]]
then
G_EXEC sed -Ei '/^setenv (kernel|fdt)_addr_r/d' /boot/boot.cmd
G_EXEC sed --follow-symlinks -Ei '/^setenv (kernel|fdt)_addr_r/d' /boot/boot.cmd
G_CONFIG_INJECT 'setenv scriptaddr ' 'setenv scriptaddr "0x9000000"' /boot/boot.cmd
G_CONFIG_INJECT 'overlay_path=' 'overlay_path=rockchip' /boot/dietpiEnv.txt
case $G_HW_MODEL in
Expand All @@ -650,29 +650,29 @@ setenv rootuuid "true"' /boot/boot.cmd
case $G_HW_MODEL in
73) G_CONFIG_INJECT 'consoleargs=' 'consoleargs=console=ttyS0,1500000' /boot/dietpiEnv.txt;; # headless
47|55|56) G_CONFIG_INJECT 'consoleargs=' 'consoleargs=console=ttyS2,1500000' /boot/dietpiEnv.txt;; # headless
78|80|82) G_EXEC sed -i 's/ttyAML0,115200/ttyFIQ0,1500000/' /boot/dietpiEnv.txt;;
*) G_EXEC sed -i 's/ttyAML0,115200/ttyS2,1500000/' /boot/dietpiEnv.txt;;
78|80|82) G_EXEC sed --follow-symlinks -i 's/ttyAML0,115200/ttyFIQ0,1500000/' /boot/dietpiEnv.txt;;
*) G_EXEC sed --follow-symlinks -i 's/ttyAML0,115200/ttyS2,1500000/' /boot/dietpiEnv.txt;;
esac

# ASUS Tinker Board (32-bit)
elif (( $G_HW_MODEL == 52 ))
then
G_EXEC sed -i 's/arm64/arm/' /etc/initramfs/post-update.d/99-dietpi-uboot /boot/boot.cmd
G_EXEC sed -Ei '/^setenv (kernel_addr_r|fdt_addr_r|overlay_path)/d' /boot/boot.cmd
G_EXEC sed --follow-symlinks -i 's/arm64/arm/' /etc/initramfs/post-update.d/99-dietpi-uboot /boot/boot.cmd
G_EXEC sed --follow-symlinks -Ei '/^setenv (kernel_addr_r|fdt_addr_r|overlay_path)/d' /boot/boot.cmd
G_CONFIG_INJECT 'setenv scriptaddr ' 'setenv scriptaddr "0x39000000"' /boot/boot.cmd
G_CONFIG_INJECT 'setenv ramdisk_addr_r ' 'setenv ramdisk_addr_r "0x21000000"' /boot/boot.cmd '^setenv scriptaddr'
# shellcheck disable=SC2016
G_EXEC sed -i -e 's|\${prefix}Image|${prefix}zImage|' -e 's/booti/bootz/' -e 's|\${overlay_path}/||' /boot/boot.cmd
G_EXEC sed -i '/^overlay_path/d' /boot/dietpiEnv.txt
G_EXEC sed --follow-symlinks -i -e 's|\${prefix}Image|${prefix}zImage|' -e 's/booti/bootz/' -e 's|\${overlay_path}/||' /boot/boot.cmd
G_EXEC sed --follow-symlinks -i '/^overlay_path/d' /boot/dietpiEnv.txt
G_CONFIG_INJECT 'overlay_prefix=' 'overlay_prefix=rockchip' /boot/dietpiEnv.txt
G_CONFIG_INJECT 'overlays=' 'overlays=uart2' /boot/dietpiEnv.txt
# ASUS Tinker Board: https://github.com/MichaIng/DietPi/issues/5554
G_EXEC sed -i -e 's/ttyAML0/ttyS2/' -e '/^extraargs=/s/$/ systemd.unified_cgroup_hierarchy=0/' /boot/dietpiEnv.txt
G_EXEC sed --follow-symlinks -i -e 's/ttyAML0/ttyS2/' -e '/^extraargs=/s/$/ systemd.unified_cgroup_hierarchy=0/' /boot/dietpiEnv.txt

# Allwinner 64-bit
elif [[ $G_HW_MODEL =~ ^(40|44|45|57|65|67|83)$ ]]
then
G_EXEC sed -Ei '/^setenv (kernel|fdt)_addr_r/d' /boot/boot.cmd
G_EXEC sed --follow-symlinks -Ei '/^setenv (kernel|fdt)_addr_r/d' /boot/boot.cmd
G_CONFIG_INJECT 'setenv scriptaddr ' 'setenv scriptaddr "0x45000000"' /boot/boot.cmd
G_CONFIG_INJECT 'overlay_path=' 'overlay_path=allwinner' /boot/dietpiEnv.txt
case $G_HW_MODEL in
Expand All @@ -693,18 +693,18 @@ setenv rootuuid "true"' /boot/boot.cmd
esac
case $G_HW_MODEL in
57|65) G_CONFIG_INJECT 'consoleargs=' 'consoleargs=console=ttyS0,115200' /boot/dietpiEnv.txt;; # headless
*) G_EXEC sed -i 's/ttyAML0/ttyS0/' /boot/dietpiEnv.txt;;
*) G_EXEC sed --follow-symlinks -i 's/ttyAML0/ttyS0/' /boot/dietpiEnv.txt;;
esac

# Allwinner H3 (32-bit)
elif [[ $G_HW_MODEL =~ ^(48|59|60|63|64|66)$ ]]
then
G_EXEC sed -i 's/arm64/arm/' /etc/initramfs/post-update.d/99-dietpi-uboot /boot/boot.cmd
G_EXEC sed -Ei '/^setenv (kernel_addr_r|fdt_addr_r|overlay_path)/d' /boot/boot.cmd
G_EXEC sed --follow-symlinks -i 's/arm64/arm/' /etc/initramfs/post-update.d/99-dietpi-uboot /boot/boot.cmd
G_EXEC sed --follow-symlinks -Ei '/^setenv (kernel_addr_r|fdt_addr_r|overlay_path)/d' /boot/boot.cmd
G_CONFIG_INJECT 'setenv scriptaddr ' 'setenv scriptaddr "0x45000000"' /boot/boot.cmd
# shellcheck disable=SC2016
G_EXEC sed -i -e 's|\${prefix}Image|${prefix}zImage|' -e 's/booti/bootz/' -e 's|\${overlay_path}/||' /boot/boot.cmd
G_EXEC sed -i '/^overlay_path/d' /boot/dietpiEnv.txt
G_EXEC sed --follow-symlinks -i -e 's|\${prefix}Image|${prefix}zImage|' -e 's/booti/bootz/' -e 's|\${overlay_path}/||' /boot/boot.cmd
G_EXEC sed --follow-symlinks -i '/^overlay_path/d' /boot/dietpiEnv.txt
G_CONFIG_INJECT 'overlay_prefix=' 'overlay_prefix=sun8i-h3' /boot/dietpiEnv.txt
case $G_HW_MODEL in
48) G_CONFIG_INJECT 'overlays=' 'overlays=usbhost1 usbhost2 uart1' /boot/dietpiEnv.txt;;
Expand All @@ -715,20 +715,20 @@ setenv rootuuid "true"' /boot/boot.cmd
case $G_HW_MODEL in
48) G_CONFIG_INJECT 'consoleargs=' 'consoleargs=console=ttyS1,115200' /boot/dietpiEnv.txt;; # headless
59|60|64) G_CONFIG_INJECT 'consoleargs=' 'consoleargs=console=ttyS0,115200' /boot/dietpiEnv.txt;; # headless
*) G_EXEC sed -i 's/ttyAML0/ttyS0/' /boot/dietpiEnv.txt;;
*) G_EXEC sed --follow-symlinks -i 's/ttyAML0/ttyS0/' /boot/dietpiEnv.txt;;
esac

# NanoPi M3/T3/Fire3 (64-bit)
elif (( $G_HW_MODEL == 62 ))
then
G_EXEC mv "DietPi-$G_GITBRANCH/.build/images/NanoPiM3/boot.cmd" /boot/boot.cmd
G_EXEC sed -i '/overlay/d' /boot/dietpiEnv.txt
G_EXEC sed -i 's/ttyAML0/ttySAC0/' /boot/dietpiEnv.txt
G_EXEC sed --follow-symlinks -i '/overlay/d' /boot/dietpiEnv.txt
G_EXEC sed --follow-symlinks -i 's/ttyAML0/ttySAC0/' /boot/dietpiEnv.txt
fi
fi

# shellcheck disable=SC2016
[[ -f '/etc/initramfs/post-update.d/99-dietpi-uboot' && $(findmnt -t vfat -M /boot) ]] && G_EXEC sed -i '/^ln -s/c\mv -v "/boot/uInitrd-$1" /boot/uInitrd' /etc/initramfs/post-update.d/99-dietpi-uboot # FAT does not support symlinks
[[ -f '/etc/initramfs/post-update.d/99-dietpi-uboot' && $(findmnt -t vfat -M /boot) ]] && G_EXEC sed --follow-symlinks -i '/^ln -s/c\mv -v "/boot/uInitrd-$1" /boot/uInitrd' /etc/initramfs/post-update.d/99-dietpi-uboot # FAT does not support symlinks

G_EXEC mv "DietPi-$G_GITBRANCH/dietpi.txt" /boot/
G_EXEC mv "DietPi-$G_GITBRANCH/README.md" /boot/dietpi-README.md
Expand Down Expand Up @@ -1251,8 +1251,8 @@ _EOF_
done
G_EXEC_OUTPUT=1 G_EXEC dpkg -i package.deb
G_EXEC rm package.deb
G_EXEC sed -i "s/root=[^[:blank:]]*/root=PARTUUID=$(findmnt -Ufnro PARTUUID -M /)/" /boot/extlinux/extlinux.conf
G_EXEC sed -i "s/rootfstype=[^[:blank:]]*/rootfstype=$(findmnt -Ufnro FSTYPE -M /)/" /boot/extlinux/extlinux.conf
G_EXEC sed --follow-symlinks -i "s/root=[^[:blank:]]*/root=PARTUUID=$(findmnt -Ufnro PARTUUID -M /)/" /boot/extlinux/extlinux.conf
G_EXEC sed --follow-symlinks -i "s/rootfstype=[^[:blank:]]*/rootfstype=$(findmnt -Ufnro FSTYPE -M /)/" /boot/extlinux/extlinux.conf
aPACKAGES_REQUIRED_INSTALL+=('libubootenv-tool')

# Star64
Expand All @@ -1265,8 +1265,8 @@ _EOF_
done
G_EXEC_OUTPUT=1 G_EXEC dpkg -i package.deb
G_EXEC rm package.deb
G_EXEC sed -i "s/root=[^[:blank:]]*/root=PARTUUID=$(findmnt -Ufnro PARTUUID -M /)/" /boot/extlinux/extlinux.conf
G_EXEC sed -i "s/rootfstype=[^[:blank:]]*/rootfstype=$(findmnt -Ufnro FSTYPE -M /)/" /boot/extlinux/extlinux.conf
G_EXEC sed --follow-symlinks -i "s/root=[^[:blank:]]*/root=PARTUUID=$(findmnt -Ufnro PARTUUID -M /)/" /boot/extlinux/extlinux.conf
G_EXEC sed --follow-symlinks -i "s/rootfstype=[^[:blank:]]*/rootfstype=$(findmnt -Ufnro FSTYPE -M /)/" /boot/extlinux/extlinux.conf
aPACKAGES_REQUIRED_INSTALL+=('libubootenv-tool')

# Orange Pi Zero 3
Expand All @@ -1292,7 +1292,7 @@ _EOF_

# Apply device tree adjustment for Ethernet adapter
# shellcheck disable=SC2016
sed -i -e '/^setenv bootargs /s/"$/ ethernet_phy=${ethernet_phy}"/' -e '/^# Boot/i\
sed --follow-symlinks -i -e '/^setenv bootargs /s/"$/ ethernet_phy=${ethernet_phy}"/' -e '/^# Boot/i\
if test "${ethernet_phy}" = "rtl8211f"; then\
echo "Ethernet adapter: ${ethernet_phy}, adjusting device tree ..."\
fdt set "/soc/ethernet@5020000" "allwinner,rx-delay-ps" "<3100>"\
Expand Down Expand Up @@ -1742,7 +1742,7 @@ _EOF_
#-----------------------------------------------------------------------------------
# Bash Profiles
# - Enable /etc/bashrc.d/ support for custom interactive non-login shell scripts:
sed -i '\#/etc/bashrc\.d/#d' /etc/bash.bashrc
sed --follow-symlinks -i '\#/etc/bashrc\.d/#d' /etc/bash.bashrc
# shellcheck disable=SC2016
echo 'for i in /etc/bashrc.d/*.sh /etc/bashrc.d/*.bash; do [ -r "$i" ] && . $i; done; unset -v i' >> /etc/bash.bashrc
# - Enable bash-completion for non-login shells:
Expand Down Expand Up @@ -2098,14 +2098,14 @@ rm -v /tmp/ax88179_178a.ko || exit 0
_EOF_
G_EXEC chmod +x /etc/kernel/postinst.d/dietpi-USBridgeSig
# Force upgrade now, regardless of current host machine
G_EXEC sed -i 's/^grep/#grep/' /etc/kernel/postinst.d/dietpi-USBridgeSig
G_EXEC sed --follow-symlinks -i 's/^grep/#grep/' /etc/kernel/postinst.d/dietpi-USBridgeSig
for i in /lib/modules/*-v7+
do
[[ -d $i ]] || continue
i=${i##*/}
/etc/kernel/postinst.d/dietpi-USBridgeSig "$i"
done
G_EXEC sed -i 's/^#grep/grep/' /etc/kernel/postinst.d/dietpi-USBridgeSig
G_EXEC sed --follow-symlinks -i 's/^#grep/grep/' /etc/kernel/postinst.d/dietpi-USBridgeSig

# For backwards compatibility with software compiled against older libraspberrypi0, create symlinks from old to new filenames
if (( $G_HW_ARCH < 3 ))
Expand Down Expand Up @@ -2192,7 +2192,7 @@ _EOF_
then
G_CONFIG_INJECT 'CONFIG_NTP_MODE=' 'CONFIG_NTP_MODE=0' /boot/dietpi.txt
else
G_EXEC_DESC='Enable Dropbear autostart' G_EXEC sed -i '/NO_START=1/c\NO_START=0' /etc/default/dropbear
G_EXEC_DESC='Enable Dropbear autostart' G_EXEC sed --follow-symlinks -i '/NO_START=1/c\NO_START=0' /etc/default/dropbear
G_EXEC systemctl unmask dropbear
G_EXEC systemctl enable dropbear
fi
Expand All @@ -2209,7 +2209,7 @@ _EOF_
# Re-enable for next run
(( $G_HW_MODEL == 75 )) || G_CONFIG_INJECT 'AUTO_SETUP_SWAPFILE_SIZE=' 'AUTO_SETUP_SWAPFILE_SIZE=1' /boot/dietpi.txt
# Reset /tmp size to default (512 MiB)
sed -i '\|/tmp|s|size=[^,]*,||' /etc/fstab
sed --follow-symlinks -i '\|/tmp|s|size=[^,]*,||' /etc/fstab

# Set WiFi
local tmp_info='Disabling'
Expand Down
2 changes: 1 addition & 1 deletion .build/software/Amiberry/container_build.bash
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ G_EXEC mkdir rootfs
G_EXEC mount "${FP_LOOP}p1" rootfs

# Enforce ARMv6 arch on Raspbian
(( $arch > 1 )) || echo 'sed -i -e '\''/^G_HW_ARCH=/c\G_HW_ARCH=1'\'' -e '\''/^G_HW_ARCH_NAME=/c\G_HW_ARCH_NAME=armv6l'\'' /boot/dietpi/.hw_model' > rootfs/boot/Automation_Custom_PreScript.sh || Error_Exit 'Failed to generate Automation_Custom_PreScript.sh'
(( $arch > 1 )) || echo 'sed --follow-symlinks -i -e '\''/^G_HW_ARCH=/c\G_HW_ARCH=1'\'' -e '\''/^G_HW_ARCH_NAME=/c\G_HW_ARCH_NAME=armv6l'\'' /boot/dietpi/.hw_model' > rootfs/boot/Automation_Custom_PreScript.sh || Error_Exit 'Failed to generate Automation_Custom_PreScript.sh'

# Enable automated setup
G_CONFIG_INJECT 'AUTO_SETUP_AUTOMATED=' 'AUTO_SETUP_AUTOMATED=1' rootfs/boot/dietpi.txt
Expand Down
2 changes: 1 addition & 1 deletion .build/software/dietpi-software-build.bash
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ G_EXEC mkdir rootfs
G_EXEC mount "${FP_LOOP}p1" rootfs

# Enforce ARMv6 arch on Raspbian
(( $arch > 1 )) || echo 'sed -i -e '\''/^G_HW_ARCH=/c\G_HW_ARCH=1'\'' -e '\''/^G_HW_ARCH_NAME=/c\G_HW_ARCH_NAME=armv6l'\'' /boot/dietpi/.hw_model' > rootfs/boot/Automation_Custom_PreScript.sh || Error_Exit 'Failed to generate Automation_Custom_PreScript.sh'
(( $arch > 1 )) || echo 'sed --follow-symlinks -i -e '\''/^G_HW_ARCH=/c\G_HW_ARCH=1'\'' -e '\''/^G_HW_ARCH_NAME=/c\G_HW_ARCH_NAME=armv6l'\'' /boot/dietpi/.hw_model' > rootfs/boot/Automation_Custom_PreScript.sh || Error_Exit 'Failed to generate Automation_Custom_PreScript.sh'

# Enable automated setup
G_CONFIG_INJECT 'AUTO_SETUP_AUTOMATED=' 'AUTO_SETUP_AUTOMATED=1' rootfs/boot/dietpi.txt
Expand Down
2 changes: 1 addition & 1 deletion .build/software/gmediarender/build.bash
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ then
INTERFACE=$(ip r l 0/0 | awk '{print $5;exit}')
[ "$INTERFACE" ] || INTERFACE=$(ip -br a | awk '$2=="UP"{print $1;exit}')
[ "$INTERFACE" ] || exit 1
sed -i "s/-u UUID -f HOSTNAME -I eth0/-u $G_HW_UUID -f $HOSTNAME -I $INTERFACE/" /etc/default/gmediarender
sed --follow-symlinks -i "s/-u UUID -f HOSTNAME -I eth0/-u $G_HW_UUID -f $HOSTNAME -I $INTERFACE/" /etc/default/gmediarender
fi
if getent passwd gmediarender > /dev/null
Expand Down
Loading

0 comments on commit ea5384b

Please sign in to comment.