pungi/bin/pungi-patch-iso
Lubomír Sedlář 4b90822115 Add a script for modifying ISO images
With this script it's possible to add additional files into an ISO file.
If the file happens to be ks.cfg, the boot configs are tweaked so that
the kickstart is actually used.

Resolves: #503
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2017-03-21 07:55:19 +01:00

58 lines
2.0 KiB
Python
Executable File

#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Library General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <https://gnu.org/licenses/>.
import argparse
import logging
import os
import sys
here = sys.path[0]
if here != '/usr/bin':
# Git checkout
sys.path[0] = os.path.dirname(here)
from pungi_utils import patch_iso
def main(args=None):
parser = argparse.ArgumentParser()
parser.add_argument('-v', '--verbose', action='store_true',
help='Print debugging information')
parser.add_argument('--supported', choices=('true', 'false'),
help='Override supported bit on the ISO')
parser.add_argument('--volume-id',
help='Override volume ID on the ISO')
parser.add_argument('--force-arch',
help='Treat the ISO as bootable on given architecture')
parser.add_argument('target', metavar='TARGET_ISO',
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')
opts = parser.parse_args(args)
level = logging.DEBUG if opts.verbose else logging.INFO
format = '%(levelname)s: %(message)s'
logging.basicConfig(level=level, format=format)
log = logging.getLogger()
patch_iso.run(log, opts)
if __name__ == '__main__':
if main():
sys.exit(1)