Where for Pull Requests for Procd? For Some Features to Boot Debian

Hi,

I have studied how Openwrt's procd works including the /sbin/init process.

I would like to use procd's /sbin/init to mount the kernel filesystems and load modules. Then procd's init should exec the init of a debian installation (on a USB), instead of exec /sbin/procd.

Below patch allows me to use openwrt menuconfig for building an image for the above purpose. (I also support disabling procd's watchdog because I intend to use debian's.)

Where do I make a PR so that these procd configuration options can be supported in openwrt?

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4b3eebd..cde232e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -35,6 +35,14 @@ IF(EARLY_PATH)
   ADD_DEFINITIONS(-DEARLY_PATH="${EARLY_PATH}")
 ENDIF()
 
+IF(WATCHDOG_DISABLE)
+  ADD_DEFINITIONS(-DWATCHDOG_DISABLE)
+ENDIF()
+
+IF(PROCD_CUSTOM_SPAWN_PATH)
+  ADD_DEFINITIONS(-DPROCD_CUSTOM_SPAWN_PATH="${PROCD_CUSTOM_SPAWN_PATH}")
+ENDIF()
+
 IF(ZRAM_TMPFS)
   ADD_DEFINITIONS(-DZRAM_TMPFS)
   SET(SOURCES_ZRAM initd/zram.c)
diff --git a/initd/init.c b/initd/init.c
index 0349e6e..80ff067 100644
--- a/initd/init.c
+++ b/initd/init.c
@@ -80,7 +80,11 @@ main(int argc, char **argv)
 
        early();
        cmdline();
+#ifndef WATCHDOG_DISABLE
        watchdog_init(1);
+#endif
+       //watchdog_set_magicclose(true);
+       //watchdog_set_stopped(true);
 
        pid = fork();
        if (!pid) {
diff --git a/initd/preinit.c b/initd/preinit.c
index fbb36df..34952b2 100644
--- a/initd/preinit.c
+++ b/initd/preinit.c
@@ -91,7 +91,10 @@ static void
 spawn_procd(struct uloop_process *proc, int ret)
 {
        char *wdt_fd = watchdog_fd();
-       char *argv[] = { "/sbin/procd", NULL};
+#ifndef PROCD_CUSTOM_SPAWN_PATH
+#define PROCD_CUSTOM_SPAWN_PATH "/sbin/procd"
+#endif
+       char *argv[] = { PROCD_CUSTOM_SPAWN_PATH, NULL};
        char dbg[2];
 
        if (plugd_proc.pid > 0)

Thanks.

1 Like

Basic gist:

# Assumes some setup of the git environs on your build machine i.e. name/email for signoff
# Clone your own forked tree on Github
$ git clone https://github.com/MONIKER/source.git
$ cd source/
# Make a feature branch just for the PR you want to make
$ git checkout -b update-thisBit
# Do your changes and commit them
$ nano package/kernel/thisBit/Makefile 
$ git add package/kernel/thisBit/Makefile 
$ git commit -s -m "target: Add blah and more" -m "Holy verbosity Batman"
# Push your feature branch to Github
$ git push origin update-thisBit
# navigate to https://github.com/MONIKER/source and it should offer you a button to create a pull request.

Thanks but actually I was asking for which git repo to make a PR against. There is no github procd repo it seems. (I updated my post "how" --> "Where".)

I am also ok if procd maintainers commit this patch (after cleanup). @curtdept can you advise?

openwrt PRs you might want to ping the maintainer as indicated by the makefile contents.

No. Looking for PR to https://git.openwrt.org/project/procd.git.

You may send the patch to OpenWrt mailing list.

From https://openwrt.org/submitting-patches

PRs can be sent to the patches mailing list from any source and will always be considered for inclusion if the quality of the tree is good and format of submission is correct

1 Like

Thanks! I will try emailing with the proper format everything.

2 Likes

The numerous closed procd PRs would indicate otherwise.