Displaying 11 results from an estimated 11 matches for "mnt_procfs".
2010 Apr 28
1
[PATCH] RFC: Running initscripts from kinit
...#include <ctype.h>
#include <termios.h>
+#include <dirent.h>
#include "kinit.h"
#include "ipconfig.h"
#include "run-init.h"
#include "resume.h"
+#define INITD "/etc/init.d"
+
const char *progname = "kinit";
int mnt_procfs;
int mnt_sysfs;
@@ -189,6 +193,70 @@ static const char *find_init(const char *root, const char *user)
return path;
}
+static int sort_compare(const void *a, const void *b)
+{
+ return strcmp(a, b);
+}
+
+/* Go through and run all scripts found in /etc/init.d */
+static void do_runscripts()
+{...
2006 Mar 22
1
[patch] trivial cleanup
...tf(stderr, "%s: '%s' not a directory\n", progname, path);
exit(1);
}
}
@@ -276,8 +276,6 @@
check_path("/root");
do_mounts(cmdc, cmdv);
- /* do_mounts cd's to /root so below tests /root/old_root */
- check_path("old_root");
if (mnt_procfs == 1)
umount2("/proc", 0);
2005 Jan 05
1
[PATCH] kinit/kinit.c
...oot so below tests /root/old_root */
+ check_path("old_root");
#ifndef INI_DEBUG
if (pivot_root(".", "old_root") == -1) {
@@ -255,6 +261,8 @@
ret = 2;
goto bail;
}
+ /* the below chdir() is good style after a pivot_root() */
+ chdir("/");
if (mnt_procfs == 1)
umount2("/proc", 0);
@@ -262,18 +270,12 @@
if (mnt_sysfs == 1)
umount2("/sys", 0);
- for (i = 1; i < cmdc; i++) {
- if (strncmp(cmdv[i], "kinit=", 6) == 0) {
- kinit = cmdv[i] + 6;
- }
- }
-
- if (kinit) {
+ if ((kinit = get_arg(cmdc, cmdv, &quo...
2012 May 04
2
[PATCH] run-init: add drop_capabilities support
...init.c b/usr/kinit/kinit.c
index 8ea0da5..523c92b 100644
--- a/usr/kinit/kinit.c
+++ b/usr/kinit/kinit.c
@@ -284,8 +284,6 @@ int main(int argc, char *argv[])
check_path("/root");
do_mounts(cmdc, cmdv);
- drop_capabilities(get_arg(cmdc, cmdv, "drop_capabilities="));
-
if (mnt_procfs) {
umount2("/proc", 0);
mnt_procfs = 0;
@@ -305,7 +303,9 @@ int main(int argc, char *argv[])
init_argv[0] = strrchr(init_path, '/') + 1;
- errmsg = run_init("/root", "/dev/console", init_path, init_argv);
+ errmsg = run_init("/root", "...
2011 Aug 03
1
[PATCH v2] kinit: Add drop_capabilities support.
...init.c b/usr/kinit/kinit.c
index 4a1f40b..098873b 100644
--- a/usr/kinit/kinit.c
+++ b/usr/kinit/kinit.c
@@ -288,6 +288,8 @@ int main(int argc, char *argv[])
check_path("/root");
do_mounts(cmdc, cmdv);
+ drop_capabilities(get_arg(cmdc, cmdv, "drop_capabilities="));
+
if (mnt_procfs) {
umount2("/proc", 0);
mnt_procfs = 0;
diff --git a/usr/kinit/kinit.h b/usr/kinit/kinit.h
index c2e67b7..85960d8 100644
--- a/usr/kinit/kinit.h
+++ b/usr/kinit/kinit.h
@@ -65,4 +65,6 @@ static inline void dump_args(int argc, char *argv[])
}
#endif
+int drop_capabilities(const c...
2020 Jun 18
1
[PATCH] Kbuild for klibc and nfsmount: fix multiple definitions
...sertions(+), 8 deletions(-)
diff --git a/usr/kinit/kinit.c b/usr/kinit/kinit.c
index 28d29534896f..e2a2439c53ac 100644
--- a/usr/kinit/kinit.c
+++ b/usr/kinit/kinit.c
@@ -15,7 +15,6 @@
#include "run-init.h"
#include "resume.h"
-const char *progname = "kinit";
int mnt_procfs;
int mnt_sysfs;
diff --git a/usr/klibc/getopt_long.c b/usr/klibc/getopt_long.c
index e3d064b0af46..87c0559399e3 100644
--- a/usr/klibc/getopt_long.c
+++ b/usr/klibc/getopt_long.c
@@ -13,8 +13,8 @@
#include <string.h>
#include <getopt.h>
-char *optarg;
-int optind, opterr, optopt;...
2011 Aug 07
2
[PATCH] kinit minor checkpatch cleanup
...eck, &st) == 0) {
+ if (stat(check, &st) == 0)
return 0;
- }
mkdir(fsname, 0555);
@@ -220,9 +217,8 @@ int main(int argc, char *argv[])
dup2(fd, STDOUT_FILENO);
dup2(fd, STDERR_FILENO);
- if (fd > STDERR_FILENO) {
+ if (fd > STDERR_FILENO)
close(fd);
- }
}
mnt_procfs = mount_sys_fs("/proc/cmdline", "/proc", "proc") >= 0;
diff --git a/usr/kinit/kinit.h b/usr/kinit/kinit.h
index c2e67b7..71414b1 100644
--- a/usr/kinit/kinit.h
+++ b/usr/kinit/kinit.h
@@ -36,17 +36,17 @@ ssize_t freadfile(FILE *f, char **pptr);
* "unnecessary...
2011 Jul 13
9
[PATCH 0/8] switch_root() enhancements
On a train ride to Bruxelles, brought out my axe and directly attacked
run_init(8). run_init(8) is dead, long live switch_root(8).
The next run on switch_root(8) involves fdopendir,
so another push for the upcoming stdio 1.6 branch.
The following is boot tested with initramfs-tools,
kinit(8) tests would very much be appreciated!?
Michal Suchanek (1):
[klibc] switch_root: Fix single file
2011 Aug 03
2
[PATCH v3 0/2] Support drop directories directly from kinit
This patchset applies to klibc mainline.
This patchset introduces the ability to kinit to execute scripts or
executable files present in in the initramfs before switching over to
the root filesystem.
This functionality is implemented in a newly introduced run_parts()
call, which calls scandir() to iterate through files which in then
executes in sequence.
run_parts() is also available as a
2011 Aug 02
6
[PATCH v2 0/4] Support drop directories directly from kinit
This patchset applies to klibc mainline.
This patchset introduces the ability to kinit to execute scripts or
executable files present in in the initramfs before switching over to
the root filesystem.
It is implemented by first implementing scandir() and alphasort() as
present in POSIX.1-2008 in klibc itself, and then using that as the
basis for iterating and executing files via a run_scripts()
2011 Jul 29
3
[PATCH 1/3] klibc: Add scandir() and alphasort() support.
Add support for scandir() and alphasort() as defined in POSIX.1-2008.
Signed-off-by: Mike Waychison <mikew at google.com>
---
usr/include/dirent.h | 7 +++++
usr/klibc/Kbuild | 2 +
usr/klibc/scandir.c | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 84 insertions(+), 1 deletions(-)
create mode 100644 usr/klibc/scandir.c
diff --git