Drop all the musl special sauce, integrated in main builds now
Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
This commit is contained in:
parent
8c876b1e5d
commit
c89c48aecf
3
tools-musl/.gitignore
vendored
3
tools-musl/.gitignore
vendored
|
@ -1,3 +0,0 @@
|
||||||
*log
|
|
||||||
*err
|
|
||||||
stage*.conf
|
|
|
@ -1,31 +0,0 @@
|
||||||
# Custom catalyst.conf file
|
|
||||||
|
|
||||||
digests="sha512 whirlpool"
|
|
||||||
|
|
||||||
contents="auto"
|
|
||||||
|
|
||||||
distdir="/release/tmp/distfiles"
|
|
||||||
|
|
||||||
envscript="/etc/catalyst/catalystrc"
|
|
||||||
|
|
||||||
hash_function="crc32"
|
|
||||||
|
|
||||||
#options="autoresume bindist kerncache pkgcache seedcache snapcache"
|
|
||||||
options="autoresume bindist kerncache pkgcache seedcache"
|
|
||||||
|
|
||||||
portdir="/usr/portage"
|
|
||||||
|
|
||||||
repo_basedir="/var/db/repos"
|
|
||||||
repo_name="gentoo"
|
|
||||||
target_distdir="/var/cache/distfiles"
|
|
||||||
target_pkgdir="/var/cache/binpkgs"
|
|
||||||
|
|
||||||
sharedir="/usr/share/catalyst"
|
|
||||||
|
|
||||||
shdir="%(sharedir)s/targets"
|
|
||||||
|
|
||||||
snapshot_cache="/release/buildroot/alt-dev/snapshot_cache"
|
|
||||||
|
|
||||||
storedir="/release/buildroot/alt-dev"
|
|
||||||
|
|
||||||
source_matching="strict"
|
|
|
@ -1,6 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# This just removes the temporary conf err and log
|
|
||||||
# files generated during a run
|
|
||||||
|
|
||||||
rm -f *conf *err *log
|
|
|
@ -1,63 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
source $(pwd)/catalyst.conf.local
|
|
||||||
|
|
||||||
mydate=`date +%Y%m%d`
|
|
||||||
|
|
||||||
|
|
||||||
undo_grsec() {
|
|
||||||
[[ -d /proc/sys/kernel/grsecurity ]] || return
|
|
||||||
for i in /proc/sys/kernel/grsecurity/chroot_* ; do
|
|
||||||
echo 0 > $i
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
banner() {
|
|
||||||
cat << EOF | tee -a zzz.log > stage$1-$2-musl-$3.log
|
|
||||||
|
|
||||||
************************************************************************
|
|
||||||
* stage$1-$2-musl-$3
|
|
||||||
************************************************************************"
|
|
||||||
|
|
||||||
EOF
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
do_stages() {
|
|
||||||
local arch=$1
|
|
||||||
local flavor=$2
|
|
||||||
|
|
||||||
for s in 1 2 3; do
|
|
||||||
local tgpath="${storedir}/builds/musl/${flavor}/${arch}"
|
|
||||||
local target="stage${s}-${arch}-musl-${flavor}-${mydate}.tar.bz2"
|
|
||||||
local tglink="stage${s}-${arch}-musl-${flavor}.tar.bz2"
|
|
||||||
|
|
||||||
if [[ ! -f "${tgpath}/${tglink}" ]]; then
|
|
||||||
touch stage${s}-${arch}-musl-${flavor}.log
|
|
||||||
echo "!!! ${tglink} at ${tgpath} doesn't exist" \
|
|
||||||
| tee -a zzz.log \
|
|
||||||
> stage${s}-${arch}-musl-${flavor}.err
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
banner ${s} ${arch} ${flavor}
|
|
||||||
catalyst -c $(pwd)/catalyst.conf.local \
|
|
||||||
-f stage${s}-${arch}-musl-${flavor}.conf \
|
|
||||||
| tee -a zzz.log \
|
|
||||||
> stage${s}-${arch}-musl-${flavor}.log \
|
|
||||||
2> stage${s}-${arch}-musl-${flavor}.err
|
|
||||||
|
|
||||||
if [[ -f "${tgpath}/${target}" ]]; then
|
|
||||||
rm -f "${tgpath}/${tglink}"
|
|
||||||
ln -s ${target} "${tgpath}/${tglink}"
|
|
||||||
else
|
|
||||||
echo "!!! ${target} was not generated" \
|
|
||||||
| tee -a zzz.log \
|
|
||||||
>stage${s}-${arch}-musl-${flavor}.err
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
return 0
|
|
||||||
}
|
|
|
@ -1 +0,0 @@
|
||||||
=net-analyzer/macchanger-1.7.0-r1 ~amd64
|
|
|
@ -1,3 +0,0 @@
|
||||||
# Allow linux-firmware and other required packages in @BINARY-REDISTRIBUTABLE
|
|
||||||
# license group
|
|
||||||
*/* @BINARY-REDISTRIBUTABLE
|
|
|
@ -1,4 +0,0 @@
|
||||||
app-admin/syslog-ng -tcpd
|
|
||||||
sys-apps/kmod lzma # kernel module compression
|
|
||||||
sys-apps/util-linux static-libs # for genkernel
|
|
||||||
dev-lang/python xml sqlite # for layman
|
|
|
@ -1 +0,0 @@
|
||||||
sys-libs/pam cracklib
|
|
|
@ -1 +0,0 @@
|
||||||
sys-libs/pam cracklib
|
|
|
@ -1 +0,0 @@
|
||||||
dev-libs/gmp static-libs
|
|
|
@ -1 +0,0 @@
|
||||||
sys-libs/pam cracklib
|
|
|
@ -1 +0,0 @@
|
||||||
dev-libs/gmp static-libs
|
|
|
@ -1 +0,0 @@
|
||||||
sys-libs/pam cracklib
|
|
|
@ -1 +0,0 @@
|
||||||
sys-libs/pam cracklib
|
|
|
@ -1 +0,0 @@
|
||||||
sys-libs/pam cracklib
|
|
|
@ -1 +0,0 @@
|
||||||
sys-libs/pam cracklib
|
|
|
@ -1,5 +0,0 @@
|
||||||
>app-editors/nano-2.3.6
|
|
||||||
>sys-apps/coreutils-8.23
|
|
||||||
>sys-apps/iproute2-3.17.0
|
|
||||||
>sys-apps/sandbox-2.6-r999
|
|
||||||
>sys-devel/gcc-4.8.5-r99
|
|
|
@ -1 +0,0 @@
|
||||||
sys-libs/pam cracklib
|
|
|
@ -1,5 +0,0 @@
|
||||||
>app-editors/nano-2.3.6
|
|
||||||
>sys-apps/coreutils-8.23
|
|
||||||
>sys-apps/iproute2-3.17.0
|
|
||||||
>sys-apps/sandbox-2.6-r999
|
|
||||||
>sys-devel/gcc-4.8.5-r99
|
|
|
@ -1 +0,0 @@
|
||||||
sys-libs/pam cracklib
|
|
|
@ -1 +0,0 @@
|
||||||
sys-libs/pam cracklib
|
|
|
@ -1,57 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
source common.sh
|
|
||||||
|
|
||||||
prepare_confs() {
|
|
||||||
local flavor=$1
|
|
||||||
local arch="arm64"
|
|
||||||
local tarch="aarch64"
|
|
||||||
local profile="default/linux/arm64/17.0/musl"
|
|
||||||
[[ "${flavor}" == "hardened" ]] && profile="${profile}/hardened"
|
|
||||||
|
|
||||||
for s in 1 2 3; do
|
|
||||||
local cstage=stage${s}
|
|
||||||
local p=$(( s - 1 ))
|
|
||||||
[[ $p == 0 ]] && p=3
|
|
||||||
local pstage=stage${p}
|
|
||||||
|
|
||||||
cat stage.conf.template | \
|
|
||||||
sed -e "s:\(^version_stamp.*$\):\1-${mydate}:" \
|
|
||||||
-e "s:CSTAGE:${cstage}:g" \
|
|
||||||
-e "s:PSTAGE:${pstage}:g" \
|
|
||||||
-e "s:SARCH:${arch}:g" \
|
|
||||||
-e "s:TARCH:${tarch}:g" \
|
|
||||||
-e "s:FLAVOR:${flavor}:g" \
|
|
||||||
-e "s:^profile\:.*:profile\: ${profile}:" \
|
|
||||||
-e "s:MYCATALYST:$(pwd):g" \
|
|
||||||
> stage${s}-${arch}-musl-${flavor}.conf
|
|
||||||
|
|
||||||
sed -i "/^portage_confdir/s:_hardfp::" \
|
|
||||||
stage${s}-${arch}-musl-${flavor}.conf
|
|
||||||
|
|
||||||
portage_confdir=$(grep portage_confdir stage${s}-${arch}-musl-${flavor}.conf \
|
|
||||||
| sed -e 's/^.*:[ \t]*//')
|
|
||||||
[[ ! -e ${portage_confdir} ]] && sed -i -e '/^portage_confdir/d' \
|
|
||||||
stage${s}-${arch}-musl-${flavor}.conf
|
|
||||||
done
|
|
||||||
|
|
||||||
sed -i "/^chost/d" stage3-${arch}-musl-${flavor}.conf
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
main() {
|
|
||||||
>zzz.log
|
|
||||||
|
|
||||||
catalyst -s current | tee -a zzz.log >snapshot.log 2>snapshot.err
|
|
||||||
|
|
||||||
for flavor in hardened vanilla; do
|
|
||||||
prepare_confs ${flavor}
|
|
||||||
done
|
|
||||||
|
|
||||||
for flavor in hardened vanilla; do
|
|
||||||
do_stages "arm64" ${flavor}
|
|
||||||
[[ $? == 1 ]] && echo "FAILURE at ${arch} ${flavor} " | tee zzz.log
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
main $1 &
|
|
|
@ -1,61 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
source common.sh
|
|
||||||
|
|
||||||
prepare_confs() {
|
|
||||||
local flavor=$1
|
|
||||||
local arch="armv7a_hardfp"
|
|
||||||
local tarch="armv7a"
|
|
||||||
local profile="default/linux/arm/17.0/musl/armv7a"
|
|
||||||
[[ "${flavor}" == "hardened" ]] && profile="${profile}/hardened"
|
|
||||||
|
|
||||||
for s in 1 2 3; do
|
|
||||||
local cstage=stage${s}
|
|
||||||
local p=$(( s - 1 ))
|
|
||||||
[[ $p == 0 ]] && p=3
|
|
||||||
local pstage=stage${p}
|
|
||||||
|
|
||||||
cat stage.conf.template | \
|
|
||||||
sed -e "s:\(^version_stamp.*$\):\1-${mydate}:" \
|
|
||||||
-e "s:CSTAGE:${cstage}:g" \
|
|
||||||
-e "s:PSTAGE:${pstage}:g" \
|
|
||||||
-e "s:SARCH:${arch}:g" \
|
|
||||||
-e "s:TARCH:${tarch}:g" \
|
|
||||||
-e "s:FLAVOR:${flavor}:g" \
|
|
||||||
-e "s:gentoo-linux-musl:unknown-linux-musleabihf:g" \
|
|
||||||
-e "s:^profile\:.*:profile\: ${profile}:" \
|
|
||||||
-e "s:MYCATALYST:$(pwd):g" \
|
|
||||||
> stage${s}-${arch}-musl-${flavor}.conf
|
|
||||||
|
|
||||||
sed -i "/^portage_confdir/s:_hardfp::" \
|
|
||||||
stage${s}-${arch}-musl-${flavor}.conf
|
|
||||||
|
|
||||||
echo "cflags: -O2 -pipe -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard" >> \
|
|
||||||
stage${s}-${arch}-musl-${flavor}.conf
|
|
||||||
|
|
||||||
portage_confdir=$(grep portage_confdir stage${s}-${arch}-musl-${flavor}.conf \
|
|
||||||
| sed -e 's/^.*:[ \t]*//')
|
|
||||||
[[ ! -e ${portage_confdir} ]] && sed -i -e '/^portage_confdir/d' \
|
|
||||||
stage${s}-${arch}-musl-${flavor}.conf
|
|
||||||
done
|
|
||||||
|
|
||||||
sed -i "/^chost/d" stage3-${arch}-musl-${flavor}.conf
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
main() {
|
|
||||||
>zzz.log
|
|
||||||
|
|
||||||
catalyst -s current | tee -a zzz.log >snapshot.log 2>snapshot.err
|
|
||||||
|
|
||||||
for flavor in hardened vanilla; do
|
|
||||||
prepare_confs ${flavor}
|
|
||||||
done
|
|
||||||
|
|
||||||
for flavor in hardened vanilla; do
|
|
||||||
do_stages "armv7a_hardfp" ${flavor}
|
|
||||||
[[ $? == 1 ]] && echo "FAILURE at ${arch} ${flavor} " | tee zzz.log
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
main $1 &
|
|
|
@ -1,65 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
source common.sh
|
|
||||||
|
|
||||||
prepare_confs() {
|
|
||||||
local arch=$1
|
|
||||||
local flavor=$2
|
|
||||||
|
|
||||||
for s in 1 2 3; do
|
|
||||||
|
|
||||||
local cstage=stage${s}
|
|
||||||
local p=$(( s - 1 ))
|
|
||||||
[[ $p == 0 ]] && p=3
|
|
||||||
local pstage=stage${p}
|
|
||||||
local tarch="${arch%32r2}"
|
|
||||||
local parch="${tarch}"
|
|
||||||
|
|
||||||
local profile=${flavor}
|
|
||||||
[[ "${flavor}" == "vanilla" ]] && profile="default"
|
|
||||||
|
|
||||||
cat stage-all.conf.template | \
|
|
||||||
sed -e "s:\(^version_stamp.*$\):\1-${mydate}:" \
|
|
||||||
-e "s:CSTAGE:${cstage}:g" \
|
|
||||||
-e "s:PSTAGE:${pstage}:g" \
|
|
||||||
-e "s:SARCH:${arch}:g" \
|
|
||||||
-e "s:PARCH:${parch}:g" \
|
|
||||||
-e "s:TARCH:${tarch}:g" \
|
|
||||||
-e "s:FLAVOR:${flavor}:g" \
|
|
||||||
-e "s:PROFILE:${profile}:g" \
|
|
||||||
-e "s:MYCATALYST:$(pwd):g" \
|
|
||||||
-e "s|^cflags:.*|cflags: -O2 -march=mips3 -mplt -Wa,-mfix-loongson2f-nop -pipe|" \
|
|
||||||
-e "s|^cxxflags:.*|cxxflags: -O2 -march=mips3 -mplt -Wa,-mfix-loongson2f-nop -pipe|" \
|
|
||||||
> stage${s}-${arch}-musl-${flavor}.conf
|
|
||||||
|
|
||||||
portage_confdir=$(grep portage_confdir stage${s}-${arch}-musl-${flavor}.conf \
|
|
||||||
| sed -e 's/^.*:[ \t]*//')
|
|
||||||
[[ ! -e ${portage_confdir} ]] && sed -i -e '/^portage_confdir/d' \
|
|
||||||
stage${s}-${arch}-musl-${flavor}.conf
|
|
||||||
done
|
|
||||||
|
|
||||||
sed -i "/^chost/d" stage3-${arch}-musl-${flavor}.conf
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
main() {
|
|
||||||
>zzz.log
|
|
||||||
|
|
||||||
catalyst -s current | tee -a zzz.log >snapshot.log 2>snapshot.err
|
|
||||||
|
|
||||||
for arch in mips32r2; do
|
|
||||||
for flavor in vanilla; do
|
|
||||||
prepare_confs ${arch} ${flavor}
|
|
||||||
done
|
|
||||||
done
|
|
||||||
|
|
||||||
# No parallelization for mips. Its too hard on the cpu!
|
|
||||||
for arch in mips32r2; do
|
|
||||||
for flavor in vanilla; do
|
|
||||||
do_stages ${arch} ${flavor}
|
|
||||||
[[ $? == 1 ]] && echo "FAILURE at ${arch} ${flavor} " | tee zzz.log
|
|
||||||
done
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
main $1 &
|
|
|
@ -1,65 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
source common.sh
|
|
||||||
|
|
||||||
prepare_confs() {
|
|
||||||
local arch=$1
|
|
||||||
local flavor=$2
|
|
||||||
|
|
||||||
for s in 1 2 3; do
|
|
||||||
|
|
||||||
local cstage=stage${s}
|
|
||||||
local p=$(( s - 1 ))
|
|
||||||
[[ $p == 0 ]] && p=3
|
|
||||||
local pstage=stage${p}
|
|
||||||
local tarch="${arch%3}"
|
|
||||||
local parch="mips/${tarch}"
|
|
||||||
|
|
||||||
local profile=${flavor}
|
|
||||||
[[ "${flavor}" == "vanilla" ]] && profile="default"
|
|
||||||
|
|
||||||
cat stage-all.conf.template | \
|
|
||||||
sed -e "s:\(^version_stamp.*$\):\1-${mydate}:" \
|
|
||||||
-e "s:CSTAGE:${cstage}:g" \
|
|
||||||
-e "s:PSTAGE:${pstage}:g" \
|
|
||||||
-e "s:SARCH:${arch}:g" \
|
|
||||||
-e "s:PARCH:${parch}:g" \
|
|
||||||
-e "s:TARCH:${tarch}:g" \
|
|
||||||
-e "s:FLAVOR:${flavor}:g" \
|
|
||||||
-e "s:PROFILE:${profile}:g" \
|
|
||||||
-e "s:MYCATALYST:$(pwd):g" \
|
|
||||||
-e "s|^cflags:.*|cflags: -O2 -march=mips3 -mplt -Wa,-mfix-loongson2f-nop -pipe|" \
|
|
||||||
-e "s|^cxxflags:.*|cxxflags: -O2 -march=mips3 -mplt -Wa,-mfix-loongson2f-nop -pipe|" \
|
|
||||||
> stage${s}-${arch}-musl-${flavor}.conf
|
|
||||||
|
|
||||||
portage_confdir=$(grep portage_confdir stage${s}-${arch}-musl-${flavor}.conf \
|
|
||||||
| sed -e 's/^.*:[ \t]*//')
|
|
||||||
[[ ! -e ${portage_confdir} ]] && sed -i -e '/^portage_confdir/d' \
|
|
||||||
stage${s}-${arch}-musl-${flavor}.conf
|
|
||||||
done
|
|
||||||
|
|
||||||
sed -i "/^chost/d" stage3-${arch}-musl-${flavor}.conf
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
main() {
|
|
||||||
>zzz.log
|
|
||||||
|
|
||||||
catalyst -s current | tee -a zzz.log >snapshot.log 2>snapshot.err
|
|
||||||
|
|
||||||
for arch in mipsel3; do
|
|
||||||
for flavor in vanilla; do
|
|
||||||
prepare_confs ${arch} ${flavor}
|
|
||||||
done
|
|
||||||
done
|
|
||||||
|
|
||||||
# No parallelization for mips. Its too hard on the cpu!
|
|
||||||
for arch in mipsel3; do
|
|
||||||
for flavor in vanilla; do
|
|
||||||
do_stages ${arch} ${flavor}
|
|
||||||
[[ $? == 1 ]] && echo "FAILURE at ${arch} ${flavor} " | tee zzz.log
|
|
||||||
done
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
main $1 &
|
|
|
@ -1,65 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
source common.sh
|
|
||||||
|
|
||||||
prepare_confs() {
|
|
||||||
local arch=$1
|
|
||||||
local flavor=$2
|
|
||||||
|
|
||||||
for s in 1 2 3; do
|
|
||||||
|
|
||||||
local cstage=stage${s}
|
|
||||||
local p=$(( s - 1 ))
|
|
||||||
[[ $p == 0 ]] && p=3
|
|
||||||
local pstage=stage${p}
|
|
||||||
local parch="${arch}"
|
|
||||||
|
|
||||||
local tarch="${arch}"
|
|
||||||
[[ "${arch}" == "ppc" ]] && tarch="powerpc"
|
|
||||||
|
|
||||||
local profile=${flavor}
|
|
||||||
[[ "${flavor}" == "vanilla" ]] && profile="default"
|
|
||||||
|
|
||||||
cat stage-all.conf.template | \
|
|
||||||
sed -e "s:\(^version_stamp.*$\):\1-${mydate}:" \
|
|
||||||
-e "s:CSTAGE:${cstage}:g" \
|
|
||||||
-e "s:PSTAGE:${pstage}:g" \
|
|
||||||
-e "s:SARCH:${arch}:g" \
|
|
||||||
-e "s:PARCH:${parch}:g" \
|
|
||||||
-e "s:TARCH:${tarch}:g" \
|
|
||||||
-e "s:FLAVOR:${flavor}:g" \
|
|
||||||
-e "s:PROFILE:${profile}:g" \
|
|
||||||
-e "s:MYCATALYST:$(pwd):g" \
|
|
||||||
> stage${s}-${arch}-musl-${flavor}.conf
|
|
||||||
|
|
||||||
portage_confdir=$(grep portage_confdir stage${s}-${arch}-musl-${flavor}.conf \
|
|
||||||
| sed -e 's/^.*:[ \t]*//')
|
|
||||||
[[ ! -e ${portage_confdir} ]] && sed -i -e '/^portage_confdir/d' \
|
|
||||||
stage${s}-${arch}-musl-${flavor}.conf
|
|
||||||
done
|
|
||||||
|
|
||||||
sed -i "/^chost/d" stage3-${arch}-musl-${flavor}.conf
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
main() {
|
|
||||||
>zzz.log
|
|
||||||
|
|
||||||
catalyst -s current | tee -a zzz.log >snapshot.log 2>snapshot.err
|
|
||||||
|
|
||||||
for arch in ppc; do
|
|
||||||
for flavor in vanilla; do
|
|
||||||
prepare_confs ${arch} ${flavor}
|
|
||||||
done
|
|
||||||
done
|
|
||||||
|
|
||||||
# No parallelization
|
|
||||||
for arch in ppc; do
|
|
||||||
for flavor in vanilla; do
|
|
||||||
do_stages ${arch} ${flavor}
|
|
||||||
[[ $? == 1 ]] && echo "FAILURE at ${arch} ${flavor} " | tee zzz.log
|
|
||||||
done
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
main $1 &
|
|
|
@ -1,23 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -eu
|
|
||||||
|
|
||||||
source /etc/catalyst/catalyst.conf
|
|
||||||
|
|
||||||
MUSL_DIR="$( cd "$( dirname ${BASH_SOURCE[0]} )" && pwd )"
|
|
||||||
MY_DATE="$(date +%Y%m%d)"
|
|
||||||
|
|
||||||
# munge specfile for this run
|
|
||||||
cp "${MUSL_DIR}"/stage4-hardened-amd64.spec "${MUSL_DIR}"/stage4-hardened-amd64-configured.spec
|
|
||||||
sed -i "s|@REPO_DIR@|${MUSL_DIR}|g" "${MUSL_DIR}"/stage4-hardened-amd64-configured.spec
|
|
||||||
sed -i "s|MY_DATE|${MY_DATE}|g" "${MUSL_DIR}"/stage4-hardened-amd64-configured.spec
|
|
||||||
|
|
||||||
# catalyst stuff
|
|
||||||
catalyst -f "${MUSL_DIR}"/stage4-hardened-amd64-configured.spec | tee -a "${MUSL_DIR}"/zzz.log
|
|
||||||
|
|
||||||
# update link, rm -f returns 0 if file isn't there yet
|
|
||||||
rm -f "${storedir}/builds/musl/hardened/amd64/stage4-amd64-musl-hardened.tar.xz"
|
|
||||||
ln -s "${storedir}/builds/musl/hardened/amd64/stage4-amd64-musl-hardened-${MY_DATE}.tar.xz" "${storedir}/builds/musl/hardened/amd64/stage4-amd64-musl-hardened.tar.xz"
|
|
||||||
|
|
||||||
# remove old specfile
|
|
||||||
rm "${MUSL_DIR}"/stage4-hardened-amd64-configured.spec
|
|
|
@ -1,70 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
source common.sh
|
|
||||||
|
|
||||||
prepare_confs() {
|
|
||||||
local arch=$1
|
|
||||||
local flavor=$2
|
|
||||||
|
|
||||||
for s in 1 2 3; do
|
|
||||||
|
|
||||||
local cstage=stage${s}
|
|
||||||
local p=$(( s - 1 ))
|
|
||||||
[[ $p == 0 ]] && p=3
|
|
||||||
local pstage=stage${p}
|
|
||||||
|
|
||||||
local parch="${arch}"
|
|
||||||
[[ "${arch}" == "i686" ]] && parch="x86"
|
|
||||||
|
|
||||||
local tarch="${arch}"
|
|
||||||
[[ "${arch}" == "amd64" ]] && tarch="x86_64"
|
|
||||||
|
|
||||||
local profile=${flavor}
|
|
||||||
[[ "${flavor}" == "vanilla" ]] && profile="" || profile="/hardened"
|
|
||||||
|
|
||||||
cat stage.conf.template | \
|
|
||||||
sed -e "s:\(^version_stamp.*$\):\1-${mydate}:" \
|
|
||||||
-e "s:CSTAGE:${cstage}:g" \
|
|
||||||
-e "s:PSTAGE:${pstage}:g" \
|
|
||||||
-e "s:SARCH:${arch}:g" \
|
|
||||||
-e "s:PARCH:${parch}:g" \
|
|
||||||
-e "s:TARCH:${tarch}:g" \
|
|
||||||
-e "s:FLAVOR:${flavor}:g" \
|
|
||||||
-e "s:PROFILE:${profile}:g" \
|
|
||||||
-e "s:MYCATALYST:$(pwd):g" \
|
|
||||||
> stage${s}-${arch}-musl-${flavor}.conf
|
|
||||||
|
|
||||||
portage_confdir=$(grep portage_confdir stage${s}-${arch}-musl-${flavor}.conf \
|
|
||||||
| sed -e 's/^.*:[ \t]*//')
|
|
||||||
[[ ! -e ${portage_confdir} ]] && sed -i -e '/^portage_confdir/d' \
|
|
||||||
stage${s}-${arch}-musl-${flavor}.conf
|
|
||||||
done
|
|
||||||
|
|
||||||
sed -i "/^chost/d" stage3-${arch}-musl-${flavor}.conf
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
main() {
|
|
||||||
>zzz.log
|
|
||||||
|
|
||||||
undo_grsec
|
|
||||||
|
|
||||||
catalyst -c $(pwd)/catalyst.conf.local -s current | tee -a zzz.log >snapshot.log 2>snapshot.err
|
|
||||||
|
|
||||||
for arch in amd64 i686; do
|
|
||||||
for flavor in hardened vanilla; do
|
|
||||||
prepare_confs ${arch} ${flavor}
|
|
||||||
done
|
|
||||||
done
|
|
||||||
|
|
||||||
# The parallelization `( do_stages ... ) &` doesn't work here
|
|
||||||
# if catalyst is using snapcache, bug #519656
|
|
||||||
for arch in amd64 i686; do
|
|
||||||
for flavor in hardened vanilla; do
|
|
||||||
do_stages ${arch} ${flavor}
|
|
||||||
[[ $? == 1 ]] && echo "FAILURE at ${arch} ${flavor} " | tee zzz.log
|
|
||||||
done
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
main $1 &
|
|
|
@ -1,12 +0,0 @@
|
||||||
subarch: SARCH
|
|
||||||
target: CSTAGE
|
|
||||||
version_stamp: musl-FLAVOR
|
|
||||||
rel_type: musl/FLAVOR/SARCH
|
|
||||||
profile: PROFILE/linux/musl/PARCH
|
|
||||||
snapshot: current
|
|
||||||
source_subpath: musl/FLAVOR/SARCH/PSTAGE-SARCH-musl-FLAVOR
|
|
||||||
chost: TARCH-gentoo-linux-musl
|
|
||||||
cflags: -O2 -pipe
|
|
||||||
cxxflags: -O2 -pipe
|
|
||||||
portage_confdir: MYCATALYST/portage.SARCH.FLAVOR
|
|
||||||
portage_overlay: /var/lib/layman/musl
|
|
|
@ -1,12 +0,0 @@
|
||||||
subarch: SARCH
|
|
||||||
target: CSTAGE
|
|
||||||
version_stamp: musl-FLAVOR
|
|
||||||
rel_type: musl/FLAVOR/SARCH
|
|
||||||
profile: default/linux/PARCH/17.0/muslPROFILE
|
|
||||||
snapshot: current
|
|
||||||
source_subpath: musl/FLAVOR/SARCH/PSTAGE-SARCH-musl-FLAVOR
|
|
||||||
chost: TARCH-gentoo-linux-musl
|
|
||||||
cflags: -O2 -pipe
|
|
||||||
cxxflags: -O2 -pipe
|
|
||||||
portage_confdir: MYCATALYST/portage.SARCH.FLAVOR
|
|
||||||
portage_overlay: /var/lib/layman/musl
|
|
|
@ -1,93 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Set timezone
|
|
||||||
echo 'UTC' > /etc/timezone
|
|
||||||
|
|
||||||
# Some rootfs stuff
|
|
||||||
grep -v rootfs /proc/mounts > /etc/mtab
|
|
||||||
|
|
||||||
# This is set in rackspaces prep, might help us
|
|
||||||
echo 'net.ipv4.conf.eth0.arp_notify = 1' >> /etc/sysctl.conf
|
|
||||||
echo 'vm.swappiness = 0' >> /etc/sysctl.conf
|
|
||||||
|
|
||||||
# Let's configure our grub
|
|
||||||
# Access on both regular tty and serial console
|
|
||||||
mkdir /boot/grub
|
|
||||||
cat >>/etc/default/grub <<EOF
|
|
||||||
GRUB_TERMINAL='serial console'
|
|
||||||
GRUB_CMDLINE_LINUX="console=tty0 console=ttyS0,115200n8"
|
|
||||||
GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"
|
|
||||||
EOF
|
|
||||||
grub-mkconfig -o /boot/grub/grub.cfg
|
|
||||||
sed -r -i 's/loop[0-9]+p1/LABEL\=cloudimg-rootfs/g' /boot/grub/grub.cfg
|
|
||||||
sed -i 's/root=.*\ ro/root=LABEL\=cloudimg-rootfs\ ro/' /boot/grub/grub.cfg
|
|
||||||
|
|
||||||
# And the fstab
|
|
||||||
echo 'LABEL=cloudimg-rootfs / ext4 defaults 0 0' > /etc/fstab
|
|
||||||
|
|
||||||
# allow the console log
|
|
||||||
sed -i 's/#s0/s0/g' /etc/inittab
|
|
||||||
|
|
||||||
# let ipv6 use normal slaac
|
|
||||||
sed -i 's/slaac/#slaac/g' /etc/dhcpcd.conf
|
|
||||||
# don't let dhcpcd set domain name or hostname
|
|
||||||
sed -i 's/domain_name\,\ domain_search\,\ host_name/domain_search/g' /etc/dhcpcd.conf
|
|
||||||
|
|
||||||
# need to do this here because it clobbers an openrc owned file
|
|
||||||
cat > /etc/conf.d/hostname << "EOL"
|
|
||||||
# Set to the hostname of this machine
|
|
||||||
if [ -f /etc/hostname ];then
|
|
||||||
hostname=$(cat /etc/hostname 2> /dev/null | cut -d"." -f1 2> /dev/null)
|
|
||||||
else
|
|
||||||
hostname="localhost"
|
|
||||||
fi
|
|
||||||
EOL
|
|
||||||
chmod 0644 /etc/conf.d/hostname
|
|
||||||
chown root:root /etc/conf.d/hostname
|
|
||||||
|
|
||||||
# set a nice default for /etc/resolv.conf
|
|
||||||
cat > /etc/resolv.conf << EOL
|
|
||||||
nameserver 8.8.8.8
|
|
||||||
nameserver 2001:4860:4860::8888
|
|
||||||
EOL
|
|
||||||
|
|
||||||
# make sure musl stuff is available
|
|
||||||
echo "=app-portage/layman-2.4.1-r1 ~amd64" >> /etc/portage/package.accept_keywords/layman
|
|
||||||
echo "=dev-python/ssl-fetch-0.4 ~amd64" >> /etc/portage/package.accept_keywords/layman
|
|
||||||
emerge -vq --jobs=4 layman dev-vcs/git
|
|
||||||
layman -L
|
|
||||||
layman -a musl
|
|
||||||
|
|
||||||
# shrink stuff down
|
|
||||||
eselect python set python3.5
|
|
||||||
emerge -C -q dev-lang/python:2.7 sys-boot/grub sys-devel/bc
|
|
||||||
USE="-build" emerge -q --jobs=2 --usepkg=n --buildpkg=y @preserved-rebuild
|
|
||||||
USE="-build" emerge --verbose=n --depclean
|
|
||||||
|
|
||||||
# let's upgrade (security fixes and otherwise)
|
|
||||||
USE="-build" emerge -uDNv --with-bdeps=y --buildpkg=y --jobs=2 @world
|
|
||||||
USE="-build" emerge --verbose=n --depclean
|
|
||||||
USE="-build" emerge -v --usepkg=n --buildpkg=y @preserved-rebuild
|
|
||||||
etc-update --automode -5
|
|
||||||
|
|
||||||
# Clean up portage
|
|
||||||
emerge --verbose=n --depclean
|
|
||||||
emaint all -f
|
|
||||||
eselect news read all
|
|
||||||
eclean-dist --destructive
|
|
||||||
sed -i '/^USE=\"\${USE}\ \ build\"$/d' /etc/portage/make.conf
|
|
||||||
echo 'PORTAGE_GPG_DIR="/var/lib/gentoo/gkeys/keyrings/gentoo/release"' >> /etc/portage/make.conf
|
|
||||||
sed -i '/dev-util\/pkgconf/d' /var/lib/portage/world
|
|
||||||
|
|
||||||
# clean up system
|
|
||||||
passwd -d root
|
|
||||||
passwd -l root
|
|
||||||
for i in $(find /var/log -type f); do truncate -s 0 $i; done
|
|
||||||
# remove foreign manpages
|
|
||||||
find /usr/share/man/ -mindepth 1 -maxdepth 1 -path "/usr/share/man/man*" -prune -o -exec rm -rf {} \;
|
|
||||||
|
|
||||||
# fine if this fails, aka non-hardened
|
|
||||||
if [[ -x /usr/sbin/migrate-pax ]]; then
|
|
||||||
echo 'migraging pax'
|
|
||||||
/usr/sbin/migrate-pax -m
|
|
||||||
fi
|
|
|
@ -1,72 +0,0 @@
|
||||||
subarch: amd64
|
|
||||||
target: stage4
|
|
||||||
version_stamp: musl-hardened-MY_DATE
|
|
||||||
rel_type: musl/hardened/amd64
|
|
||||||
profile: default/linux/amd64/17.0/musl/hardened
|
|
||||||
snapshot: current
|
|
||||||
compression_mode: pixz_x
|
|
||||||
source_subpath: musl/hardened/amd64/stage3-amd64-musl-hardened
|
|
||||||
portage_confdir: @REPO_DIR@/portage.amd64.hardened.stage4
|
|
||||||
portage_overlay: /opt/overlays/musl
|
|
||||||
|
|
||||||
stage4/use:
|
|
||||||
bash-completion
|
|
||||||
bindist
|
|
||||||
bzip2
|
|
||||||
idm
|
|
||||||
ipv6
|
|
||||||
mmx
|
|
||||||
sse
|
|
||||||
sse2
|
|
||||||
urandom
|
|
||||||
|
|
||||||
stage4/packages:
|
|
||||||
app-admin/syslog-ng
|
|
||||||
app-portage/layman
|
|
||||||
dev-util/pkgconf
|
|
||||||
net-misc/dhcpcd
|
|
||||||
sys-apps/iproute2
|
|
||||||
sys-devel/bc
|
|
||||||
sys-power/acpid
|
|
||||||
sys-process/cronie
|
|
||||||
app-crypt/gentoo-keys
|
|
||||||
stage4/fsscript: @REPO_DIR@/stage4-fsscript.sh
|
|
||||||
stage4/rcadd:
|
|
||||||
acpid|default
|
|
||||||
cronie|default
|
|
||||||
dhcpcd|default
|
|
||||||
net.lo|default
|
|
||||||
netmount|default
|
|
||||||
sshd|default
|
|
||||||
syslog-ng|default
|
|
||||||
|
|
||||||
boot/kernel: gentoo
|
|
||||||
boot/kernel/gentoo/sources: gentoo-sources
|
|
||||||
boot/kernel/gentoo/config: @REPO_DIR@/../releases/kconfig/amd64/cloud-amd64-gentoo.config
|
|
||||||
boot/kernel/gentoo/extraversion: openstack
|
|
||||||
boot/kernel/gentoo/gk_kernargs: --all-ramdisk-modules --no-nfs --makeopts=-j4
|
|
||||||
|
|
||||||
stage4/empty:
|
|
||||||
/root/.ccache
|
|
||||||
/tmp
|
|
||||||
/usr/portage/distfiles
|
|
||||||
/usr/src
|
|
||||||
/var/cache
|
|
||||||
/var/empty
|
|
||||||
/var/run
|
|
||||||
/var/state
|
|
||||||
/var/tmp
|
|
||||||
|
|
||||||
stage4/rm:
|
|
||||||
/boot/System.map-genkernel*
|
|
||||||
/etc/*-
|
|
||||||
/etc/*.old
|
|
||||||
/etc/ssh/ssh_host_*
|
|
||||||
/root/.*history
|
|
||||||
/root/.lesshst
|
|
||||||
/root/.ssh/known_hosts
|
|
||||||
/root/.viminfo
|
|
||||||
# Remove any generated stuff by genkernel
|
|
||||||
/usr/share/genkernel
|
|
||||||
# This is 3MB of crap for each copy
|
|
||||||
/usr/lib64/python*/site-packages/gentoolkit/test/eclean/testdistfiles.tar.gz
|
|
Loading…
Reference in a new issue