trivial: firmware-packager: make it easier to reuse code

This commit is contained in:
Mario Limonciello 2019-11-03 22:08:19 -06:00 committed by Mario Limonciello
parent f603e2df88
commit 22379ab16c
6 changed files with 19 additions and 18 deletions

View File

View File

@ -104,19 +104,20 @@ def main(args):
print('Done')
shutil.copy(os.path.join(dir, 'firmware.cab'), args.out)
parser = argparse.ArgumentParser(description='Create fwupd packaged from windows executables')
parser.add_argument('--firmware-name', help='Name of the firmware package can be customized (e.g. DellTBT)', required=True)
parser.add_argument('--firmware-summary', help='One line description of the firmware package')
parser.add_argument('--firmware-description', help='Longer description of the firmware package')
parser.add_argument('--device-guid', help='GUID of the device this firmware will run on, this *must* match the output of one of the GUIDs in `fwupdmgr get-devices`', required=True)
parser.add_argument('--firmware-homepage', help='Website for the firmware provider')
parser.add_argument('--contact-info', help='Email address of the firmware developer')
parser.add_argument('--developer-name', help='Name of the firmware developer', required=True)
parser.add_argument('--release-version', help='Version number of the firmware package', required=True)
parser.add_argument('--release-description', help='Description of the firmware release')
parser.add_argument('--exe', help='(optional) Executable file to extract firmware from')
parser.add_argument('--bin', help='Path to the .bin file (Relative if inside the executable; Absolute if outside) to use as the firmware image', required=True)
parser.add_argument('--out', help='Output cab file path', required=True)
args = parser.parse_args()
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Create fwupd packaged from windows executables')
parser.add_argument('--firmware-name', help='Name of the firmware package can be customized (e.g. DellTBT)', required=True)
parser.add_argument('--firmware-summary', help='One line description of the firmware package')
parser.add_argument('--firmware-description', help='Longer description of the firmware package')
parser.add_argument('--device-guid', help='GUID of the device this firmware will run on, this *must* match the output of one of the GUIDs in `fwupdmgr get-devices`', required=True)
parser.add_argument('--firmware-homepage', help='Website for the firmware provider')
parser.add_argument('--contact-info', help='Email address of the firmware developer')
parser.add_argument('--developer-name', help='Name of the firmware developer', required=True)
parser.add_argument('--release-version', help='Version number of the firmware package', required=True)
parser.add_argument('--release-description', help='Description of the firmware release')
parser.add_argument('--exe', help='(optional) Executable file to extract firmware from')
parser.add_argument('--bin', help='Path to the .bin file (Relative if inside the executable; Absolute if outside) to use as the firmware image', required=True)
parser.add_argument('--out', help='Output cab file path', required=True)
args = parser.parse_args()
main(args)
main(args)

View File

@ -1,4 +1,4 @@
if get_option('firmware-packager')
install_data('firmware-packager',
install_data('firmware_packager.py',
install_dir : 'share/fwupd')
endif

View File

@ -282,7 +282,7 @@ rm ${RPM_BUILD_ROOT}%{_sbindir}/flashrom
%{_datadir}/man/man1/fwupdmgr.1.gz
%{_datadir}/metainfo/org.freedesktop.fwupd.metainfo.xml
%{_datadir}/icons/hicolor/scalable/apps/org.freedesktop.fwupd.svg
%{_datadir}/fwupd/firmware-packager
%{_datadir}/fwupd/firmware_packager.py
%{_unitdir}/fwupd-offline-update.service
%{_unitdir}/fwupd.service
%{_unitdir}/fwupd-refresh.service

View File

@ -1 +1 @@
subdir('firmware-packager')
subdir('firmware_packager')