10 Commits

Author SHA1 Message Date
3ad16d3a3c fix: Makefile 2025-07-05 20:16:40 +02:00
df6a565874 release: v1.2.1 2025-07-05 19:01:55 +02:00
310b0a87dc Merge pull request #55 from javalsai/fix_makefile_rsync
fix: makefile rsync dependency, runit installation
2025-07-05 18:45:02 +02:00
6384a94f61 pkg(Makefile): make services packaging easier 2025-07-05 18:27:29 +02:00
56e8897565 fix(Makefile): wrong path 2025-07-05 18:23:05 +02:00
f67e30991a fix(Makedile): proper service install recipes
update docs too
2025-07-05 17:53:53 +02:00
grialion
e8a9e57af9 fix(Makefile): comprehensive runit installation 2025-07-05 15:19:39 +02:00
31c3ad6d42 fix(Makefile): duplicated s6 install 2025-07-05 14:52:13 +02:00
a00a73756c fix: support /etc/sv/ and /etc/<init>/sv 2025-07-05 14:50:43 +02:00
grialion
51c12eefdc fix: makefile rsync dependency, runit installation 2025-07-05 11:16:02 +02:00
6 changed files with 93 additions and 18 deletions

View File

@@ -39,9 +39,15 @@ make install-service
# or if you don't like autodetection
make install-service-systemd # systemd
make install-service-dinit # dinit
make install-service-runit # runit
make install-service-runit # runit (/etc/sv)
make install-service-runit-etc # runit (/etc/runit/sv)
make install-service-openrc # openrc
make install-service-s6 # s6
make install-service-s6 # s6 (/etc/sv)
make install-service-s6-etc # s6 (/etc/s6/sv)
# For runit and s6, some distros (e.g. Artix) like to put it in /etc/<init>/sv
# to better isolate their packages while other distros (e.g. Void) just put it
# in /etc/sv
```
# AUR

View File

@@ -1,4 +1,4 @@
VERSION = 1.2.0
VERSION = 1.2.1
.DEFAULT_GOAL := lidm
CDIR=src
@@ -54,7 +54,7 @@ install: lidm
uninstall:
rm -rf ${DESTDIR}${PREFIX}/bin/lidm ${DESTDIR}/etc/lidm.ini
rm -rf ${DESTDIR}/usr/share/man/man{1/lidm.1,5/lidm-config.5}.gz
rm -rf /etc/systemd/system/lidm.service /etc/dinit.d/lidm /etc/runit/sv/lidm
rm -rf ${DESTDIR}/etc/systemd/system/lidm.service ${DESTDIR}/etc/dinit.d/lidm ${DESTDIR}/etc/runit/sv/lidm
install-service:
@if command -v systemctl &> /dev/null; then \
@@ -62,30 +62,72 @@ install-service:
elif command -v dinitctl &> /dev/null; then \
make install-service-dinit; \
elif command -v sv &> /dev/null; then \
make install-service-runit; \
if [ -d /etc/sv ]; then \
make install-service-runit; \
elif [ -d /etc/runit/sv ]; then \
make install-service-runit-etc; \
else \
printf '\033[31m%s\033[0m\n' "Unknown init system structure, skipping service install..." >&2; \
fi \
elif command -v rc-update &> /dev/null; then \
make install-service-openrc; \
elif command -v s6-service &> /dev/null; then \
make install-service-s6; \
if [ -d /etc/sv ]; then \
make install-service-s6; \
elif [ -d /etc/r6nit/sv ]; then \
make install-service-s6-etc; \
else \
printf '\033[31m%s\033[0m\n' "Unknown init system structure, skipping service install..." >&2; \
fi \
else \
printf '\x1b[1;31m%s\x1b[0m\n' "Unknown init system, skipping service install..."; \
printf '\033[1;31m%s\033[0m\n' "Unknown init system, skipping service install..." >&2; \
fi
install-service-systemd:
install -m644 ./assets/services/systemd.service /etc/systemd/system/lidm.service
@printf '\x1b[1m%s\x1b[0m\n\n' " don't forget to run 'systemctl enable lidm'"
install -m644 ./assets/services/systemd.service ${DESTDIR}/etc/systemd/system/lidm.service
@printf '\033[1m%s\033[0m\n\n' " don't forget to run 'systemctl enable lidm'"
install-service-dinit:
install -m644 ./assets/services/dinit /etc/dinit.d/lidm
@printf '\x1b[1m%s\x1b[0m\n\n' " don't forget to run 'dinitctl enable lidm'"
install -m644 ./assets/services/dinit ${DESTDIR}/etc/dinit.d/lidm
@printf '\033[1m%s\033[0m\n\n' " don't forget to run 'dinitctl enable lidm'"
install-service-runit:
rsync -a --no-owner --no-group ./assets/services/runit/. /etc/runit/sv/lidm
@printf '\x1b[1m%s\x1b[0m\n\n' " don't forget to run 'ln -s /etc/runit/sv/lidm /run/runit/service' and 'sv enable lidm'"
@if [ ! -e /etc/sv ] && [ -d /etc/runit/sv ] && [ -z "$FORCE" ]; then \
printf '\033[31m%s\033[0m\n' "/etc/sv doesn't exist but /etc/runit/sv does" >&2; \
printf '\033[31m%s\033[0m\n' "you probably meant to 'make install-service-runit-etc'" >&2; \
exit 1; \
fi
mkdir -p ${DESTDIR}/etc/sv/lidm
cp -r --update=all ./assets/services/runit/* ${DESTDIR}/etc/sv/lidm/
@printf '\033[1m%s\033[0m\n\n' " don't forget to run 'ln -s ${DESTDIR}/etc/sv/lidm /var/service' or your distro equivalent"
install-service-runit-etc:
@if [ ! -e /etc/runit/sv ] && [ -d /etc/sv ] && [ -z "$FORCE" ]; then \
printf '\033[31m%s\033[0m\n' "/etc/runit/sv doesn't exist but /etc/sv does" >&2; \
printf '\033[31m%s\033[0m\n' "you probably meant to 'make install-service-runit'" >&2; \
exit 1; \
fi
mkdir -p ${DESTDIR}/etc/runit/sv/lidm
cp -r --update=all ./assets/services/runit/* ${DESTDIR}/etc/runit/sv/lidm/
@printf '\033[1m%s\033[0m\n\n' " don't forget to run 'ln -s ${DESTDIR}/etc/runit/sv/lidm /run/runit/service' or your distro equivalent"
install-service-openrc:
install -m755 ./assets/services/openrc /etc/init.d/lidm
@printf '\x1b[1m%s\x1b[0m\n\n' " don't forget to run 'rc-update add lidm'"
install -m755 ./assets/services/openrc ${DESTDIR}/etc/init.d/lidm
@printf '\033[1m%s\033[0m\n\n' " don't forget to run 'rc-update add lidm'"
install-service-s6:
rsync -a --no-owner --no-group ./assets/services/s6/. /etc/s6/sv/lidm
@printf '\x1b[1m%s\x1b[0m\n\n' " don't forget to run 's6-service add default lidm' and 's6-db-reload'"
@if [ ! -e /etc/sv ] && [ -d /etc/s6/sv ] && [ -z "$FORCE" ]; then \
printf '\033[31m%s\033[0m\n' "/etc/sv doesn't exist but /etc/s6/sv does" >&2; \
printf '\033[31m%s\033[0m\n' "you probably meant to 'make install-service-s6-etc'" >&2; \
exit 1; \
fi
mkdir -p ${DESTDIR}/etc/sv/lidm
cp -r --update=all ./assets/services/s6/* ${DESTDIR}/etc/sv/lidm/
@printf '\033[1m%s\033[0m\n\n' " don't forget to run 's6-service add default lidm' and 's6-db-reload'"
install-service-s6-etc:
@if [ ! -e /etc/s6/sv ] && [ -d /etc/sv ] && [ -z "$FORCE" ]; then \
printf '\033[31m%s\033[0m\n' "/etc/s6/sv doesn't exist but /etc/sv does" >&2; \
printf '\033[31m%s\033[0m\n' "you probably meant to 'make install-service-s6'" >&2; \
exit 1; \
fi
mkdir -p ${DESTDIR}/etc/s6/sv/lidm
cp -r --update=all ./assets/services/s6/* ${DESTDIR}/etc/s6/sv/lidm/
@printf '\033[1m%s\033[0m\n\n' " don't forget to run 's6-service add default lidm' and 's6-db-reload'"
pre-commit:
codespell
@@ -100,8 +142,10 @@ print-version:
install uninstall \
install-service \
install-service-s6 \
install-service-s6-etc \
install-service-dinit \
install-service-runit \
install-service-runit-etc \
install-service-openrc \
install-service-systemd \
pre-commit \

5
aaaa/etc/sv/lidm/conf Executable file
View File

@@ -0,0 +1,5 @@
BAUD_RATE=38400
TERM_NAME=linux
TTY=tty7
EXEC_PATH=/bin/lidm

5
aaaa/etc/sv/lidm/finish Executable file
View File

@@ -0,0 +1,5 @@
#!/bin/sh
[ -r conf ] && . ./conf
exec utmpset -w $TTY

15
aaaa/etc/sv/lidm/run Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/sh
[ -r conf ] && . ./conf
if [ -x /sbin/getty -o -x /bin/getty ]; then
# busybox
GETTY=getty
elif [ -x /sbin/agetty -o -x /bin/agetty ]; then
# util-linux
GETTY=agetty
fi
exec setsid ${GETTY} ${GETTY_ARGS} \
"${TTY}" "${TERM_NAME}" \
-n -l "${EXEC_PATH}" -o 7

View File

@@ -4,7 +4,7 @@ This folder contains the files necessary to set up lidm on start up for the supp
If you don't know what a init system is, you're certainly using `systemd`.
There's make scripts to automatically copy the service files to the proper locations, you just have to run `make install-service-$INIT`. `make install-service` will attempt to detect the init system in use and install for it.
There's make scripts to automatically copy the service files to the proper locations, you just have to run `make install-service-$INIT` (or `make install-service-$INIT-etc`). `make install-service` will attempt to detect the init system in use and install for it.
The manual steps for installation are: