Initial commit
commit
86330dc292
|
@ -0,0 +1,7 @@
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*.sh]
|
||||||
|
end_of_line = lf
|
||||||
|
insert_final_newline = true
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 4
|
|
@ -0,0 +1,2 @@
|
||||||
|
stage3-*.tar.*
|
||||||
|
latest-*.txt
|
|
@ -0,0 +1,38 @@
|
||||||
|
# Aimee OS Build Container Images
|
||||||
|
|
||||||
|
Prerequisites:
|
||||||
|
|
||||||
|
* `buildah`
|
||||||
|
|
||||||
|
|
||||||
|
## Gentoo Stage 3 Image
|
||||||
|
|
||||||
|
This image forms the base layer for Aimee OS build images.
|
||||||
|
|
||||||
|
Use the default stage3 tarball (`stage3-amd64-nomultilib-openrc`):
|
||||||
|
|
||||||
|
```sh
|
||||||
|
sh stage3-image.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
Use a specific stage3 tarball:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
sh stage3-image.sh amd64-systemd
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## Crossdev Image
|
||||||
|
|
||||||
|
This image includes a cross-compilation toolchain, generated by _crossdev_.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
sh crossdev-image.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
Use the `--base` and `--target` command-line arguments to specify a base Stage
|
||||||
|
3 image (see above) and crossdev target, respectively, e.g.:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
sh crossdev-image.sh --target armv7a-unknown-linux-gnueabihf
|
||||||
|
```
|
|
@ -0,0 +1,63 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
target=aarch64-unknown-linux-gnu
|
||||||
|
|
||||||
|
MIRROR=http://mirror.leaseweb.com/gentoo
|
||||||
|
URLPATH=releases/amd64/autobuilds
|
||||||
|
GENTOO_KEY=13EBBDBEDE7A12775DFDB1BABB572E0E2D182910
|
||||||
|
GENTOO_KEYSERVER=hkps://keys.gentoo.org
|
||||||
|
|
||||||
|
target=aarch64-unknown-linux-gnu
|
||||||
|
stage3=amd64-nomultilib-openrc
|
||||||
|
while [ $# -gt 0 ]; do
|
||||||
|
case "$1" in
|
||||||
|
-t|--target)
|
||||||
|
shift
|
||||||
|
target="$1"
|
||||||
|
;;
|
||||||
|
-b|--base)
|
||||||
|
shift
|
||||||
|
stage3="$1"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
printf 'Unknown argument: %s\n' "$1" >&2
|
||||||
|
exit 2
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
gpg --keyserver ${GENTOO_KEYSERVER} --recv-keys ${GENTOO_KEY}
|
||||||
|
curl -fLO "${MIRROR}/${URLPATH}/latest-stage3-${stage3}.txt"
|
||||||
|
gpg --verify "latest-stage3-${stage3}.txt"
|
||||||
|
|
||||||
|
tarball=$(gpg --decrypt "latest-stage3-${stage3}.txt" | awk '$1!="#"{print $1}')
|
||||||
|
if [ ! -f "${tarball##*/}" ]; then
|
||||||
|
curl -fLO "${MIRROR}/${URLPATH}/${tarball}"
|
||||||
|
fi
|
||||||
|
if [ ! -f "${tarball##*/}.asc" ]; then
|
||||||
|
curl -fLO "${MIRROR}/${URLPATH}/${tarball}.asc"
|
||||||
|
fi
|
||||||
|
gpg --verify "${tarball##*/}.asc"
|
||||||
|
|
||||||
|
cid=$(buildah from scratch)
|
||||||
|
buildah add ${cid} "${tarball##*/}"
|
||||||
|
buildah run \
|
||||||
|
--mount type=cache,target=/var/db/repos/gentoo \
|
||||||
|
--mount type=cache,target=/var/cache\
|
||||||
|
-- ${cid} \
|
||||||
|
sh -s - "${target}" \
|
||||||
|
< build.sh \
|
||||||
|
|| {
|
||||||
|
rc=$?
|
||||||
|
buildah rm ${cid}
|
||||||
|
exit $rc
|
||||||
|
}
|
||||||
|
|
||||||
|
buildah config \
|
||||||
|
--add-history \
|
||||||
|
--cmd /bin/bash \
|
||||||
|
--label target=${target} \
|
||||||
|
${cid}
|
||||||
|
buildah commit --rm --squash ${cid} aimee-os.org/build/cross-${target}
|
|
@ -0,0 +1,15 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
buildah_run_script() {
|
||||||
|
local cid script
|
||||||
|
cid=$1
|
||||||
|
shift
|
||||||
|
script=$1
|
||||||
|
shift
|
||||||
|
buildah run \
|
||||||
|
--mount type=cache,target=/var/db/repos/gentoo \
|
||||||
|
--mount type=cache,target=/var/cache \
|
||||||
|
-- "${cid}" \
|
||||||
|
sh -s - "$@" \
|
||||||
|
< "${script}"
|
||||||
|
}
|
|
@ -0,0 +1,36 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
SELF=$(readlink -f "$0")
|
||||||
|
SRCDIR=${SELF%/*}
|
||||||
|
. "${SRCDIR}"/common.sh
|
||||||
|
|
||||||
|
target=aarch64-unknown-linux-gnu
|
||||||
|
stage3=amd64-nomultilib-openrc
|
||||||
|
while [ $# -gt 0 ]; do
|
||||||
|
case "$1" in
|
||||||
|
-t|--target)
|
||||||
|
shift
|
||||||
|
target="$1"
|
||||||
|
;;
|
||||||
|
-b|--base)
|
||||||
|
shift
|
||||||
|
stage3="$1"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
printf 'Unknown argument: %s\n' "$1" >&2
|
||||||
|
exit 2
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
cid=$(buildah from "aimee-os.org/gentoo/stage3-${stage3}")
|
||||||
|
buildah_run_script ${cid} sync.sh
|
||||||
|
buildah_run_script ${cid} crossdev.sh "${target}"
|
||||||
|
buildah config \
|
||||||
|
--add-history \
|
||||||
|
--cmd /bin/bash \
|
||||||
|
--label target=${target} \
|
||||||
|
${cid}
|
||||||
|
buildah commit --rm ${cid} aimee-os.org/build/cross-${target}
|
|
@ -0,0 +1,20 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
export FEATURES='-ipc-sandbox -network-sandbox -pid-sandbox'
|
||||||
|
|
||||||
|
mkdir -p /var/db/repos/crossdev/profiles /var/db/repos/crossdev/metadata
|
||||||
|
echo crossdev > /var/db/repos/crossdev/profiles/repo_name
|
||||||
|
echo 'masters = gentoo' > /var/db/repos/crossdev/metadata/layout.conf
|
||||||
|
chown -R portage:portage /var/db/repos/crossdev
|
||||||
|
mkdir -p /etc/portage/repos.conf
|
||||||
|
cat > /etc/portage/repos.conf/crossdev.conf <<EOF
|
||||||
|
[crossdev]
|
||||||
|
location = /var/db/repos/crossdev
|
||||||
|
priority = 10
|
||||||
|
masters = gentoo
|
||||||
|
auto-sync = no
|
||||||
|
EOF
|
||||||
|
|
||||||
|
emerge -j sys-devel/crossdev
|
||||||
|
|
||||||
|
crossdev --stable -t "$1"
|
|
@ -0,0 +1,37 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
SELF=$(readlink -f "$0")
|
||||||
|
SRCDIR=${SELF%/*}
|
||||||
|
. "${SRCDIR}"/common.sh
|
||||||
|
|
||||||
|
: "${GENTOO_MIRROR:=http://mirror.leaseweb.com/gentoo}"
|
||||||
|
URLPATH=releases/amd64/autobuilds
|
||||||
|
GENTOO_KEY=13EBBDBEDE7A12775DFDB1BABB572E0E2D182910
|
||||||
|
GENTOO_KEYSERVER=hkps://keys.gentoo.org
|
||||||
|
|
||||||
|
stage3="${1:-amd64-nomultilib-openrc}"
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
gpg --keyserver ${GENTOO_KEYSERVER} --recv-keys ${GENTOO_KEY}
|
||||||
|
curl -fLO "${MIRROR}/${URLPATH}/latest-stage3-${stage3}.txt"
|
||||||
|
gpg --verify "latest-stage3-${stage3}.txt"
|
||||||
|
|
||||||
|
tarball=$(gpg --decrypt "latest-stage3-${stage3}.txt" | awk '$1!="#"{print $1}')
|
||||||
|
if [ ! -f "${tarball##*/}" ]; then
|
||||||
|
curl -fLO "${GENTOO_MIRROR}/${URLPATH}/${tarball}"
|
||||||
|
fi
|
||||||
|
if [ ! -f "${tarball##*/}.asc" ]; then
|
||||||
|
curl -fLO "${GENTOO_MIRROR}/${URLPATH}/${tarball}.asc"
|
||||||
|
fi
|
||||||
|
gpg --verify "${tarball##*/}.asc"
|
||||||
|
|
||||||
|
cid=$(buildah from scratch)
|
||||||
|
buildah add ${cid} "${tarball##*/}"
|
||||||
|
buildah_run_script ${cid} sync.sh
|
||||||
|
buildah_run_script ${cid} update.sh
|
||||||
|
buildah config \
|
||||||
|
--add-history \
|
||||||
|
--cmd /bin/bash \
|
||||||
|
${cid}
|
||||||
|
buildah commit --rm --squash ${cid} "aimee-os.org/gentoo/stage3-${stage3}"
|
|
@ -0,0 +1,10 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
export FEATURES='-ipc-sandbox -network-sandbox -pid-sandbox'
|
||||||
|
|
||||||
|
if [ ! -e /var/db/repos/gentoo/metadata ]; then
|
||||||
|
emaint sync
|
||||||
|
fi
|
||||||
|
if [ "$(find /var/db/repos/gentoo -newermt '-24 hours' | wc -l)" -eq 0 ]; then
|
||||||
|
emerge-webrsync
|
||||||
|
fi
|
Reference in New Issue