Subject: support for Alpine Linux
From: Natanael Copa <natanael.copa@gmail.com>
Date: Tue, 31 Jul 2007 12:04:35 +0200

Hi,

I'm making an uclibc/busybox based linux distro based on gentoo, Alpine
linux. I have managed to get vserver started and I can bootstrap a
debian etch vserver. (I think its prettty cool, minimalistic grsec'ed
vserver host on tmpfs from a cd/usb. memory usage less than 60MB)

Now I would like to add support for alpine as a vserver guest but I
cannot really find out how to handle the init.

First I tried to use plain init. It booted with minor issues related the
fact that it uses busybox init. But when I try to stop the vserver I
only get: "reboot: no". Its busybox reboot/halt command that tries to
kill pid 1 and when it fails it just gives up.

But what I really need is only to run /etc/init.d/rcL on start
and /etc/init.d/rcK && killall5 on stop so I thought I would try to
start an initstyle called "alpine" by
modifying /usr/lib/util-vserver/vserver.functions:

--- /usr/lib/util-vserver/vserver.functions.orig        Tue Jul 31 11:43:26 2007
+++ /usr/lib/util-vserver/vserver.functions     Tue Jul 31 11:45:01 2007
@@ -322,7 +322,11 @@
 Your vserver ($(basename "$vdir")) seems to have baselayout-$basever,
 please use 'plain' init-style instead!"
            ;;
-
+       (xalpine)
+           INITCMD_START=( /etc/init.d/rcL )
+           INITCMD_STOP=( /etc/init.d/rcK killall5 )
+           INITCMD_PREPARE=( $_FAKE_RUNLEVEL 3 /var/run/utmp )
+           ;;
        (x) ;;
        (*) panic "Unknown init-style '$INITSTYLE'; aborting";;
     esac


But when I tried to start it I get:

~ $ vserver alpine start
vshelper.init: can not determine xid of vserver 'alpine'; returned value
was ''

An error occured after executing the vserver startup sequence. This
means that some processes may exist in the created context and the
manual execution of

  /usr/sbin/vserver '/etc/vservers/alpine' stop

is recommended to fix this.


I tried to dig around in the bash script to find out whats going on but
I cannot figure out whats going on. 

Any pointers?

Would you be interested in patches so next official release of
util-vserver has support for alpine linux?

If you want to try alpine as vserver host, then download alpine-1.7.3 from:
http://dev.alpinelinux.org/alpine/v1.7/iso/ 

or boot from usb:
http://dev.alpinelinux.org/alpine/v1.7/usbdrive/

You can also install the base system (2-3MB?) in a directory, designed
for mini vserver guests, using the albootstrap script:
http://dev.alpinelinux.org/alpine/v1.7/albootstrap

sh albootstrap /vservers/alpine

Thanks!

Natanael Copa