search for: cmdc

Displaying 18 results from an estimated 18 matches for "cmdc".

Did you mean: cmd
2005 Jan 05
1
[PATCH] kinit/kinit.c
...name pointed to by char *s - this fix also eliminates six lines of unecessary code and improves readability by using get_arg(). --- klibc-0.194/kinit/kinit.c.orig 2005-01-05 15:40:15.468305608 -0700 +++ klibc-0.194/kinit/kinit.c 2005-01-05 15:41:44.400785816 -0700 @@ -246,8 +251,9 @@ do_ipconfig(cmdc, cmdv); check_path("/root"); - check_path("/old_root"); do_mounts(cmdc, cmdv); + /* do_mounts cd's to /root so below tests /root/old_root */ + check_path("old_root"); #ifndef INI_DEBUG if (pivot_root(".", "old_root") == -1) { @@ -255,...
2006 May 10
1
[patch] kinit cmdline handling change
...zeof(char *)); - memcpy(init_argv, argv, (argc+1)*sizeof(char *)); - if ((fd = open("/dev/console", O_RDWR)) != -1) { dup2(fd, STDIN_FILENO); dup2(fd, STDOUT_FILENO); @@ -293,6 +288,11 @@ goto bail; } + /* Default parameters for anything init-like we execute */ + init_argc = cmdc; + init_argv = alloca((cmdc+1)*sizeof(char *)); + memcpy(init_cmdv, cmdv, (cmdc+1)*sizeof(char *)); + /* Resume from suspend-to-disk, if appropriate */ /* If successful, does not return */ do_resume(cmdc, cmdv);
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
2012 May 04
2
[PATCH] run-init: add drop_capabilities support
...apabilities(const char *caps); + +#endif /* KINIT_CAPABILITIES_H */ diff --git a/usr/kinit/kinit.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("/ro...
2016 Jan 17
1
[PATCH klibc] run-init: Add dry-run mode
...nit not executable"; + return NULL; /* Success */ + } } --- a/usr/kinit/kinit.c +++ b/usr/kinit/kinit.c @@ -304,7 +304,7 @@ int main(int argc, char *argv[]) init_argv[0] = strrchr(init_path, '/') + 1; errmsg = run_init("/root", "/dev/console", - get_arg(cmdc, cmdv, "drop_capabilities="), + get_arg(cmdc, cmdv, "drop_capabilities="), false, init_path, init_argv); /* If run_init returned, something went bad */ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: applicati...
2006 Mar 22
1
[patch] trivial cleanup
...e if (!S_ISDIR(st.st_mode)) { - fprintf(stderr, "NFS-Root: '%s' not a directory\n", path); + fprintf(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);
2011 Aug 03
1
[PATCH v2] kinit: Add drop_capabilities support.
...op_setpcap) + drop_capability(CAP_SETPCAP); + + free(s); + return 0; +} diff --git a/usr/kinit/kinit.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 +6...
2019 Jan 18
0
[klibc:master] run-init: Add dry-run mode
...kinit/kinit.c b/usr/kinit/kinit.c index 523c92b..de03c2d 100644 --- a/usr/kinit/kinit.c +++ b/usr/kinit/kinit.c @@ -304,7 +304,7 @@ int main(int argc, char *argv[]) init_argv[0] = strrchr(init_path, '/') + 1; errmsg = run_init("/root", "/dev/console", - get_arg(cmdc, cmdv, "drop_capabilities="), + get_arg(cmdc, cmdv, "drop_capabilities="), false, init_path, init_argv); /* If run_init returned, something went bad */ diff --git a/usr/kinit/run-init/run-init.c b/usr/kinit/run-init/run-init.c index 2147d06..a14ce7c 100644 --- a/us...
2006 Jun 06
1
arch.cmd file and init args
...I doubt the order would matter. As such, parsing arguments *after* /proc/cmdline as a necessity seems like a strong edge case to me. It seems more plausible to parse the command line args before the kernel cmdline. On a related note: kinit starts off by creating a composite argv/argc setup (cmdv/cmdc) with /arch.cmd (see above), then /proc/cmdline, then argv/argc. While I feel the order should be different, that doesn't matter here - it seems more logical to pass the entire composite args to the init= app as well. Case in point: If I edit grub to boot me into 'S' single user mode,...
2019 Apr 18
1
[PATCH] Allow the initramfs to be persisted across root changes
...-persist @@ -0,0 +1,131 @@ +diff --git a/usr/kinit/kinit.c b/usr/kinit/kinit.c +index de03c2d3..28d29534 100644 +--- a/usr/kinit/kinit.c ++++ b/usr/kinit/kinit.c +@@ -305,7 +305,7 @@ int main(int argc, char *argv[]) + + errmsg = run_init("/root", "/dev/console", + get_arg(cmdc, cmdv, "drop_capabilities="), false, +- init_path, init_argv); ++ false, init_path, init_argv); + + /* If run_init returned, something went bad */ + fprintf(stderr, "%s: %s: %s\n", progname, errmsg, strerror(errno)); +diff --git a/usr/kinit/run-init/run-init.c b/usr/k...
2010 Apr 28
1
[PATCH] RFC: Running initscripts from kinit
...em(buf); + } +out: + for (i = 0; i < used_count; i++) + free(names[i]); + free(names); + closedir(dir); +} + /* This is the argc and argv we pass to init */ const char *init_path; int init_argc; @@ -288,6 +356,8 @@ int main(int argc, char *argv[]) check_path("/root"); do_mounts(cmdc, cmdv); + do_runscripts(); + if (mnt_procfs) { umount2("/proc", 0); mnt_procfs = 0; -- 1.7.0.1
2019 Apr 18
0
[PATCH] Allow the initramfs to be persisted across root changes
...21 insertions(+), 12 deletions(-) diff --git a/usr/kinit/kinit.c b/usr/kinit/kinit.c index de03c2d3..28d29534 100644 --- a/usr/kinit/kinit.c +++ b/usr/kinit/kinit.c @@ -305,7 +305,7 @@ int main(int argc, char *argv[]) errmsg = run_init("/root", "/dev/console", get_arg(cmdc, cmdv, "drop_capabilities="), false, - init_path, init_argv); + false, init_path, init_argv); /* If run_init returned, something went bad */ fprintf(stderr, "%s: %s: %s\n", progname, errmsg, strerror(errno)); diff --git a/usr/kinit/run-init/run-init.c b/usr/kinit/r...
2019 Apr 28
0
[klibc:master] run-init: Allow the initramfs to be persisted across root changes
...21 insertions(+), 12 deletions(-) diff --git a/usr/kinit/kinit.c b/usr/kinit/kinit.c index de03c2d3..28d29534 100644 --- a/usr/kinit/kinit.c +++ b/usr/kinit/kinit.c @@ -305,7 +305,7 @@ int main(int argc, char *argv[]) errmsg = run_init("/root", "/dev/console", get_arg(cmdc, cmdv, "drop_capabilities="), false, - init_path, init_argv); + false, init_path, init_argv); /* If run_init returned, something went bad */ fprintf(stderr, "%s: %s: %s\n", progname, errmsg, strerror(errno)); diff --git a/usr/kinit/run-init/run-init.c b/usr/kinit/r...
2017 Dec 31
4
[PATCH klibc 0/4] Fixes from Debian and Ubuntu
The following patches come from Debian and/or Ubuntu packages of klibc. Ben. Ben Hutchings (1): [klibc] run-init: Add dry-run mode Jay Vosburgh (1): [klibc] ipconfig: Use separate sockets for DHCP from multiple interfaces Mathieu Trudel-Lapierre (1): [klibc] ipconfig: Set broadcast when sending DHCPREQUEST and DHCPDISCOVER YunQiang Su (1): [klibc] mips: setjmp.S: don't
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 Jul 19
4
[PATCH v1 0/2] Support dropping of capabilities from early userspace.
This patchset applies to klibc mainline. As is it will probably collide with Maximilian's recent patch to rename run-init to switch_root posted last week. To boot an untrusted environment with certain capabilities locked out, we'd like to be able to drop the capabilities up front from early userspace, before we actually transition onto the root volume. This patchset implements this by