Hi,
I'm making a LiveCD that I want to autorun (from Windows and Linux) to
open a browser showing some help about how it works. So I added a new
option that lets add to the CD root file system.
If someone finds it useful, the attached patch adds this option to
pilgrim. The patch is for the latest git version.
Cheers,
Àlex
diff --git a/creator/livecd-creator b/creator/livecd-creator
index 305fed6..d4ab41a 100755
--- a/creator/livecd-creator
+++ b/creator/livecd-creator
@@ -283,7 +283,7 @@ class LiveCDYum(yum.YumBase):
return self.runTransaction(cb)
class InstallationTarget:
- def __init__(self, repos, packages, epackages, groups, fs_label, skip_compression, skip_prelink,tmpdir):
+ def __init__(self, repos, packages, epackages, groups, fs_label, skip_compression, skip_prelink, tmpdir, extra_files_dir):
self.ayum = None
self.repos = repos
self.packages = packages
@@ -293,6 +293,7 @@ class InstallationTarget:
self.skip_compression = skip_compression
self.skip_prelink = skip_prelink
self.tmpdir = tmpdir
+ self.extra_files_dir = extra_files_dir
self.build_dir = None
self.instloop = None
@@ -876,12 +877,17 @@ menu color hotkey 7 #ffffffff #ff000000
def createIso(self):
"""write out the live CD ISO"""
- subprocess.call(["/usr/bin/mkisofs", "-o", "%s.iso" %(self.fs_label,),
+ args = ["/usr/bin/mkisofs", "-o", "%s.iso" %(self.fs_label,),
"-b", "isolinux/isolinux.bin",
"-c", "isolinux/boot.cat",
"-no-emul-boot", "-boot-load-size", "4",
"-boot-info-table", "-J", "-r", "-hide-rr-moved",
- "-V", "%s" %(self.fs_label,), "%s/out" %(self.build_dir)])
+ "-V", "%s" %(self.fs_label,), "%s/out" %(self.build_dir)]
+
+ if self.extra_files_dir is not None:
+ args.append(self.extra_files_dir)
+
+ subprocess.call(args)
# implant an isomd5sum
if os.path.exists("/usr/lib/anaconda-runtime/implantisomd5"):
@@ -919,6 +925,7 @@ usage: livecd-creator [--help]
[--uncompressed-size=<size-in-MB>]
[--shell]
[--tmpdir=<tmpdir>]
+ [--add-extra-files=<directory>]
--help : Print usage and exit
--config : Path to kickstart config file
@@ -932,6 +939,7 @@ usage: livecd-creator [--help]
--uncompressed-size : Size of uncompressed fs in MB (default: 4096)
--shell : Start a shell in the chroot for post-configuration
--tmpdir : Temporary directory to use (default: /var/tmp)
+ --add-extra-files : Add files from especified directory into CD root
Examples:
@@ -962,14 +970,16 @@ class Options:
self.uncompressed_size = 4096
self.give_shell = False
self.tmpdir = "/var/tmp"
+ self.extra_files_dir = None
def parse_options(args):
try:
- opts, args = getopt.getopt(args, "hr:b:p:e:f:c:su:lt:",
+ opts, args = getopt.getopt(args, "hr:b:p:e:f:c:su:lt:a:",
["help", "repo=", "base-on=", "package=",
"exclude-package=", "fslabel=", "config=",
"skip-compression", "uncompressed-size=",
- "shell", "no-prelink", "prelink","tmpdir="])
+ "shell", "no-prelink", "prelink", "tmpdir=",
+ "add-extra-files="])
except getopt.GetoptError, msg:
raise Usage(msg)
@@ -1027,6 +1037,9 @@ def parse_options(args):
if o in ("-t", "--tmpdir"):
options.tmpdir = a
continue
+ if o in ("-a", "--add-extra-files"):
+ options.extra_files_dir = a
+ continue
raise Usage("Unknown option %s" % o)
if not options.kscfg and not (options.packages or options.groups):
@@ -1063,7 +1076,8 @@ def main():
options.fs_label,
options.skip_compression,
options.skip_prelink,
- options.tmpdir)
+ options.tmpdir,
+ options.extra_files_dir)
try:
target.parse(options.kscfg)
--
Fedora-livecd-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/fedora-livecd-list