summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorBrian C. Lane <bcl@redhat.com>2012-06-22 10:25:50 -0700
committerBrian C. Lane <bcl@redhat.com>2012-06-22 10:53:19 -0700
commit826a9c170a7618ae7cd7761f1cb9a844fc615fbc (patch)
tree39300141e347aa9a83fd039537e93e0ed169371c /scripts
parent94cbf8b3864b80ea134fea8db90efe720acbff66 (diff)
downloadanaconda-826a9c170a7618ae7cd7761f1cb9a844fc615fbc.tar.gz
anaconda-826a9c170a7618ae7cd7761f1cb9a844fc615fbc.tar.xz
anaconda-826a9c170a7618ae7cd7761f1cb9a844fc615fbc.zip
makeupdates: add rpm contents to updates.img
This adds the -a option to makeupdates, it will expand the contents of an rpm into the root of the updates image. This overlays the installer's root filesystem, allowing any file to be updated.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/makeupdates17
1 files changed, 15 insertions, 2 deletions
diff --git a/scripts/makeupdates b/scripts/makeupdates
index 1f6a98733..1eb3629ad 100755
--- a/scripts/makeupdates
+++ b/scripts/makeupdates
@@ -206,6 +206,12 @@ def copyUpdatedIsys(updates, cwd):
if os.path.isfile(isysmodule):
shutil.copy2(isysmodule, updates)
+def addRpms(updates, add_rpms):
+ for rpm in add_rpms:
+ cmd = "cd %s && rpm2cpio %s | cpio -dium" % (updates, rpm)
+ sys.stdout.write(cmd+"\n")
+ os.system(cmd)
+
def createUpdatesImage(cwd, updates):
os.chdir(updates)
os.system("find . | cpio -c -o | gzip -9cv > %s/updates.img" % (cwd,))
@@ -219,6 +225,7 @@ def usage(cmd):
sys.stdout.write(" -h, --help Display this help and exit.\n")
sys.stdout.write(" -t, --tag Make image from TAG to HEAD.\n")
sys.stdout.write(" -o, --offset Make image from (latest_tag - OFFSET) to HEAD.\n")
+ sys.stdout.write(" -a, --add Add contents of rpm to the update\n")
def main(argv):
prog = os.path.basename(sys.argv[0])
@@ -230,10 +237,11 @@ def main(argv):
tag = None
opts = []
offset = 0
+ add_rpms = []
try:
- opts, args = getopt.getopt(sys.argv[1:], 't:o:kc?',
- ['tag=', 'offset=',
+ opts, args = getopt.getopt(sys.argv[1:], 'a:t:o:kc?',
+ ['add=', 'tag=', 'offset=',
'keep', 'compile', 'help'])
except getopt.GetoptError:
help = True
@@ -249,6 +257,8 @@ def main(argv):
tag = a
elif o in ('-o', '--offset'):
offset = int(a)
+ elif o in ('-a', '--add'):
+ add_rpms.append(os.path.abspath(a))
else:
unknown = True
@@ -280,6 +290,9 @@ def main(argv):
if isysChanged(tag):
copyUpdatedIsys(updates, cwd)
+ if add_rpms:
+ addRpms(updates, add_rpms)
+
createUpdatesImage(cwd, updates)
if not keep: