Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 300553 Details for
Bug 401573
sys-apps/openrc: If /usr is mount and is read-only, remount it into into read-write
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
0001-fstabinfo-add-remount-option.patch
0001-fstabinfo-add-remount-option.patch (text/plain), 2.79 KB, created by
William Hubbs
on 2012-01-31 18:06:54 UTC
(
hide
)
Description:
0001-fstabinfo-add-remount-option.patch
Filename:
MIME Type:
Creator:
William Hubbs
Created:
2012-01-31 18:06:54 UTC
Size:
2.79 KB
patch
obsolete
>From e1b9bceec613222a431621745e419315c7156df0 Mon Sep 17 00:00:00 2001 >From: William Hubbs <williamh@gentoo.org> >Date: Tue, 31 Jan 2012 10:56:57 -0600 >Subject: [PATCH] fstabinfo: add --remount option > >--- > src/rc/fstabinfo.c | 37 ++++++++++++++++++++++++++++++------- > 1 files changed, 30 insertions(+), 7 deletions(-) > >diff --git a/src/rc/fstabinfo.c b/src/rc/fstabinfo.c >index 3cf0e02..c6cf2a6 100644 >--- a/src/rc/fstabinfo.c >+++ b/src/rc/fstabinfo.c >@@ -93,20 +93,33 @@ getmntfile(const char *file) > extern const char *applet; > > static int >-do_mount(struct ENT *ent) >+do_mount(struct ENT *ent, bool remount) > { >- char *argv[8]; >+ char *argv[10]; > pid_t pid; > int status; > >+ memset(argv, NULL, sizeof(argv)); > argv[0] = UNCONST("mount"); > argv[1] = UNCONST("-o"); > argv[2] = ENT_OPTS(*ent); > argv[3] = UNCONST("-t"); > argv[4] = ENT_TYPE(*ent); >- argv[5] = ENT_BLOCKDEVICE(*ent); >- argv[6] = ENT_FILE(*ent); >- argv[7] = NULL; >+ if (!remount) { >+ argv[5] = ENT_BLOCKDEVICE(*ent); >+ argv[6] = ENT_FILE(*ent); >+ } else { >+#ifdef __linux__ >+ argv[5] = UNCONST("-o"); >+ argv[6] = UNCONST("remount"); >+ argv[7] = ENT_BLOCKDEVICE(*ent); >+ argv[8] = ENT_FILE(*ent); >+#else >+ argv[5] = UNCONST("-u"); >+ argv[6] = ENT_BLOCKDEVICE(*ent); >+ argv[7] = ENT_FILE(*ent); >+#endif >+ } > switch (pid = vfork()) { > case -1: > eerrorx("%s: vfork: %s", applet, strerror(errno)); >@@ -127,9 +140,10 @@ do_mount(struct ENT *ent) > } > > #include "_usage.h" >-#define getoptstring "Mbmop:t:" getoptstring_COMMON >+#define getoptstring "MRbmop:t:" getoptstring_COMMON > static const struct option longopts[] = { > { "mount", 0, NULL, 'M' }, >+ { "remount", 0, NULL, 'R' }, > { "blockdevice", 0, NULL, 'b' }, > { "mountargs", 0, NULL, 'm' }, > { "options", 0, NULL, 'o' }, >@@ -139,6 +153,7 @@ static const struct option longopts[] = { > }; > static const char * const longopts_help[] = { > "Mounts the filesytem from the mountpoint", >+ "Remounts the filesystem based on the information in fstab", > "Extract the block device", > "Show arguments needed to mount the entry", > "Extract the options field", >@@ -154,6 +169,7 @@ static const char * const longopts_help[] = { > #define OUTPUT_PASSNO (1 << 4) > #define OUTPUT_BLOCKDEV (1 << 5) > #define OUTPUT_MOUNT (1 << 6) >+#define OUTPUT_REMOUNT (1 << 7) > > int > fstabinfo(int argc, char **argv) >@@ -182,6 +198,9 @@ fstabinfo(int argc, char **argv) > case 'M': > output = OUTPUT_MOUNT; > break; >+ case 'R': >+ output = OUTPUT_REMOUNT; >+ break; > case 'b': > output = OUTPUT_BLOCKDEV; > break; >@@ -287,7 +306,11 @@ fstabinfo(int argc, char **argv) > break; > > case OUTPUT_MOUNT: >- result += do_mount(ent); >+ result += do_mount(ent, false); >+ break; >+ >+ case OUTPUT_REMOUNT: >+ result += do_mount(ent, true); > break; > > case OUTPUT_MOUNTARGS: >-- >1.7.3.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 401573
:
300467
|
300471
|
300485
|
300487
|
300489
| 300553 |
300879
|
301041