From 7770e6965452ed5fede5a94f287f54a4d382dc69 Mon Sep 17 00:00:00 2001 From: Liangbin Lian Date: Tue, 31 Dec 2024 13:40:12 +0800 Subject: [PATCH] istoreos: write boot done message to process fd/1 instead of /dev/console /dev/console may invalid on 24.10 ``` root@OpenWrt:~# echo hello > /dev/console ash: write error: I/O error root@OpenWrt:~# ``` --- package/istoreos-files/files/etc/init.d/zprintk | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/package/istoreos-files/files/etc/init.d/zprintk b/package/istoreos-files/files/etc/init.d/zprintk index dda38dea9c..3e16979c89 100755 --- a/package/istoreos-files/files/etc/init.d/zprintk +++ b/package/istoreos-files/files/etc/init.d/zprintk @@ -9,8 +9,9 @@ boot() { # notify console system is ready sleep 1 - if pgrep -P 1 askfirst >/dev/null; then - echo "iStoreOS is ready!" >/dev/console - echo "Please press Enter to activate this console." >/dev/console + local pid=`pgrep -P 1 askfirst 2>/dev/null` + if [ -n "$pid" ]; then + echo "iStoreOS is ready!" >/proc/$pid/fd/1 + echo "Please press Enter to activate this console." >/proc/$pid/fd/1 fi }