summaryrefslogtreecommitdiff
path: root/strata/build-essential
diff options
context:
space:
mode:
Diffstat (limited to 'strata/build-essential')
-rw-r--r--strata/build-essential/binutils.morph7
-rw-r--r--strata/build-essential/busybox.morph99
-rw-r--r--strata/build-essential/ccache.morph12
-rw-r--r--strata/build-essential/eglibc.morph57
-rw-r--r--strata/build-essential/fhs-dirs.morph50
-rw-r--r--strata/build-essential/gawk.morph5
-rw-r--r--strata/build-essential/gcc.morph28
-rw-r--r--strata/build-essential/linux-api-headers.morph7
-rw-r--r--strata/build-essential/make.morph5
-rw-r--r--strata/build-essential/stage1-binutils.morph10
-rw-r--r--strata/build-essential/stage1-gcc.morph30
-rw-r--r--strata/build-essential/stage2-binutils.morph19
-rw-r--r--strata/build-essential/stage2-busybox.morph57
-rw-r--r--strata/build-essential/stage2-eglibc.morph38
-rw-r--r--strata/build-essential/stage2-fhs-dirs.morph52
-rw-r--r--strata/build-essential/stage2-gawk.morph9
-rw-r--r--strata/build-essential/stage2-gcc-fixed-headers.morph10
-rw-r--r--strata/build-essential/stage2-gcc.morph40
-rw-r--r--strata/build-essential/stage2-linux-api-headers.morph9
-rw-r--r--strata/build-essential/stage2-make.morph9
-rw-r--r--strata/build-essential/stage2-reset-specs.morph9
-rw-r--r--strata/build-essential/zlib.morph9
22 files changed, 571 insertions, 0 deletions
diff --git a/strata/build-essential/binutils.morph b/strata/build-essential/binutils.morph
new file mode 100644
index 00000000..81d4d6f7
--- /dev/null
+++ b/strata/build-essential/binutils.morph
@@ -0,0 +1,7 @@
+name: binutils
+kind: chunk
+build-system: autotools
+configure-commands:
+- |
+ ./configure --prefix="$PREFIX" --disable-nls --disable-werror \
+ --with-system-zlib
diff --git a/strata/build-essential/busybox.morph b/strata/build-essential/busybox.morph
new file mode 100644
index 00000000..df7bf008
--- /dev/null
+++ b/strata/build-essential/busybox.morph
@@ -0,0 +1,99 @@
+name: busybox
+kind: chunk
+configure-commands:
+- make defconfig
+- sed -e 's|.*UDHCPC_DEFAULT_SCRIPT.*|CONFIG_UDHCPC_DEFAULT_SCRIPT="'"$PREFIX"/share/udhcpc/default.script'"|'
+ -i .config
+- sed -e 's|.*IFUPDOWN_IFSTATE_PATH.*|CONFIG_IFUPDOWN_IFSTATE_PATH="/run/ifstate"|'
+ -i .config
+- '[ "$PREFIX" = /usr ] || sed -e ''s/.*INSTALL_NO_USR.*/CONFIG_INSTALL_NO_USR=y/''
+ -i .config'
+- sed -e 's/CONFIG_INETD=y.*/# CONFIG_INETD is not set/' -i .config
+- sed -e 's/CONFIG_PATCH=y.*/# CONFIG_PATCH is not set/' -i .config
+- sed -e 's/CONFIG_DEPMOD=y.*/# CONFIG_DEPMOD is not set/' -i .config
+- sed -e 's/CONFIG_INSMOD=y.*/# CONFIG_INSMOD is not set/' -i .config
+- sed -e 's/CONFIG_MODPROBE=y.*/# CONFIG_MODPROBE is not set/' -i .config
+- sed -e 's/CONFIG_MODPROBE_SMALL=y.*/# CONFIG_MODPROBE_SMALL is not set/' -i .config
+- sed -e 's/CONFIG_LSMOD=y.*/# CONFIG_LSMOD is not set/' -i .config
+- sed -e 's/CONFIG_RMMOD=y.*/# CONFIG_RMMOD is not set/' -i .config
+- sed -e 's/CONFIG_FEATURE_MOUNT_CIFS=y.*/# CONFIG_FEATURE_MOUNT_CIFS is not set/'
+ -i .config
+- sed -e 's/CONFIG_FEATURE_EXTRA_QUIET=y.*/# CONFIG_FEATURE_EXTRA_QUIET is not set/'
+ -i .config
+- sed -e 's/CONFIG_FEATURE_INIT_COREDUMPS=y.*/# CONFIG_FEATURE_INIT_COREDUMPS is not
+ set/' -i .config
+- sed -e 's/CONFIG_FEATURE_INIT_SCTTY=y.*/# CONFIG_FEATURE_INIT_SCTTY is not set/'
+ -i .config
+- sed -e 's/CONFIG_FEATURE_INIT_SYSLOG=y.*/# CONFIG_FEATURE_INIT_SYSLOG is not set/'
+ -i .config
+- sed -e 's/CONFIG_FEATURE_INITRD=y.*/# CONFIG_FEATURE_INITRD is not set/' -i .config
+- sed -e 's/CONFIG_FEATURE_MINIX2=y.*/# CONFIG_FEATURE_MINIX2 is not set/' -i .config
+- sed -e 's/CONFIG_FSCK_MINIX=y.*/# CONFIG_FSCK_MINIX is not set/' -i .config
+- sed -e 's/CONFIG_LOSETUP=y.*/# CONFIG_LOSETUP is not set/' -i .config
+- sed -e 's/CONFIG_LSUSB=y.*/# CONFIG_LSUSB is not set/' -i .config
+- sed -e 's/CONFIG_LZMA=y.*/# CONFIG_LZMA is not set/' -i .config
+- sed -e 's/CONFIG_MKFS_EXT2=y.*/# CONFIG_MKFS_EXT2 is not set/' -i .config
+- sed -e 's/CONFIG_MKFS_MINIX=y.*/# CONFIG_MKFS_MINIX is not set/' -i .config
+- sed -e 's/CONFIG_STRINGS=y.*/# CONFIG_STRINGS is not set/' -i .config
+- sed -e 's/CONFIG_UNLZMA=y.*/# CONFIG_UNLZMA is not set/' -i .config
+- sed -e 's/CONFIG_UNXZ=y.*/# CONFIG_UNXZ is not set/' -i .config
+- sed -e 's/CONFIG_XZ=y.*/# CONFIG_XZ is not set/' -i .config
+- sed -e 's/# CONFIG_BBCONFIG is not set/CONFIG_BBCONFIG=y/' -i .config
+- sed -e 's/# CONFIG_FEATURE_COMPRESS_BBCONFIG is not set/CONFIG_FEATURE_COMPRESS_BBCONFIG=y/'
+ -i .config
+- sed -e 's/# CONFIG_FEATURE_MOUNT_HELPERS is not set/CONFIG_FEATURE_MOUNT_HELPERS=y/'
+ -i .config
+build-commands:
+- make
+- |
+ for fin in systemd-units/*.in
+ do
+ f=$(echo "$fin" | sed 's/\.in$//')
+ sed -e 's|@rootprefix@||g' "$fin" >"$f";
+ done
+install-commands:
+- |
+ if [ "$PREFIX" = /usr ]; then PREFIX=; fi &&
+ make CONFIG_PREFIX="$DESTDIR$PREFIX" install &&
+ chmod 6755 "$DESTDIR$PREFIX"/bin/busybox
+- mkdir -p "$DESTDIR/var/spool/cron/crontabs"
+- mkdir -p "$DESTDIR/lib/systemd/system/multi-user.target.wants"
+- |
+ for f in systemd-units/*.service; do
+ install -m 644 "$f" "$DESTDIR/lib/systemd/system";
+ done
+- |
+ for f in $(cd systemd-units; ls *.service | grep -v -F "@"); do
+ ln -s "../$f" "$DESTDIR/lib/systemd/system/multi-user.target.wants/";
+ done
+- mkdir -p "$DESTDIR/lib/udev/rules.d"
+- for f in udev-rules/100-baserock.rules; do install -m 644 "$f" "$DESTDIR/lib/udev/rules.d";
+ done
+- mkdir -p "$DESTDIR$PREFIX"/share/udhcpc
+- cp examples/udhcp/simple.script "$DESTDIR$PREFIX"/share/udhcpc/default.script
+- install scripts/run-ntpd-with-config "$DESTDIR$PREFIX"/sbin/.
+- install -d "$DESTDIR/etc"
+- |
+ cat << EOF > "$DESTDIR/etc/ntpd.conf"
+ server 0.pool.ntp.org
+ server 1.pool.ntp.org
+ server 2.pool.ntp.org
+ server 3.pool.ntp.org
+ EOF
+- |
+ cat << EOF > "$DESTDIR/etc/profile"
+ # Set default pager to less
+ export MANPAGER='less -R'
+ EOF
+- |
+ cat << EOF > "$DESTDIR/etc/man.conf"
+ # This file is used by man to provide a manpath for those without one by
+ # examining their PATH environment variable.
+ #
+ # Lines beginning with `#' are comments and are ignored. Any combination of
+ # tabs or spaces may be used as `whitespace' separators.
+
+ MANDATORY_MANPATH /usr/man
+ MANDATORY_MANPATH /usr/share/man
+ MANDATORY_MANPATH /usr/local/share/man
+ EOF
diff --git a/strata/build-essential/ccache.morph b/strata/build-essential/ccache.morph
new file mode 100644
index 00000000..383eee8a
--- /dev/null
+++ b/strata/build-essential/ccache.morph
@@ -0,0 +1,12 @@
+name: ccache
+kind: chunk
+build-system: autotools
+configure-commands:
+- ./configure --prefix="$PREFIX"
+install-commands:
+- make DESTDIR="$DESTDIR" install
+- mkdir -p "$DESTDIR/$PREFIX/lib/ccache"
+- for cc in gcc cc g++ c++; do ln -sf "$PREFIX/bin/ccache" "$DESTDIR/$PREFIX/lib/ccache/$cc";
+ done
+- for cc in gcc cc g++ c++; do ln -sf "$PREFIX/bin/ccache" "$DESTDIR/$PREFIX/lib/ccache/$TARGET-$cc";
+ done
diff --git a/strata/build-essential/eglibc.morph b/strata/build-essential/eglibc.morph
new file mode 100644
index 00000000..6f781a53
--- /dev/null
+++ b/strata/build-essential/eglibc.morph
@@ -0,0 +1,57 @@
+name: eglibc
+kind: chunk
+products:
+- artifact: eglibc-nss
+ include:
+ - etc/nsswitch.conf
+ - (usr/)?lib/libnss.*
+- artifact: eglibc-gconv
+ include:
+ - (usr/)?lib/gconv/.*
+- artifact: eglibc-libs
+ include:
+ - sbin/ldconfig
+ - lib(32|64)?/ld-.*
+ - (usr/)?lib(exec)?/pt_chown
+- artifact: eglibc-bins
+ include:
+ - (usr/)?s?bin/.*
+ - (usr/)?libexec/getconf/.*
+ - (usr/)?lib/libSegFault\.so(\.\d+)*$
+- artifact: eglibc-libs
+ include:
+ - (usr/)?lib(32|64)?/lib[^/]*\.so(\.\d+)*$
+- artifact: eglibc-devel
+ include:
+ - (usr/)?include/.*
+ - (usr/)?lib(32|64)?/lib.*\.a
+ - (usr/)?lib(32|64)?/lib.*\.la
+ - (usr/)?(lib(32|64)?|share)/pkgconfig/.*\.pc
+ - (usr/)?lib(32|64)?/.*\.o
+- artifact: eglibc-locale
+ include:
+ - (usr/)?share/locale/.*
+ - (usr/)?share/i18n/.*
+ - (usr/)?share/zoneinfo/.*
+- artifact: eglibc-misc
+ include:
+ - .*
+configure-commands:
+- mkdir o
+- cd libc && ln -s ../ports ports
+- |
+ export CFLAGS="-O2 $CFLAGS"; cd o &&
+ ../libc/configure \
+ $(../morph-arch-config) \
+ --prefix="$PREFIX" \
+ --disable-profile \
+ --enable-kernel=2.6.25 \
+ --enable-add-ons=nptl,ports \
+ --without-cvs \
+ --without-selinux
+build-commands:
+- cd o && make localtime=UTC
+install-commands:
+- cd o && make install_root="$DESTDIR" localtime=UTC install
+- mkdir -p "$DESTDIR/etc"
+- install -m 644 -o root -g root nsswitch.conf "$DESTDIR/etc/nsswitch.conf"
diff --git a/strata/build-essential/fhs-dirs.morph b/strata/build-essential/fhs-dirs.morph
new file mode 100644
index 00000000..64474872
--- /dev/null
+++ b/strata/build-essential/fhs-dirs.morph
@@ -0,0 +1,50 @@
+name: fhs-dirs
+kind: chunk
+description: create the FHS 2.3 directory hierarchy and the usual files
+install-commands:
+- sh ./create-fhs-dirs "$DESTDIR"
+- install -m 644 passwd "$DESTDIR/etc/passwd"
+- install -m 600 shadow "$DESTDIR/etc/shadow"
+- install -m 644 interfaces "$DESTDIR/etc/network/interfaces"
+- install -m 644 group "$DESTDIR/etc/group"
+- install -m 644 ld.so.conf "$DESTDIR/etc/ld.so.conf"
+- install -m 644 issue "$DESTDIR/etc/issue"
+- install -m 644 services "$DESTDIR/etc/services"
+- install -m 644 protocols "$DESTDIR/etc/protocols"
+- echo baserock > "$DESTDIR"/etc/hostname
+devices:
+- type: c
+ filename: /dev/console
+ gid: 0
+ major: 5
+ minor: 1
+ permissions: '0600'
+ uid: 0
+- type: c
+ filename: /dev/full
+ gid: 0
+ major: 1
+ minor: 7
+ permissions: '0666'
+ uid: 0
+- type: c
+ filename: /dev/null
+ gid: 0
+ major: 1
+ minor: 3
+ permissions: '0666'
+ uid: 0
+- type: c
+ filename: /dev/urandom
+ gid: 0
+ major: 1
+ minor: 9
+ permissions: '0666'
+ uid: 0
+- type: c
+ filename: /dev/zero
+ gid: 0
+ major: 1
+ minor: 5
+ permissions: '0666'
+ uid: 0
diff --git a/strata/build-essential/gawk.morph b/strata/build-essential/gawk.morph
new file mode 100644
index 00000000..1ad871c6
--- /dev/null
+++ b/strata/build-essential/gawk.morph
@@ -0,0 +1,5 @@
+name: gawk
+kind: chunk
+build-system: autotools
+configure-commands:
+- ./configure --prefix="$PREFIX" --disable-nls
diff --git a/strata/build-essential/gcc.morph b/strata/build-essential/gcc.morph
new file mode 100644
index 00000000..c57edb61
--- /dev/null
+++ b/strata/build-essential/gcc.morph
@@ -0,0 +1,28 @@
+name: gcc
+kind: chunk
+configure-commands:
+- mkdir o
+- |
+ cd o && \
+ ../configure \
+ $(../morph-arch-config) \
+ --prefix="$PREFIX" \
+ `# [1]` --libdir=$PREFIX/lib \
+ --disable-nls \
+ --enable-languages=c,c++,fortran \
+ --enable-shared --enable-threads=posix \
+ `# [2]` --disable-multilib \
+ `# [3]` --disable-libgomp --without-cloog --without-ppl \
+ `# [4]` --enable-__cxa_atexit \
+ `# [5]` --with-mpfr-include="$(pwd)/../mpfr/src" \
+ --with-mpfr-lib="$(pwd)/mpfr/src/.libs" \
+ `# [6]` --with-system-zlib
+build-commands:
+- cd o && make
+install-commands:
+- cd o && make DESTDIR="$DESTDIR" install
+- ln -s gcc "$DESTDIR/$PREFIX/bin/cc"
+- |
+ for fortran_alias in f77 f90 f95; do
+ ln -s gfortran "$DESTDIR/$PREFIX/bin/$fortran_alias"
+ done
diff --git a/strata/build-essential/linux-api-headers.morph b/strata/build-essential/linux-api-headers.morph
new file mode 100644
index 00000000..d28b0905
--- /dev/null
+++ b/strata/build-essential/linux-api-headers.morph
@@ -0,0 +1,7 @@
+name: linux-api-headers
+kind: chunk
+install-commands:
+- make mrproper
+- ARCH=$(./morph-arch) make INSTALL_HDR_PATH=dest headers_install
+- install -d "$DESTDIR${PREFIX-/usr}/include"
+- cp -r dest/include/* "$DESTDIR/${PREFIX-/usr}/include"
diff --git a/strata/build-essential/make.morph b/strata/build-essential/make.morph
new file mode 100644
index 00000000..1259b342
--- /dev/null
+++ b/strata/build-essential/make.morph
@@ -0,0 +1,5 @@
+name: make
+kind: chunk
+build-system: autotools
+configure-commands:
+- ./configure --prefix="$PREFIX" --disable-nls
diff --git a/strata/build-essential/stage1-binutils.morph b/strata/build-essential/stage1-binutils.morph
new file mode 100644
index 00000000..d3e73a87
--- /dev/null
+++ b/strata/build-essential/stage1-binutils.morph
@@ -0,0 +1,10 @@
+name: stage1-binutils
+kind: chunk
+build-system: autotools
+configure-commands:
+- |
+ ./configure --prefix="$PREFIX" --disable-nls --disable-werror \
+ --build=$(sh config.guess) \
+ --host=$(sh config.guess) \
+ --target=$TARGET_STAGE1 \
+ --with-sysroot="/" --with-lib-path="=$PREFIX/lib"
diff --git a/strata/build-essential/stage1-gcc.morph b/strata/build-essential/stage1-gcc.morph
new file mode 100644
index 00000000..0e0c2d81
--- /dev/null
+++ b/strata/build-essential/stage1-gcc.morph
@@ -0,0 +1,30 @@
+name: stage1-gcc
+kind: chunk
+configure-commands:
+- mkdir o
+- |
+ cd o &&
+ ../configure \
+ $(../morph-arch-config) \
+ --build=$(sh ../config.guess) --host=$(sh ../config.guess) \
+ --target=$TARGET_STAGE1 \
+ --prefix="$PREFIX" \
+ --disable-bootstrap --disable-nls \
+ `# [1]` --libdir="$PREFIX/lib" --disable-multilib --disable-libgomp \
+ --without-cloog --without-ppl \
+ --with-mpfr-include="$(pwd)/../mpfr/src" \
+ --with-mpfr-lib="$(pwd)/mpfr/src/.libs" \
+ `# [2]` --with-local-prefix="$PREFIX" \
+ `# [3]` --with-native-system-header-dir="$PREFIX/include" \
+ `# [4]` --enable-languages=c --disable-decimal-float \
+ --disable-libmudflap --disable-libquadmath --disable-libssp \
+ --disable-shared --disable-threads --disable-target-libiberty \
+ --disable-target-zlib --without-headers --with-newlib \
+ --with-system-zlib
+build-commands:
+- cd o && make
+install-commands:
+- cd o && make DESTDIR="$DESTDIR" install
+- |
+ libgcc_filename=$($DESTDIR$PREFIX/bin/$TARGET_STAGE1-gcc -print-libgcc-file-name)
+ ln -sv libgcc.a $(echo $libgcc_filename | sed 's/libgcc/&_eh/')
diff --git a/strata/build-essential/stage2-binutils.morph b/strata/build-essential/stage2-binutils.morph
new file mode 100644
index 00000000..a3701b2c
--- /dev/null
+++ b/strata/build-essential/stage2-binutils.morph
@@ -0,0 +1,19 @@
+name: stage2-binutils
+kind: chunk
+build-system: autotools
+configure-commands:
+- |
+ export STAGE2_SYSROOT="$(dirname $(pwd))"
+ export CPPFLAGS="--sysroot=$STAGE2_SYSROOT"
+ export CXX=false
+ export LDFLAGS="-Wl,--sysroot=$STAGE2_SYSROOT"
+ ./configure --prefix="$PREFIX" --disable-nls --disable-werror \
+ --build=$(sh config.guess) \
+ --host=$TARGET_STAGE1 \
+ --target=$TARGET_STAGE1
+build-commands:
+- |
+ export STAGE2_SYSROOT="$(dirname $(pwd))"
+ export CPPFLAGS="--sysroot=$STAGE2_SYSROOT"
+ export LDFLAGS="-Wl,--sysroot=$STAGE2_SYSROOT"
+ make
diff --git a/strata/build-essential/stage2-busybox.morph b/strata/build-essential/stage2-busybox.morph
new file mode 100644
index 00000000..7d17ea40
--- /dev/null
+++ b/strata/build-essential/stage2-busybox.morph
@@ -0,0 +1,57 @@
+name: stage2-busybox
+kind: chunk
+configure-commands:
+- make HOSTCC="/usr/bin/gcc" CROSS_COMPILE=$TARGET_STAGE1- defconfig
+- '[ "$PREFIX" = /usr ] || sed -e ''s/.*INSTALL_NO_USR.*/CONFIG_INSTALL_NO_USR=y/''
+ -i .config'
+- sed -e 's/CONFIG_AWK=y.*/# CONFIG_AWK is not set/' -i .config
+- sed -e 's/CONFIG_INETD=y.*/# CONFIG_INETD is not set/' -i .config
+- sed -e 's/CONFIG_PATCH=y.*/# CONFIG_PATCH is not set/' -i .config
+- sed -e 's/CONFIG_DEPMOD=y.*/# CONFIG_DEPMOD is not set/' -i .config
+- sed -e 's/CONFIG_INSMOD=y.*/# CONFIG_INSMOD is not set/' -i .config
+- sed -e 's/CONFIG_MODPROBE=y.*/# CONFIG_MODPROBE is not set/' -i .config
+- sed -e 's/CONFIG_MODPROBE_SMALL=y.*/# CONFIG_MODPROBE_SMALL is not set/' -i .config
+- sed -e 's/CONFIG_LSMOD=y.*/# CONFIG_LSMOD is not set/' -i .config
+- sed -e 's/CONFIG_RMMOD=y.*/# CONFIG_RMMOD is not set/' -i .config
+- sed -e 's/CONFIG_FEATURE_MOUNT_CIFS=y.*/# CONFIG_FEATURE_MOUNT_CIFS is not set/'
+ -i .config
+- sed -e 's/CONFIG_FEATURE_EXTRA_QUIET=y.*/# CONFIG_FEATURE_EXTRA_QUIET is not set/'
+ -i .config
+- sed -e 's/CONFIG_FEATURE_INIT_COREDUMPS=y.*/# CONFIG_FEATURE_INIT_COREDUMPS is not
+ set/' -i .config
+- sed -e 's/CONFIG_FEATURE_INIT_SCTTY=y.*/# CONFIG_FEATURE_INIT_SCTTY is not set/'
+ -i .config
+- sed -e 's/CONFIG_FEATURE_INIT_SYSLOG=y.*/# CONFIG_FEATURE_INIT_SYSLOG is not set/'
+ -i .config
+- sed -e 's/CONFIG_FEATURE_INITRD=y.*/# CONFIG_FEATURE_INITRD is not set/' -i .config
+- sed -e 's/CONFIG_FEATURE_USE_INITTAB=y.*/# CONFIG_FEATURE_USE_INITTAB is not set/'
+ -i .config
+- sed -e 's/CONFIG_FEATURE_MINIX2=y.*/# CONFIG_FEATURE_MINIX2 is not set/' -i .config
+- sed -e 's/CONFIG_FSCK_MINIX=y.*/# CONFIG_FSCK_MINIX is not set/' -i .config
+- sed -e 's/CONFIG_HALT=y.*/# CONFIG_HALT is not set/' -i .config
+- sed -e 's/CONFIG_INIT=y.*/# CONFIG_INIT is not set/' -i .config
+- sed -e 's/CONFIG_INIT_TERMINAL_TYPE=y.*/CONFIG_INIT_TERMINAL_TYPE=""/' -i .config
+- sed -e 's/CONFIG_LOSETUP=y.*/# CONFIG_LOSETUP is not set/' -i .config
+- sed -e 's/CONFIG_LSUSB=y.*/# CONFIG_LSUSB is not set/' -i .config
+- sed -e 's/CONFIG_LZMA=y.*/# CONFIG_LZMA is not set/' -i .config
+- sed -e 's/CONFIG_MKFS_EXT2=y.*/# CONFIG_MKFS_EXT2 is not set/' -i .config
+- sed -e 's/CONFIG_MKFS_MINIX=y.*/# CONFIG_MKFS_MINIX is not set/' -i .config
+- sed -e 's/CONFIG_RUNLEVEL=y.*/# CONFIG_RUNLEVEL is not set/' -i .config
+- sed -e 's/CONFIG_STRINGS=y.*/# CONFIG_STRINGS is not set/' -i .config
+- sed -e 's/CONFIG_UNLZMA=y.*/# CONFIG_UNLZMA is not set/' -i .config
+- sed -e 's/CONFIG_UNXZ=y.*/# CONFIG_UNXZ is not set/' -i .config
+- sed -e 's/CONFIG_XZ=y.*/# CONFIG_XZ is not set/' -i .config
+build-commands:
+- |
+ export STAGE2_SYSROOT="$(dirname $(pwd))"
+ export CPPFLAGS="--sysroot=$STAGE2_SYSROOT"
+ export LDFLAGS="-Wl,--sysroot=$STAGE2_SYSROOT"
+ make HOSTCC="/usr/bin/gcc" CROSS_COMPILE=$TARGET_STAGE1-
+install-commands:
+- |
+ export STAGE2_SYSROOT="$(dirname $(pwd))"
+ export CPPFLAGS="--sysroot=$STAGE2_SYSROOT"
+ export LDFLAGS="-Wl,--sysroot=$STAGE2_SYSROOT"
+ make CONFIG_PREFIX="$DESTDIR$PREFIX" \
+ HOSTCC="/usr/bin/gcc" CROSS_COMPILE=$TARGET_STAGE1- install &&
+ chmod 6755 "$DESTDIR$PREFIX"/bin/busybox
diff --git a/strata/build-essential/stage2-eglibc.morph b/strata/build-essential/stage2-eglibc.morph
new file mode 100644
index 00000000..05b0e231
--- /dev/null
+++ b/strata/build-essential/stage2-eglibc.morph
@@ -0,0 +1,38 @@
+name: stage2-eglibc
+kind: chunk
+configure-commands:
+- mkdir o
+- cd libc && ln -s ../ports ports
+- |
+ export CFLAGS="-O2 $CFLAGS"; export CXX=false; \
+ cd o && ../libc/configure \
+ $(../morph-arch-config) \
+ --build=$(../libc/scripts/config.guess) --host=$TARGET_STAGE1 \
+ --prefix="$PREFIX" \
+ `# [1]` --libdir="$PREFIX/lib" \
+ `# [2]` --with-headers="$(pwd)/../../$PREFIX/include" \
+ `# [3]` --disable-profile --enable-kernel=2.6.25 \
+ --enable-add-ons=nptl,ports --without-cvs --without-selinux \
+ `# [4]` libc_cv_c_cleanup=yes libc_cv_ctors_header=yes \
+ libc_cv_forced_unwind=yes libc_cv_ssp=no
+build-commands:
+- cd o && make localtime=UTC
+install-commands:
+- cd o && make install_root="$DESTDIR" localtime=UTC install
+- sh stage2-eglibc-fix-specs
+- install -d $DESTDIR/lib
+- |
+ cpu=$(echo $TARGET | cut -d '-' -f 1)
+ case "$cpu" in
+ x86_64)
+ install -d "$DESTDIR/lib64"
+ ln -s "$PREFIX/lib/ld-linux-x86-64.so.2" \
+ "$DESTDIR/lib64/ld-linux-x86-64.so.2" ;;
+ ppc64)
+ install -d "$DESTDIR/lib64"
+ ln -s "$PREFIX/lib/ld64.so.1" \
+ "$DESTDIR/lib64/ld64.so.1" ;;
+ *)
+ loader=$(basename $(ls "$DESTDIR$PREFIX"/lib/ld-linux*))
+ ln -s "$PREFIX/lib/$loader" "$DESTDIR/lib/$loader"
+ esac
diff --git a/strata/build-essential/stage2-fhs-dirs.morph b/strata/build-essential/stage2-fhs-dirs.morph
new file mode 100644
index 00000000..14a6e253
--- /dev/null
+++ b/strata/build-essential/stage2-fhs-dirs.morph
@@ -0,0 +1,52 @@
+name: stage2-fhs-dirs
+kind: chunk
+description: create the FHS 2.3 directory hierarchy and the usual files
+install-commands:
+- sh ./create-fhs-dirs "$DESTDIR"
+- rmdir "$DESTDIR/bin"
+- ln -s "$PREFIX/bin" "$DESTDIR/bin"
+- install -m 644 passwd "$DESTDIR/etc/passwd"
+- install -m 600 shadow "$DESTDIR/etc/shadow"
+- install -m 644 interfaces "$DESTDIR/etc/network/interfaces"
+- install -m 644 group "$DESTDIR/etc/group"
+- install -m 644 ld.so.conf "$DESTDIR/etc/ld.so.conf"
+- install -m 644 issue "$DESTDIR/etc/issue"
+- install -m 644 services "$DESTDIR/etc/services"
+- install -m 644 protocols "$DESTDIR/etc/protocols"
+- echo baserock > "$DESTDIR"/etc/hostname
+devices:
+- type: c
+ filename: /dev/console
+ gid: 0
+ major: 5
+ minor: 1
+ permissions: '0600'
+ uid: 0
+- type: c
+ filename: /dev/full
+ gid: 0
+ major: 1
+ minor: 7
+ permissions: '0666'
+ uid: 0
+- type: c
+ filename: /dev/null
+ gid: 0
+ major: 1
+ minor: 3
+ permissions: '0666'
+ uid: 0
+- type: c
+ filename: /dev/urandom
+ gid: 0
+ major: 1
+ minor: 9
+ permissions: '0666'
+ uid: 0
+- type: c
+ filename: /dev/zero
+ gid: 0
+ major: 1
+ minor: 5
+ permissions: '0666'
+ uid: 0
diff --git a/strata/build-essential/stage2-gawk.morph b/strata/build-essential/stage2-gawk.morph
new file mode 100644
index 00000000..f644d72b
--- /dev/null
+++ b/strata/build-essential/stage2-gawk.morph
@@ -0,0 +1,9 @@
+name: stage2-gawk
+kind: chunk
+build-system: autotools
+configure-commands:
+- STAGE2_SYSROOT="$(dirname $(pwd))" CPPFLAGS="--sysroot=$STAGE2_SYSROOT" CXX=false
+ LDFLAGS="-Wl,--sysroot=$STAGE2_SYSROOT" ./configure --prefix="$PREFIX" --disable-nls
+ --build=$(sh config.guess) --host=$TARGET_STAGE1
+build-commands:
+- STAGE2_SYSROOT="$(dirname $(pwd))" make
diff --git a/strata/build-essential/stage2-gcc-fixed-headers.morph b/strata/build-essential/stage2-gcc-fixed-headers.morph
new file mode 100644
index 00000000..2c4741ee
--- /dev/null
+++ b/strata/build-essential/stage2-gcc-fixed-headers.morph
@@ -0,0 +1,10 @@
+name: stage2-gcc-fixed-headers
+kind: chunk
+install-commands:
+- |
+ libgcc_dir=$(dirname $($TARGET_STAGE1-gcc -print-libgcc-file-name))
+ sysroot="$(dirname "$(pwd)")"
+ target_libgcc_dir="${libgcc_dir#$sysroot}"
+ mkdir -p "$DESTDIR/$target_libgcc_dir/include-fixed"
+ cat "gcc/limitx.h" "gcc/glimits.h" "gcc/limity.h" \
+ >"$DESTDIR/$target_libgcc_dir/include-fixed/limits.h"
diff --git a/strata/build-essential/stage2-gcc.morph b/strata/build-essential/stage2-gcc.morph
new file mode 100644
index 00000000..e342d648
--- /dev/null
+++ b/strata/build-essential/stage2-gcc.morph
@@ -0,0 +1,40 @@
+name: stage2-gcc
+kind: chunk
+configure-commands:
+- mkdir o
+- |
+ export STAGE2_SYSROOT="$(dirname $(pwd))"
+ export CC="$TARGET_STAGE1-gcc --sysroot=$STAGE2_SYSROOT"
+ export LDFLAGS="-Wl,--sysroot=$STAGE2_SYSROOT"
+ cd o && ../configure \
+ $(../morph-arch-config) \
+ `# [1]` --build=$(sh ../config.guess) \
+ --host=$TARGET_STAGE1 \
+ --target=$TARGET_STAGE1 \
+ --prefix="$PREFIX" \
+ `# [2]` --with-local-prefix=$PREFIX \
+ `# [3]` --with-build-sysroot="$STAGE2_SYSROOT" \
+ --disable-bootstrap \
+ --enable-clocale=gnu --enable-shared --enable-threads=posix \
+ `# [4]` --enable-languages=c \
+ `# [5]` --libdir=$PREFIX/lib \
+ --disable-libgomp --disable-multilib --disable-nls \
+ --without-cloog --without-ppl \
+ --with-mpfr-include="$(pwd)/../mpfr/src" \
+ --with-mpfr-lib="$(pwd)/mpfr/src/.libs"
+build-commands:
+- |
+ export STAGE2_SYSROOT="$(dirname $(pwd))"
+ cd o && make
+install-commands:
+- cd o && make DESTDIR="$DESTDIR" install
+- |
+ if [ "$(echo $TARGET | cut -c -6)" = "x86_64" ]; then
+ libdir=lib64
+ else
+ libdir=lib
+ fi
+
+ install -d "$DESTDIR/lib"
+ ln -s "$PREFIX/$libdir/libgcc_s.so" "$DESTDIR/lib/"
+ ln -s "$PREFIX/$libdir/libgcc_s.so.1" "$DESTDIR/lib/"
diff --git a/strata/build-essential/stage2-linux-api-headers.morph b/strata/build-essential/stage2-linux-api-headers.morph
new file mode 100644
index 00000000..e7d1f8ed
--- /dev/null
+++ b/strata/build-essential/stage2-linux-api-headers.morph
@@ -0,0 +1,9 @@
+name: stage2-linux-api-headers
+kind: chunk
+install-commands:
+- make mrproper
+- |
+ export ARCH=$(./morph-arch)
+ make INSTALL_HDR_PATH=dest headers_install
+- install -d "$DESTDIR${PREFIX-/usr}/include"
+- cp -r dest/include/* "$DESTDIR/${PREFIX-/usr}/include"
diff --git a/strata/build-essential/stage2-make.morph b/strata/build-essential/stage2-make.morph
new file mode 100644
index 00000000..d3c8bf22
--- /dev/null
+++ b/strata/build-essential/stage2-make.morph
@@ -0,0 +1,9 @@
+name: stage2-make
+kind: chunk
+build-system: autotools
+configure-commands:
+- STAGE2_SYSROOT="$(dirname $(pwd))" CPPFLAGS="--sysroot=$STAGE2_SYSROOT" CXX=false
+ LDFLAGS="-Wl,--sysroot=$STAGE2_SYSROOT" ./configure --prefix="$PREFIX" --disable-nls
+ --build=$(sh config/config.guess) --host=$TARGET_STAGE1
+build-commands:
+- STAGE2_SYSROOT="$(dirname $(pwd))" make
diff --git a/strata/build-essential/stage2-reset-specs.morph b/strata/build-essential/stage2-reset-specs.morph
new file mode 100644
index 00000000..6495909c
--- /dev/null
+++ b/strata/build-essential/stage2-reset-specs.morph
@@ -0,0 +1,9 @@
+name: stage2-reset-specs
+kind: chunk
+install-commands:
+- |
+ STAGE2_SYSROOT="$(dirname "$(pwd)")"
+ specs_dir="$(dirname $($TARGET_STAGE1-gcc -print-libgcc-file-name))"
+ target_specs_dir="$DESTDIR/${specs_dir#$STAGE2_SYSROOT}"
+ mkdir -p "$target_specs_dir"
+ ln -s "temporary specs removed by baserock bootstrap" "$target_specs_dir/specs"
diff --git a/strata/build-essential/zlib.morph b/strata/build-essential/zlib.morph
new file mode 100644
index 00000000..a69eebf3
--- /dev/null
+++ b/strata/build-essential/zlib.morph
@@ -0,0 +1,9 @@
+name: zlib
+kind: chunk
+max-jobs: 1
+configure-commands:
+- ./configure --prefix="$PREFIX"
+build-commands:
+- make
+install-commands:
+- make DESTDIR="$DESTDIR" install