Skip to content

Commit

Permalink
Merge pull request #580 from m-1-k-3/free_diskspace_action
Browse files Browse the repository at this point in the history
fix actions, fix l10 lnk fixer
  • Loading branch information
m-1-k-3 committed Apr 17, 2023
2 parents de9dc53 + 2bc3b23 commit c742314
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
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

0 comments on commit c742314

Please sign in to comment.