1 (edited by benyouyou 2024-06-02 16:22:02)

Topic: Sinit

Hello,
I am new here so please guide me if I did something wrong.

You know that sinit is the lightest and fastest init of all:
https://git.suckless.org/sinit/.

I have thankfully installed it on a base Hyperbola, but I don't know if I
should add it as a package, please give me the instructions, thanks !

EDIT: I realized that I should have posted this in the community section, sorry.

2

Re: Sinit

Hello .  Tell me please, do you use DWM with Hyperbola? Just wanted to clarify..

3

Re: Sinit

Yes, I do

4

Re: Sinit

Hello and welcome to the forums: If you have finished sinit as package, we would be happy to have your guidance here. Always welcome to share PKGBUILDs and more so the community can approve and test it. smile

Human being in favor with clear principles and so also for freedom in soft- and hardware!

Certainly anyone who has the power to make you believe absurdities has the power to make you commit injustices: For a life of every being full with peace and kindness, including diversity and freedom. Capitalism is destroying our minds, the planet itself and the universe in the end!

5 (edited by benyouyou 2024-06-03 20:24:34)

Re: Sinit

PKGBUILD:

#


 Contributor: Maaram Zakaria <benyouyou@mailo.com>

pkgname=sinit
pkgver=1.1
pkgrel=1
pkgdesc="Simple init"
arch=('i686' 'x86_64')
url='https://https://git.suckless.org/sinit/'
license=('MIT/X Consortium')
source=("https://dl.suckless.org/${pkgname}/${pkgname}-${pkgver}.tar.gz"
        "rc.init"
        "rc.shutdown")

sha512sums=('418ec52f9e855b2245c5db0a47db4960e5155df3bd7d45dedcd323ccb513e66568de91e12bc2e0a0b026be2cd4ffde3d67438e35fb0706d1087e806a3caed4e0'







            
'c5c8794c6d28d2bdf2626c5e97cfefd810eecca28f9a1cf8dcaa9aacd75a6a5287f2f79fda8a6eb96dbd7a853b459e2f18d1da72f3e101580741743347a796e0'







            
'db26866692a244346d77ac3813c9f7554310a17bdf99604a5f077148b2737c0d5f95d3fbf5e7a6eeb87b16d7a301750e5e83d352b4fae1527844f3e479fee046')






            
prepare() {
  cd "pkgname-$pkger"
  cp "$srcdir/rc.init" rc.init
  cp "$srcdir/rc.shutdown" rc.shutdown
}

build() {
  cd ${pkgname}-${pkgver}
  make
}

package() {
  cd $pkgname-$pkgver
  install -Dm0644 sinit -t /sbin
  chmod +x rc.init
  install -Dm0644 rc.init -t /bin
  chmod +x rc.shutdown
  install -Dm0644 rc.shutdown -t /bin
  ln -s sinit /sbin/init
  install -Dm0644 sinit.8 -t /usr/share/man/man8
  mkdir -p "/usr/share/licenses/$pkgname"
  install -Dm0644 LICENSE -t "/usr/share/licenses/$pkgname"
}

These have been inspired by stali init files: http://r-36.net/scm/stali-init/files.html

rc.init:

#!/bin/sh
#Please modify this file as it suits you
#All commented lines are optional

#umask 022

echo Running udev

/sbin/udevd --daemon
udevadm trigger --action=add --type=devices
udevadm settle

#Modules loading, just in case, normally they are automatically loaded 
by udev

#GPU module loading like nouveau
#/sbin/modprobe i915

#Sound module loading 
#/sbin/modprobe snd_hda_intel

#Keyboard map setting

#loadkeys es

echo Mounting filesystems

/bin/mount /dev/sda1 /boot
/sbin/swapon /dev/sda2

ln -sf /proc/mounts /etc/mtab

#Zram swap setting

#modprobe zram
#echo 4G > /sys/block/zram0/disksize 
##echo lzo > /sys/block/zram0/comp_algorithm
#mkswap /dev/zram0
#swapon /dev/zram0

echo Launching ttys

#/sbin/agetty --noclear tty0 38400 linux &>/dev/null &
/sbin/agetty --noclear tty1 38400 linux &>/dev/null &
/sbin/agetty --noclear tty2 38400 linux &>/dev/null &
/sbin/agetty --noclear tty3 38400 linux &>/dev/null &
/sbin/agetty --noclear tty4 38400 linux &>/dev/null &
/sbin/agetty --noclear tty5 38400 linux &>/dev/null &
/sbin/agetty --noclear tty6 38400 linux &>/dev/null &
/sbin/agetty --noclear tty7 38400 linux &>/dev/null &
/sbin/agetty --noclear tty8 38400 linux &>/dev/null &
/sbin/agetty --noclear tty9 38400 linux &>/dev/null &
/sbin/agetty --noclear tty10 38400 linux &>/dev/null &
/sbin/agetty --noclear tty11 38400 linux &>/dev/null &
/sbin/agetty --noclear tty12 38400 linux &>/dev/null &

/bin/mkdir -p /dev/pts
/bin/mount -n -t devpts -o gid=5,mode=0620 devpts /dev/pts

#network configuration, replace enp2s0 by your interface or leave it

#ifconfig enp2s0 up
#ip link set enp2s0 up

#wifi, replace wlan0 by your interface or leave it
#wpa_supplicant -B -i wlan0 -c/etc/wpa_supplicant.conf

#replace sdhcp by your dhcp client or leave it
#sdhcp -d enp2s0

rc.shutdown:

#!/bin/sh
#Please modify this file as it suits you
#All commented lines are optional

#umask 022

case "$1" in
reboot|poweroff)
    ;;
*)
    echo "Invalid action '$1' for rc.shutdown" 1>&2
    exit 1
    ;;
esac

# Set linefeed mode to avoid staircase effect
#echo; /bin/stty onlcr

umount /dev/pts

#ifconfig enp2s0 down

pkill -15 -e 1
pkill -9 -e 1

swapoff -a

echo Remounting root as read-only

echo u > /proc/sysrq-trigger
sleep 2

echo Syncing filesystems

echo s > /proc/sysrq-trigger
sleep 2

case "$1" in
reboot)
    echo b > /proc/sysrq-trigger
    ;;
poweroff)
    echo o > /proc/sysrq-trigger
    ;;
esac

6

Re: Sinit

Thank you. How do you manage generic services after the system starts? This would be a good example therefore. Likewise:

dhcpcd or slim

Human being in favor with clear principles and so also for freedom in soft- and hardware!

Certainly anyone who has the power to make you believe absurdities has the power to make you commit injustices: For a life of every being full with peace and kindness, including diversity and freedom. Capitalism is destroying our minds, the planet itself and the universe in the end!

7

Re: Sinit

benyouyou wrote:

Yes, I do

This is great because few people here use this environment.  I'm also trying to set up so I can post the setup here, that's what I'm going for (this is an example with a BSD system)

https://files.catbox.moe/4e7s14.png

8

Re: Sinit

jim wrote:

This is great because few people here use this environment.  I'm also trying to set up so I can post the setup here, that's what I'm going for (this is an example with a BSD system)

Thanks, we can talk about it if you want in "Bringing my .cwmrc to Hyperbola" thread.


throgh wrote:

Thank you. How do you manage generic services after the system starts? This would be a good example therefore. Likewise:

dhcpcd or slim

I don't know, but I start them manually like "sdhcp -d enp2s0" or "sx": https://github.com/Earnestly/sx. Normally it should be daemontools-encore: http://troubleshooters.com/linux/diy/su … _plop.htm.