From 7d90e4d691a24aaa4afff14e2560553893df52e7 Mon Sep 17 00:00:00 2001
From: P. J. McDermott <pehjota>
Date: Mon, 09 Jul 2012 23:03:00 -0400
Subject: Document core-linux-eglibc bootstrap plan.

---
(limited to 'dev/ports')

diff --git a/dev/ports/core-linux-eglibc-bootstrap.mdwn b/dev/ports/core-linux-eglibc-bootstrap.mdwn
new file mode 100644
index 0000000..d0a8be9
--- /dev/null
+++ b/dev/ports/core-linux-eglibc-bootstrap.mdwn
@@ -0,0 +1,113 @@
+[[!meta title="Bootstrap of the core-linux-eglibc Port"]]
+
+Following is the planned procedure to bootstrap the core-linux-eglibc port from
+a Debian GNU system.  Debian's GNU toolchain for its amd64 architecture is used
+to build a fake generic port named amd64-linux-eglibc.
+
+This procedure assumes that Debian's build-essential package is installed, that
+opkhelper 1.0.0 is installed, that genopkg.sh from opkhelper 1.0.0 has been run,
+and that the following architecture table is present at
+`/usr/local/share/opkhelper/archtab`:
+
+    # Map between distro architecture strings and GNU system types.
+    #
+    # <Distribution arch>  <GNU system type>
+    i686-linux-eglibc      i686-pc-linux-gnu
+    core-linux-eglibc      x86_64-pc-linux-gnu
+    k8-linux-eglibc        x86_64-pc-linux-gnu
+    cortexa8-linux-eglibc  arm-cortex_a8-linux-gnueabi
+
+Subsequent ports may simply be built from the core-linux-eglibc port.
+
+1.  Build the following base system packages for amd64-linux-eglibc using
+    Debian's GNU toolchain:
+
+    * src:eglibc
+    * src:busybox
+    * src:linux-libre
+    * src:opkg
+
+2.  Build the following build essential packages for amd64-linux-eglibc using
+    Debian's GNU toolchain:
+
+    * src:binutils
+    * src:gmp
+    * src:mpfr
+    * src:mpc
+    * src:gcc-4.7
+    * src:gcc-defaults
+    * src:opkhelper-1.0
+    * src:build-essential
+    * src:fakeroot
+
+    Build src:binutils and src:gcc-4.7 with a core-linux-eglibc target.
+
+3.  Unpack the following essential binary packages into the target directory:
+
+    * libc.6
+    * libc-bin
+    * locales
+    * nscd
+    * zoneinfo
+    * busybox
+    * linux-libre
+    * libopkg.1
+    * opkg
+
+4.  Unpack the following build essential binary packages into the target
+    directory:
+
+    * libc.6-dev
+    * libc-dev-bin
+    * linux-libre-headers
+    * libgmp.10
+    * libgmp-dev
+    * libmpfr.4
+    * libmpfr-dev
+    * libmpc.2
+    * libmpc-dev
+    * gcc-4.7-base-core-linux-eglibc
+    * cpp-4.7-core-linux-eglibc
+    * gcc-4.7-core-linux-eglibc
+    * g++-4.7-core-linux-eglibc
+    * libgcc.1
+    * libstdc++.6
+    * libstdc++.6-4.7-dev
+    * cpp-core-linux-eglibc
+    * gcc-core-linux-eglibc
+    * g++-core-linux-eglibc
+    * opkhelper-1.0
+    * fakeroot
+    * build-essential-core-linux-eglibc
+
+5.  Unpack the following source binary packages into the target directory:
+
+    * eglibc-src
+    * busybox-src
+    * linux-libre-src
+    * opkg-src
+    * binutils-src
+    * gmp-src
+    * mpfr-src
+    * mpc-src
+    * gcc-4.7-src
+    * gcc-defaults-src
+    * opkhelper-1.0-src
+    * build-essential-src
+
+6.  Mount the proc and sysfs filesystems.
+
+7.  Run `/bin/sh` in an isolated environment with chroot.
+
+8.  Run the following command to rebuild every source package for
+    core-linux-eglibc:
+
+        # for src in /usr/src/*; do \
+        >   cd "${src}"; \
+        >   opkbuild -a core-linux-eglibc; \
+        > done
+
+9.  Exit ash and the isolated environment.
+
+10. Collect from `usr/src` in the target directory the binary packages built for
+    core-linux-eglibc.
--
cgit v0.9.1