morpheus

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

install-crux (1499B)


      1 #!/bin/sh
      2 # Things you might want to do after setup:
      3 # - use misc/run-chroot to chroot to it.
      4 #
      5 # Properly install packages and install prt-get:
      6 # - cd /pkg/core; for i in *; do pkgadd -f $i; done
      7 # - ports -u
      8 # - prt-get sysup
      9 #
     10 # Setup morpheus building environment:
     11 # - remove gcc, binutils, pkg-config etc packages.
     12 # - remove libraries such as libpng (png-config), these can mess up
     13 #   the builds.
     14 # - remove /usr/include or move to /usr/include.old, note that
     15 #   python for example uses files from /usr/include/python2.7 at runtime (oh oh).
     16 # - add a separate morpheus user to build stuff.
     17 # - copy static plan9 mk to /bin.
     18 # - prt-get install git.
     19 #
     20 # Links to iso:
     21 #   wget http://www.mirrorservice.org/sites/crux.nu/crux/latest/iso/crux-3.0.iso
     22 #   wget http://serverop.de/crux/crux-3.1/iso/crux-3.1.iso
     23 
     24 set -e -x
     25 
     26 iso="crux-3.1.iso"
     27 mnt="/mnt/crux"
     28 root="/ns/crux-3.1"
     29 test x"$1" != x"" && root="$1"
     30 
     31 # mount
     32 dev=$(losetup -f)
     33 losetup "${dev}" "${iso}"
     34 mkdir -p "${mnt}"
     35 mount -t iso9660 -o ro "${dev}" "${mnt}"
     36 
     37 # install
     38 mkdir -p "${root}"
     39 cd "${root}"
     40 tar -xJf "${mnt}/rootfs.tar.xz"
     41 
     42 # copy packages (core only).
     43 mkdir -p "${root}/pkg/"
     44 cp -a "${mnt}/crux/core" "${root}/pkg/"
     45 
     46 # make package dir needed by crux.
     47 mkdir -p "${root}/var/lib/pkg"
     48 touch "${root}/var/lib/pkg/db"
     49 
     50 # copy etc/resolv.conf
     51 mkdir -p "${root}/etc"
     52 cp /etc/resolv.conf "${root}/etc/resolv.conf"
     53 chmod 644 "${root}/etc/resolv.conf"
     54 
     55 # unmount
     56 cd /
     57 umount "${mnt}"
     58 losetup -d "${dev}" || true
     59 
     60 # rmdir "${mnt}"