forked from Panchajanya1999/archlinux-docker
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patharch_strip.sh
28 lines (21 loc) · 1.07 KB
/
arch_strip.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
CUR_DIR=$1
PROTON="https://github.com/kdrag0n/proton-clang/raw/master/bin"
A64S=aarch64-linux-gnu-strip && A32S=arm-linux-gnueabi-strip
curl -LSsO "$PROTON/strip" && chmod +x "$CUR_DIR/strip" && X86_STRIP="$CUR_DIR/strip"
curl -LSsO "$PROTON/$A64S" && chmod +x "$CUR_DIR/$A64S" && A64_STRIP="$CUR_DIR/$A64S"
curl -LSsO "$PROTON/$A32S" && chmod +x "$CUR_DIR/$A32S" && A32_STRIP="$CUR_DIR/$A32S"
find "$CUR_DIR" -type f -size +100k -exec file {} \; > .file-idx
grep "x86" .file-idx \
| grep "not strip" | grep -v "relocatable" \
| tr ':' ' ' | awk '{print $1}' \
| while read -r file; do $X86_STRIP -gSsdXx "$file"; done
grep "ARM" .file-idx | grep "aarch64" \
| grep "not strip" | grep -v "relocatable" \
| tr ':' ' ' | awk '{print $1}' \
| while read -r file; do $A64_STRIP -gSsdXx "$file"; done
grep "ARM" .file-idx | grep "32.bit" \
| grep "not strip" | grep -v "relocatable" \
| tr ':' ' ' | awk '{print $1}' \
| while read -r file; do $A32_STRIP -gSsdXx "$file"; done
rm "$CUR_DIR/strip" "$CUR_DIR/$A64S" "$CUR_DIR/$A32S" ".file-idx"