Skip to content

Commit f8eb7a7

Browse files
committed
Adjust the system initialization wait time to 60 seconds
1 parent b415775 commit f8eb7a7

File tree

4 files changed

+27
-28
lines changed

4 files changed

+27
-28
lines changed

build-armbian/armbian-files/common-files/etc/custom_service/start_service.sh

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# Dependent script: /etc/rc.local (which runs with 'set -e')
1313
# File path: /etc/custom_service/start_service.sh
1414
#
15-
# Version: v1.1
15+
# Version: v1.2
1616
#
1717
#========================================================================================
1818

@@ -42,64 +42,66 @@ log_message "Detected FDT file: ${FDT_FILE:-'not found'}"
4242

4343
# For Tencent Aurora 3Pro (s905x3-b) box: Load Bluetooth module
4444
if [[ "${FDT_FILE}" == "meson-sm1-skyworth-lb2004-a4091.dtb" ]]; then
45-
modprobe btmtksdio 2>/dev/null || true
45+
modprobe btmtksdio >/dev/null 2>&1 &
4646
log_message "Attempted to load btmtksdio module for Tencent-Aurora-3Pro."
4747
fi
4848

4949
# For swan1-w28(rk3568) board: USB power and switch control
5050
if [[ "${FDT_FILE}" == "rk3568-swan1-w28.dtb" ]]; then
5151
# GPIO operations are critical, but we also add error suppression.
52-
gpioset 0 21=1 2>/dev/null
53-
gpioset 3 20=1 2>/dev/null
54-
gpioset 4 21=1 2>/dev/null
55-
gpioset 4 22=1 2>/dev/null
52+
gpioset 0 21=1 >/dev/null 2>&1
53+
gpioset 3 20=1 >/dev/null 2>&1
54+
gpioset 4 21=1 >/dev/null 2>&1
55+
gpioset 4 22=1 >/dev/null 2>&1
5656
log_message "USB power control GPIOs set for Swan1-w28."
5757
fi
5858

5959
# For smart-am60(rk3588)/orangepi-5b(rk3588s) board: Bluetooth control
6060
if [[ "${FDT_FILE}" =~ ^(rk3588-smart-am60\.dtb|rk3588s-orangepi-5b\.dtb)$ ]]; then
6161
# This is a sequence of commands, with the last one running in the background.
6262
# The background command (&) won't affect the script's exit code.
63-
rfkill block all
64-
chmod a+x /lib/firmware/ap6276p/brcm_patchram_plus1 2>/dev/null || true
65-
sleep 2
66-
rfkill unblock all
67-
/lib/firmware/ap6276p/brcm_patchram_plus1 --enable_hci --no2bytes --use_baudrate_for_download --tosleep 200000 --baudrate 1500000 --patchram /lib/firmware/ap6275p/BCM4362A2.hcd /dev/ttyS9 &
63+
(
64+
rfkill block all
65+
chmod a+x /lib/firmware/ap6276p/brcm_patchram_plus1 >/dev/null 2>&1 &
66+
sleep 2
67+
rfkill unblock all
68+
/lib/firmware/ap6276p/brcm_patchram_plus1 --enable_hci --no2bytes --use_baudrate_for_download --tosleep 200000 --baudrate 1500000 --patchram /lib/firmware/ap6275p/BCM4362A2.hcd /dev/ttyS9 &
69+
) &
6870
log_message "Bluetooth firmware download process started for Smart-am60/orangepi-5b."
6971
fi
7072

7173
# General System Services
7274

7375
# Restart ssh service
74-
mkdir -p -m0755 /var/run/sshd 2>/dev/null
76+
mkdir -p -m0755 /var/run/sshd >/dev/null 2>&1
7577
if [[ -f "/etc/init.d/ssh" ]]; then
76-
(sleep 5 && /etc/init.d/ssh restart 2>/dev/null) || true
78+
(sleep 5 && /etc/init.d/ssh restart >/dev/null 2>&1) &
7779
log_message "SSH service restart attempted."
7880
fi
7981

8082
# Add network performance optimization
8183
if [[ -x "/usr/sbin/balethirq.pl" ]]; then
82-
(perl /usr/sbin/balethirq.pl 2>/dev/null) || true
84+
(perl /usr/sbin/balethirq.pl >/dev/null 2>&1) &
8385
log_message "Network optimization service (balethirq.pl) execution attempted."
8486
fi
8587

8688
# Led display control
8789
openvfd_enable="no"
8890
openvfd_boxid="15"
8991
if [[ "${openvfd_enable}" == "yes" && -n "${openvfd_boxid}" && -x "/usr/sbin/armbian-openvfd" ]]; then
90-
(armbian-openvfd "${openvfd_boxid}") || true
92+
(armbian-openvfd "${openvfd_boxid}") &
9193
log_message "OpenVFD service execution attempted."
9294
fi
9395

9496
# For vplus(Allwinner h6) led color lights
9597
if [[ -x "/usr/bin/rgb-vplus" ]]; then
96-
rgb-vplus --RedName=RED --GreenName=GREEN --BlueName=BLUE 2>/dev/null &
98+
rgb-vplus --RedName=RED --GreenName=GREEN --BlueName=BLUE >/dev/null 2>&1 &
9799
log_message "Vplus RGB LED service started in background."
98100
fi
99101

100102
# For fan control service
101103
if [[ -x "/usr/bin/pwm-fan.pl" ]]; then
102-
perl /usr/bin/pwm-fan.pl 2>/dev/null &
104+
perl /usr/bin/pwm-fan.pl >/dev/null 2>&1 &
103105
log_message "Fan control service (pwm-fan.pl) started in background."
104106
fi
105107

@@ -112,16 +114,9 @@ fi
112114
# For pveproxy startup service
113115
if [[ -n "$(dpkg -l | awk '{print $2}' | grep -w "^pve-manager$")" ]]; then
114116
# Restarting systemd services can sometimes fail during early boot.
115-
# Using '|| true' makes this step fault-tolerant.
116-
(systemctl restart pveproxy) || true
117+
(systemctl restart pveproxy) &
117118
log_message "PVE proxy service restart attempted."
118119
fi
119120

120-
# For wxy-oec-turbo-4g board: Enable and restart getty on ttyS2
121-
if [[ "${FDT_FILE}" == "rk3566-wxy-oec-turbo-4g.dtb" ]]; then
122-
(sudo systemctl enable getty@ttyS2 && sudo systemctl restart getty@ttyS2) || true
123-
log_message "Getty service on ttyS2 restart attempted for wxy-oec-turbo-4g board."
124-
fi
125-
126121
# Finalization
127122
log_message "All custom services have been processed."

build-armbian/armbian-files/different-files/wxy-oect-mod/bootfs/extlinux/extlinux.conf.bak

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ LABEL Armbian
22
LINUX /Image
33
INITRD /uInitrd
44
FDT /dtb/rockchip/rk3566-wxy-oec-turbo-4g.dtb
5-
APPEND root=LABEL=ROOTFS earlycon=uart8250,mmio32,0xfe660000 console=ttyFIQ0 console=ttyS2,1500000 console=tty1 no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 max_loop=128 bootsplash.bootfile=bootsplash.armbian systemd.unified_cgroup_hierarchy=0
5+
APPEND root=LABEL=ROOTFS earlycon=uart8250,mmio32,0xfe660000 console=ttyS2,1500000 console=tty1 no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 max_loop=128 bootsplash.bootfile=bootsplash.armbian systemd.unified_cgroup_hierarchy=0

build-armbian/armbian-files/different-files/wxy-oect/bootfs/extlinux/extlinux.conf.bak

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ LABEL Armbian
22
LINUX /Image
33
INITRD /uInitrd
44
FDT /dtb/rockchip/rk3566-wxy-oec-turbo-4g.dtb
5-
APPEND root=LABEL=ROOTFS earlycon=uart8250,mmio32,0xfe660000 console=ttyFIQ0 console=ttyS2,1500000 console=tty1 no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 max_loop=128 bootsplash.bootfile=bootsplash.armbian
5+
APPEND root=LABEL=ROOTFS earlycon=uart8250,mmio32,0xfe660000 console=ttyS2,1500000 console=tty1 no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 max_loop=128 bootsplash.bootfile=bootsplash.armbian

rebuild

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1038,7 +1038,7 @@ refactor_rootfs() {
10381038
# Add custom startup script
10391039
custom_startup_script="etc/custom_service/start_service.sh"
10401040
[[ -x "${custom_startup_script}" && -f "etc/rc.local" ]] && {
1041-
sed -i '/^exit 0/i\bash /etc/custom_service/start_service.sh' etc/rc.local
1041+
sed -i '/^exit 0/i\bash /etc/custom_service/start_service.sh &' etc/rc.local
10421042
}
10431043

10441044
# Enable ssh service
@@ -1100,6 +1100,10 @@ refactor_rootfs() {
11001100
armbian_firstrun="usr/lib/armbian/armbian-firstrun"
11011101
[[ -f "${armbian_firstrun}" ]] && sed -i '/\/etc\/armbian-release/i\[[ -x "/usr/sbin/armbian-fix" ]] && . /usr/sbin/armbian-fix' ${armbian_firstrun}
11021102

1103+
# Improve systemd startup speed, avoid timeout waiting
1104+
armbian_firstlogin="usr/lib/armbian/armbian-firstlogin"
1105+
[[ -f "${armbian_firstlogin}" ]] && sed -i "s#.*systemctl is-system-running.*# timeout 120s systemctl is-system-running --wait > /dev/null 2>\&1 || true#g" "${armbian_firstlogin}"
1106+
11031107
# Fix abnormal CPU temperature
11041108
temp_file="usr/lib/armbian/armbian-allwinner-battery"
11051109
[[ -f "${temp_file}" ]] && {

0 commit comments

Comments
 (0)