Untested updates to merge script.
authorRyan C. Gordon <icculus@icculus.org>
Thu, 15 Oct 2009 21:51:18 -0400
changeset 78 6da552ccf3fc
parent 77 39354468b42d
child 79 9706ea4613c5
Untested updates to merge script.
misc/merge.sh
--- a/misc/merge.sh	Thu Oct 15 00:35:36 2009 -0400
+++ b/misc/merge.sh	Thu Oct 15 21:51:18 2009 -0400
@@ -5,6 +5,14 @@
     exit 1
 fi
 
+AMD64=0
+if [ `uname -m` = "x86_64" ]; then
+    AMD64=1
+    echo "This is an x86_64 system."
+else
+    echo "This is NOT an x86_64 system."
+fi
+
 set -x
 set -e
 
@@ -12,17 +20,36 @@
 mkdir -p cmake-build
 cd cmake-build
 
+mkdir -p /x86_64
+mkdir -p /x86
+
+umount /x86_64 || echo "ignore any umount errors"
+umount /x86 || echo "ignore any umount errors"
+
+mount -t ext3 /dev/sda1 /x86_64
+mount -t ext3 /dev/sdb1 /x86
+
 # Special case: it's a symlink to /lib32, so it causes an endless loop.
 rm -f /x86_64/lib/ld-linux.so.2
 ln -s ld-2.9.so /x86_64/lib/ld-linux.so.2
 
-cmake -DCMAKE_BUILD_TYPE=Release ../..
-make -j2
+# other issues.
+rm -rf /x86/lib/udev/devices
+rm -rf /x86/usr/bin/X11
+
+#cmake -DCMAKE_BUILD_TYPE=Release ../..
+#make -j2
+if [ "x$AMD64" = "x1" ]; then
+   cp -av /x86_64/usr/local/bin/fatelf-* .
+else
+   cp -av /x86/usr/local/bin/fatelf-* .
+fi
+
 gcc -o iself -s -O3 ../iself.c
 gcc -o is32bitelf -s -O3 ../is32bitelf.c
 
 if [ ! -f ./binaries-32 ]; then
-    time for feh in bin boot etc lib opt sbin usr/bin usr/games usr/sbin usr/X11R6 usr/lib usr/local var/lib ; do find /x86/$feh -type f -exec ./iself {} \; ; done |perl -w -pi -e 's/\A\/x86\///;' |grep -v "usr/lib64" |sort |uniq > ./binaries-32
+    time for feh in bin boot etc lib opt sbin usr/bin usr/games usr/sbin usr/X11R6 usr/lib usr/local var/lib ; do find /x86/$feh -follow -type f -exec ./iself {} \; ; done |perl -w -pi -e 's/\A\/x86\///;' |sort |uniq > ./binaries-32
 fi
 
 for feh in `cat binaries-32` ; do
@@ -55,5 +82,13 @@
 ln -s /lib /x86_64/lib32
 ln -s /lib /x86_64/lib64
 
+umount /x86
+umount /x86_64
+
+# We disable fsck intervals...this is a demo, after all!
+time fsck.ext3 /dev/sda1
+tune2fs -c 0 /dev/sda1
+tune2fs -i 0 /dev/sda1
+
 # end of merge.sh ...