morpheus

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

README (3620B)


      1 morpheus - a statically linked musl based Linux distro
      2 ======================================================
      3 
      4 Building
      5 --------
      6 
      7 *** HIGHLY EXPERIMENTAL SOFTWARE - READ THE CODE FIRST! ***
      8 
      9 To build  morpheus you  currently need an  x86_64/x86 host.   You will
     10 need to have mk(1) from 9base or plan9port.
     11 
     12 Please review config.mk prior to building and adjust any parameters.
     13 
     14 Setting up the environment:
     15 
     16   export mkbuild=$(pwd)/mkbuild
     17   export configmk=$(pwd)/config.mk
     18   export PATH=/path/to/musl/toolchain/bin:$PATH
     19 
     20 Clone the git submodules, either via git commands or:
     21 
     22   mk init
     23 
     24 To build everything (though this isn't recommended):
     25 
     26   mk
     27 
     28 To build specific ports:
     29 
     30   mk TARG="port1 port2 ..."
     31 
     32   or:
     33 
     34   cd ports/port1; mk
     35 
     36 To force build ports:
     37 
     38   mk -a
     39 
     40 To clean the build system's cache:
     41 
     42   mk clean
     43 
     44 To clean source dirs completely:
     45 
     46   mk distclean
     47 
     48 To fetch all ports without building anything:
     49 
     50   mk fetch
     51 
     52 To generate a package tarball:
     53 
     54   mk TARG="port1 port2 ..." package
     55 
     56 You can then install the package using installpkg(1) from
     57 http://git.2f30.org/pkgtools.
     58 
     59 To install a port to the rootfs:
     60 
     61   mk TARG="port1 port2 ..." ROOT=$(pwd)/root install
     62 
     63 Note that this however will *not* create the /var/log/packages
     64 entries.
     65 
     66 For a bootable system you need at least the following packages:
     67 
     68   busybox#1.22.1.pkg.tgz
     69   curl#7.36.0.pkg.tgz
     70   e2fsprogs#1.42.9.pkg.tgz
     71   extlinux#6.02.pkg.tgz
     72   file#5.17.pkg.tgz
     73   fs.pkg.tgz
     74   hbase.pkg.tgz
     75   ii.pkg.tgz
     76   libarchive#3.1.2.pkg.tgz
     77   linux#3.10.32.pkg.tgz
     78   mksh#R47.pkg.tgz
     79   pkgtools.pkg.tgz
     80   sbase.pkg.tgz
     81   sdhcp.pkg.tgz
     82   sinit.pkg.tgz
     83   smdev.pkg.tgz
     84   tmux#1.9a.pkg.tgz
     85   ubase.pkg.tgz
     86   vim#7.4.pkg.tgz
     87 
     88 There are precompiled versions at http://morpheus.2f30.org/0.0 for the
     89 x86_64   architecture.   Use   the  misc/install-morpheus   script  to
     90 bootstrap your system.
     91 
     92 We  suggest using  a  stripped-down CRUX  rootfs  for building  ports.
     93 
     94 http://morpheus.2f30.org/0.0/packages/x86_64/emul.pkg.tgz.
     95 
     96 Rebuilding the kernel
     97 ---------------------
     98 
     99 There is a default config for  the kernel in ports/linux.  The default
    100 config is  copied over  .config in the  kernel source  directory every
    101 time you do a build via mk(1).   You can adjust your local .config and
    102 copy  it over  the  relevant config  in ports/linux  or  you can  just
    103 manually  compile  the  kernel  and copy  System.map  and  bzImage  to
    104 $ROOT/boot.
    105 
    106 Installing
    107 ----------
    108 
    109 There is currently no installer.  There is a script that creates a 2GB
    110 image file that is suitable to dd to a usb stick.
    111 
    112 To create a bootable image:
    113 
    114   sudo modprobe -r loop
    115   sudo modprobe loop max_part=15 # to be done only once
    116   sudo mk ROOT=$(pwd)/root bootable # set ROOT to point to your rootfs
    117 
    118 Make sure to change  the kernel command line to point  it to your root
    119 device.  You can do this at the boot prompt:
    120 
    121   bzImage root=/dev/sd[X]1 rootwait ro
    122 
    123 Otherwise modify ports/extlinux/extlinux.conf and rebuild the extlinux
    124 port or directly modify $ROOT/boot/extlinux.conf.
    125 
    126 You will also want to modify the fstab file.
    127 
    128 Testing
    129 -------
    130 
    131 To experiment with the x86_64 image in qemu:
    132 
    133   qemu-system-x86_64 -hda morpheus-x86_64-0.0.img -enable-kvm -vga cirrus
    134 
    135 Login with root and an empty password.
    136 
    137 Debugging
    138 ---------
    139 
    140 In some  cases you may  want to set nprocs to 1  in order to  get sane
    141 build output. You can then use something like the following:
    142 
    143   mk 2>&1 | tee -a output.log
    144 
    145 Props
    146 -----
    147 
    148 I'd like to thank the people behind the sabotage-linux project.
    149 Their work has been really helpful to us.
    150 
    151 Contact
    152 -------
    153 
    154 You can find us on #morpheus at irc.oftc.net or through
    155 tech@lists.2f30.org.
    156 
    157 Enjoy!