mirror of
https://abf.rosa.ru/djam/livecd-tools.git
synced 2025-02-23 15:42:58 +00:00
added good,old afterall patch
This commit is contained in:
parent
976356c332
commit
7081001abc
3 changed files with 161 additions and 1 deletions
157
livecd-tools-031-afterall-script.patch
Normal file
157
livecd-tools-031-afterall-script.patch
Normal file
|
@ -0,0 +1,157 @@
|
|||
diff -ur livecd-tools-031.orig/imgcreate/creator.py livecd-tools-031/imgcreate/creator.py
|
||||
--- livecd-tools-031.orig/imgcreate/creator.py 2011-11-30 14:36:13.000000000 +0300
|
||||
+++ livecd-tools-031/imgcreate/creator.py 2011-12-12 16:56:00.000000000 +0300
|
||||
@@ -706,31 +706,35 @@
|
||||
|
||||
def __run_post_scripts(self):
|
||||
for s in kickstart.get_post_scripts(self.ks):
|
||||
- (fd, path) = tempfile.mkstemp(prefix = "ks-script-",
|
||||
- dir = self._instroot + "/tmp")
|
||||
+ if not s.afterAll:
|
||||
+ (fd, path) = tempfile.mkstemp(prefix = "ks-script-",
|
||||
+ dir = self._instroot + "/tmp")
|
||||
+
|
||||
+ os.write(fd, s.script)
|
||||
+ os.close(fd)
|
||||
+ os.chmod(path, 0700)
|
||||
+
|
||||
+ env = self._get_post_scripts_env(s.inChroot)
|
||||
+
|
||||
+ if not s.inChroot:
|
||||
+ env["INSTALL_ROOT"] = self._instroot
|
||||
+ preexec = None
|
||||
+ script = path
|
||||
+ else:
|
||||
+ preexec = self._chroot
|
||||
+ script = "/tmp/" + os.path.basename(path)
|
||||
+
|
||||
+ try:
|
||||
+ subprocess.call([s.interp, script],
|
||||
+ preexec_fn = preexec, env = env)
|
||||
+ except OSError, (err, msg):
|
||||
+ raise CreatorError("Failed to execute %%post script "
|
||||
+ "with '%s' : %s" % (s.interp, msg))
|
||||
+ finally:
|
||||
+ os.unlink(path)
|
||||
|
||||
- os.write(fd, s.script)
|
||||
- os.close(fd)
|
||||
- os.chmod(path, 0700)
|
||||
-
|
||||
- env = self._get_post_scripts_env(s.inChroot)
|
||||
-
|
||||
- if not s.inChroot:
|
||||
- env["INSTALL_ROOT"] = self._instroot
|
||||
- preexec = None
|
||||
- script = path
|
||||
- else:
|
||||
- preexec = self._chroot
|
||||
- script = "/tmp/" + os.path.basename(path)
|
||||
-
|
||||
- try:
|
||||
- subprocess.call([s.interp, script],
|
||||
- preexec_fn = preexec, env = env)
|
||||
- except OSError, (err, msg):
|
||||
- raise CreatorError("Failed to execute %%post script "
|
||||
- "with '%s' : %s" % (s.interp, msg))
|
||||
- finally:
|
||||
- os.unlink(path)
|
||||
+ def run_afterall_scripts(self):
|
||||
+ pass
|
||||
|
||||
def configure(self):
|
||||
"""Configure the system image according to the kickstart.
|
||||
@@ -756,9 +760,8 @@
|
||||
kickstart.NetworkConfig(self._instroot).apply(ksh.network)
|
||||
kickstart.RPMMacroConfig(self._instroot).apply(self.ks)
|
||||
|
||||
- self.__run_post_scripts()
|
||||
-
|
||||
self._create_bootconfig()
|
||||
+ self.__run_post_scripts()
|
||||
|
||||
def launch_shell(self):
|
||||
"""Launch a shell in the install root.
|
||||
@@ -783,9 +786,9 @@
|
||||
"""
|
||||
self._stage_final_image()
|
||||
|
||||
- for f in os.listdir(self._outdir):
|
||||
- shutil.move(os.path.join(self._outdir, f),
|
||||
- os.path.join(destdir, f))
|
||||
+ #for f in os.listdir(self._outdir):
|
||||
+ # shutil.move(os.path.join(self._outdir, f),
|
||||
+ # os.path.join(destdir, f))
|
||||
|
||||
def create(self):
|
||||
"""Install, configure and package an image.
|
||||
diff -ur livecd-tools-031.orig/imgcreate/live.py livecd-tools-031/imgcreate/live.py
|
||||
--- livecd-tools-031.orig/imgcreate/live.py 2011-11-30 14:36:13.000000000 +0300
|
||||
+++ livecd-tools-031/imgcreate/live.py 2011-12-13 20:44:19.452058265 +0300
|
||||
@@ -206,6 +206,7 @@
|
||||
|
||||
if not in_chroot:
|
||||
env["LIVE_ROOT"] = self.__ensure_isodir()
|
||||
+ env["LIVE_ROOT"] = self.__ensure_isodir()
|
||||
|
||||
return env
|
||||
|
||||
@@ -270,6 +271,31 @@
|
||||
|
||||
subprocess.call([implantisomd5, iso])
|
||||
|
||||
+ def run_afterall_scripts(self):
|
||||
+ for s in kickstart.get_post_scripts(self.ks):
|
||||
+ if s.afterAll:
|
||||
+ (fd, path) = tempfile.mkstemp(prefix = "ks-script-",
|
||||
+ dir = "/tmp")
|
||||
+ os.write(fd, s.script)
|
||||
+ os.close(fd)
|
||||
+ os.chmod(path, 0700)
|
||||
+ env = self._get_post_scripts_env(s.inChroot)
|
||||
+ preexec = None
|
||||
+ script = path
|
||||
+ try:
|
||||
+ subprocess.call([s.interp, script],
|
||||
+ preexec_fn = preexec, env = env)
|
||||
+ except OSError, (err, msg):
|
||||
+ raise CreatorError("Failed to execute %%post script "
|
||||
+ "with '%s' : %s" % (s.interp, msg))
|
||||
+ finally:
|
||||
+ os.unlink(path)
|
||||
+ self.__create_iso(self.__isodir)
|
||||
+ destdir = "."
|
||||
+ for f in os.listdir(self._outdir):
|
||||
+ shutil.move(os.path.join(self._outdir, f),
|
||||
+ os.path.join(destdir, f))
|
||||
+
|
||||
def _stage_final_image(self):
|
||||
try:
|
||||
makedirs(self.__ensure_isodir() + "/LiveOS")
|
||||
@@ -296,10 +322,11 @@
|
||||
logging.warn("Switching to UDF due to size of LiveOS/squashfs.img")
|
||||
|
||||
|
||||
- self.__create_iso(self.__isodir)
|
||||
+ #self.__create_iso(self.__isodir)
|
||||
finally:
|
||||
- shutil.rmtree(self.__isodir, ignore_errors = True)
|
||||
- self.__isodir = None
|
||||
+ #shutil.rmtree(self.__isodir, ignore_errors = True)
|
||||
+ #self.__isodir = None
|
||||
+ pass
|
||||
|
||||
class x86LiveImageCreator(LiveImageCreatorBase):
|
||||
"""ImageCreator for x86 machines"""
|
||||
Только в livecd-tools-031/imgcreate: live.py~
|
||||
diff -ur livecd-tools-031.orig/tools/livecd-creator livecd-tools-031/tools/livecd-creator
|
||||
--- livecd-tools-031.orig/tools/livecd-creator 2011-11-30 14:36:13.000000000 +0300
|
||||
+++ livecd-tools-031/tools/livecd-creator 2011-11-30 19:44:11.511905444 +0300
|
||||
@@ -137,6 +137,7 @@
|
||||
creator.launch_shell()
|
||||
creator.unmount()
|
||||
creator.package()
|
||||
+ creator.run_afterall_scripts()
|
||||
except imgcreate.CreatorError, e:
|
||||
logging.error(u"Error creating Live CD : %s" % e)
|
||||
return 1
|
BIN
livecd-tools-031.tar.bz2
Normal file
BIN
livecd-tools-031.tar.bz2
Normal file
Binary file not shown.
|
@ -3,7 +3,7 @@
|
|||
Summary: Tools for building live CDs
|
||||
Name: livecd-tools
|
||||
Version: 031
|
||||
Release: %mkrel 51
|
||||
Release: %mkrel 52
|
||||
License: GPLv2
|
||||
Group: System/Base
|
||||
Buildarch: noarch
|
||||
|
@ -49,6 +49,8 @@ Patch27: livecd-tools-031-fdisk-unit-cylinder.patch
|
|||
Patch28: livecd-tools-031-cp-progress-bar.patch
|
||||
# (eugeni) fix format change in dmsetup output parsing
|
||||
Patch29: livecd-tools-031-new_dmsetup.patch
|
||||
#afterall patch for ROSA
|
||||
Patch30: livecd-tools-031-afterall-script.patch
|
||||
|
||||
%description
|
||||
Tools for generating live CDs on Fedora based systems including
|
||||
|
@ -109,6 +111,7 @@ Convert a live CD iso so that it's bootable off of a USB stick
|
|||
%patch27 -p1
|
||||
%patch28 -p1
|
||||
%patch29 -p1
|
||||
%patch30 -p1
|
||||
|
||||
%build
|
||||
make
|
||||
|
|
Loading…
Add table
Reference in a new issue