From ad3593e93dbbbf2f797141d0425d1d5f847d6551 Mon Sep 17 00:00:00 2001 From: Gui Chen Date: Thu, 15 Aug 2013 03:47:01 -0400 Subject: [PATCH] bind mount /lib/modules with 'ro' option to keep the /lib/modules untouch as expected, we must use 'ro' option when mounting it Signed-off-by: Gui Chen --- mic/chroot.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mic/chroot.py b/mic/chroot.py index 4e4120d..ac2c007 100644 --- a/mic/chroot.py +++ b/mic/chroot.py @@ -117,7 +117,11 @@ def get_bindmounts(chrootdir, bindmounts = None): mountlist.append(tuple((mntpoint, None))) for pair in mountlist: - bmount = fs_related.BindChrootMount(pair[0], chrootdir, pair[1]) + if pair[0] == "/lib/modules": + opt = "ro" + else: + opt = None + bmount = fs_related.BindChrootMount(pair[0], chrootdir, pair[1], opt) chroot_bindmounts.append(bmount) return chroot_bindmounts -- 2.7.4