forked from npinto/gentoo-prefix-bootstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstage2.mk
137 lines (115 loc) · 3.63 KB
/
stage2.mk
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
ifndef STAGE2_MK
STAGE2_MK=stage2.mk
include init.mk
install/stage2: install/stage1 \
install/_stage2-sed \
install/_stage2-bash \
install/_stage2-xz-utils \
install/_stage2-automake \
install/_stage2-tar \
install/_stage2-file \
install/_stage2-pkgconfig \
install/_stage2-wget \
install/_stage2-baselayout-prefix \
install/_stage2-m4 \
install/_stage2-flex \
install/_stage2-bison \
install/_stage2-binutils-config \
install/_stage2-binutils \
install/stage2-gcc \
install/stage2-up-to-pax-utils \
install/stage2-portage
touch $@
install/_stage2-sed:
${EMERGE} --oneshot -j sys-apps/sed
touch $@
install/_stage2-bash:
MAKEOPTS=-j1 ${EMERGE} --oneshot --nodeps app-shells/bash
touch $@
install/_stage2-xz-utils:
${EMERGE} --oneshot --nodeps app-arch/xz-utils
touch $@
install/_stage2-automake:
${EMERGE} --oneshot -j sys-apps/help2man
${EMERGE} --oneshot -j sys-devel/automake
touch $@
install/_stage2-tar:
${EMERGE} --oneshot --nodeps app-arch/tar
touch $@
install/_stage2-file:
${EMERGE} --oneshot --nodeps sys-apps/file
touch $@
install/_stage2-pkgconfig:
${EMERGE} --oneshot -j dev-util/pkgconfig
touch $@
install/_stage2-wget:
${EMERGE} --oneshot -j net-misc/wget
touch $@
install/_stage2-baselayout-prefix:
${EMERGE} --oneshot --nodeps sys-apps/baselayout-prefix
touch $@
install/_stage2-m4:
${EMERGE} --oneshot --nodeps sys-devel/m4
touch $@
install/_stage2-flex:
${EMERGE} --oneshot --nodeps sys-devel/flex
touch $@
install/_stage2-bison:
${EMERGE} --oneshot --nodeps sys-devel/bison
touch $@
install/stage2-up-to-bison: install/stage1 \
touch $@
install/_stage2-binutils-config:
# emerge --oneshot --nodeps "<sys-devel/binutils-2.22"
${EMERGE} --oneshot --nodeps sys-devel/binutils-config
touch $@
install/_stage2-binutils: install/_stage2-binutils-config
MAKEOPTS=-j1 ${EMERGE} --oneshot --nodeps sys-devel/binutils \
|| \
MAKEOPTS=-j1 ebuild --skip-manifest \
${EPREFIX}/usr/portage/sys-devel/binutils/binutils-2.20.1-r1.ebuild \
clean merge
touch $@
install/stage2-gcc: install/_stage2-binutils
${EMERGE} --oneshot --nodeps sys-devel/gcc-config
# XXX: get the right kernel version?
${EMERGE} --oneshot --nodeps sys-kernel/linux-headers
${EMERGE} --oneshot -j sys-devel/bison
${EMERGE} --oneshot --nodeps "=sys-devel/gcc-4.2*"
echo ">=sys-devel/gcc-4.2" > ${EPREFIX}/etc/portage/package.mask/gcc
touch $@
install/stage2-up-to-pax-utils: install/stage2-gcc
${EMERGE} --oneshot coreutils
# -- perl: workaround to avoid user confirmation
${EMERGE} --oneshot perl < /dev/null
${EMERGE} --oneshot -j findutils
${EMERGE} --oneshot -j sys-devel/automake
${EMERGE} --oneshot -j app-arch/tar
${EMERGE} --oneshot grep
${EMERGE} --oneshot patch
${EMERGE} --oneshot gawk
${EMERGE} --oneshot make
${EMERGE} --oneshot --nodeps file
${EMERGE} --oneshot --nodeps eselect
${EMERGE} --oneshot pax-utils
touch $@
install/stage2-portage-workarounds: install/stage2-up-to-pax-utils
# -- python: workarounds (only for stage2)
mkdir -p ${EPREFIX}/etc/portage/env/dev-lang/
echo "export LDFLAGS='-L/usr/lib64'" > ${EPREFIX}/etc/portage/env/dev-lang/python
# --
${EMERGE} --oneshot -j sys-libs/readline
${EMERGE} --oneshot --nodeps app-admin/python-updater
FEATURES=-collision-protect ${EMERGE} --oneshot --nodeps app-admin/eselect-python
${EMERGE} --nodeps dev-lang/python
eselect python set python2.7
touch $@
install/stage2-portage: install/stage2-up-to-pax-utils install/stage2-portage-workarounds
# -- Update portage
env FEATURES="-collision-protect" ${EMERGE} --oneshot sys-apps/portage
# -- Move tmp directory
mv -f ${EPREFIX}/tmp ${EPREFIX}/tmp.old
# -- Synchronize repo
${EMERGE} --sync
touch $@
endif