Go to file
sin 824deb7151 We can now do mk TARG=wtv package 2014-05-19 20:51:38 +01:00
misc add helper script to make a crux chroot 2014-05-17 19:44:54 +02:00
mkbuild@75a44c1318 Add mkbuild and ports submodules 2014-04-07 13:03:39 +03:00
ports@37ff31a8aa Add mkbuild and ports submodules 2014-04-07 13:03:39 +03:00
stuff Refuse to run create-bootable if $ROOT is not set 2014-04-18 13:08:18 +01:00
.gitignore Complete rewrite of the build system 2014-03-26 21:19:02 +00:00
.gitmodules Use 2f30 mkbuild repo 2014-04-08 22:20:41 +03:00
LICENSE Add Hiltjo Posthuma to LICENSE 2014-03-04 16:26:45 +00:00
README mk bootable requires ROOT to be set 2014-05-17 15:23:41 +01:00
TODO Remove tic from the TODO 2014-04-09 14:17:34 +03:00
config.def.mk Add SUM to config.def.mk 2014-05-15 12:12:25 +03:00
mkfile We can now do mk TARG=wtv package 2014-05-19 20:51:38 +01:00

morpheus - a statically linked musl based Linux distro
======================================================

Building
--------

*** HIGHLY EXPERIMENTAL SOFTWARE - READ THE CODE FIRST! ***

To build  morpheus you  currently need an  x86_64/x86 host.   You will
need to have mk(1) from 9base or plan9port.

Please review config.mk prior to building and adjust any parameters.

Setting up the environment:

  export mkbuild=$(pwd)/mkbuild
  export configmk=$(pwd)/config.mk
  export PATH=/path/to/musl/toolchain/bin:$PATH

Clone the git submodules, either via git commands or:

  mk init

To build everything (though this isn't recommended):

  mk

To build specific packages:

  mk TARG="pkg1 pkg2 ..."

  or:

  cd ports/pkg1; mk

To force build packages:

  mk -a

To clean the build system's cache:

  mk clean

To clean source dirs completely:

  mk distclean

To fetch all packages without building anything:

  mk fetch

Rebuilding the kernel
---------------------

There is a default config for  the kernel in ports/linux.  The default
config is  copied over  .config in the  kernel source  directory every
time you do a build via mk(1).   You can adjust your local .config and
copy  it over  the  relevant config  in ports/linux  or  you can  just
manually  compile  the  kernel  and copy  System.map  and  bzImage  to
$root/boot.

Installing
----------

There is currently no installer.  There is a script that creates a 2GB
image file that is suitable to dd to a usb stick.

To create a bootable image:

  sudo modprobe -r loop
  sudo modprobe loop max_part=15 # to be done only once
  sudo mk ROOT=$(pwd)/root bootable # set ROOT to point to your rootfs

Make sure to change  the kernel command line to point  it to your root
device.  You can do this at the boot prompt:

  bzImage root=/dev/sd[X]1 rootwait init=/init ro

Otherwise modify ports/extlinux/extlinux.conf and rebuild the extlinux
package.

You will also want to modify the fstab file.

Testing
-------

To experiment with the x86_64 image in qemu:

  qemu-system-x86_64 -hda morpheus-x86_64-0.0.img -enable-kvm -vga cirrus

Login with root and an empty password.

To obtain binary images go to http://dl.2f30.org/morpheus-img/

Debugging
---------

In some  cases you may  want to set nprocs to 1  in order to  get sane
build output. You can then use something like the following:

  mk 2>&1 | tee -a output.log

Props
-----

I'd like to thank the people behind the sabotage-linux project.
Their work has been really helpful to us.

Contact
-------

You can find us on #morpheus at irc.oftc.net.

Enjoy!