Probably shouldn't do this on a root filesystem. :)
authorRyan C. Gordon <icculus@icculus.org>
Sun, 04 Oct 2009 16:22:32 -0400
changeset 70 d702ac585686
parent 69 eac4c3810ee4
child 71 09d3c952aae9
Probably shouldn't do this on a root filesystem. :)
misc/merge.sh
--- a/misc/merge.sh	Sun Oct 04 16:16:00 2009 -0400
+++ b/misc/merge.sh	Sun Oct 04 16:22:32 2009 -0400
@@ -16,23 +16,23 @@
 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