1
0
mirror of git://git.2f30.org/morpheus.git synced 2024-06-24 13:48:32 +00:00
morpheus/README

149 lines
3.2 KiB
Plaintext
Raw Normal View History

2014-03-03 17:26:07 +00:00
morpheus - a statically linked musl based Linux distro
======================================================
2013-09-06 11:05:08 +00:00
2014-03-03 17:26:07 +00:00
Building
--------
2013-09-17 16:25:48 +00:00
2014-03-04 16:39:24 +00:00
*** 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.
2013-09-05 13:31:38 +00:00
2014-03-03 17:36:28 +00:00
Please review config.mk prior to building and adjust any parameters.
2014-03-03 17:26:07 +00:00
2014-04-09 07:31:14 +00:00
Setting up the environment:
2014-03-03 17:26:07 +00:00
2014-04-09 07:31:14 +00:00
export mkbuild=$(pwd)/mkbuild
export configmk=$(pwd)/config.mk
export PATH=/path/to/musl/toolchain/bin:$PATH
2014-04-09 07:44:37 +00:00
Clone the git submodules, either via git commands or:
2014-04-30 16:00:10 +00:00
2014-04-09 07:44:37 +00:00
mk init
2014-04-09 07:31:14 +00:00
To build everything (though this isn't recommended):
mk
2013-09-06 11:47:53 +00:00
2014-05-22 15:42:16 +00:00
To build specific ports:
2013-09-25 09:15:02 +00:00
2014-05-22 15:42:16 +00:00
mk TARG="port1 port2 ..."
2014-04-09 07:31:14 +00:00
or:
2013-09-25 09:15:02 +00:00
2014-05-22 15:42:16 +00:00
cd ports/port1; mk
2014-02-28 15:30:19 +00:00
2014-05-22 15:42:16 +00:00
To force build ports:
2014-04-09 07:31:14 +00:00
mk -a
2014-02-28 15:30:19 +00:00
2014-03-03 17:26:07 +00:00
To clean the build system's cache:
mk clean
2014-04-09 07:31:14 +00:00
To clean source dirs completely:
2014-03-03 17:26:07 +00:00
2014-04-09 07:31:14 +00:00
mk distclean
2014-03-03 17:26:07 +00:00
2014-05-22 15:42:16 +00:00
To fetch all ports without building anything:
2014-03-03 17:26:48 +00:00
2014-04-09 07:31:14 +00:00
mk fetch
2014-03-03 17:26:48 +00:00
2014-05-22 15:42:16 +00:00
To generate a package tarball:
mk TARG="port1 port2 ..." package
You can then install the package using installpkg(1) from
http://git.2f30.org/pkgtools.
To install a port to the rootfs:
mk TARG="port1 port2 ..." ROOT=$(pwd)/root install
Note that this however will *not* create the /var/log/packages
entries.
For a bootable system you need at least the following packages:
busybox
2014-05-22 15:46:11 +00:00
e2fsprogs
2014-05-22 15:42:16 +00:00
extlinux
file
fs
hbase
linux
mksh
sbase
sdhcp
sinit
smdev
ubase
There are precompiled versions at http://morpheus.2f30.org/0.0 for the
x86_64 architecture.
We suggest using a stripped-down CRUX rootfs for building ports. There
2014-05-23 11:27:48 +00:00
is one prepackaged rootfs at http://morpheus.2f30.org/0.0/emul-x86_64.tgz.
2014-05-22 15:42:16 +00:00
Rebuilding the kernel
---------------------
2014-04-09 07:31:14 +00:00
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
2014-04-09 07:31:14 +00:00
copy it over the relevant config in ports/linux or you can just
manually compile the kernel and copy System.map and bzImage to
2014-05-22 15:42:16 +00:00
$ROOT/boot.
2014-03-03 17:26:07 +00:00
Installing
----------
2014-03-04 16:23:03 +00:00
There is currently no installer. There is a script that creates a 2GB
2014-03-03 17:26:07 +00:00
image file that is suitable to dd to a usb stick.
To create a bootable image:
2013-09-25 09:15:02 +00:00
2013-09-27 09:23:50 +00:00
sudo modprobe -r loop
sudo modprobe loop max_part=15 # to be done only once
2014-05-17 14:23:41 +00:00
sudo mk ROOT=$(pwd)/root bootable # set ROOT to point to your rootfs
2013-09-17 15:16:00 +00:00
2014-03-03 17:26:07 +00:00
Make sure to change the kernel command line to point it to your root
2014-03-07 11:07:07 +00:00
device. You can do this at the boot prompt:
2014-05-22 15:42:16 +00:00
bzImage root=/dev/sd[X]1 rootwait ro
2013-09-27 09:23:50 +00:00
2014-04-09 07:31:14 +00:00
Otherwise modify ports/extlinux/extlinux.conf and rebuild the extlinux
2014-05-22 15:42:16 +00:00
port or directly modify $ROOT/boot/extlinux.conf.
2014-03-07 11:07:07 +00:00
You will also want to modify the fstab file.
2014-03-03 17:26:07 +00:00
Testing
-------
2014-03-03 17:28:33 +00:00
To experiment with the x86_64 image in qemu:
2014-02-20 16:52:13 +00:00
qemu-system-x86_64 -hda morpheus-x86_64-0.0.img -enable-kvm -vga cirrus
2013-09-27 09:23:50 +00:00
Login with root and an empty password.
2013-09-05 13:31:38 +00:00
2014-03-03 17:36:28 +00:00
Debugging
---------
2014-04-09 07:31:14 +00:00
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:
2014-03-03 17:36:28 +00:00
2014-04-09 07:31:14 +00:00
mk 2>&1 | tee -a output.log
2014-03-03 17:36:28 +00:00
2014-03-15 20:19:42 +00:00
Props
-----
2014-03-16 15:38:03 +00:00
I'd like to thank the people behind the sabotage-linux project.
Their work has been really helpful to us.
2014-03-15 20:19:42 +00:00
2014-03-04 15:49:43 +00:00
Contact
-------
You can find us on #morpheus at irc.oftc.net.
2013-09-05 13:31:38 +00:00
Enjoy!