Open funk-on-code opened 1 year ago
Ace! Now does the repack correctly, however, when I try and apply the updates in out/ I receive:
$ fwupdmgr install --allow-older --allow-reinstall --force out/elan_41.0.3723_d19aa234-ae8e-4fea-83b7-d71814fc193c.cab
**Decompressing… [***] firmware signature missing or not trusted; set OnlyTrusted=false in /etc/fwupd/daemon.conf ONLY if you are a firmware developer**
Is this a known issue? (ie. should it be in the documentation) Or something I need to work around?
Yes, its a known issue and yes it should be in the docs. Just set that option, like it tells you to.
The change above worked for me on a Surface Laptop 5, thanks for putting this together!
Trying to run this on a new (August 2023) Surface Laptop 5, running Ubuntu 22.04.3 with the linux-surface kernel installed, gives me:
$
bash -x repack.sh -f ../SurfaceLaptop5_Win10_19044_22.102.17126.0.msi -o out
+ set -e
+ FILE=
+ OUTPUT=
+ getopts :hf:o: args
+ case "$args" in
+ FILE=../SurfaceLaptop5_Win10_19044_22.102.17126.0.msi
+ getopts :hf:o: args
+ case "$args" in
+ OUTPUT=out
+ getopts :hf:o: args
+ '[' ../SurfaceLaptop5_Win10_19044_22.102.17126.0.msi = '' ']'
+ '[' out = '' ']'
+ command -v msiextract
+ command -v gcab
+ command -v dos2unix
+ mkdir -p out
+ echo ../SurfaceLaptop5_Win10_19044_22.102.17126.0.msi
+ grep -Eiq '\.msi$'
+ repackmsi ../SurfaceLaptop5_Win10_19044_22.102.17126.0.msi out
+ MSI=../SurfaceLaptop5_Win10_19044_22.102.17126.0.msi
+ OUT=out
+ echo '==> Extracting ../SurfaceLaptop5_Win10_19044_22.102.17126.0.msi'
==> Extracting ../SurfaceLaptop5_Win10_19044_22.102.17126.0.msi
++ mktemp -p . -d
+ TEMP=./tmp.QFsL4rle39
+ msiextract -C ./tmp.QFsL4rle39 ../SurfaceLaptop5_Win10_19044_22.102.17126.0.msi
+ repackdir ./tmp.QFsL4rle39 out
+ DIR=./tmp.QFsL4rle39
+ OUT=out
+ find ./tmp.QFsL4rle39 -iname '*.inf' -exec sh -c 'dos2unix "$0" > /dev/null 2>&1' '{}' ';'
+ grep -lR Firmware_Install,UEFI ./tmp.QFsL4rle39
+ IFS=
+ read -r INF
+ echo '==> Repacking ./tmp.QFsL4rle39/SurfaceUpdate/surfacenullcapsule/SurfaceNullCapsule.inf'
==> Repacking ./tmp.QFsL4rle39/SurfaceUpdate/surfacenullcapsule/SurfaceNullCapsule.inf
+ repackinf ./tmp.QFsL4rle39/SurfaceUpdate/surfacenullcapsule/SurfaceNullCapsule.inf out
+ INF=./tmp.QFsL4rle39/SurfaceUpdate/surfacenullcapsule/SurfaceNullCapsule.inf
+ OUT=out
++ dirname ./tmp.QFsL4rle39/SurfaceUpdate/surfacenullcapsule/SurfaceNullCapsule.inf
+ DIR=./tmp.QFsL4rle39/SurfaceUpdate/surfacenullcapsule
++ basename ./tmp.QFsL4rle39/SurfaceUpdate/surfacenullcapsule
+ FIRMWARE=surfacenullcapsule
++ mktemp -p . -d
+ TEMP=./tmp.nOU8c92zaU
++ find ./tmp.QFsL4rle39/SurfaceUpdate/surfacenullcapsule -iname '*.bin' -or -iname '*.cap'
++ head -n1
+ BINFILE=
++ find ./tmp.QFsL4rle39/SurfaceUpdate/surfacenullcapsule -iname '*.cat'
++ head -n1
+ CATFILE=./tmp.QFsL4rle39/SurfaceUpdate/surfacenullcapsule/SurfaceNullCapsule.cat
++ find ./tmp.QFsL4rle39/SurfaceUpdate/surfacenullcapsule -iname '*.inf'
+ INFFILE=./tmp.QFsL4rle39/SurfaceUpdate/surfacenullcapsule/SurfaceNullCapsule.inf
+ cp '' ./tmp.nOU8c92zaU/firmware.bin
cp: cannot stat '': No such file or directoryLooking through the extracted files, there doesn't appear to be a firmware.bin file in any of the directories though.