Git Repositories

First tools to install a basic 32 bits system in a 64 bits OS without multilib nor... master
authorCyrille Pontvieux <cyrille.pontvieux@april-waf.com>
Thu, 13 Feb 2014 13:02:58 +0000 (14:02 +0100)
committerCyrille Pontvieux <cyrille.pontvieux@april-waf.com>
Thu, 13 Feb 2014 13:02:58 +0000 (14:02 +0100)
Links are hardware to Slackware 13.37 for now.

fixbin [new file with mode: 0755]
install-bin-32.sh [new file with mode: 0755]
install-coreutils-32.sh [new file with mode: 0755]
install-elflibs-32.sh [new file with mode: 0755]
install-glibc-32.sh [new file with mode: 0755]
run32 [new file with mode: 0755]
wrap32 [new file with mode: 0755]

diff --git a/fixbin b/fixbin
new file mode 100755 (executable)
index 0000000..ddaea11
--- /dev/null
+++ b/fixbin
@@ -0,0 +1,24 @@
+#!/bin/sh
+# vim: et sw=2 sts=2 ts=2 tw=0:
+cd $(dirname "$0")
+for d in bin sbin usr/bin usr/sbin usr/libexec; do
+  mkdir -p wrap/$d
+  parent=
+  for i in $(seq 0 $(printf "$d"|sed 's,/,\n,g'|wc -l)); do
+    parent="${parent}../"
+  done
+  wrap32="${parent}wrap32"
+  for f in $d/*; do
+    if [ -h "$f" ]; then
+      tlink=$(readlink "$f")
+      if echo "$tlink"|grep -q wrap32; then
+        echo skiping $f
+      else
+        cp -P -v "$f" wrap/$d/
+      fi
+    elif file "$f" | grep -q ELF; then
+      mv -v "$f" wrap/$d/
+      ( cd $d; ln -s "$wrap32" $(basename "$f") )
+    fi
+  done
+done
diff --git a/install-bin-32.sh b/install-bin-32.sh
new file mode 100755 (executable)
index 0000000..b4c29de
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/sh
+# vim: et sw=2 sts=2 ts=2 tw=0:
+set -e
+cd $(dirname "$0")
+wget http://ftp.gwdg.de/pub/linux/slackware/slackware-13.37/slackware/a/bin-11.1-i486-1.txz
+tar xf bin-11.1-i486-1.txz
+rm -r install etc usr/doc usr/man
+rm bin-11.1-i486-1.txz
diff --git a/install-coreutils-32.sh b/install-coreutils-32.sh
new file mode 100755 (executable)
index 0000000..e79e516
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+# vim: et sw=2 sts=2 ts=2 tw=0:
+set -e
+cd $(dirname "$0")
+wget http://ftp.gwdg.de/pub/linux/slackware/slackware-13.37/slackware/a/coreutils-8.11-i486-1.txz
+tar xf coreutils-8.11-i486-1.txz
+sh install/doinst.sh
+rm -r install etc usr/doc usr/info usr/man usr/share
+rm coreutils-8.11-i486-1.txz
diff --git a/install-elflibs-32.sh b/install-elflibs-32.sh
new file mode 100755 (executable)
index 0000000..52742a6
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+# vim: et sw=2 sts=2 ts=2 tw=0:
+set -e
+cd $(dirname "$0")
+wget http://ftp.gwdg.de/pub/linux/slackware/slackware-13.37/slackware/a/aaa_elflibs-13.37-i486-7.txz
+tar xf aaa_elflibs-13.37-i486-7.txz
+sh install/doinst.sh
+rm -r install
+rm aaa_elflibs-13.37-i486-7.txz
diff --git a/install-glibc-32.sh b/install-glibc-32.sh
new file mode 100755 (executable)
index 0000000..b7794a2
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh
+# vim: et sw=2 sts=2 ts=2 tw=0:
+set -e
+cd $(dirname "$0")
+wget http://ftp.gwdg.de/pub/linux/slackware/slackware-13.37/patches/packages/glibc-solibs-2.13-i486-7_slack13.37.txz
+tar xf glibc-solibs-2.13-i486-7_slack13.37.txz
+rm -r etc
+mv lib/incoming/* lib/
+rmdir lib/incoming
+eval "$(grep '^( cd' install/doinst.sh)"
+rm -r install
+rm glibc-solibs-2.13-i486-7_slack13.37.txz
diff --git a/run32 b/run32
new file mode 100755 (executable)
index 0000000..95e005c
--- /dev/null
+++ b/run32
@@ -0,0 +1,5 @@
+#!/bin/sh
+ROOT32=$(dirname "$0")
+LD_LIBRARY_PATH=$ROOT32/lib:$ROOT32/usr/lib
+export LD_LIBRARY_PATH
+$ROOT32/lib/ld-linux.so.2 "$@"
diff --git a/wrap32 b/wrap32
new file mode 100755 (executable)
index 0000000..2e560ae
--- /dev/null
+++ b/wrap32
@@ -0,0 +1,7 @@
+#!/bin/sh
+# vim: et sw=2 sts=2 ts=2 tw=0:
+HERE=$(dirname $(readlink -f "$0"))
+ORIG="$0"
+ORIG_FP=$(readlink -f $(dirname "$ORIG"))/$(basename "$ORIG")
+TARGET_FP=$(echo "$ORIG_FP"|sed "s,^$HERE,$HERE/wrap,")
+"$HERE"/run32 "$TARGET_FP" "$@"