Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix actions, fix l10 lnk fixer #580

Merged
merged 2 commits into from
Apr 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
android: true
dotnet: true
haskell: true
large-packages: true
large-packages: false
swap-storage: true
- name: EMBA container build
uses: Wandalen/wretry.action@master
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/trivy-container-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
android: true
dotnet: true
haskell: true
large-packages: true
large-packages: false
swap-storage: true
- name: Generate tarball from image
run: |
Expand Down
7 changes: 4 additions & 3 deletions modules/L10_system_emulation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -258,15 +258,16 @@ create_emulation_filesystem() {
print_output "[*] Copy extracted root filesystem to new QEMU image"
cp -prf "$ROOT_PATH"/* "$MNT_POINT"/ || true

if [[ -f "$HELP_DIR"/fix_bins_lnk_emulation.sh ]]; then
print_output "[*] Starting link fixing helper ..."
if [[ -f "$HELP_DIR"/fix_bins_lnk_emulation.sh ]] && [[ $(find "$MNT_POINT" -type l | wc -l) -lt 10 ]]; then
print_output "[*] No symlinks found in firmware ... Starting link fixing helper ..."
"$HELP_DIR"/fix_bins_lnk_emulation.sh "$MNT_POINT"
else
# ensure that the needed permissions for exec files are set correctly
# This is needed at some firmwares have corrupted permissions on ELF or sh files
print_output "[*] Multiple firmwares have broken script and ELF permissions - We fix them now"
readarray -t BINARIES_L10 < <( find "$MNT_POINT" -xdev -type f -exec file {} \; 2>/dev/null | grep executable | cut -d: -f1)
readarray -t BINARIES_L10 < <( find "$MNT_POINT" -xdev -type f -exec file {} \; 2>/dev/null | grep "ELF\|executable" | cut -d: -f1)
for BINARY_L10 in "${BINARIES_L10[@]}"; do
[[ -x "${BINARY_L10}" ]] && continue
if [[ -f "$BINARY_L10" ]]; then
chmod +x "$BINARY_L10"
fi
Expand Down
5 changes: 3 additions & 2 deletions modules/P02_firmware_bin_file_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,11 @@ fw_bin_detector() {
# if we have a zip, tgz, tar archive we are going to use the patools extractor
if [[ "$FILE_BIN_OUT" == *"gzip compressed data"* || "$FILE_BIN_OUT" == *"Zip archive data"* || \
"$FILE_BIN_OUT" == *"POSIX tar archive"* || "$FILE_BIN_OUT" == *"ISO 9660 CD-ROM filesystem data"* || \
"$FILE_BIN_OUT" == *"7-zip archive data"* || "$FILE_BIN_OUT" == *"XZ compressed data"* ]]; then
"$FILE_BIN_OUT" == *"7-zip archive data"* || "$FILE_BIN_OUT" == *"XZ compressed data"* || \
"$FILE_BIN_OUT" == *"bzip2 compressed data"* ]]; then
# as the AVM images are also zip files we need to bypass it here:
if [[ "$AVM_DETECTED" -ne 1 ]]; then
print_output "[+] Identified gzip/zip/tar/iso/xz archive file - using patools extraction module"
print_output "[+] Identified gzip/zip/tar/iso/xz/bzip2 archive file - using patools extraction module"
export PATOOLS_INIT=1
write_csv_log "basic compressed (patool)" "yes" "NA"
fi
Expand Down