The officially official Devuan Forum!

You are not logged in.

#1 2019-08-24 15:03:25

siva
Member
Registered: 2018-01-25
Posts: 207  
Website

Installing sinit on devuan [alpha]

This post should offer some pointers if you want to try out suckless.org's init on a devuan system.  It is the first step in a larger overhaul with my project spin.  This alpha-quality documentation, and I intend to provide updates when I can.  Please post your wisdom to help expand it.

I find sinit attractive becuase it's quick and builds quickly.  For a nonpersistent live system, this is very desirable.  I also don't care about having a service manager on a drive-by operating system.

I'm going to proceed with a yet-unverified claim: that this will work for any devuan system.  If anyone wants to prove this right or wrong, please post your results.  Unfortunately, my bandwidth and time are limited at the time of writing.

Requirements

  • * A devuan image with sysvinit preinstalled (I used thomos, which is built from an ascii debootstrap)
    * Suckless.org's init
    * A test environment or virtual machine (I used virtualbox)
    * sysvinit scripts in rcS.d
    * gcc and make installed
    * git (optional)

Installing the base system

This is probably the sloppiest (but easiest) way to test the init's functionality.

- Install devuan or devuan-like image in your test environment.
- Chroot into your system.
- Set up your network.  In virtualbox: dhclient eth0
- If needed, update packages and install gcc, make, and git (if that's how you're getting the source): apt-get update && apt-get install gcc make git
- Grab the sinit source: git clone git://git.suckless.org/sinit
- Build the package: cd sinit && make && make install (by default, it installs to /usr/local/bin)
- Replace sysv's init: cp /sbin/init /sbin/init.sysvinit && cp /usr/local/bin/sinit /sbin/init
- At this point, you can remove sysv packages if you want.
- Use an editor to create the file /bin/rc.init (My example is used below):

#!/bin/sh
echo "Loading devuan with sinit."
# At bare minimum, boot to a shell.
/bin/bash
exit 0

- I made it executable, but I'm not sure if it's necessary to do so: chmod +x /bin/rc.init
- Exit the chroot and reboot the test system
- At boot, you should see the "Loading devuan with sinit" message, and a bash prompt should appear.

Getting Xorg

Using the rc.init file we created, you should boot to a root console.  Your system is read only.

The scripts in rcS.d have some missing links to getting Xorg up and running.  Right now, I could not tell you what they are doing.

- Make sure /tmp has write premissions.  One way to accomplish this is to remount the filesystem as read/write: mount -o remount,rw /
- Open /bin/rc.init in an editor.
- Add the following code before /bin/bash:

# Borrowing lingering SysV scripts.
# This method is sloppy and pays no mind to what each script is doing.
for script in /etc/rcS.d/*; do 
    sh $script start;
done

- To run Xorg as a user (example, the user "thomos"): su thomos
- Make sure .xinitrc executes an environment (example, "exec openbox-session")
- Run startx

Screenshot

Final product, based on 2019-08-24 procedures:
2019-08-24-142501-1021x633-scrot.png


the thomos project
thomos support thread
cynwulf wrote: "You should get some more sleep and spend less time on forums."

Offline

Board footer