Skip to content

Commit

Permalink
Probably shouldn't do this on a root filesystem. :)
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Oct 4, 2009
1 parent 2618459 commit fe7aed1
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions misc/merge.sh
Expand Up @@ -16,23 +16,23 @@ 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_64/$feh -type f -exec ./iself {} \; ; done |perl -w -pi -e 's/\A\x86_64\///;' |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
mkdir -p --mode=0755 `dirname "/x86_64/$feh"`
if [ -f "/x86_64/$feh" ]; then
FATELF=0
./fatelf-validate "/$feh" && ISFATELF=1
./fatelf-validate "/x86_64/$feh" && ISFATELF=1
if [ "x$ISFATELF" = "x1" ]; then
./fatelf-replace tmp-fatelf "/$feh" "/x86/$feh"
./fatelf-replace tmp-fatelf "/x86_64/$feh" "/x86/$feh"
else
./fatelf-glue tmp-fatelf "/$feh" "/x86/$feh"
./fatelf-glue tmp-fatelf "/x86_64/$feh" "/x86/$feh"
fi
chmod --reference="/$feh" tmp-fatelf
mv tmp-fatelf "/$feh"
chmod --reference="/x86_64/$feh" tmp-fatelf
mv tmp-fatelf "/x86_64/$feh"
else
cp -a "/x86/$feh" "/$feh"
cp -a "/x86/$feh" "/x86_64/$feh"
fi
done

Expand Down

0 comments on commit fe7aed1

Please sign in to comment.