morpheus

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

commit 2172a60f1a25dc9ee6d47a18c4f9987bd1174b5d
Author: sin <sin@2f30.org>
Date:   Thu,  5 Sep 2013 11:59:49 +0100

Initial commit

Diffstat:
Abuild | 81+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Apkgs/mksh-R47 | 21+++++++++++++++++++++
Apkgs/sbase | 14++++++++++++++
Apkgs/sdhcp | 18++++++++++++++++++
Apkgs/sic | 18++++++++++++++++++
Apkgs/smdev | 14++++++++++++++
Apkgs/toybox | 12++++++++++++
Apkgs/ubase | 14++++++++++++++
Aqemu-run | 10++++++++++
9 files changed, 202 insertions(+), 0 deletions(-)

diff --git a/build b/build @@ -0,0 +1,81 @@ +#!/bin/bash -x + +# Export important variables for the build scripts +top=$(pwd) +root=$top/root +mirror=http://dl.2f30.org/morpheus-pkgs +export top root mirror + +# Create directory hierarchy +rm -rf root src +mkdir -p root/{bin,boot,dev,etc,svc,home,root,var,share,devel} +mkdir -p root/share/man +mkdir -p root/devel/{include,lib,src} +mkdir -p root/{sys,proc} +pushd $root/ +ln -s /bin sbin +popd +mkdir -p src +mkdir -p kernel + +# Fetch packages +pkglist=$(ls pkgs) +for pkg in $pkglist; do + export pkg + . pkgs/$pkg +done + +# Fetch kernel +wget -c http://dl.2f30.org/morpheus-pkgs/bzImage -O kernel/bzImage +wget -c http://dl.2f30.org/morpheus-pkgs/bzImage-config -O kernel/bzImage-config + +# Dummy hotplug event handler +cat << EOF > $root/bin/hotplug +#!/bin/sh + +env >> /tmp/hotplug-events +EOF + +chmod +x $root/bin/hotplug + +# Our init script +cat << EOF > $root/init +#!/bin/sh + +export PATH=/bin:/sbin + +mount -t sysfs sysfs /sys +mount -t proc proc /proc +echo /bin/smdev > /proc/sys/kernel/hotplug +smdev -s +hostname morpheus +ifconfig eth0 up && sdhcp eth0 + +while :; do + sh +done +EOF + +chmod +x $root/init + +# Basic group/passwd files +cat <<EOF > $root/etc/group +root:x:0:root +bin:x:1:root,bin,daemon +daemon:x:2:root,bin,daemon +sys:x:3:root,bin +adm:x:4:root,daemon +tty:x:5: +disk:x:6:root +cdrom:x:7:root +EOF + +cat <<EOF > $root/etc/passwd +root:x:0:0:root:/root:/bin/mksh +bin:x:1:1:bin:/bin:/bin/false +daemon:x:2:2:daemon:/sbin:/bin/false +EOF + +pushd $root +find . | cpio --quiet -H newc -o | gzip -9 -n > ../rootfs.img +popd diff --git a/pkgs/mksh-R47 b/pkgs/mksh-R47 @@ -0,0 +1,21 @@ +file=$pkg.tar.gz +url=$mirror/$file + +# Fetch package +wget -c $url -O src/$file + +# Unpack package +pushd src +tar xzf $file +popd + +# Build package +pushd src/mksh +CC=musl-gcc LDFLAGS+=-static sh Build.sh +popd + +# Install package +cp src/mksh/mksh $root/bin +pushd $root/bin +ln -s /bin/mksh sh +popd diff --git a/pkgs/sbase b/pkgs/sbase @@ -0,0 +1,14 @@ +url=git://git.2f30.org/$pkg + +# Fetch package +git clone $url src/$pkg + +# Build package +pushd src/$pkg +make CC=musl-gcc LDFLAGS=-static +popd + +# Install package +pushd src/$pkg +make PREFIX=$root install +popd diff --git a/pkgs/sdhcp b/pkgs/sdhcp @@ -0,0 +1,18 @@ +file=$pkg.tar.gz +url=$mirror/$file + +# Fetch package +wget -c $url -O src/$file + +# Unpack package +pushd src +tar xzf $file +popd + +# Build package +pushd src/$pkg +make CC=musl-gcc LDFLAGS=-static +popd + +# Install package +cp src/$pkg/sdhcp $root/bin diff --git a/pkgs/sic b/pkgs/sic @@ -0,0 +1,18 @@ +file=$pkg.tar.gz +url=$mirror/$file + +# Fetch package +wget -c $url -O src/$file + +# Unpack package +pushd src +tar xzf $file +popd + +# Build package +pushd src/$pkg +make CC=musl-gcc LDFLAGS=-static +popd + +# Install package +cp src/$pkg/sic $root/bin diff --git a/pkgs/smdev b/pkgs/smdev @@ -0,0 +1,14 @@ +url=git://git.2f30.org/$pkg + +# Fetch package +git clone $url src/$pkg + +# Build package +pushd src/$pkg +make CC=musl-gcc LDFLAGS=-static +popd + +# Install package +pushd src/$pkg +make PREFIX=$root install +popd diff --git a/pkgs/toybox b/pkgs/toybox @@ -0,0 +1,12 @@ +# Fetch package +wget -c http://www.landley.net/toybox/bin/toybox-x86_64 -O src/$pkg + +# Install package +pushd src/ +chmod +x $pkg +cp $pkg $root/bin +pushd $root/bin +ln -s toybox ifconfig +ln -s toybox nc +popd +popd diff --git a/pkgs/ubase b/pkgs/ubase @@ -0,0 +1,14 @@ +url=git://git.2f30.org/$pkg + +# Fetch package +git clone $url src/$pkg + +# Build package +pushd src/$pkg +make CC=musl-gcc LDFLAGS=-static +popd + +# Install package +pushd src/$pkg +make PREFIX=$root install +popd diff --git a/qemu-run b/qemu-run @@ -0,0 +1,10 @@ +#!/bin/bash + +vdesock="/tmp/sucklessvde" + +ps -ef | grep vde_switch | grep "sock $vdesock" | grep -v grep > /dev/null || { + vde_switch -sock "$vdesock" -daemon -mod 660 -group kvm && + slirpvde -s "$vdesock" --dhcp --daemon -H '10.1.2.0/24' -L '2223:10.1.2.15:22' +} + +qemu-system-x86_64 -net nic,model=ne2k_pci -net vde,sock="${vdesock}" -kernel kernel/bzImage -initrd rootfs.img -append "quiet"