Displaying 9 results from an estimated 9 matches for "nuke_dir".
2004 Jul 30
1
Patch for bug in nuke_dirent in run-init.c
Hi
In run-init.c there is a minor bug which can cause major problems i.e.
not able to boot systems with udev-enabled initramfs on systems with
multiple cdrom drives. In nuke_dirent () in run-init.c the stat call
should be replaced with a lstat call, else nuking symbolic links which
have been created before the link target will fail. Was somewhat tricky
to debug... The bug gets triggered by udev with the /dev/cdrom symbolic
link rule (from the default udev rules file) if th...
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
2016 Jan 17
1
[PATCH klibc] run-init: Add dry-run mode
...ps, bool dry_run, const char *init,
char **initargs)
{
- struct stat rst, cst;
+ struct stat rst, cst, ist;
struct statfs sfs;
int confd;
@@ -186,13 +186,15 @@ const char *run_init(const char *realroo
/* Okay, I think we should be safe... */
- /* Delete rootfs contents */
- if (nuke_dir("/"))
- return "nuking initramfs contents";
-
- /* Overmount the root */
- if (mount(".", "/", NULL, MS_MOVE, NULL))
- return "overmounting root";
+ if (!dry_run) {
+ /* Delete rootfs contents */
+ if (nuke_dir("/"))
+ return "n...
2019 Apr 18
1
[PATCH] Allow the initramfs to be persisted across root changes
...sist_initramfs, const char *init, char **initargs)
+ {
+ struct stat rst, cst, ist;
+ struct statfs sfs;
+@@ -187,9 +187,11 @@ const char *run_init(const char *realroot, const char *console,
+ /* Okay, I think we should be safe... */
+
+ if (!dry_run) {
+- /* Delete rootfs contents */
+- if (nuke_dir("/"))
+- return "nuking initramfs contents";
++ if (!persist_initramfs) {
++ /* Delete rootfs contents */
++ if (nuke_dir("/"))
++ return "nuking initramfs contents";
++ }
+
+ /* Overmount the root */
+ if (mount(".", "/",...
2019 Apr 18
0
[PATCH] Allow the initramfs to be persisted across root changes
...bool persist_initramfs, const char *init, char **initargs)
{
struct stat rst, cst, ist;
struct statfs sfs;
@@ -187,9 +187,11 @@ const char *run_init(const char *realroot, const char *console,
/* Okay, I think we should be safe... */
if (!dry_run) {
- /* Delete rootfs contents */
- if (nuke_dir("/"))
- return "nuking initramfs contents";
+ if (!persist_initramfs) {
+ /* Delete rootfs contents */
+ if (nuke_dir("/"))
+ return "nuking initramfs contents";
+ }
/* Overmount the root */
if (mount(".", "/", NULL, MS_...
2019 Apr 28
0
[klibc:master] run-init: Allow the initramfs to be persisted across root changes
...bool persist_initramfs, const char *init, char **initargs)
{
struct stat rst, cst, ist;
struct statfs sfs;
@@ -187,9 +187,11 @@ const char *run_init(const char *realroot, const char *console,
/* Okay, I think we should be safe... */
if (!dry_run) {
- /* Delete rootfs contents */
- if (nuke_dir("/"))
- return "nuking initramfs contents";
+ if (!persist_initramfs) {
+ /* Delete rootfs contents */
+ if (nuke_dir("/"))
+ return "nuking initramfs contents";
+ }
/* Overmount the root */
if (mount(".", "/", NULL, MS_...
2019 Jan 18
0
[klibc:master] run-init: Add dry-run mode
...char *init,
char **initargs)
{
- struct stat rst, cst;
+ struct stat rst, cst, ist;
struct statfs sfs;
int confd;
@@ -186,13 +186,15 @@ const char *run_init(const char *realroot, const char *console,
/* Okay, I think we should be safe... */
- /* Delete rootfs contents */
- if (nuke_dir("/"))
- return "nuking initramfs contents";
+ if (!dry_run) {
+ /* Delete rootfs contents */
+ if (nuke_dir("/"))
+ return "nuking initramfs contents";
- /* Overmount the root */
- if (mount(".", "/", NULL, MS_MOVE, NULL))
- return...
2006 Aug 18
2
[patch] simplify nuke
...20 +++++---------------
1 file changed, 5 insertions(+), 15 deletions(-)
diff --git a/usr/utils/nuke.c b/usr/utils/nuke.c
index 01b300f..9470bcf 100644
--- a/usr/utils/nuke.c
+++ b/usr/utils/nuke.c
@@ -101,18 +101,11 @@ static int nuke(const char *what)
/* It's a directory. */
err = nuke_dir(what);
if (!err)
- err = rmdir(what) ? errno : err;
- } else {
- err = errno;
+ rmdir(what);
}
}
- if (err) {
- fprintf(stderr, "%s: %s: %s\n", program, what, strerror(err));
- return err;
- } else {
- return 0;
- }
+ return 0;
}
int main(int argc, char *argv[])...
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