From 560825acf267c2547972386992acb79335c3ac49 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Thu, 15 Oct 2009 21:51:18 -0400 Subject: [PATCH] Untested updates to merge script. --- misc/merge.sh | 41 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/misc/merge.sh b/misc/merge.sh index 0bff56e..412fadd 100755 --- a/misc/merge.sh +++ b/misc/merge.sh @@ -5,6 +5,14 @@ if [ "x`id -u`" != "x0" ]; then 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 @@ rm -rf cmake-build 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 @@ rm -rf /x86_64/lib64 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 ...