summaryrefslogtreecommitdiffstats
path: root/dev/ports/core-linux-eglibc-bootstrap.mdwn
blob: 647b15a075742ba5a4e1848e76863fc4681548f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
[[!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 distribution and build system architecture names.
    #
    # <Distribution arch>  <GNU system type>            <kbuild arch>
    i686-linux-eglibc      i686-pc-linux-gnu            x86
    amd64-linux-eglibc     x86_64-pc-linux-gnu          x86
    core-linux-eglibc      x86_64-pc-linux-gnu          x86
    k8-linux-eglibc        x86_64-pc-linux-gnu          x86
    cortexa8-linux-eglibc  arm-cortex_a8-linux-gnueabi  arm

Subsequent ports like
[[i686-linux-eglibc|dev/ports/i686-linux-eglibc-bootstrap]] may simply be cross
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.