Changes to 'refs/tags/livecd-tools-17.12'
by Brian C. Lane
Tag 'livecd-tools-17.12' created by Brian C. Lane <bcl(a)redhat.com> at 2012-07-31 20:50 +0000
Tag as livecd-tools-17.12
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iQEVAwUAUBhFKRF+jBaO/jp/AQLU4Qf/W+c1/AQVC2hz/OKxMb3VJCfC+kX5SUAM
Wtse3MFS+5fHntAjS1py6sLAfGtiXnsb6xP2KqqNaDNpgOmiboKdpjp++8ObLQ6J
VUD7ZoOCnAAvV6vaIBLTgHjmJeFoYLGmPLJnaPCCDfJa5QXkC6zlQDjlYVrN0jRf
TLvvPX4bbm1dLOG5mSwFiYEhw2fJ/iucmK4OMSBX6FmcW+ulyY4U9cve15I/Ar0v
A/nDzCSsW+Q7McxTByIDp0NRFO27SMy+POt/FbYNoxhP0Thdvg1zRs74legNPaEI
+sXhaR4HxguhpUn8xpUKHUdG921cGfseXoqlQ6j3brL4iqaolJ2AGQ==
=uihB
-----END PGP SIGNATURE-----
Changes since livecd-tools-17.11:
Brian C. Lane (3):
imgcreate: Use copy2 for TimezoneConfig (#829032)
dracut doesn't need explicit filesystems
Version 17.12
Joey Boggs (1):
if mounting squashfs add ro mount option
Martin Langhoff (2):
Implement cacheonly (offline) support in ImageCreator and LoopCreator
livecd-creator: Add --cacheonly for offline use
---
Makefile | 2 +-
imgcreate/creator.py | 12 ++++++++----
imgcreate/fs.py | 3 ++-
imgcreate/kickstart.py | 2 +-
imgcreate/live.py | 5 ++---
imgcreate/yuminst.py | 9 ++++++---
tools/livecd-creator | 10 ++++++++--
7 files changed, 28 insertions(+), 15 deletions(-)
---
11 years, 4 months
Branch 'f17-branch' - 6 commits - imgcreate/creator.py imgcreate/fs.py imgcreate/kickstart.py imgcreate/live.py imgcreate/yuminst.py Makefile tools/livecd-creator
by Brian C. Lane
Makefile | 2 +-
imgcreate/creator.py | 12 ++++++++----
imgcreate/fs.py | 3 ++-
imgcreate/kickstart.py | 2 +-
imgcreate/live.py | 5 ++---
imgcreate/yuminst.py | 9 ++++++---
tools/livecd-creator | 10 ++++++++--
7 files changed, 28 insertions(+), 15 deletions(-)
New commits:
commit 24a16d370bbe8133b736e26b4232d60d5aa6257c
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Tue Jul 31 13:50:34 2012 -0700
Version 17.12
diff --git a/Makefile b/Makefile
index 49fba36..85ea462 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
-VERSION = 17.11
+VERSION = 17.12
INSTALL = /usr/bin/install -c
INSTALL_PROGRAM = ${INSTALL}
commit fecdb917a4465ba5b74e97e2825e77af07c62108
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Tue Jul 31 11:12:24 2012 -0700
dracut doesn't need explicit filesystems
diff --git a/imgcreate/live.py b/imgcreate/live.py
index 8872f24..88c7034 100755
--- a/imgcreate/live.py
+++ b/imgcreate/live.py
@@ -295,7 +295,6 @@ class LiveImageCreatorBase(LoopImageCreator):
if not os.path.exists(os.path.dirname(path)):
makedirs(os.path.dirname(path))
f = open(path, "a")
- f.write('filesystems+="' + self.__extra_filesystems() + ' "\n')
f.write('drivers+="' + self.__extra_drivers() + ' "\n')
f.write('add_dracutmodules+=" dmsquash-live "')
f.close()
commit 9bc6abca1b80a44778bc49f3b59eab1306b5c03b
Author: Martin Langhoff <martin(a)laptop.org>
Date: Tue Jul 24 09:39:00 2012 -0400
livecd-creator: Add --cacheonly for offline use
First, complete a run with --cache=/some/cache/dir, then you can
re-run it with --cache=/some/cache/dir --cacheonly
Lightly tested.
diff --git a/tools/livecd-creator b/tools/livecd-creator
index 8bb81aa..e9be1e5 100755
--- a/tools/livecd-creator
+++ b/tools/livecd-creator
@@ -75,6 +75,10 @@ def parse_options(args):
sysopt.add_option("", "--cache", type="string",
dest="cachedir", default=None,
help="Cache directory to use (default: private cache")
+ sysopt.add_option("", "--cacheonly", action="store_true",
+ dest="cacheonly", default=False,
+ help="Work offline from cache, use together with --cache (default: False)")
+
parser.add_option_group(sysopt)
imgcreate.setup_logging(parser)
@@ -175,13 +179,15 @@ def main():
releasever=options.releasever,
tmpdir=os.path.abspath(options.tmpdir),
useplugins=options.plugins,
- title=title, product=product)
+ title=title, product=product,
+ cacheonly=options.cacheonly)
elif options.image_type == 'image':
creator = imgcreate.LoopImageCreator(ks, name,
fslabel=fslabel,
releasever=options.releasever,
useplugins=options.plugins,
- tmpdir=os.path.abspath(options.tmpdir))
+ tmpdir=os.path.abspath(options.tmpdir),
+ cacheonly=options.cacheonly)
else:
# Cannot happen, we validate this when parsing options.
logging.error(u"'%s' is not a valid image type" % options.image_type)
commit cc1290b70ebeca3470ea8272d2654b412f03fa82
Author: Martin Langhoff <martin(a)laptop.org>
Date: Mon Jul 23 17:30:27 2012 -0400
Implement cacheonly (offline) support in ImageCreator and LoopCreator
this takes advangage of yum backend smarts in supporting offline usage.
This allows OLPC OS Builder, a user of imgcreate, to support offline use.
diff --git a/imgcreate/creator.py b/imgcreate/creator.py
index d8249cb..77b6e56 100644
--- a/imgcreate/creator.py
+++ b/imgcreate/creator.py
@@ -51,7 +51,7 @@ class ImageCreator(object):
"""
- def __init__(self, ks, name, releasever=None, tmpdir="/tmp", useplugins=False):
+ def __init__(self, ks, name, releasever=None, tmpdir="/tmp", useplugins=False, cacheonly=False):
"""Initialize an ImageCreator instance.
ks -- a pykickstart.KickstartParser instance; this instance will be
@@ -64,6 +64,8 @@ class ImageCreator(object):
releasever -- Value to substitute for $releasever in repo urls
tmpdir -- Top level directory to use for temporary files and dirs
+
+ cacheonly -- Only read from cache, work offline
"""
self.ks = ks
"""A pykickstart.KickstartParser instance."""
@@ -79,6 +81,8 @@ class ImageCreator(object):
if not os.path.exists(self.tmpdir):
makedirs(self.tmpdir)
+ self.cacheonly = cacheonly
+
self.__builddir = None
self.__bindmounts = []
@@ -619,7 +623,7 @@ class ImageCreator(object):
yum_conf = self._mktemp(prefix = "yum.conf-")
ayum = LiveCDYum(releasever=self.releasever, useplugins=self.useplugins)
- ayum.setup(yum_conf, self._instroot)
+ ayum.setup(yum_conf, self._instroot, cacheonly=self.cacheonly)
for repo in kickstart.get_repos(self.ks, repo_urls):
(name, baseurl, mirrorlist, proxy, inc, exc, cost) = repo
@@ -780,7 +784,7 @@ class LoopImageCreator(ImageCreator):
"""
- def __init__(self, ks, name, fslabel=None, releasever=None, tmpdir="/tmp", useplugins=False):
+ def __init__(self, ks, name, fslabel=None, releasever=None, tmpdir="/tmp", useplugins=False, cacheonly=False):
"""Initialize a LoopImageCreator instance.
This method takes the same arguments as ImageCreator.__init__() with
@@ -789,7 +793,7 @@ class LoopImageCreator(ImageCreator):
fslabel -- A string used as a label for any filesystems created.
"""
- ImageCreator.__init__(self, ks, name, releasever=releasever, tmpdir=tmpdir, useplugins=useplugins)
+ ImageCreator.__init__(self, ks, name, releasever=releasever, tmpdir=tmpdir, useplugins=useplugins, cacheonly=cacheonly)
self.__fslabel = None
self.fslabel = fslabel
diff --git a/imgcreate/live.py b/imgcreate/live.py
index cd022a5..8872f24 100755
--- a/imgcreate/live.py
+++ b/imgcreate/live.py
@@ -40,7 +40,7 @@ class LiveImageCreatorBase(LoopImageCreator):
"""
def __init__(self, ks, name, fslabel=None, releasever=None, tmpdir="/tmp",
- title="Linux", product="Linux", useplugins=False):
+ title="Linux", product="Linux", useplugins=False, cacheonly=False):
"""Initialise a LiveImageCreator instance.
This method takes the same arguments as LoopImageCreator.__init__().
@@ -50,7 +50,7 @@ class LiveImageCreatorBase(LoopImageCreator):
fslabel=fslabel,
releasever=releasever,
tmpdir=tmpdir,
- useplugins=useplugins)
+ useplugins=useplugins, cacheonly=cacheonly)
self.compress_type = "xz"
"""mksquashfs compressor to use."""
diff --git a/imgcreate/yuminst.py b/imgcreate/yuminst.py
index 5605eea..97e5ecf 100644
--- a/imgcreate/yuminst.py
+++ b/imgcreate/yuminst.py
@@ -92,11 +92,14 @@ class LiveCDYum(yum.YumBase):
for f in glob.glob(installroot + "/var/lib/rpm/__db*"):
os.unlink(f)
- def setup(self, confpath, installroot):
+ def setup(self, confpath, installroot, cacheonly=False):
self._writeConf(confpath, installroot)
self._cleanupRpmdbLocks(installroot)
self.doConfigSetup(fn = confpath, root = installroot)
- self.conf.cache = 0
+ if cacheonly:
+ self.conf.cache = 1
+ else:
+ self.conf.cache = 0
self.doTsSetup()
self.doRpmDBSetup()
self.doRepoSetup()
@@ -176,7 +179,7 @@ class LiveCDYum(yum.YumBase):
# disable gpg check???
repo.gpgcheck = 0
repo.enable()
- repo.setup(0)
+ repo.setup(self.conf.cache)
repo.setCallback(TextProgress())
self.repos.add(repo)
return repo
commit e2f3a0f70ae4cd4f5d421ee230c2a446b9d4395e
Author: Joey Boggs <jboggs(a)redhat.com>
Date: Mon Jul 9 14:38:50 2012 -0400
if mounting squashfs add ro mount option
This just adds the ro mount option when using squashfs images otherwise we get output
saying read/write mount failed switching to readonly.
Signed-off-by: Joey Boggs <jboggs(a)redhat.com>
diff --git a/imgcreate/fs.py b/imgcreate/fs.py
index da444e4..d4558d3 100644
--- a/imgcreate/fs.py
+++ b/imgcreate/fs.py
@@ -433,7 +433,8 @@ class DiskMount(Mount):
args = [ "/bin/mount", self.disk.device, self.mountdir ]
if self.fstype:
args.extend(["-t", self.fstype])
-
+ if self.fstype == "squashfs":
+ args.extend(["-o", "ro"])
rc = call(args)
if rc != 0:
raise MountError("Failed to mount '%s' to '%s'" %
commit a49aeb25176a832a083f871ff025a73fecc2df0c
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Tue Jun 12 12:18:02 2012 -0700
imgcreate: Use copy2 for TimezoneConfig (#829032)
diff --git a/imgcreate/kickstart.py b/imgcreate/kickstart.py
index ad69a87..aca4043 100644
--- a/imgcreate/kickstart.py
+++ b/imgcreate/kickstart.py
@@ -154,7 +154,7 @@ class TimezoneConfig(KickstartConfig):
f.write("UTC=" + utc + "\n")
f.close()
try:
- shutil.copyfile(self.path("/usr/share/zoneinfo/%s" %(tz,)),
+ shutil.copy2(self.path("/usr/share/zoneinfo/%s" %(tz,)),
self.path("/etc/localtime"))
except OSError, e:
log.error("Error copying timezone: %s" %(e.strerror,))
11 years, 4 months
4 commits - imgcreate/creator.py imgcreate/kickstart.py imgcreate/live.py imgcreate/yuminst.py tools/livecd-creator
by Brian C. Lane
imgcreate/creator.py | 12 ++++++++----
imgcreate/kickstart.py | 2 +-
imgcreate/live.py | 5 ++---
imgcreate/yuminst.py | 9 ++++++---
tools/livecd-creator | 10 ++++++++--
5 files changed, 25 insertions(+), 13 deletions(-)
New commits:
commit f62f3eab2963d756fa7f8f73abf0e73ffc2296e4
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Tue Jul 31 11:58:48 2012 -0700
switch to using rd.live.image instead of liveimg
diff --git a/imgcreate/kickstart.py b/imgcreate/kickstart.py
index aca4043..3bcbe1e 100644
--- a/imgcreate/kickstart.py
+++ b/imgcreate/kickstart.py
@@ -476,7 +476,7 @@ def get_timeout(ks, default = None):
return default
return int(ks.handler.bootloader.timeout)
-def get_kernel_args(ks, default = "ro liveimg quiet"):
+def get_kernel_args(ks, default = "ro rd.live.image quiet"):
if not hasattr(ks.handler.bootloader, "appendLine"):
return default
if ks.handler.bootloader.appendLine is None:
commit 091812a30e7d7f004962b10337e9ccdfb8fcfc08
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Tue Jul 31 11:12:24 2012 -0700
dracut doesn't need explicit filesystems
diff --git a/imgcreate/live.py b/imgcreate/live.py
index 8872f24..88c7034 100755
--- a/imgcreate/live.py
+++ b/imgcreate/live.py
@@ -295,7 +295,6 @@ class LiveImageCreatorBase(LoopImageCreator):
if not os.path.exists(os.path.dirname(path)):
makedirs(os.path.dirname(path))
f = open(path, "a")
- f.write('filesystems+="' + self.__extra_filesystems() + ' "\n')
f.write('drivers+="' + self.__extra_drivers() + ' "\n')
f.write('add_dracutmodules+=" dmsquash-live "')
f.close()
commit 93588da9058253fcafc8246b8354ad239c6746aa
Author: Martin Langhoff <martin(a)laptop.org>
Date: Tue Jul 24 09:39:00 2012 -0400
livecd-creator: Add --cacheonly for offline use
First, complete a run with --cache=/some/cache/dir, then you can
re-run it with --cache=/some/cache/dir --cacheonly
Lightly tested.
diff --git a/tools/livecd-creator b/tools/livecd-creator
index 8bb81aa..e9be1e5 100755
--- a/tools/livecd-creator
+++ b/tools/livecd-creator
@@ -75,6 +75,10 @@ def parse_options(args):
sysopt.add_option("", "--cache", type="string",
dest="cachedir", default=None,
help="Cache directory to use (default: private cache")
+ sysopt.add_option("", "--cacheonly", action="store_true",
+ dest="cacheonly", default=False,
+ help="Work offline from cache, use together with --cache (default: False)")
+
parser.add_option_group(sysopt)
imgcreate.setup_logging(parser)
@@ -175,13 +179,15 @@ def main():
releasever=options.releasever,
tmpdir=os.path.abspath(options.tmpdir),
useplugins=options.plugins,
- title=title, product=product)
+ title=title, product=product,
+ cacheonly=options.cacheonly)
elif options.image_type == 'image':
creator = imgcreate.LoopImageCreator(ks, name,
fslabel=fslabel,
releasever=options.releasever,
useplugins=options.plugins,
- tmpdir=os.path.abspath(options.tmpdir))
+ tmpdir=os.path.abspath(options.tmpdir),
+ cacheonly=options.cacheonly)
else:
# Cannot happen, we validate this when parsing options.
logging.error(u"'%s' is not a valid image type" % options.image_type)
commit 2d7c4518410d328f5d91664d2a2c64ab55939d25
Author: Martin Langhoff <martin(a)laptop.org>
Date: Mon Jul 23 17:30:27 2012 -0400
Implement cacheonly (offline) support in ImageCreator and LoopCreator
this takes advangage of yum backend smarts in supporting offline usage.
This allows OLPC OS Builder, a user of imgcreate, to support offline use.
diff --git a/imgcreate/creator.py b/imgcreate/creator.py
index d8249cb..77b6e56 100644
--- a/imgcreate/creator.py
+++ b/imgcreate/creator.py
@@ -51,7 +51,7 @@ class ImageCreator(object):
"""
- def __init__(self, ks, name, releasever=None, tmpdir="/tmp", useplugins=False):
+ def __init__(self, ks, name, releasever=None, tmpdir="/tmp", useplugins=False, cacheonly=False):
"""Initialize an ImageCreator instance.
ks -- a pykickstart.KickstartParser instance; this instance will be
@@ -64,6 +64,8 @@ class ImageCreator(object):
releasever -- Value to substitute for $releasever in repo urls
tmpdir -- Top level directory to use for temporary files and dirs
+
+ cacheonly -- Only read from cache, work offline
"""
self.ks = ks
"""A pykickstart.KickstartParser instance."""
@@ -79,6 +81,8 @@ class ImageCreator(object):
if not os.path.exists(self.tmpdir):
makedirs(self.tmpdir)
+ self.cacheonly = cacheonly
+
self.__builddir = None
self.__bindmounts = []
@@ -619,7 +623,7 @@ class ImageCreator(object):
yum_conf = self._mktemp(prefix = "yum.conf-")
ayum = LiveCDYum(releasever=self.releasever, useplugins=self.useplugins)
- ayum.setup(yum_conf, self._instroot)
+ ayum.setup(yum_conf, self._instroot, cacheonly=self.cacheonly)
for repo in kickstart.get_repos(self.ks, repo_urls):
(name, baseurl, mirrorlist, proxy, inc, exc, cost) = repo
@@ -780,7 +784,7 @@ class LoopImageCreator(ImageCreator):
"""
- def __init__(self, ks, name, fslabel=None, releasever=None, tmpdir="/tmp", useplugins=False):
+ def __init__(self, ks, name, fslabel=None, releasever=None, tmpdir="/tmp", useplugins=False, cacheonly=False):
"""Initialize a LoopImageCreator instance.
This method takes the same arguments as ImageCreator.__init__() with
@@ -789,7 +793,7 @@ class LoopImageCreator(ImageCreator):
fslabel -- A string used as a label for any filesystems created.
"""
- ImageCreator.__init__(self, ks, name, releasever=releasever, tmpdir=tmpdir, useplugins=useplugins)
+ ImageCreator.__init__(self, ks, name, releasever=releasever, tmpdir=tmpdir, useplugins=useplugins, cacheonly=cacheonly)
self.__fslabel = None
self.fslabel = fslabel
diff --git a/imgcreate/live.py b/imgcreate/live.py
index cd022a5..8872f24 100755
--- a/imgcreate/live.py
+++ b/imgcreate/live.py
@@ -40,7 +40,7 @@ class LiveImageCreatorBase(LoopImageCreator):
"""
def __init__(self, ks, name, fslabel=None, releasever=None, tmpdir="/tmp",
- title="Linux", product="Linux", useplugins=False):
+ title="Linux", product="Linux", useplugins=False, cacheonly=False):
"""Initialise a LiveImageCreator instance.
This method takes the same arguments as LoopImageCreator.__init__().
@@ -50,7 +50,7 @@ class LiveImageCreatorBase(LoopImageCreator):
fslabel=fslabel,
releasever=releasever,
tmpdir=tmpdir,
- useplugins=useplugins)
+ useplugins=useplugins, cacheonly=cacheonly)
self.compress_type = "xz"
"""mksquashfs compressor to use."""
diff --git a/imgcreate/yuminst.py b/imgcreate/yuminst.py
index 5605eea..97e5ecf 100644
--- a/imgcreate/yuminst.py
+++ b/imgcreate/yuminst.py
@@ -92,11 +92,14 @@ class LiveCDYum(yum.YumBase):
for f in glob.glob(installroot + "/var/lib/rpm/__db*"):
os.unlink(f)
- def setup(self, confpath, installroot):
+ def setup(self, confpath, installroot, cacheonly=False):
self._writeConf(confpath, installroot)
self._cleanupRpmdbLocks(installroot)
self.doConfigSetup(fn = confpath, root = installroot)
- self.conf.cache = 0
+ if cacheonly:
+ self.conf.cache = 1
+ else:
+ self.conf.cache = 0
self.doTsSetup()
self.doRpmDBSetup()
self.doRepoSetup()
@@ -176,7 +179,7 @@ class LiveCDYum(yum.YumBase):
# disable gpg check???
repo.gpgcheck = 0
repo.enable()
- repo.setup(0)
+ repo.setup(self.conf.cache)
repo.setCallback(TextProgress())
self.repos.add(repo)
return repo
11 years, 4 months
Changes to 'refs/tags/livecd-tools-18.6'
by Brian C. Lane
Tag 'livecd-tools-18.6' created by Brian C. Lane <bcl(a)redhat.com> at 2012-07-31 19:01 +0000
Tag as livecd-tools-18.6
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iQEVAwUAUBgrfBF+jBaO/jp/AQLg4Af/WWVam0qc024T6yAGZGL2Y5yzS/bySHp/
cS4MKtJj33xv1dpXZFzUo4XKTN4t7nwDhci3YryPKisZQgKxnaScmYmpXIumETdz
fAhmZSg17DYJW9VP2JXW8DzGkNZnL5sKAbhrLXMveYdFgMcidcRiygWk4SIhjxA0
3i158TP09yBzc/Fq1zczunbGFzZ8ZLaGIIEqt/3lWrfwG1l4FXdTzw8Z8iaKDLe/
pxlfZoLxpkj+WS9aJrpWhfqRnqN3b9Lz6yrY3fzRh7GAZ+jSr4XtGJKmIVp/QC4X
eJCmyHRCr0keyFifmj/mbeZHft8t5iWhwFDkxnzhBNnYZ//vDd5yAQ==
=lbUE
-----END PGP SIGNATURE-----
Changes since livecd-tools-18.5:
Brian C. Lane (4):
imgcreate: Use copy2 for TimezoneConfig (#829032)
dracut doesn't need explicit filesystems
switch to using rd.live.image instead of liveimg
Version 18.6
Joey Boggs (1):
if mounting squashfs add ro mount option
Martin Langhoff (2):
Implement cacheonly (offline) support in ImageCreator and LoopCreator
livecd-creator: Add --cacheonly for offline use
---
Makefile | 2 +-
imgcreate/creator.py | 12 ++++++++----
imgcreate/fs.py | 3 ++-
imgcreate/kickstart.py | 4 ++--
imgcreate/live.py | 5 ++---
imgcreate/yuminst.py | 9 ++++++---
tools/livecd-creator | 10 ++++++++--
7 files changed, 29 insertions(+), 16 deletions(-)
---
11 years, 4 months
Makefile
by Brian C. Lane
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 5b8e6ab2ccd9fe20dfaff9800ec3e5b9cb10b69d
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Tue Jul 31 12:00:42 2012 -0700
Version 18.6
diff --git a/Makefile b/Makefile
index a75aa08..b944b24 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
-VERSION = 18.5
+VERSION = 18.6
INSTALL = /usr/bin/install -c
INSTALL_PROGRAM = ${INSTALL}
11 years, 4 months
imgcreate/fs.py
by Brian C. Lane
imgcreate/fs.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
New commits:
commit 51582cd889ab721d09c576008e6b93f2ca26e89c
Author: Joey Boggs <jboggs(a)redhat.com>
Date: Mon Jul 9 14:38:50 2012 -0400
if mounting squashfs add ro mount option
This just adds the ro mount option when using squashfs images otherwise we get output
saying read/write mount failed switching to readonly.
Signed-off-by: Joey Boggs <jboggs(a)redhat.com>
diff --git a/imgcreate/fs.py b/imgcreate/fs.py
index da444e4..d4558d3 100644
--- a/imgcreate/fs.py
+++ b/imgcreate/fs.py
@@ -433,7 +433,8 @@ class DiskMount(Mount):
args = [ "/bin/mount", self.disk.device, self.mountdir ]
if self.fstype:
args.extend(["-t", self.fstype])
-
+ if self.fstype == "squashfs":
+ args.extend(["-o", "ro"])
rc = call(args)
if rc != 0:
raise MountError("Failed to mount '%s' to '%s'" %
11 years, 5 months
[PATCH] if mounting squashfs add ro mount option
by Joey Boggs
This just adds the ro mount option when using squashfs images otherwise we get output
saying read/write mount failed switching to readonly.
Signed-off-by: Joey Boggs <jboggs(a)redhat.com>
---
imgcreate/fs.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/imgcreate/fs.py b/imgcreate/fs.py
index da444e4..d4558d3 100644
--- a/imgcreate/fs.py
+++ b/imgcreate/fs.py
@@ -433,7 +433,8 @@ class DiskMount(Mount):
args = [ "/bin/mount", self.disk.device, self.mountdir ]
if self.fstype:
args.extend(["-t", self.fstype])
-
+ if self.fstype == "squashfs":
+ args.extend(["-o", "ro"])
rc = call(args)
if rc != 0:
raise MountError("Failed to mount '%s' to '%s'" %
--
1.7.10.2
11 years, 5 months