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:25:50 -0700
commit87dbfd4fe9d6b63774169a52a77389f1f2442d7f (patch)
tree6f9dff3d71e8a3d3d9629ab15e089863dacdf497 /scripts
parent9c656e7b45e4f9be16f8992e69aad26c39068090 (diff)
downloadanaconda-87dbfd4fe9d6b63774169a52a77389f1f2442d7f.tar.gz
anaconda-87dbfd4fe9d6b63774169a52a77389f1f2442d7f.tar.xz
anaconda-87dbfd4fe9d6b63774169a52a77389f1f2442d7f.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 b8f2e1d58..12e9366f0 100755
--- a/scripts/makeupdates
+++ b/scripts/makeupdates
@@ -201,6 +201,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,))
@@ -214,6 +220,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])
@@ -225,10 +232,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
@@ -244,6 +252,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
@@ -275,6 +285,9 @@ def main(argv):
if isysChanged(tag):
copyUpdatedIsys(updates, cwd)
+ if add_rpms:
+ addRpms(updates, add_rpms)
+
createUpdatesImage(cwd, updates)
if not keep: