Skip to content

Commit 5cbb773

Browse files
ExaneServerTeamseveas
authored andcommitted
Support HPE fwpkg firmware packaging
iLO5 are now delivered through this format on HPE support site. This a simple Zip file containing the .bin file and few extra files. This simple patch extract the .bin in the Zip. Sample content of a fwpkg file: Archive: ilo5_218.fwpkg inflating: ilo5_218.bin inflating: ilo5_218.xml inflating: payload.json inflating: readme.txt
1 parent 50cb73e commit 5cbb773

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

hpilo_fw.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import io
88
import os
99
import sys
10+
from zipfile import ZipFile
1011
PY3 = sys.version_info[0] >= 3
1112

1213
if PY3:
@@ -50,6 +51,9 @@ def download(ilo, path=None, progress = lambda txt: None):
5051
if conf[ilo]['url'].endswith('.bin'):
5152
with open(os.path.join(path, conf[ilo]['file']), 'wb') as fd:
5253
fd.write(data)
54+
elif conf[ilo]['url'].endswith('.fwpkg'):
55+
with ZipFile(io.BytesIO(data)) as zipObj:
56+
zipObj.extract(conf[ilo]['file'], path)
5357
else:
5458
_parse(data, path, conf[ilo]['file'])
5559
return True

0 commit comments

Comments
 (0)