Branch 'f18-branch' - 4 commits - imgcreate/creator.py imgcreate/kickstart.py imgcreate/yuminst.py
by Brian C. Lane
imgcreate/creator.py | 9 ------
imgcreate/kickstart.py | 65 +++++++++++++++++++++++++++----------------------
imgcreate/yuminst.py | 1
3 files changed, 37 insertions(+), 38 deletions(-)
New commits:
commit 84b14777b7d9025a802e03008fcec670d4164f1f
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Tue Oct 9 13:19:05 2012 -0700
add nocontexts for selinux (#858373)
We relabel everything after the install, so tell rpm not to use
selinux.
diff --git a/imgcreate/yuminst.py b/imgcreate/yuminst.py
index 97e5ecf..f753e8f 100644
--- a/imgcreate/yuminst.py
+++ b/imgcreate/yuminst.py
@@ -79,6 +79,7 @@ class LiveCDYum(yum.YumBase):
conf += "reposdir=\n"
conf += "failovermethod=priority\n"
conf += "keepcache=1\n"
+ conf += "tsflags=nocontexts\n"
f = file(confpath, "w+")
f.write(conf)
commit d72c04d6c3228de5e83eef94d8fca68398f0dab5
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Tue Oct 30 16:39:46 2012 -0700
remove lokkit usage
Write to /etc/selinux/config instead of using lokkit.
Setup firewall with firewalld's firewall-offline-cmd
diff --git a/imgcreate/creator.py b/imgcreate/creator.py
index 891d6ef..0e5ed6b 100644
--- a/imgcreate/creator.py
+++ b/imgcreate/creator.py
@@ -607,13 +607,6 @@ class ImageCreator(object):
self._get_excluded_packages()):
ayum.deselectPackage(pkg)
- # if the system is running selinux and the kickstart wants it disabled
- # we need /usr/sbin/lokkit
- def __can_handle_selinux(self, ayum):
- file = "/usr/sbin/lokkit"
- if not kickstart.selinux_enabled(self.ks) and selinux.is_selinux_enabled() and not ayum.installHasFile(file):
- raise CreatorError("Unable to disable SELinux because the installed package set did not include the file %s" % (file))
-
def install(self, repo_urls = {}):
"""Install packages into the install root.
@@ -657,8 +650,6 @@ class ImageCreator(object):
self.__select_groups(ayum)
self.__deselect_packages(ayum)
- self.__can_handle_selinux(ayum)
-
ayum.runInstall()
except yum.Errors.RepoError, e:
raise CreatorError("Unable to download from repo : %s" % (e,))
diff --git a/imgcreate/kickstart.py b/imgcreate/kickstart.py
index 1d8f5cf..7adb37a 100644
--- a/imgcreate/kickstart.py
+++ b/imgcreate/kickstart.py
@@ -175,23 +175,25 @@ class AuthConfig(KickstartConfig):
class FirewallConfig(KickstartConfig):
"""A class to apply a kickstart firewall configuration to a system."""
def apply(self, ksfirewall):
- if not os.path.exists(self.path("/usr/sbin/lokkit")):
- return
- args = ["/usr/sbin/lokkit", "-f", "--quiet", "--nostart"]
- if ksfirewall.enabled:
- args.append("--enabled")
-
- for port in ksfirewall.ports:
- args.append("--port=%s" %(port,))
- for svc in ksfirewall.services:
- args.append("--service=%s" %(svc,))
- for dev in ksfirewall.trusts:
- args.append("--trust=%s" %(dev,))
+ args = ["/usr/bin/firewall-offline-cmd"]
+ # enabled is None if neither --enable or --disable is passed
+ # default to enabled if nothing has been set.
+ if ksfirewall.enabled == False:
+ args += ["--disabled"]
else:
- args.append("--disabled")
+ args += ["--enabled"]
+
+ for dev in ksfirewall.trusts:
+ args += [ "--trust=%s" % (dev,) ]
+
+ for port in ksfirewall.ports:
+ args += [ "--port=%s" % (port,) ]
+
+ for service in ksfirewall.services:
+ args += [ "--service=%s" % (service,) ]
self.call(args)
-
+
class RootPasswordConfig(KickstartConfig):
"""A class to apply a kickstart root password configuration to a system."""
def unset(self):
@@ -426,17 +428,27 @@ class SelinuxConfig(KickstartConfig):
self.call(["/sbin/setfiles", "-p", "-e", "/proc", "-e", "/sys", "-e", "/dev", selinux.selinux_file_context_path(), "/"])
def apply(self, ksselinux):
- if os.path.exists(self.path("/usr/sbin/lokkit")):
- args = ["/usr/sbin/lokkit", "--quiet", "--nostart"]
+ selinux_config = "/etc/selinux/config"
+ if not os.path.exists(self.instroot+selinux_config):
+ return
- if ksselinux.selinux == ksconstants.SELINUX_ENFORCING:
- args.append("--selinux=enforcing")
- if ksselinux.selinux == ksconstants.SELINUX_PERMISSIVE:
- args.append("--selinux=permissive")
- if ksselinux.selinux == ksconstants.SELINUX_DISABLED:
- args.append("--selinux=disabled")
+ if ksselinux.selinux == ksconstants.SELINUX_ENFORCING:
+ cmd = "SELINUX=enforcing\n"
+ elif ksselinux.selinux == ksconstants.SELINUX_PERMISSIVE:
+ cmd = "SELINUX=permissive\n"
+ elif ksselinux.selinux == ksconstants.SELINUX_DISABLED:
+ cmd = "SELINUX=disabled\n"
+ else:
+ return
- self.call(args)
+ # Replace the SELINUX line in the config
+ lines = open(self.instroot+selinux_config).readlines()
+ with open(self.instroot+selinux_config, "w") as f:
+ for line in lines:
+ if line.startswith("SELINUX="):
+ f.write(cmd)
+ else:
+ f.write(line)
self.relabel(ksselinux)
commit 9260623205f51ab5d27a39734b55a20c80025b57
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Mon Oct 29 17:32:01 2012 -0700
use locale.conf not sysconfig/i18n (#870805)
diff --git a/imgcreate/kickstart.py b/imgcreate/kickstart.py
index c82dde3..1d8f5cf 100644
--- a/imgcreate/kickstart.py
+++ b/imgcreate/kickstart.py
@@ -131,7 +131,7 @@ class LanguageConfig(KickstartConfig):
def apply(self, kslang):
lang = kslang.lang or "en_US.UTF-8"
- f = open(self.path("/etc/sysconfig/i18n"), "w+")
+ f = open(self.path("/etc/locale.conf"), "w+")
f.write("LANG=\"" + lang + "\"\n")
f.close()
commit fa6a0a2ab7f7bc2c5a16622ac33ae446bf2b3d52
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Mon Oct 29 17:26:40 2012 -0700
don't write clock (#870805)
diff --git a/imgcreate/kickstart.py b/imgcreate/kickstart.py
index b66367c..c82dde3 100644
--- a/imgcreate/kickstart.py
+++ b/imgcreate/kickstart.py
@@ -149,11 +149,6 @@ class TimezoneConfig(KickstartConfig):
tz = kstimezone.timezone or "America/New_York"
utc = str(kstimezone.isUtc)
- f = open(self.path("/etc/sysconfig/clock"), "w+")
- f.write("ZONE=\"" + tz + "\"\n")
- f.write("UTC=" + utc + "\n")
- f.close()
-
# /etc/localtime is a symlink with glibc > 2.15-41
if os.path.islink(self.path("/etc/localtime")):
os.unlink(self.path("/etc/localtime"))
10 years, 11 months
Changes to 'refs/tags/livecd-tools-13.4.3'
by Brian C. Lane
Tag 'livecd-tools-13.4.3' created by Brian C. Lane <bcl(a)redhat.com> at 2012-10-25 17:05 +0000
Tag as livecd-tools-13.4.3
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iQEVAwUAUIlxaRF+jBaO/jp/AQKrcwf/RA0ejw3srj7r9ple0qfU7Furhq0pmNOR
I/bub5nEYM88MMSDp32anBsQo+l8SDJ4xfh7WBgssmIbPJv1fK3uzGSB7WX41oG/
oMt1T+UfYunuMocggi/d1IrW4qq+VXMcefsu7ksgsdfQiCJBpxZ81X3mgBeXebYz
ylJ53T/cF1aKzdL89zLj48/PyM6lCMdqfOqwb9Gh7APmER2OBIrYLbn0FG5NTkFP
DnaKIYtoObFlGh5wKAswhU1biXQPXzgnCVOp36VYERmzZALeLi/wXK7eChT1em+j
jQe1gSAkNPseH9Szg3ODbIKk1TkyVieV9dPRP3EFjv6se+tpqvxY5A==
=v+i/
-----END PGP SIGNATURE-----
Changes since livecd-tools-13.4.2:
Brian C. Lane (2):
don't pass None to mksquashfs (#869300)
Version 13.4.3
---
Makefile | 2 +-
imgcreate/fs.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
---
10 years, 11 months
Branch 'rhel6-branch' - 2 commits - imgcreate/fs.py Makefile
by Brian C. Lane
Makefile | 2 +-
imgcreate/fs.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
New commits:
commit 741d3cddac6f821301b48aed89093d8fe6d7c8ca
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Thu Oct 25 10:05:33 2012 -0700
Version 13.4.3
diff --git a/Makefile b/Makefile
index f003c4d..2abfac3 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
-VERSION = 13.4.2
+VERSION = 13.4.3
INSTALL = /usr/bin/install -c
INSTALL_PROGRAM = ${INSTALL}
commit 8963f41eb0576f825274e69f3351e15ba7582c52
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Tue Oct 23 11:37:56 2012 -0700
don't pass None to mksquashfs (#869300)
If the compression type is None don't pass --comp to mksquashfs.
Resolves: rhbz#869300
diff --git a/imgcreate/fs.py b/imgcreate/fs.py
index d7b751b..67d4c3d 100644
--- a/imgcreate/fs.py
+++ b/imgcreate/fs.py
@@ -42,7 +42,7 @@ def makedirs(dirname):
def mksquashfs(in_img, out_img, compress_type):
# Allow gzip to work for older versions of mksquashfs
- if compress_type == "gzip":
+ if not compress_type or compress_type == "gzip":
args = ["/sbin/mksquashfs", in_img, out_img]
else:
args = ["/sbin/mksquashfs", in_img, out_img, "-comp", compress_type]
10 years, 11 months
imgcreate/fs.py
by Brian C. Lane
imgcreate/fs.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 36b6165c0ec2f05ecd6c625f6669c19caf1d38ae
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Tue Oct 23 11:37:56 2012 -0700
don't pass None to mksquashfs (#869300)
If the compression type is None don't pass --comp to mksquashfs.
Resolves: rhbz#869300
diff --git a/imgcreate/fs.py b/imgcreate/fs.py
index d4558d3..38ac724 100644
--- a/imgcreate/fs.py
+++ b/imgcreate/fs.py
@@ -72,7 +72,7 @@ def squashfs_compression_type(sqfs_img):
def mksquashfs(in_img, out_img, compress_type):
# Allow gzip to work for older versions of mksquashfs
- if compress_type == "gzip":
+ if not compress_type or compress_type == "gzip":
args = ["/sbin/mksquashfs", in_img, out_img]
else:
args = ["/sbin/mksquashfs", in_img, out_img, "-comp", compress_type]
10 years, 11 months
[PATCH] Catch up edit-livecd with creator.py changes
by Frederick Grose
commit 840ca52675c0626699e9f487f625fc9bd28e9580
Author: Frederick Grose <fgrose(a)sugarlabs.org>
Date: Mon Oct 22 17:22:30 2012 -0400
Catch up with creator.py changes.
Remove and symlink /etc/mtab.
Support new docleanup attribute.
diff --git a/tools/edit-livecd b/tools/edit-livecd
index 1670228..a033f59 100755
--- a/tools/edit-livecd
+++ b/tools/edit-livecd
@@ -248,7 +248,9 @@ class LiveImageEditor(LiveImageCreator):
self._do_bindmounts()
- os.symlink("../proc/mounts", self._instroot + "/etc/mtab")
+ mtab = os.path.join(self._instroot, 'etc', 'mtab')
+ os.remove(mtab)
+ os.symlink('/proc/self/mounts', mtab)
self.__copy_img_root(base_on)
self._brand(self._builder)
@@ -547,6 +549,7 @@ def parse_options(args):
[-k <kickstart-file>]
[-s <script.sh>]
[-t <tmpdir>]
+ [-T, --leave-tmpfiles]
[-e <excludes>]
[-f <exclude-file>]
[-i <includes>]
@@ -576,6 +579,11 @@ def parse_options(args):
dest="tmpdir", default="/var/tmp",
help="Temporary directory to use (default:
/var/tmp)")
+ parser.add_option("-T", "--leave-tmpfiles", action="store_false",
+ dest="docleanup", default=True,
+ help='Skip deletion of temporary files and
directories '
+ 'and unmounting of the edited image.')
+
parser.add_option("-e", "--exclude", type="string", dest="exclude",
help="Specify directory or file patterns to be
excluded "
"from the rsync copy of the filesystem.")
@@ -679,6 +687,7 @@ def main():
editor._include = options.include
editor.clone = options.clone
editor.tmpdir = options.tmpdir
+ editor.docleanup = options.docleanup
editor._builder = options.builder
editor._releasefile = options.releasefile
editor.compress_type = options.compress_type
10 years, 11 months
Branch 'f18-branch' - imgcreate/live.py
by Brian C. Lane
imgcreate/live.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
New commits:
commit 31bc3dff2ad2644e4cb24030b02fdf8e03841efc
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Thu Oct 18 14:10:55 2012 -0700
add remainder of virtio modules to initrd (#864012)
diff --git a/imgcreate/live.py b/imgcreate/live.py
index 189b869..47b9dcd 100755
--- a/imgcreate/live.py
+++ b/imgcreate/live.py
@@ -82,7 +82,8 @@ class LiveImageCreatorBase(LoopImageCreator):
self.__modules = ["=ata", "sym53c8xx", "aic7xxx", "=usb", "=firewire",
"=mmc", "=pcmcia", "mptsas", "udf", "virtio_blk",
- "virtio_pci"]
+ "virtio_pci", "virtio_scsi", "virtio_net", "virtio_mmio",
+ "virtio_balloon", "virtio-rng"]
self.__modules.extend(kickstart.get_modules(self.ks))
self._isofstype = "iso9660"
10 years, 11 months
imgcreate/live.py
by Brian C. Lane
imgcreate/live.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
New commits:
commit 212bb38e5c03b98fb8b11ba9dbc70e5cdee616aa
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Thu Oct 18 14:10:55 2012 -0700
add remainder of virtio modules to initrd (#864012)
diff --git a/imgcreate/live.py b/imgcreate/live.py
index 189b869..47b9dcd 100755
--- a/imgcreate/live.py
+++ b/imgcreate/live.py
@@ -82,7 +82,8 @@ class LiveImageCreatorBase(LoopImageCreator):
self.__modules = ["=ata", "sym53c8xx", "aic7xxx", "=usb", "=firewire",
"=mmc", "=pcmcia", "mptsas", "udf", "virtio_blk",
- "virtio_pci"]
+ "virtio_pci", "virtio_scsi", "virtio_net", "virtio_mmio",
+ "virtio_balloon", "virtio-rng"]
self.__modules.extend(kickstart.get_modules(self.ks))
self._isofstype = "iso9660"
10 years, 11 months
spec file for livecd-tools
by Tomas Karasek
Hi,
I would like to have modified python-imgcreate rpm in a local repo.
I figured the code is at
http://git.fedorahosted.org/git/livecd
But there's no specfile for rpmbuild. Why is that?
Or where else could I find sources for python-imgcreate package in version control?
Thanks for answering,
Tomas
10 years, 11 months
Changes to 'refs/tags/livecd-tools-13.4.2'
by Brian C. Lane
Tag 'livecd-tools-13.4.2' created by Brian C. Lane <bcl(a)redhat.com> at 2012-10-15 21:06 +0000
Tag as livecd-tools-13.4.2
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iQEVAwUAUHx6zhF+jBaO/jp/AQIQPQf/Vz4ukw61MKoEM46ANXabDBScCzlFzcqR
zqZ4JWj/fsUfq8S90PBXeZdvORmvwoS108JuMuT+TM6NL2Pvg/FC1kwVGjP0otCL
SSfPLFR5F1v3PVSujE0u3mPUqd69ouCQuzqv7HJWXQJWdRyE2idsPwL8p31WdK3I
a/gN3aVwCpp3NOT9FCo0Q69rd58Fg80l2U4SlVbt92iobvLwXR1VyYi4+c4CpHTO
kJD2DrzMpim8TyeybG4NW4Q/ltfBr3MmjcX/wUnc1gZWezNJk00p1/8EdQT+ow3Y
5QNs0PXWh+BJNQagW0miLCkneBVnIUwCLVxPQ7x5QKYtPISwLLmbHg==
=AHkk
-----END PGP SIGNATURE-----
Changes since livecd-tools-13.4.1:
Brian C. Lane (2):
mount squashfs read-only (#839804)
Version 13.4.2
---
Makefile | 2 +-
imgcreate/fs.py | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
---
10 years, 11 months
Branch 'rhel6-branch' - Makefile
by Brian C. Lane
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 0bfefec6908442bf2266685b089076ddea93e1aa
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Mon Oct 15 14:05:57 2012 -0700
Version 13.4.2
diff --git a/Makefile b/Makefile
index cbe2dd3..f003c4d 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
-VERSION = 13.4.1
+VERSION = 13.4.2
INSTALL = /usr/bin/install -c
INSTALL_PROGRAM = ${INSTALL}
10 years, 11 months