mirror of
git://git.2f30.org/morpheus.git
synced 2024-06-16 12:58:34 +00:00
add setup-alpine script
Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
This commit is contained in:
parent
a52a87fb72
commit
0b6fc88b20
42
misc/setup-alpine
Executable file
42
misc/setup-alpine
Executable file
@ -0,0 +1,42 @@
|
||||
#!/bin/sh
|
||||
# Things you might want to do after setup:
|
||||
# - apk update
|
||||
# - apk add alpine-sdk
|
||||
# - use misc/run-chroot to chroot to it.
|
||||
# - remove gcc, binutils, pkg-config etc packages.
|
||||
# - remove libraries such as libpng (png-config), these can mess up
|
||||
# the builds.
|
||||
# - remove /usr/include or move to /usr/include.old, note that
|
||||
# python for example uses files from /usr/include/python2.7 at runtime (oh oh).
|
||||
# - add a separate morpheus user to build stuff.
|
||||
# - copy static plan9 mk to /bin.
|
||||
# - copy static git to /bin
|
||||
|
||||
set -e -x
|
||||
|
||||
mirror="http://nl.alpinelinux.org/alpine/"
|
||||
installdir="/ns/alpine"
|
||||
tmpdir="${installdir}/tmp"
|
||||
|
||||
# fetch apk package tools.
|
||||
mkdir -p "${tmpdir}/sbin"
|
||||
cd "$tmpdir"
|
||||
apktools="apk-tools-static-2.4.4-r0.apk"
|
||||
if ! test -f "$apktools"; then
|
||||
wget "${mirror}/v3.0/main/x86_64/${apktools}"
|
||||
fi
|
||||
if ! test -d "sbin"; then
|
||||
tar -xzf "$apktools"
|
||||
fi
|
||||
|
||||
# install in chroot.
|
||||
"${installdir}/tmp/sbin/apk.static" -X "${mirror}/v3.0/main" -U --allow-untrusted --root "${installdir}" --initdb add alpine-base
|
||||
|
||||
# copy etc/resolv.conf
|
||||
mkdir -p "${installdir}/etc"
|
||||
cp /etc/resolv.conf "${installdir}/etc/resolv.conf"
|
||||
chmod 755 "${installdir}/etc/resolv.conf"
|
||||
|
||||
# write used mirror as apk repository.
|
||||
mkdir -p "${installdir}/etc/apk"
|
||||
echo "${mirror}/v3.0/main" > ${installdir}/etc/apk/repositories
|
Loading…
Reference in New Issue
Block a user