morpheus

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

commit 517f69e8849eda264a5b4d867d68bbd300136ace
parent ad2f5337ae4483e542808c5f0658998e7236d269
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Sun Jul  6 12:57:03 +0000

misc: update install scripts

Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>

Diffstat:
misc/install-alpine | 42++++++++++++++++++++++++++++++++++++++++++
misc/install-crux | 50++++++++++++++++++++++++++++++++++++++++++++++++++
misc/install-morpheus | 32++++++++++++++++++++++----------
misc/setup-alpine | 42------------------------------------------
misc/setup-crux | 50--------------------------------------------------
5 files changed, 114 insertions(+), 102 deletions(-)
diff --git a/misc/install-alpine b/misc/install-alpine @@ -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 644 "${installdir}/etc/resolv.conf" + +# write used mirror as apk repository. +mkdir -p "${installdir}/etc/apk" +echo "${mirror}/v3.0/main" > ${installdir}/etc/apk/repositories diff --git a/misc/install-crux b/misc/install-crux @@ -0,0 +1,50 @@ +#!/bin/sh +# Things you might want to do after setup: +# - 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 + +# wget http://www.mirrorservice.org/sites/crux.nu/crux/latest/iso/crux-3.0.iso + +set -e -x + +iso="crux-3.0.iso" +mnt="/mnt/crux" +installdir="/ns/crux" + +# mount +dev=$(losetup -f) +losetup "${dev}" "${iso}" +mkdir -p "${mnt}" +mount -t iso9660 -o ro "${dev}" "${mnt}" + +# install +mkdir -p "${installdir}" +cd "${installdir}" +tar -xJf "${mnt}/rootfs.tar.xz" + +# copy packages (core only). +#mkdir -p "${installdir}/pkg/" +#cp -a "${mnt}/crux/core" "${installdir}/pkg/" + +# make package dir needed by crux. +mkdir -p "${installdir}/var/lib/pkg" +touch "${installdir}/var/lib/pkg/db" + +# copy etc/resolv.conf +mkdir -p "${installdir}/etc" +cp /etc/resolv.conf "${installdir}/etc/resolv.conf" +chmod 644 "${installdir}/etc/resolv.conf" + +# unmount +cd / +umount "${mnt}" +losetup -d "${dev}" || true + +# rmdir "${mnt}" diff --git a/misc/install-morpheus b/misc/install-morpheus @@ -1,7 +1,10 @@ #!/bin/sh -root="root" -pkgdir="pkgs" +set -e -x + +root="/ns/morpheus" +tmpdir="$root/tmp/morpheus_install" +pkgdir="$tmpdir/pkgs" # list of important packages pkgs="curl#7.36.0.pkg.tgz @@ -26,19 +29,24 @@ tmux#1.9a.pkg.tgz ubase.pkg.tgz vim#7.4.pkg.tgz" -# grab and build pkgtools -git clone git://git.2f30.org/pkgtools -cd pkgtools -make || ( echo "missing libarchive?" 1>&2 && exit 1 ) -cd - 1>/dev/null -PATH=$(pwd)/pkgtools:$PATH -export PATH - # prepare root mkdir -p "$root/var/pkg" mkdir -p "$pkgdir" +mkdir -p "$tmpdir" + +# fetch pkgtools in tmpdir +cd "$tmpdir" +pkgtools="pkgtools.pkg.tgz" +if ! test -f "$pkgtools"; then + wget "http://morpheus.2f30.org/0.0/packages/x86_64/${pkgtools}" +fi +if ! test -d "$tmpdir/bin"; then + tar -xzf "$pkgtools" +fi +export PATH="$tmpdir/bin:$PATH" # fetch packages +mkdir -p "$pkgdir" cd "$pkgdir" for i in $pkgs; do searchpkg "$i" | fetchpkg @@ -49,3 +57,7 @@ cd - 1>/dev/null for i in $pkgs; do installpkg -r "$root" "$pkgdir/$i" done + +# copy etc/resolv.conf +cp /etc/resolv.conf "$root/etc/resolv.conf" +chmod 644 "$root/etc/resolv.conf" diff --git a/misc/setup-alpine b/misc/setup-alpine @@ -1,42 +0,0 @@ -#!/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 644 "${installdir}/etc/resolv.conf" - -# write used mirror as apk repository. -mkdir -p "${installdir}/etc/apk" -echo "${mirror}/v3.0/main" > ${installdir}/etc/apk/repositories diff --git a/misc/setup-crux b/misc/setup-crux @@ -1,50 +0,0 @@ -#!/bin/sh -# Things you might want to do after setup: -# - 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 - -# wget http://www.mirrorservice.org/sites/crux.nu/crux/latest/iso/crux-3.0.iso - -set -e -x - -iso="crux-3.0.iso" -mnt="/mnt/crux" -installdir="/ns/crux" - -# mount -dev=$(losetup -f) -losetup "${dev}" "${iso}" -mkdir -p "${mnt}" -mount -t iso9660 -o ro "${dev}" "${mnt}" - -# install -mkdir -p "${installdir}" -cd "${installdir}" -tar -xJf "${mnt}/rootfs.tar.xz" - -# copy packages (core only). -#mkdir -p "${installdir}/pkg/" -#cp -a "${mnt}/crux/core" "${installdir}/pkg/" - -# make package dir needed by crux. -mkdir -p "${installdir}/var/lib/pkg" -touch "${installdir}/var/lib/pkg/db" - -# copy etc/resolv.conf -mkdir -p "${installdir}/etc" -cp /etc/resolv.conf "${installdir}/etc/resolv.conf" -chmod 644 "${installdir}/etc/resolv.conf" - -# unmount -cd / -umount "${mnt}" -losetup -d "${dev}" || true - -# rmdir "${mnt}"