Skip to content

Latest commit

 

History

History
executable file
·
34 lines (26 loc) · 906 Bytes

merge.sh

File metadata and controls

executable file
·
34 lines (26 loc) · 906 Bytes
 
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
29
30
31
32
33
#!/bin/bash
if [ "x`id -u`" != "x0" ]; then
echo "not root."
exit 1
fi
set -x
set -e
rm -rf cmake-build
mkdir cmake-build
cd cmake-build
cmake -DCMAKE_BUILD_TYPE=Release ../..
make -j2
gcc -o iself -s -O3 ../iself.c
#time for feh in bin boot etc lib opt sbin usr var ; do find /$feh -type f -exec ./iself {} \; ; done |perl -w -pi -e 's/\A\///;' |grep -v "usr/lib32/" |sort |uniq > ./binaries-64
time for feh in bin boot etc lib opt sbin usr var ; do find /x86/$feh -type f -exec ./iself {} \; ; done |perl -w -pi -e 's/\A\/x86\///;' |grep -v "usr/lib64" |sort |uniq > ./binaries-32
for feh in `cat binaries-32` ; do
mkdir -p --mode=0755 `dirname $feh`
if [ -f "/$feh" ]; then
./fatelf-glue tmp-fatelf "/$feh" "/x86/$feh"
chmod --reference="/$feh" tmp-fatelf
mv tmp-fatelf "/$feh"
else
cp -a "/x86/$feh" "/$feh"
fi
done
# end of merge.sh ...