1 |
commit: b81a0c349874f03b6ef9980d3f10f02cc7513b16 |
2 |
Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Feb 5 19:49:16 2014 +0000 |
4 |
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Feb 5 19:49:16 2014 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/releng.git;a=commit;h=b81a0c34 |
7 |
|
8 |
tools-musl: make the run.sh script work for both amd64 and i686 |
9 |
|
10 |
--- |
11 |
tools-musl/portage/make.conf | 2 +- |
12 |
tools-musl/run.sh | 30 +++++++++++++++++++++++++----- |
13 |
2 files changed, 26 insertions(+), 6 deletions(-) |
14 |
|
15 |
diff --git a/tools-musl/portage/make.conf b/tools-musl/portage/make.conf |
16 |
index 041ec69..63003ee 100644 |
17 |
--- a/tools-musl/portage/make.conf |
18 |
+++ b/tools-musl/portage/make.conf |
19 |
@@ -1,4 +1,4 @@ |
20 |
-CHOST=x86_64-gentoo-linux-musl |
21 |
+CHOST=ALTARCH-gentoo-linux-musl |
22 |
CFLAGS="-Os -pipe -fomit-frame-pointer" |
23 |
CXXFLAGS="${CFLAGS}" |
24 |
|
25 |
|
26 |
diff --git a/tools-musl/run.sh b/tools-musl/run.sh |
27 |
index ae21c08..4ff3785 100755 |
28 |
--- a/tools-musl/run.sh |
29 |
+++ b/tools-musl/run.sh |
30 |
@@ -1,24 +1,40 @@ |
31 |
#!/bin/bash |
32 |
|
33 |
-ROOTFS="stage4-amd64-musl-vanilla" |
34 |
+MYARCH=${1:-"amd64"} |
35 |
+ |
36 |
+if [[ "$MYARCH" != "amd64" && "$MYARCH" != "i686" ]]; then |
37 |
+ echo "Unsupported arch $MYARCH" |
38 |
+ exit |
39 |
+fi |
40 |
+ |
41 |
+[[ "$MYARCH" == "amd64" ]] && ALTARCH="x86_64" |
42 |
+[[ "$MYARCH" == "i686" ]] && ALTARCH="i386" |
43 |
+ |
44 |
+ROOTFS="stage4-${MYARCH}-musl-vanilla" |
45 |
PWD="$(pwd)" |
46 |
|
47 |
prepare_etc () { |
48 |
mkdir -p "${ROOTFS}"/etc |
49 |
cp -a "${PWD}"/portage/ "${ROOTFS}"/etc/ |
50 |
+ |
51 |
+ if [[ "$MYARCH" == "amd64" ]]; then |
52 |
+ sed -i "s/ALTARCH/${ALTARCH}/" "${ROOTFS}"/etc/make.conf |
53 |
+ elif [[ "$MYARCH" == "i686" ]]; then |
54 |
+ sed -i "s/ALTARCH/${MYARCH}/" "${ROOTFS}"/etc/make.conf |
55 |
+ fi |
56 |
} |
57 |
|
58 |
prepare_usr_etc() { |
59 |
mkdir -p "${ROOTFS}"/usr/etc |
60 |
|
61 |
- cat <<-EOF > "${ROOTFS}"/usr/etc/ld-musl-x86_64.path |
62 |
+ cat <<-EOF > "${ROOTFS}"/usr/etc/ld-musl-${ALTARCH}.path |
63 |
/lib |
64 |
/usr/lib |
65 |
- /usr/lib/gcc/x86_64-gentoo-linux-musl/4.7.3 |
66 |
- /usr/x86_64-gentoo-linux-musl/lib |
67 |
+ /usr/lib/gcc/${ALTARCH}-gentoo-linux-musl/4.7.3 |
68 |
+ /usr/${ALTARCH}-gentoo-linux-musl/lib |
69 |
EOF |
70 |
|
71 |
- ln -sf ld-musl-x86_64.path "${ROOTFS}"/usr/etc/ld-musl.path |
72 |
+ ln -sf ld-musl-${ALTARCH}.path "${ROOTFS}"/usr/etc/ld-musl.path |
73 |
} |
74 |
|
75 |
prepare_overlay() { |
76 |
@@ -39,6 +55,10 @@ setup_configs() { |
77 |
sed -i '/^SYNC/d' "${ROOTFS}"/etc/portage/make.conf |
78 |
sed -i '/^GENTOO_MIRRORS/d' "${ROOTFS}"/etc/portage/make.conf |
79 |
sed -i 's/^MAKEOPTS/#MAKEOPTS/' "${ROOTFS}"/etc/portage/make.conf |
80 |
+ |
81 |
+ # There are some issue with python3, so let's select python2 |
82 |
+ # which so far is option 1 in elesect python. |
83 |
+ chroot "${ROOTFS}" eselect python set 1 |
84 |
} |
85 |
|
86 |
bundle_it() { |