tools-musl: initial commit

This commit is contained in:
Anthony G. Basile 2014-01-27 12:22:49 +00:00
parent 3d4d415a27
commit c5b17f302e
10 changed files with 1129 additions and 0 deletions

2
tools-musl/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
stage*
*.log

11
tools-musl/README Normal file
View file

@ -0,0 +1,11 @@
This is not ready yet for a full catalyst run. However,
if you have a musl chroot (which you can get from any
gentoo mirror off of /experimental/amd64/musl) then you
can build a new stage by running ./run.sh. It basically
uses the `ROOT=rootfs emerge -e @system` technique.
Once more stuff is integrated into gentoo, we will replace
this with a catalyst scripts.
Anthony G. Basile <blueness@gentoo.org>

View file

@ -0,0 +1,17 @@
CHOST=x86_64-gentoo-linux-musl
CFLAGS="-Os -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
USE="-hardened -fortran -mudflap"
USE="${USE} -xattr python zlib"
MAKEOPTS="-j9"
INSTALL_MASK="charset.alias"
FEATURES="-sandbox"
PORTDIR="/usr/portage"
source /var/lib/layman/make.conf
GENTOO_MIRRORS="ftp://192.168.3.1/pub/gentoo"
SYNC="rsync://192.168.3.1/portage"

View file

@ -0,0 +1 @@
/usr/portage/profiles/hardened/linux/musl/amd64

View file

@ -0,0 +1,2 @@
=sys-libs/musl-0.9.15 ~amd64
=sys-apps/getent-0 ~amd64

View file

@ -0,0 +1,2 @@
sys-fs/udev
sys-apps/systemd

View file

@ -0,0 +1,3 @@
app-editors/vim -python
dev-vcs/git -gpg
sys-apps/busybox -* savedconfig

View file

@ -0,0 +1,7 @@
[DEFAULT]
main-repo = gentoo
[gentoo]
location = /usr/portage
sync-type = rsync
sync-uri = rsync://192.168.3.1/portage

File diff suppressed because it is too large Load diff

53
tools-musl/run.sh Executable file
View file

@ -0,0 +1,53 @@
#!/bin/bash
ROOTFS="stage4-amd64-musl"
PWD="$(pwd)"
prepare_etc () {
mkdir -p "${ROOTFS}"/etc
cp -a "${PWD}"/portage/ "${ROOTFS}"/etc/
}
prepare_usr_etc() {
mkdir -p "${ROOTFS}"/usr/etc
cat <<-EOF > "${ROOTFS}"/usr/etc/ld-musl-x86_64.path
/lib
/usr/lib
/usr/lib/gcc/x86_64-gentoo-linux-musl/4.7.3
/usr/x86_64-gentoo-linux-musl/lib
EOF
ln -sf ld-musl-x86_64.path "${ROOTFS}"/usr/etc/ld-musl.path
}
prepare_overlay() {
# This is intensely ugly, but for now ...
mkdir -p "${ROOTFS}"/var/lib/layman/
cp -a /var/lib/layman/* "${ROOTFS}"/var/lib/layman/
}
emerge_system() {
ROOT="${ROOTFS}" emerge --keep-going --with-bdeps=y -uvq @system
}
mk_top_level_dirs() {
mkdir "${ROOTFS}"/{boot,dev,home,media,mnt,opt,proc,root,sys}
}
setup_configs() {
sed -i '/^SYNC/d' "${ROOTFS}"/etc/portage/make.conf
sed -i '/^GENTOO_MIRRORS/d' "${ROOTFS}"/etc/portage/make.conf
sed -i 's/^MAKEOPTS/#MAKEOPTS/' "${ROOTFS}"/etc/portage/make.conf
}
main (){
prepare_etc
prepare_usr_etc
prepare_overlay
emerge_system
mk_top_level_dirs
setup_configs
}
main > zzz.log 2>&1 &