patch-iso supports multiple graft directories
Pungi patch iso now supports multiple graft directories. This should make usage more comfortable. Signed-off-by: Jiri Konecny <jkonecny@redhat.com>
This commit is contained in:
parent
479d17c033
commit
0cd089802f
@ -40,8 +40,8 @@ def main(args=None):
|
||||
help='which file to write the result to')
|
||||
parser.add_argument('source', metavar='SOURCE_ISO',
|
||||
help='source ISO to work with')
|
||||
parser.add_argument('dir', metavar='GRAFT_DIR',
|
||||
help='extra directory to graft on the ISO')
|
||||
parser.add_argument('dirs', nargs="+", metavar='GRAFT_DIR',
|
||||
help='extra directories to graft on the ISO')
|
||||
opts = parser.parse_args(args)
|
||||
|
||||
level = logging.DEBUG if opts.verbose else logging.INFO
|
||||
|
@ -92,7 +92,7 @@ def run(log, opts):
|
||||
volume_id = opts.volume_id or iso.get_volume_id(opts.source)
|
||||
|
||||
# create graft points from mounted source iso + overlay dir
|
||||
graft_points = iso.get_graft_points([work_dir, opts.dir])
|
||||
graft_points = iso.get_graft_points([work_dir] + opts.dirs)
|
||||
# if ks.cfg is detected, patch syslinux + grub to use it
|
||||
if 'ks.cfg' in graft_points:
|
||||
log.info('Adding ks.cfg to boot configs')
|
||||
|
@ -87,6 +87,7 @@ class TestPatchingIso(unittest.TestCase):
|
||||
source='source.iso',
|
||||
force_arch=None,
|
||||
volume_id='FOOBAR',
|
||||
dirs=[]
|
||||
)
|
||||
patch_iso.run(log, opts)
|
||||
|
||||
@ -124,7 +125,8 @@ class TestPatchingIso(unittest.TestCase):
|
||||
target='test.iso',
|
||||
source='source.iso',
|
||||
force_arch=None,
|
||||
volume_id=None
|
||||
volume_id=None,
|
||||
dirs=[]
|
||||
)
|
||||
patch_iso.run(log, opts)
|
||||
|
||||
@ -164,7 +166,8 @@ class TestPatchingIso(unittest.TestCase):
|
||||
target='test.iso',
|
||||
source='source.iso',
|
||||
force_arch=None,
|
||||
volume_id=None
|
||||
volume_id=None,
|
||||
dirs=[]
|
||||
)
|
||||
patch_iso.run(log, opts)
|
||||
|
||||
@ -206,6 +209,7 @@ class TestPatchingIso(unittest.TestCase):
|
||||
source='source.iso',
|
||||
force_arch='s390',
|
||||
volume_id='foobar',
|
||||
dirs=[],
|
||||
)
|
||||
patch_iso.run(log, opts)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user