1
1

Initial dump from Zyxel

This commit is contained in:
2026-04-17 17:00:52 +02:00
commit 81fec250f4
23116 changed files with 5231237 additions and 0 deletions
@@ -0,0 +1,32 @@
From 45cb04fd85d788a37367a5385e5e90dd98a0a991 Mon Sep 17 00:00:00 2001
From: Jo-Philipp Wich <jow@openwrt.org>
Date: Thu, 14 Jan 2016 13:51:36 +0100
Subject: [PATCH] Align early init PATH with system wide OpenWrt path value
Changeset r47080 globally unified the executable search path in OpenWrt,
now update procd to use the same path value.
This fixes diverging path values observed in programs launched by netifd
which inherits the early path value from procd.
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
---
initd/early.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/initd/early.c b/initd/early.c
index e87774f..5821c58 100644
--- a/initd/early.c
+++ b/initd/early.c
@@ -90,7 +90,7 @@ early_mounts(void)
static void
early_env(void)
{
- setenv("PATH", "/bin:/sbin:/usr/bin:/usr/sbin", 1);
+ setenv("PATH", "/usr/sbin:/usr/bin:/sbin:/bin", 1);
}
void
--
2.1.4
@@ -0,0 +1,55 @@
diff -urN procd-2015-10-29.1_org/CMakeLists.txt procd-2015-10-29.1/CMakeLists.txt
--- procd-2015-10-29.1_org/CMakeLists.txt 2018-11-15 11:20:03.360719098 +0800
+++ procd-2015-10-29.1/CMakeLists.txt 2018-11-16 16:11:42.346035000 +0800
@@ -36,6 +36,14 @@
add_subdirectory(upgraded)
ENDIF()
+IF(SHOW_BOOT_ON_CONSOLE)
+ ADD_DEFINITIONS(-DSHOW_BOOT_ON_CONSOLE)
+ENDIF()
+
+IF(IPQ_807X)
+ ADD_DEFINITIONS(-DIPQ_807X)
+ENDIF()
+
ADD_EXECUTABLE(procd ${SOURCES})
TARGET_LINK_LIBRARIES(procd ${LIBS})
INSTALL(TARGETS procd
diff -urN procd-2015-10-29.1_org/rcS.c procd-2015-10-29.1/rcS.c
--- procd-2015-10-29.1_org/rcS.c 2018-11-15 11:20:03.360719098 +0800
+++ procd-2015-10-29.1/rcS.c 2018-11-16 16:14:19.288454518 +0800
@@ -21,7 +21,9 @@
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
-
+#ifdef IPQ_807X
+#include <fcntl.h>
+#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <glob.h>
@@ -87,8 +89,22 @@
return;
}
close(pipefd[0]);
+#ifdef IPQ_807X
+ {
+ //direct stdout stderr to /dev/console
+ int fd = open("/dev/console", O_RDWR);
+
+ if (fd > -1) {
+ dup2(fd, STDOUT_FILENO);
+ dup2(fd, STDERR_FILENO);
+ if (fd > STDERR_FILENO)
+ close(fd);
+ }
+ }
+#else
dup2(pipefd[1], STDOUT_FILENO);
dup2(pipefd[1], STDERR_FILENO);
+#endif
execlp(s->file, s->file, s->param, NULL);
exit(1);
@@ -0,0 +1,66 @@
From 02d56c03115276aa4e2203ddbd411c3e587cf08f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
Date: Wed, 6 Jul 2016 13:55:48 +0200
Subject: [PATCH] system: add reboot method to system ubus object
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Sometimes, for various reasons, user may want to reboot a device. This
is a common task and it makes sense to support it with something common
like a procd.
Right now both: LuCI and LuCI2 implement this feature on their own with
luci-rpc-luci2-system reboot and luci-rpc-sys reboot. This leads to code
duplication and situation may become even worse with more software
controlling system with ubus.
Othen than that procd already has support for rebooting so one may
consider this ubus method even cleaner.
Once we get this patch in place we may consider switching LuCI and LuCI2
to this new method.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
---
system.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/system.c b/system.c
index 569a75d..1e31ce6 100644
--- a/system.c
+++ b/system.c
@@ -18,6 +18,7 @@
#endif
#include <sys/ioctl.h>
#include <sys/types.h>
+#include <sys/reboot.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <signal.h>
@@ -242,6 +243,14 @@ static int system_upgrade(struct ubus_context *ctx, struct ubus_object *obj,
return 0;
}
+static int system_reboot(struct ubus_context *ctx, struct ubus_object *obj,
+ struct ubus_request_data *req, const char *method,
+ struct blob_attr *msg)
+{
+ procd_shutdown(RB_AUTOBOOT);
+ return 0;
+}
+
enum {
WDT_FREQUENCY,
WDT_TIMEOUT,
@@ -388,6 +397,7 @@ static const struct ubus_method system_methods[] = {
UBUS_METHOD_NOARG("board", system_board),
UBUS_METHOD_NOARG("info", system_info),
UBUS_METHOD_NOARG("upgrade", system_upgrade),
+ UBUS_METHOD_NOARG("reboot", system_reboot),
UBUS_METHOD("watchdog", watchdog_set, watchdog_policy),
UBUS_METHOD("signal", proc_signal, signal_policy),
--
2.7.4