morpheus

suckless linux distro
git clone git://git.2f30.org/morpheus
Log | Files | Refs | Submodules | README | LICENSE

install-alpine (1289B)


      1 #!/bin/sh
      2 # Things you might want to do after setup:
      3 # - apk update
      4 # - apk add alpine-sdk
      5 # - use misc/run-chroot to chroot to it.
      6 # - remove gcc, binutils, pkg-config etc packages.
      7 # - remove libraries such as libpng (png-config), these can mess up
      8 #   the builds.
      9 # - remove /usr/include or move to /usr/include.old, note that
     10 #   python for example uses files from /usr/include/python2.7 at runtime (oh oh).
     11 # - add a separate morpheus user to build stuff.
     12 # - copy static plan9 mk to /bin.
     13 # - copy static git to /bin
     14 
     15 set -e -x
     16 
     17 mirror="http://nl.alpinelinux.org/alpine/"
     18 root="/ns/alpine"
     19 test x"$1" != x"" && root="$1"
     20 tmpdir="${root}/tmp"
     21 
     22 # fetch apk package tools.
     23 mkdir -p "${tmpdir}/sbin"
     24 cd "$tmpdir"
     25 apktools="apk-tools-static-2.4.4-r0.apk"
     26 if ! test -f "$apktools"; then
     27 	wget "${mirror}/v3.0/main/x86_64/${apktools}"
     28 fi
     29 if ! test -f "sbin/apk.static"; then
     30 	tar -xzf "$apktools"
     31 fi
     32 
     33 # install in chroot.
     34 "$tmpdir/sbin/apk.static" -X "${mirror}/v3.0/main" -U --allow-untrusted --root "${root}" --initdb add alpine-base
     35 
     36 # copy etc/resolv.conf
     37 mkdir -p "${root}/etc"
     38 cp /etc/resolv.conf "${root}/etc/resolv.conf"
     39 chmod 644 "${root}/etc/resolv.conf"
     40 
     41 # write used mirror as apk repository.
     42 mkdir -p "${root}/etc/apk"
     43 echo "${mirror}/v3.0/main" > ${root}/etc/apk/repositories