linux-surface / surface-uefi-firmware

UEFI firmware updates for surface using fwupd. WIP, be careful.
104 stars 9 forks source link

Arithmetic error #18

Closed DrBrad closed 2 years ago

DrBrad commented 2 years ago
brad@brad-l:~/Downloads/surface-uefi-firmware-master$ ./repack.sh -m cab -f ../SurfaceLaptop4_Win10_18363_21.094.39212.0.msi -o out
 ==> Found Model: SurfaceLaptop4
 ==> Unpacking driver package
 ==> Repacking surfacesmf firmware
./repack.sh: 147: arithmetic expression: expecting primary: ""0x58" >> 24"

I keep getting that error.

Because of this when I list cab files or look for them manually they are not their, only a bin, cat, xml, and an inf file are there.

professor-rage commented 2 years ago

Same issue. Resolved by explicitly calling bash, which resolved the error

bash ./repack.sh -m cab -f ../SurfaceLaptop4_Win10_18363_21.094.39212.0.msi -o out

DrBrad commented 2 years ago

@professor-rage ./ is to execute a shell script, it should run it fine, I will try that though

professor-rage commented 2 years ago

Depends on environment shell overrides. ./ used different shell in pop producing the error you shared. Explicitly calling with bash worked in my env.

kepi commented 2 years ago

@professor-rage ./ is to execute a shell script, it should run it fine, I will try that though

That is correct, and according to shebang in repack.sh, it will run script under /bin/sh

Depends on environment shell overrides. ./ used different shell in pop producing the error you shared. Explicitly calling with bash worked in my env.

I suppose you both are using Debian, which, by default, is using dash instead of bash. dash is installed in /bin/sh.

When you call script with bash script, it will force running under bash instead of using shebang (#!/bin/sh).

I just created push request with fixes from #21 which are resolving this issue be removing bashishms from repack.sh. After fixes, it works under dash too.