summaryrefslogtreecommitdiffstats
path: root/isys
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2003-02-18 00:45:54 +0000
committerJeremy Katz <katzj@redhat.com>2003-02-18 00:45:54 +0000
commit0c8eba97b35d7503336bc7b2ea154ce98aebaaf2 (patch)
tree7f8da4dbbf3dde47de40ba8eea7a6b583b10e15e /isys
parent9a5589e67a1862f7e49e62d2b65e54db54b7c787 (diff)
downloadanaconda-0c8eba97b35d7503336bc7b2ea154ce98aebaaf2.tar.gz
anaconda-0c8eba97b35d7503336bc7b2ea154ce98aebaaf2.tar.xz
anaconda-0c8eba97b35d7503336bc7b2ea154ce98aebaaf2.zip
support bind mounts for upgrade/rescue mode.
basically, create a new filesystem type and device which get used and add a keyword parameter for mounting the diff looks large, but most of it is adjusting callers of doPwMount in the loader
Diffstat (limited to 'isys')
-rw-r--r--isys/imount.c4
-rw-r--r--isys/imount.h2
-rw-r--r--isys/isys.c7
-rw-r--r--isys/isys.py5
4 files changed, 11 insertions, 7 deletions
diff --git a/isys/imount.c b/isys/imount.c
index a17628fc7..a249888a0 100644
--- a/isys/imount.c
+++ b/isys/imount.c
@@ -14,7 +14,7 @@
static int mkdirIfNone(char * directory);
int doPwMount(char * dev, char * where, char * fs, int rdonly, int istty,
- char * acct, char * pw) {
+ char * acct, char * pw, int bindmnt) {
char * buf = NULL;
int isnfs = 0;
char * mount_opt = NULL;
@@ -82,6 +82,8 @@ int doPwMount(char * dev, char * where, char * fs, int rdonly, int istty,
flag = MS_MGC_VAL;
if (rdonly)
flag |= MS_RDONLY;
+ if (bindmnt)
+ flag |= MS_BIND;
if (!strncmp(fs, "vfat", 4))
mount_opt="check=relaxed";
diff --git a/isys/imount.h b/isys/imount.h
index 8fa7e8f26..3f7e826bd 100644
--- a/isys/imount.h
+++ b/isys/imount.h
@@ -7,7 +7,7 @@
#include <sys/mount.h> /* for umount() */
int doPwMount(char * dev, char * where, char * fs, int rdonly, int istty,
- char * acct, char * pw);
+ char * acct, char * pw, int bindmnt);
int mkdirChain(char * origChain);
#endif
diff --git a/isys/isys.c b/isys/isys.c
index d74112607..53098741b 100644
--- a/isys/isys.c
+++ b/isys/isys.c
@@ -487,11 +487,12 @@ static PyObject * doMount(PyObject * s, PyObject * args) {
char * fs, * device, * mntpoint;
int rc;
int readOnly;
+ int bindMount;
- if (!PyArg_ParseTuple(args, "sssi", &fs, &device, &mntpoint,
- &readOnly)) return NULL;
+ if (!PyArg_ParseTuple(args, "sssii", &fs, &device, &mntpoint,
+ &readOnly, &bindMount)) return NULL;
- rc = doPwMount(device, mntpoint, fs, readOnly, 0, NULL, NULL);
+ rc = doPwMount(device, mntpoint, fs, readOnly, 0, NULL, NULL, bindMount);
if (rc == IMOUNT_ERR_ERRNO)
PyErr_SetFromErrno(PyExc_SystemError);
else if (rc)
diff --git a/isys/isys.py b/isys/isys.py
index 2f104ee5c..176b572ab 100644
--- a/isys/isys.py
+++ b/isys/isys.py
@@ -141,7 +141,7 @@ def ddfile(file, megs, pw = None):
os.close(fd)
-def mount(device, location, fstype = "ext2", readOnly = 0):
+def mount(device, location, fstype = "ext2", readOnly = 0, bindMount = 0):
location = os.path.normpath(location)
#
@@ -160,7 +160,8 @@ def mount(device, location, fstype = "ext2", readOnly = 0):
mountCount[location] = mountCount[location] + 1
return
- rc = _isys.mount(fstype, device, location, readOnly)
+ log("going to mount %s on %s" %(device, location))
+ rc = _isys.mount(fstype, device, location, readOnly, bindMount)
if not rc:
mountCount[location] = 1