[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: [Fedora-livecd-list] [PATCH] pick a better fs label by default
- From: Colin Walters <walters redhat com>
- To: fedora-livecd-list redhat com
- Subject: Re: [Fedora-livecd-list] [PATCH] pick a better fs label by default
- Date: Tue, 07 Aug 2007 17:44:25 -0400
On Tue, 2007-08-07 at 16:09 -0400, Colin Walters wrote:
> This makes it so things aren't all named livecd-.
diff --git a/creator/livecd-creator b/creator/livecd-creator
index 69624cb..7e02386 100755
--- a/creator/livecd-creator
+++ b/creator/livecd-creator
@@ -1054,7 +1054,7 @@ class Options:
self.packages = []
self.groups = []
self.epackages = []
- self.fs_label = "livecd-" + time.strftime("%Y%m%d-%H%M")
+ self.fs_label = None
self.mount = None
self.base_on = None
self.kscfg = None
@@ -1171,11 +1171,34 @@ def main():
print >> sys.stderr, "You must run livecd-creator as root"
return 1
+ if options.fs_label:
+ fs_label = options.fs_label
+ else:
+ fs_label_prefix = 'livecd-'
+ fs_label_suffix = time.strftime("%Y%m%d%H%M")
+ name = ''
+ if options.kscfg:
+ name = os.path.basename(options.kscfg)
+ idx = name.rfind('.')
+ if idx >= 0:
+ name = name[:idx]
+ if name.startswith(fs_label_prefix):
+ name = name[len(fs_label_prefix):]
+ fs_label = fs_label_prefix + name + fs_label_suffix
+ if len(fs_label) > 32:
+ if name.startswith("livecd-"):
+ name = name[len("livecd-"):]
+ fs_label = name + fs_label_suffix
+ if len(fs_label) > 32:
+ name = name[:(32 - len(fs_label_suffix))]
+ fs_label = name + fs_label_suffix
+ print "Using label %s" % (fs_label,)
+
target = InstallationTarget(options.repos,
options.packages,
options.epackages,
options.groups,
- options.fs_label,
+ fs_label,
options.skip_compression,
options.skip_prelink,
options.tmpdir)
--
1.5.2.2
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]