* [bug#40601] [PATCH 0/5] Handle runit-based foreign distributions @ 2020-04-13 16:04 Vincent Legoll 2020-04-13 16:07 ` [bug#40601] [PATCH 1/5] nix/local.mk: Add missing comment to sysvinit section Vincent Legoll ` (8 more replies) 0 siblings, 9 replies; 77+ messages in thread From: Vincent Legoll @ 2020-04-13 16:04 UTC (permalink / raw) To: 40601 And assorted small fixes around the subject. The first 3 patches are smallish things. Maybe the REQUIRED array could get other missing requirements: tar (or maybe the "tr" item is a typoed tar, I've found no use of tr), mkdir, ln, usermod, useradd, cp, cat... The handling of local files for guix-install.sh is to help testing modified / locally generated binary tarballs. One thing that is working as-is, but that I'm not sure is right: The runit script in the guix-binary tarball is patched for the shebang to point to /gnu/store/... This looks wrong even if it is working, the interpreter for that script should be the one of the foreign distro. But this is not specific to the runit support, the sysv scripts also are shebang-patched. How would I tell guix not to patch these files's shebangs ? WDYT ? This series has been tested on void linux i686 in qemu kvm with: - upload locally build guix-binary tarball & guix-install.sh to VM - run guix-install.sh guix-binary.i686-linux.tar.xz 1) guix search hello 2) guix show hello 3) guix build hello 4) guix gc -D/gnu/store/*hello* 5) guix build --no-substitutes hello (stopped as it was rebuilding the world) 6) guix package -u 7) guix pull 8) guix package -u 9) guix gc So the download part is not tested, but all ran well. -- Vincent Legoll ^ permalink raw reply [flat|nested] 77+ messages in thread
* [bug#40601] [PATCH 1/5] nix/local.mk: Add missing comment to sysvinit section. 2020-04-13 16:04 [bug#40601] [PATCH 0/5] Handle runit-based foreign distributions Vincent Legoll @ 2020-04-13 16:07 ` Vincent Legoll 2020-04-13 16:07 ` [bug#40601] [PATCH 2/5] guix-install.sh: Add xz to requirements Vincent Legoll ` (3 more replies) 2020-05-17 17:15 ` [bug#40601] [RFC, PATCH 0/28] guix-install.sh: port to other distros & init systems Vincent Legoll ` (7 subsequent siblings) 8 siblings, 4 replies; 77+ messages in thread From: Vincent Legoll @ 2020-04-13 16:07 UTC (permalink / raw) To: 40601; +Cc: Vincent Legoll * nix/local.mk (sysvinit): Add comment. --- nix/local.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/nix/local.mk b/nix/local.mk index a64bdd2137..412d89ba3d 100644 --- a/nix/local.mk +++ b/nix/local.mk @@ -164,6 +164,7 @@ etc/guix-%.service: etc/guix-%.service.in \ "$<" > "$@.tmp"; \ mv "$@.tmp" "$@" +# The service script for sysvinit. sysvinitservicedir = $(sysconfdir)/init.d nodist_sysvinitservice_DATA = etc/init.d/guix-daemon -- 2.26.0 ^ permalink raw reply related [flat|nested] 77+ messages in thread
* [bug#40601] [PATCH 2/5] guix-install.sh: Add xz to requirements. 2020-04-13 16:07 ` [bug#40601] [PATCH 1/5] nix/local.mk: Add missing comment to sysvinit section Vincent Legoll @ 2020-04-13 16:07 ` Vincent Legoll 2020-04-13 16:07 ` [bug#40601] [PATCH 3/5] guix-install.sh: Fix systemctl not found error message at probe Vincent Legoll ` (2 subsequent siblings) 3 siblings, 0 replies; 77+ messages in thread From: Vincent Legoll @ 2020-04-13 16:07 UTC (permalink / raw) To: 40601; +Cc: Vincent Legoll * etc/guix-install.sh (REQUIRE): Add xz to requirements list. --- etc/guix-install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index 4909d3f162..dbc038a0ab 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -48,6 +48,7 @@ REQUIRE=( "groupadd" "tail" "tr" + "xz" ) PAS=$'[ \033[32;1mPASS\033[0m ] ' -- 2.26.0 ^ permalink raw reply related [flat|nested] 77+ messages in thread
* [bug#40601] [PATCH 3/5] guix-install.sh: Fix systemctl not found error message at probe. 2020-04-13 16:07 ` [bug#40601] [PATCH 1/5] nix/local.mk: Add missing comment to sysvinit section Vincent Legoll 2020-04-13 16:07 ` [bug#40601] [PATCH 2/5] guix-install.sh: Add xz to requirements Vincent Legoll @ 2020-04-13 16:07 ` Vincent Legoll 2020-04-13 16:07 ` [bug#40601] [PATCH 4/5] guix-install.sh: Handle local binary tarball file Vincent Legoll 2020-04-13 16:07 ` [bug#40601] [PATCH 5/5] guix-install.sh, guix-binary tarball: Handle runit-based foreign distributions Vincent Legoll 3 siblings, 0 replies; 77+ messages in thread From: Vincent Legoll @ 2020-04-13 16:07 UTC (permalink / raw) To: 40601; +Cc: Vincent Legoll * etc/guix-install.sh (chk_init_sys)[systemctl]: Redirect errors to /dev/null. --- etc/guix-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index dbc038a0ab..4fa9664cf5 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -142,7 +142,7 @@ chk_init_sys() _msg "${INF}init system is: upstart" INIT_SYS="upstart" return 0 - elif [[ $(systemctl) =~ -\.mount ]]; then + elif [[ $(systemctl 2>/dev/null) =~ -\.mount ]]; then _msg "${INF}init system is: systemd" INIT_SYS="systemd" return 0 -- 2.26.0 ^ permalink raw reply related [flat|nested] 77+ messages in thread
* [bug#40601] [PATCH 4/5] guix-install.sh: Handle local binary tarball file. 2020-04-13 16:07 ` [bug#40601] [PATCH 1/5] nix/local.mk: Add missing comment to sysvinit section Vincent Legoll 2020-04-13 16:07 ` [bug#40601] [PATCH 2/5] guix-install.sh: Add xz to requirements Vincent Legoll 2020-04-13 16:07 ` [bug#40601] [PATCH 3/5] guix-install.sh: Fix systemctl not found error message at probe Vincent Legoll @ 2020-04-13 16:07 ` Vincent Legoll 2020-04-13 16:07 ` [bug#40601] [PATCH 5/5] guix-install.sh, guix-binary tarball: Handle runit-based foreign distributions Vincent Legoll 3 siblings, 0 replies; 77+ messages in thread From: Vincent Legoll @ 2020-04-13 16:07 UTC (permalink / raw) To: 40601; +Cc: Vincent Legoll * etc/guix-install.sh (REQUIRE): add realpath. (main): Handle local binary tarball file path passed as first arg. --- etc/guix-install.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index 4fa9664cf5..0d15a05cb4 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -4,6 +4,7 @@ # Copyright © 2018 Ricardo Wurmus <rekado@elephly.net> # Copyright © 2018 Efraim Flashner <efraim@flashner.co.il> # Copyright © 2019 Tobias Geerinckx-Rice <me@tobias.gr> +# Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com> # # This file is part of GNU Guix. # @@ -47,6 +48,7 @@ REQUIRE=( "uname" "groupadd" "tail" + "realpath" "tr" "xz" ) @@ -482,10 +484,14 @@ main() umask 0022 tmp_path="$(mktemp -t -d guix.XXX)" - guix_get_bin_list "${GNU_URL}" - guix_get_bin "${GNU_URL}" "${BIN_VER}" "$tmp_path" - - sys_create_store "${BIN_VER}.tar.xz" "${tmp_path}" + if [ -z "$1" ]; then + guix_get_bin_list "${GNU_URL}" + guix_get_bin "${GNU_URL}" "${BIN_VER}" "$tmp_path" + TARBALL="${BIN_VER}.tar.xz" + else + TARBALL="$(realpath $1)" + fi + sys_create_store "${TARBALL}" "${tmp_path}" sys_create_build_user sys_enable_guix_daemon sys_authorize_build_farms -- 2.26.0 ^ permalink raw reply related [flat|nested] 77+ messages in thread
* [bug#40601] [PATCH 5/5] guix-install.sh, guix-binary tarball: Handle runit-based foreign distributions. 2020-04-13 16:07 ` [bug#40601] [PATCH 1/5] nix/local.mk: Add missing comment to sysvinit section Vincent Legoll ` (2 preceding siblings ...) 2020-04-13 16:07 ` [bug#40601] [PATCH 4/5] guix-install.sh: Handle local binary tarball file Vincent Legoll @ 2020-04-13 16:07 ` Vincent Legoll 3 siblings, 0 replies; 77+ messages in thread From: Vincent Legoll @ 2020-04-13 16:07 UTC (permalink / raw) To: 40601; +Cc: Vincent Legoll * .gitignore: Add /etc/runit/run. * etc/guix-install.sh (chk_init_sys): Add case to detect runit. (sys_enable_guix_daemon): Add case to setup guix-daemon within runit. * etc/runit/run.in: New file. * nix/local.mk (etc/runit/run): Add target to generate etc/runit/run from etc/runit/run.in. (nodist_runitservice_DATA): New variable... (CLEANFILES): ... add it here. (runitservicedir): New variable. (EXTRA_DIST): Add etc/runit/run.in. --- .gitignore | 1 + etc/guix-install.sh | 11 +++++++++++ etc/runit/run.in | 15 +++++++++++++++ nix/local.mk | 13 +++++++++++++ 4 files changed, 40 insertions(+) create mode 100644 etc/runit/run.in diff --git a/.gitignore b/.gitignore index fd2cf56098..89a2c89e1e 100644 --- a/.gitignore +++ b/.gitignore @@ -72,6 +72,7 @@ /etc/guix-publish.conf /etc/guix-publish.service /etc/init.d/guix-daemon +/etc/runit/run /guix-daemon /guix/config.scm /libformat.a diff --git a/etc/guix-install.sh b/etc/guix-install.sh index 0d15a05cb4..06590ee97f 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -152,6 +152,10 @@ chk_init_sys() _msg "${INF}init system is: sysv-init" INIT_SYS="sysv-init" return 0 + elif [[ -d /etc/sv ]]; then + _msg "${INF}init system is: runit" + INIT_SYS="runit" + return 0 else INIT_SYS="NA" _err "${ERR}Init system could not be detected." @@ -364,6 +368,13 @@ sys_enable_guix_daemon() systemctl enable guix-daemon; } && _msg "${PAS}enabled Guix daemon via systemd" ;; + runit) + { cp -r "${ROOT_HOME}/.config/guix/current/lib/runit/guix-daemon" \ + /etc/sv; + chmod 755 /etc/sv/guix-daemon/run; + ln -s /etc/sv/guix-daemon /etc/runit/runsvdir/default/; } && + _msg "${PAS}enabled Guix daemon via runit" + ;; sysv-init) { mkdir -p /etc/init.d; cp "${ROOT_HOME}/.config/guix/current/etc/init.d/guix-daemon" \ diff --git a/etc/runit/run.in b/etc/runit/run.in new file mode 100644 index 0000000000..e57ef597bc --- /dev/null +++ b/etc/runit/run.in @@ -0,0 +1,15 @@ +#!/bin/sh + +# This is a "run script" for the runit init system to launch +# 'guix-daemon'. Drop it in /etc/sv/guix-daemon and add a symlink to +# it like the following to have 'guix-daemon' automatically started. +# ln -s /etc/sv/guix-daemon /etc/runit/runsvdir/default/ + +GUIX_LOCPATH=@localstatedir@/guix/profiles/per-user/root/guix-profile/lib/locale +LC_ALL=en_US.utf8 + +export GUIX_LOCPATH LC_ALL + +exec @localstatedir@/guix/profiles/per-user/root/current-guix/bin/guix-daemon \ + --build-users-group=guixbuild + diff --git a/nix/local.mk b/nix/local.mk index 412d89ba3d..877ddcc281 100644 --- a/nix/local.mk +++ b/nix/local.mk @@ -175,6 +175,17 @@ etc/init.d/guix-daemon: etc/init.d/guix-daemon.in \ "$<" > "$@.tmp"; \ mv "$@.tmp" "$@" +# The service run script for runit. +runitservicedir = $(libdir)/runit/guix-daemon +nodist_runitservice_DATA = etc/runit/run + +etc/runit/run: etc/runit/run.in \ + $(top_builddir)/config.status + $(AM_V_GEN)$(MKDIR_P) "`dirname $@`"; \ + $(SED) -e 's|@''localstatedir''@|$(localstatedir)|' < \ + "$<" > "$@.tmp"; \ + mv "$@.tmp" "$@" + # The '.conf' jobs for Upstart. upstartjobdir = $(libdir)/upstart/system nodist_upstartjob_DATA = etc/guix-daemon.conf etc/guix-publish.conf @@ -189,6 +200,7 @@ etc/guix-%.conf: etc/guix-%.conf.in \ CLEANFILES += \ $(nodist_systemdservice_DATA) \ $(nodist_upstartjob_DATA) \ + $(nodist_runitservice_DATA) \ $(nodist_sysvinitservice_DATA) EXTRA_DIST += \ @@ -198,6 +210,7 @@ EXTRA_DIST += \ etc/guix-daemon.conf.in \ etc/guix-publish.service.in \ etc/guix-publish.conf.in \ + etc/runit/run.in \ etc/init.d/guix-daemon.in if CAN_RUN_TESTS -- 2.26.0 ^ permalink raw reply related [flat|nested] 77+ messages in thread
* [bug#40601] [RFC, PATCH 0/28] guix-install.sh: port to other distros & init systems 2020-04-13 16:04 [bug#40601] [PATCH 0/5] Handle runit-based foreign distributions Vincent Legoll 2020-04-13 16:07 ` [bug#40601] [PATCH 1/5] nix/local.mk: Add missing comment to sysvinit section Vincent Legoll @ 2020-05-17 17:15 ` Vincent Legoll 2020-05-17 19:26 ` Julien Lepiller 2020-05-17 17:16 ` [bug#40601] [PATCH 01/28] nix/local.mk: Add missing comment to sysvinit section Vincent Legoll ` (6 subsequent siblings) 8 siblings, 1 reply; 77+ messages in thread From: Vincent Legoll @ 2020-05-17 17:15 UTC (permalink / raw) To: 40601 Hello, Here is a RFC series of patches that add a few things: - small fixes & cleanups - removing some (not all) bashisms - non-interactive mode (useful for (semi-) automated testing) - openrc init system support - runit init system support - busybox compatibility (for alpine support) - handle local guix-binary.${ARCH}.tar.xz file (useful for (semi-) automated testing) - requirements fixes It currently has been tested on a range of distros/arches but the latest patches are still not polished (missing proper commit messages) The series is RFC as a few questions remain for me: - Do we want to support alien (aka foreign++) distros (different shells, different init systems, etc...) - To what extent - Are the patches too fine-grained (I personally like them smallish) Future, additionnal work items: - s6 (adelie / obarun) init support - handle GPG downloading in non-interactive mode - being able to cross-build & test them on other arches again (dunno why it broke) - documentation - add missing guix-publish services - add missing RO remounting the store on other distros - removing allremaining bashisms (being shellcheck clean maybe ?) This is to gather input before investing too much time. For example, do we want to commit part of this now, with the rest coming later ? Any feedback ? On individual patch(es) or on the whole series goal... Thanks for reading this far. -- Vincent Legoll ^ permalink raw reply [flat|nested] 77+ messages in thread
* [bug#40601] [RFC, PATCH 0/28] guix-install.sh: port to other distros & init systems 2020-05-17 17:15 ` [bug#40601] [RFC, PATCH 0/28] guix-install.sh: port to other distros & init systems Vincent Legoll @ 2020-05-17 19:26 ` Julien Lepiller 2020-05-17 19:37 ` Vincent Legoll 0 siblings, 1 reply; 77+ messages in thread From: Julien Lepiller @ 2020-05-17 19:26 UTC (permalink / raw) To: Vincent Legoll, 40601 Le 17 mai 2020 13:15:46 GMT-04:00, Vincent Legoll <vincent.legoll@gmail.com> a écrit : >Hello, > >Here is a RFC series of patches that add a few things: > >- small fixes & cleanups >- removing some (not all) bashisms >- non-interactive mode (useful for (semi-) automated > testing) >- openrc init system support >- runit init system support >- busybox compatibility (for alpine support) >- handle local guix-binary.${ARCH}.tar.xz file (useful > for (semi-) automated testing) >- requirements fixes > >It currently has been tested on a range of distros/arches >but the latest patches are still not polished (missing >proper commit messages) > >The series is RFC as a few questions remain for me: > >- Do we want to support alien (aka foreign++) distros > (different shells, different init systems, etc...) >- To what extent >- Are the patches too fine-grained (I personally like > them smallish) > >Future, additionnal work items: >- s6 (adelie / obarun) init support >- handle GPG downloading in non-interactive mode >- being able to cross-build & test them on other > arches again (dunno why it broke) >- documentation >- add missing guix-publish services >- add missing RO remounting the store on other distros >- removing allremaining bashisms (being shellcheck clean > maybe ?) > >This is to gather input before investing too much time. > >For example, do we want to commit part of this now, with >the rest coming later ? > >Any feedback ? >On individual patch(es) or on the whole series goal... > >Thanks for reading this far. Nice series! I think we want to support as many foreign (init, shell, …) distros as possible. You might want to consider fixing bug #41266. I also found out that daemonize is required on sysv systems. ^ permalink raw reply [flat|nested] 77+ messages in thread
* [bug#40601] [RFC, PATCH 0/28] guix-install.sh: port to other distros & init systems 2020-05-17 19:26 ` Julien Lepiller @ 2020-05-17 19:37 ` Vincent Legoll 0 siblings, 0 replies; 77+ messages in thread From: Vincent Legoll @ 2020-05-17 19:37 UTC (permalink / raw) To: Julien Lepiller, 40601 > Nice series! I think we want to support as many foreign > (init, shell, …) distros as possible. OK that makes at least 3 of us > You might want to consider fixing bug #41266. Ah, nice, that shows that my testing rig is still missing cases, I only run everything directly as root (for which I pre-import the key), so the problem slipped through. Another one for the TODO list. > I also found out that daemonize is required on sysv systems. Yep, I've seen it, but forgot to add it to the TODO list, it's now. Thanks, this will end in a ~50-patches series ;-) -- Vincent Legoll ^ permalink raw reply [flat|nested] 77+ messages in thread
* [bug#40601] [PATCH 01/28] nix/local.mk: Add missing comment to sysvinit section. 2020-04-13 16:04 [bug#40601] [PATCH 0/5] Handle runit-based foreign distributions Vincent Legoll 2020-04-13 16:07 ` [bug#40601] [PATCH 1/5] nix/local.mk: Add missing comment to sysvinit section Vincent Legoll 2020-05-17 17:15 ` [bug#40601] [RFC, PATCH 0/28] guix-install.sh: port to other distros & init systems Vincent Legoll @ 2020-05-17 17:16 ` Vincent Legoll 2020-05-17 17:16 ` [bug#40601] [PATCH 02/28] guix-install.sh: Add xz to requirements Vincent Legoll ` (27 more replies) 2020-05-22 13:44 ` [bug#40601] [guix-daemon now working on parabola with openrc] jgart--- via Guix-patches via ` (5 subsequent siblings) 8 siblings, 28 replies; 77+ messages in thread From: Vincent Legoll @ 2020-05-17 17:16 UTC (permalink / raw) To: 40601; +Cc: Vincent Legoll * nix/local.mk (sysvinit): Add comment. --- nix/local.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/nix/local.mk b/nix/local.mk index a64bdd2137..412d89ba3d 100644 --- a/nix/local.mk +++ b/nix/local.mk @@ -164,6 +164,7 @@ etc/guix-%.service: etc/guix-%.service.in \ "$<" > "$@.tmp"; \ mv "$@.tmp" "$@" +# The service script for sysvinit. sysvinitservicedir = $(sysconfdir)/init.d nodist_sysvinitservice_DATA = etc/init.d/guix-daemon -- 2.26.2 ^ permalink raw reply related [flat|nested] 77+ messages in thread
* [bug#40601] [PATCH 02/28] guix-install.sh: Add xz to requirements. 2020-05-17 17:16 ` [bug#40601] [PATCH 01/28] nix/local.mk: Add missing comment to sysvinit section Vincent Legoll @ 2020-05-17 17:16 ` Vincent Legoll 2020-05-17 17:17 ` [bug#40601] [PATCH 03/28] guix-install.sh: Fix systemctl not found error message at probe Vincent Legoll ` (26 subsequent siblings) 27 siblings, 0 replies; 77+ messages in thread From: Vincent Legoll @ 2020-05-17 17:16 UTC (permalink / raw) To: 40601; +Cc: Vincent Legoll * etc/guix-install.sh (REQUIRE): Add xz to requirements list. --- etc/guix-install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index 4909d3f162..dbc038a0ab 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -48,6 +48,7 @@ REQUIRE=( "groupadd" "tail" "tr" + "xz" ) PAS=$'[ \033[32;1mPASS\033[0m ] ' -- 2.26.2 ^ permalink raw reply related [flat|nested] 77+ messages in thread
* [bug#40601] [PATCH 03/28] guix-install.sh: Fix systemctl not found error message at probe. 2020-05-17 17:16 ` [bug#40601] [PATCH 01/28] nix/local.mk: Add missing comment to sysvinit section Vincent Legoll 2020-05-17 17:16 ` [bug#40601] [PATCH 02/28] guix-install.sh: Add xz to requirements Vincent Legoll @ 2020-05-17 17:17 ` Vincent Legoll 2020-05-17 17:17 ` [bug#40601] [PATCH 04/28] guix-install.sh: Handle local binary tarball file Vincent Legoll ` (25 subsequent siblings) 27 siblings, 0 replies; 77+ messages in thread From: Vincent Legoll @ 2020-05-17 17:17 UTC (permalink / raw) To: 40601; +Cc: Vincent Legoll * etc/guix-install.sh (chk_init_sys)[systemctl]: Redirect errors to /dev/null. --- etc/guix-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index dbc038a0ab..4fa9664cf5 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -142,7 +142,7 @@ chk_init_sys() _msg "${INF}init system is: upstart" INIT_SYS="upstart" return 0 - elif [[ $(systemctl) =~ -\.mount ]]; then + elif [[ $(systemctl 2>/dev/null) =~ -\.mount ]]; then _msg "${INF}init system is: systemd" INIT_SYS="systemd" return 0 -- 2.26.2 ^ permalink raw reply related [flat|nested] 77+ messages in thread
* [bug#40601] [PATCH 04/28] guix-install.sh: Handle local binary tarball file. 2020-05-17 17:16 ` [bug#40601] [PATCH 01/28] nix/local.mk: Add missing comment to sysvinit section Vincent Legoll 2020-05-17 17:16 ` [bug#40601] [PATCH 02/28] guix-install.sh: Add xz to requirements Vincent Legoll 2020-05-17 17:17 ` [bug#40601] [PATCH 03/28] guix-install.sh: Fix systemctl not found error message at probe Vincent Legoll @ 2020-05-17 17:17 ` Vincent Legoll 2020-05-23 13:42 ` Tobias Geerinckx-Rice via Guix-patches via 2020-05-17 17:17 ` [bug#40601] [PATCH 05/28] guix-install.sh, guix-binary tarball: Handle runit-based foreign distributions Vincent Legoll ` (24 subsequent siblings) 27 siblings, 1 reply; 77+ messages in thread From: Vincent Legoll @ 2020-05-17 17:17 UTC (permalink / raw) To: 40601; +Cc: Vincent Legoll * etc/guix-install.sh (REQUIRE): add realpath. (main): Handle local binary tarball file path passed as first arg. --- etc/guix-install.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index 4fa9664cf5..7b9a729570 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -4,6 +4,7 @@ # Copyright © 2018 Ricardo Wurmus <rekado@elephly.net> # Copyright © 2018 Efraim Flashner <efraim@flashner.co.il> # Copyright © 2019 Tobias Geerinckx-Rice <me@tobias.gr> +# Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com> # # This file is part of GNU Guix. # @@ -47,6 +48,7 @@ REQUIRE=( "uname" "groupadd" "tail" + "realpath" "tr" "xz" ) @@ -482,10 +484,14 @@ main() umask 0022 tmp_path="$(mktemp -t -d guix.XXX)" - guix_get_bin_list "${GNU_URL}" - guix_get_bin "${GNU_URL}" "${BIN_VER}" "$tmp_path" - - sys_create_store "${BIN_VER}.tar.xz" "${tmp_path}" + if [ -z "$1" ]; then + guix_get_bin_list "${GNU_URL}" + guix_get_bin "${GNU_URL}" "${BIN_VER}" "${tmp_path}" + TARBALL="${BIN_VER}.tar.xz" + else + TARBALL="$(realpath $1)" + fi + sys_create_store "${TARBALL}" "${tmp_path}" sys_create_build_user sys_enable_guix_daemon sys_authorize_build_farms -- 2.26.2 ^ permalink raw reply related [flat|nested] 77+ messages in thread
* [bug#40601] [PATCH 04/28] guix-install.sh: Handle local binary tarball file. 2020-05-17 17:17 ` [bug#40601] [PATCH 04/28] guix-install.sh: Handle local binary tarball file Vincent Legoll @ 2020-05-23 13:42 ` Tobias Geerinckx-Rice via Guix-patches via 2020-05-23 21:37 ` Vincent Legoll 0 siblings, 1 reply; 77+ messages in thread From: Tobias Geerinckx-Rice via Guix-patches via @ 2020-05-23 13:42 UTC (permalink / raw) To: Vincent Legoll; +Cc: 40601 [-- Attachment #1: Type: text/plain, Size: 663 bytes --] Vincent, I've pushed the first three patches with some commit message tweaks. Vincent Legoll 写道: > * etc/guix-install.sh (REQUIRE): add realpath. > (main): Handle local binary tarball file path passed as first > arg. ‘file name’, ‘argument’. I'm OK with this change in general but it needs to be documented *somewhere*: in (guix)Binary Installation and/or a (new) --help message and/or an ‘Invocation:’ comment at the top of the script. I notice you ran out of commit message energy halfway through the series :-) While I've come to love Guix's discipline, I sympathise, but what's the plan? Thanks, T G-R [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 227 bytes --] ^ permalink raw reply [flat|nested] 77+ messages in thread
* [bug#40601] [PATCH 04/28] guix-install.sh: Handle local binary tarball file. 2020-05-23 13:42 ` Tobias Geerinckx-Rice via Guix-patches via @ 2020-05-23 21:37 ` Vincent Legoll 0 siblings, 0 replies; 77+ messages in thread From: Vincent Legoll @ 2020-05-23 21:37 UTC (permalink / raw) To: Tobias Geerinckx-Rice; +Cc: 40601 On 23/05/2020 15:42, Tobias Geerinckx-Rice wrote: > Vincent, > > I've pushed the first three patches with some commit message tweaks. Thanks & thanks > Vincent Legoll 写道: >> * etc/guix-install.sh (REQUIRE): add realpath. >> (main): Handle local binary tarball file path passed as first arg. > > ‘file name’, ‘argument’. > > I'm OK with this change in general but it needs to be documented > *somewhere*: in (guix)Binary Installation and/or a (new) --help message > and/or an ‘Invocation:’ comment at the top of the script. > > I notice you ran out of commit message energy halfway through the series > :-) While I've come to love Guix's discipline, I sympathise, but what's > the plan? I was off duty at dayjob cause of covid partial unemployment last week, that's why I got more time to work on guix. I have resumed work this week so it explains the slowdown ;-) The plan is that I'll continue working on this series to polish the commit messages that need to be. I just wanted to send the series to have the ACKs that it will not be lost work, before continuing. I've got ACKs, so I'll work on finishing the pending patches, before embarking on more TODO items. And doc is one item from that TODO list. I'll put it on top. But even if dev speed is lower, I'm committed to finish this. -- Vincent Legoll ^ permalink raw reply [flat|nested] 77+ messages in thread
* [bug#40601] [PATCH 05/28] guix-install.sh, guix-binary tarball: Handle runit-based foreign distributions. 2020-05-17 17:16 ` [bug#40601] [PATCH 01/28] nix/local.mk: Add missing comment to sysvinit section Vincent Legoll ` (2 preceding siblings ...) 2020-05-17 17:17 ` [bug#40601] [PATCH 04/28] guix-install.sh: Handle local binary tarball file Vincent Legoll @ 2020-05-17 17:17 ` Vincent Legoll 2020-05-17 17:17 ` [bug#40601] [PATCH 06/28] guix-install.sh: trivial whitespace fix Vincent Legoll ` (23 subsequent siblings) 27 siblings, 0 replies; 77+ messages in thread From: Vincent Legoll @ 2020-05-17 17:17 UTC (permalink / raw) To: 40601; +Cc: Vincent Legoll * .gitignore: Add /etc/runit/run. * etc/guix-install.sh (chk_init_sys): Add case to detect runit. (sys_enable_guix_daemon): Add case to setup guix-daemon within runit. * etc/runit/run.in: New file. * nix/local.mk (etc/runit/run): Add target to generate etc/runit/run from etc/runit/run.in. (nodist_runitservice_DATA): New variable... (CLEANFILES): ... add it here. (runitservicedir): New variable. (EXTRA_DIST): Add etc/runit/run.in. --- .gitignore | 1 + etc/guix-install.sh | 11 +++++++++++ etc/runit/run.in | 15 +++++++++++++++ nix/local.mk | 14 ++++++++++++++ 4 files changed, 41 insertions(+) create mode 100644 etc/runit/run.in diff --git a/.gitignore b/.gitignore index fd2cf56098..89a2c89e1e 100644 --- a/.gitignore +++ b/.gitignore @@ -72,6 +72,7 @@ /etc/guix-publish.conf /etc/guix-publish.service /etc/init.d/guix-daemon +/etc/runit/run /guix-daemon /guix/config.scm /libformat.a diff --git a/etc/guix-install.sh b/etc/guix-install.sh index 7b9a729570..6eff82c444 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -152,6 +152,10 @@ chk_init_sys() _msg "${INF}init system is: sysv-init" INIT_SYS="sysv-init" return 0 + elif [[ -d /etc/sv ]]; then + _msg "${INF}init system is: runit" + INIT_SYS="runit" + return 0 else INIT_SYS="NA" _err "${ERR}Init system could not be detected." @@ -364,6 +368,13 @@ sys_enable_guix_daemon() systemctl enable guix-daemon; } && _msg "${PAS}enabled Guix daemon via systemd" ;; + runit) + { cp -r "${ROOT_HOME}/.config/guix/current/lib/runit/guix-daemon" \ + /etc/sv; + chmod 755 /etc/sv/guix-daemon/run; + ln -s /etc/sv/guix-daemon /etc/runit/runsvdir/default/; } && + _msg "${PAS}enabled Guix daemon via runit" + ;; sysv-init) { mkdir -p /etc/init.d; cp "${ROOT_HOME}/.config/guix/current/etc/init.d/guix-daemon" \ diff --git a/etc/runit/run.in b/etc/runit/run.in new file mode 100644 index 0000000000..e57ef597bc --- /dev/null +++ b/etc/runit/run.in @@ -0,0 +1,15 @@ +#!/bin/sh + +# This is a "run script" for the runit init system to launch +# 'guix-daemon'. Drop it in /etc/sv/guix-daemon and add a symlink to +# it like the following to have 'guix-daemon' automatically started. +# ln -s /etc/sv/guix-daemon /etc/runit/runsvdir/default/ + +GUIX_LOCPATH=@localstatedir@/guix/profiles/per-user/root/guix-profile/lib/locale +LC_ALL=en_US.utf8 + +export GUIX_LOCPATH LC_ALL + +exec @localstatedir@/guix/profiles/per-user/root/current-guix/bin/guix-daemon \ + --build-users-group=guixbuild + diff --git a/nix/local.mk b/nix/local.mk index 412d89ba3d..582ff16168 100644 --- a/nix/local.mk +++ b/nix/local.mk @@ -1,6 +1,7 @@ # GNU Guix --- Functional package management for GNU # Copyright © 2012, 2013, 2014, 2015, 2016, 2018, 2019 Ludovic Courtès <ludo@gnu.org> # Copyright © 2016 Mathieu Lirzin <mthl@gnu.org> +# Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com> # # This file is part of GNU Guix. # @@ -175,6 +176,17 @@ etc/init.d/guix-daemon: etc/init.d/guix-daemon.in \ "$<" > "$@.tmp"; \ mv "$@.tmp" "$@" +# The service run script for runit. +runitservicedir = $(libdir)/runit/guix-daemon +nodist_runitservice_DATA = etc/runit/run + +etc/runit/run: etc/runit/run.in \ + $(top_builddir)/config.status + $(AM_V_GEN)$(MKDIR_P) "`dirname $@`"; \ + $(SED) -e 's|@''localstatedir''@|$(localstatedir)|' < \ + "$<" > "$@.tmp"; \ + mv "$@.tmp" "$@" + # The '.conf' jobs for Upstart. upstartjobdir = $(libdir)/upstart/system nodist_upstartjob_DATA = etc/guix-daemon.conf etc/guix-publish.conf @@ -189,6 +201,7 @@ etc/guix-%.conf: etc/guix-%.conf.in \ CLEANFILES += \ $(nodist_systemdservice_DATA) \ $(nodist_upstartjob_DATA) \ + $(nodist_runitservice_DATA) \ $(nodist_sysvinitservice_DATA) EXTRA_DIST += \ @@ -198,6 +211,7 @@ EXTRA_DIST += \ etc/guix-daemon.conf.in \ etc/guix-publish.service.in \ etc/guix-publish.conf.in \ + etc/runit/run.in \ etc/init.d/guix-daemon.in if CAN_RUN_TESTS -- 2.26.2 ^ permalink raw reply related [flat|nested] 77+ messages in thread
* [bug#40601] [PATCH 06/28] guix-install.sh: trivial whitespace fix. 2020-05-17 17:16 ` [bug#40601] [PATCH 01/28] nix/local.mk: Add missing comment to sysvinit section Vincent Legoll ` (3 preceding siblings ...) 2020-05-17 17:17 ` [bug#40601] [PATCH 05/28] guix-install.sh, guix-binary tarball: Handle runit-based foreign distributions Vincent Legoll @ 2020-05-17 17:17 ` Vincent Legoll 2020-05-17 17:17 ` [bug#40601] [PATCH 07/28] guix-install.sh: Move code in a new function Vincent Legoll ` (22 subsequent siblings) 27 siblings, 0 replies; 77+ messages in thread From: Vincent Legoll @ 2020-05-17 17:17 UTC (permalink / raw) To: 40601; +Cc: Vincent Legoll Almost the entire file is indented with spaces, a few tabs slipped in, clean them up. Checked triviality with git diff -b. * etc/guix-install.sh(chk_sys_arch): Replace tabs with spaces. (sys_enable_guix_daemon): Likewise. --- etc/guix-install.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index 6eff82c444..078aa4a781 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -180,9 +180,9 @@ chk_sys_arch() aarch64) local arch=aarch64 ;; - armv7l) - local arch=armhf - ;; + armv7l) + local arch=armhf + ;; *) _err "${ERR}Unsupported CPU type: ${arch}" exit 1 @@ -353,15 +353,15 @@ sys_enable_guix_daemon() /etc/systemd/system/; chmod 664 /etc/systemd/system/guix-daemon.service; - # Work around <https://bugs.gnu.org/36074>, present in 1.0.1. - sed -i /etc/systemd/system/guix-daemon.service \ - -e "s/GUIX_LOCPATH='/'GUIX_LOCPATH=/"; + # Work around <https://bugs.gnu.org/36074>, present in 1.0.1. + sed -i /etc/systemd/system/guix-daemon.service \ + -e "s/GUIX_LOCPATH='/'GUIX_LOCPATH=/"; - # Work around <https://bugs.gnu.org/35671>, present in 1.0.1. - if ! grep en_US /etc/systemd/system/guix-daemon.service >/dev/null; - then sed -i /etc/systemd/system/guix-daemon.service \ - -e 's/^Environment=\(.*\)$/Environment=\1 LC_ALL=en_US.UTF-8'; - fi; + # Work around <https://bugs.gnu.org/35671>, present in 1.0.1. + if ! grep en_US /etc/systemd/system/guix-daemon.service >/dev/null; + then sed -i /etc/systemd/system/guix-daemon.service \ + -e 's/^Environment=\(.*\)$/Environment=\1 LC_ALL=en_US.UTF-8'; + fi; systemctl daemon-reload && systemctl start guix-daemon && -- 2.26.2 ^ permalink raw reply related [flat|nested] 77+ messages in thread
* [bug#40601] [PATCH 07/28] guix-install.sh: Move code in a new function. 2020-05-17 17:16 ` [bug#40601] [PATCH 01/28] nix/local.mk: Add missing comment to sysvinit section Vincent Legoll ` (4 preceding siblings ...) 2020-05-17 17:17 ` [bug#40601] [PATCH 06/28] guix-install.sh: trivial whitespace fix Vincent Legoll @ 2020-05-17 17:17 ` Vincent Legoll 2020-05-17 17:17 ` [bug#40601] [PATCH 08/28] guix-install.sh: Use getent for both user & group presence checking Vincent Legoll ` (21 subsequent siblings) 27 siblings, 0 replies; 77+ messages in thread From: Vincent Legoll @ 2020-05-17 17:17 UTC (permalink / raw) To: 40601; +Cc: Vincent Legoll * etc/guix-install.sh (sys_enable_guix_daemon): Move code from here... (sys_make_guix_available): ...to this new function, fixing whitespace... (main): ...and call it here. --- etc/guix-install.sh | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index 078aa4a781..225cf532b8 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -330,16 +330,8 @@ sys_create_build_user() sys_enable_guix_daemon() { # Run the daemon, and set it to automatically start on boot. - local info_path - local local_bin - local var_guix - _debug "--- [ $FUNCNAME ] ---" - info_path="/usr/local/share/info" - local_bin="/usr/local/bin" - var_guix="/var/guix/profiles/per-user/root/current-guix" - case "$INIT_SYS" in upstart) { initctl reload-configuration; @@ -391,11 +383,25 @@ sys_enable_guix_daemon() echo " ${ROOT_HOME}/.config/guix/current/bin/guix-daemon --build-users-group=guixbuild" ;; esac +} + +sys_make_guix_available() +{ # add guix into PATH + + local info_path + local local_bin + local var_guix + + _debug "--- [ $FUNCNAME ] ---" + + info_path="/usr/local/share/info" + local_bin="/usr/local/bin" + var_guix="/var/guix/profiles/per-user/root/current-guix" _msg "${INF}making the guix command available to other users" [ -e "$local_bin" ] || mkdir -p "$local_bin" - ln -sf "${var_guix}/bin/guix" "$local_bin" + ln -sf "${var_guix}/bin/guix" "$local_bin" [ -e "$info_path" ] || mkdir -p "$info_path" for i in ${var_guix}/share/info/*; do @@ -505,6 +511,7 @@ main() sys_create_store "${TARBALL}" "${tmp_path}" sys_create_build_user sys_enable_guix_daemon + sys_make_guix_available sys_authorize_build_farms sys_create_init_profile -- 2.26.2 ^ permalink raw reply related [flat|nested] 77+ messages in thread
* [bug#40601] [PATCH 08/28] guix-install.sh: Use getent for both user & group presence checking. 2020-05-17 17:16 ` [bug#40601] [PATCH 01/28] nix/local.mk: Add missing comment to sysvinit section Vincent Legoll ` (5 preceding siblings ...) 2020-05-17 17:17 ` [bug#40601] [PATCH 07/28] guix-install.sh: Move code in a new function Vincent Legoll @ 2020-05-17 17:17 ` Vincent Legoll 2020-05-17 17:17 ` [bug#40601] [PATCH 09/28] guix-install.sh: Fix requirements Vincent Legoll ` (20 subsequent siblings) 27 siblings, 0 replies; 77+ messages in thread From: Vincent Legoll @ 2020-05-17 17:17 UTC (permalink / raw) To: 40601; +Cc: Vincent Legoll * etc/guix-install.sh (sys_create_build_user): Use getent instead of id to check presence of users, use bare getent call with output redirection for group check. --- etc/guix-install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index 225cf532b8..a56e0ec7b2 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -303,7 +303,7 @@ sys_create_build_user() _debug "--- [ $FUNCNAME ] ---" - if [ $(getent group guixbuild) ]; then + if getent group guixbuild >/dev/null 2>&1; then _msg "${INF}group guixbuild exists" else groupadd --system guixbuild @@ -311,7 +311,7 @@ sys_create_build_user() fi for i in $(seq -w 1 10); do - if id "guixbuilder${i}" &>/dev/null; then + if getent passwd "guixbuilder${i}" >/dev/null 2>&1; then _msg "${INF}user is already in the system, reset" usermod -g guixbuild -G guixbuild \ -d /var/empty -s "$(which nologin)" \ -- 2.26.2 ^ permalink raw reply related [flat|nested] 77+ messages in thread
* [bug#40601] [PATCH 09/28] guix-install.sh: Fix requirements. 2020-05-17 17:16 ` [bug#40601] [PATCH 01/28] nix/local.mk: Add missing comment to sysvinit section Vincent Legoll ` (6 preceding siblings ...) 2020-05-17 17:17 ` [bug#40601] [PATCH 08/28] guix-install.sh: Use getent for both user & group presence checking Vincent Legoll @ 2020-05-17 17:17 ` Vincent Legoll 2020-05-17 17:17 ` [bug#40601] [PATCH 10/28] guix-install.sh: Replace subshell-inducing command grouping Vincent Legoll ` (19 subsequent siblings) 27 siblings, 0 replies; 77+ messages in thread From: Vincent Legoll @ 2020-05-17 17:17 UTC (permalink / raw) To: 40601; +Cc: Vincent Legoll There's no usage of "tr" in the script, whereas tar is used. * etc/guix-install.sh (REQUIRE): Change tr to tar, add ln, remove readlink & dirname. --- etc/guix-install.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index a56e0ec7b2..19883b89ae 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -33,8 +33,6 @@ set -e [ "$UID" -eq 0 ] || { echo "This script must be run as root."; exit 1; } REQUIRE=( - "dirname" - "readlink" "wget" "gpg" "grep" @@ -42,6 +40,7 @@ REQUIRE=( "sed" "sort" "getent" + "ln" "mktemp" "rm" "chmod" @@ -49,7 +48,7 @@ REQUIRE=( "groupadd" "tail" "realpath" - "tr" + "tar" "xz" ) -- 2.26.2 ^ permalink raw reply related [flat|nested] 77+ messages in thread
* [bug#40601] [PATCH 10/28] guix-install.sh: Replace subshell-inducing command grouping. 2020-05-17 17:16 ` [bug#40601] [PATCH 01/28] nix/local.mk: Add missing comment to sysvinit section Vincent Legoll ` (7 preceding siblings ...) 2020-05-17 17:17 ` [bug#40601] [PATCH 09/28] guix-install.sh: Fix requirements Vincent Legoll @ 2020-05-17 17:17 ` Vincent Legoll 2020-05-17 17:17 ` [bug#40601] [PATCH 11/28] guix-install.sh: Use a variable for GPG key URL Vincent Legoll ` (18 subsequent siblings) 27 siblings, 0 replies; 77+ messages in thread From: Vincent Legoll @ 2020-05-17 17:17 UTC (permalink / raw) To: 40601; +Cc: Vincent Legoll * etc/guix-install.sh (chk_gpg_keyring): Replace () command grouping by {}. --- etc/guix-install.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index 19883b89ae..d2e44e98b2 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -110,11 +110,11 @@ chk_gpg_keyring() # Without --dry-run this command will create a ~/.gnupg owned by root on # systems where gpg has never been used, causing errors and confusion. - gpg --dry-run --list-keys ${OPENPGP_SIGNING_KEY_ID} >/dev/null 2>&1 || ( - _err "${ERR}Missing OpenPGP public key. Fetch it with this command:" - echo " wget https://sv.gnu.org/people/viewgpg.php?user_id=15145 -qO - | gpg --import -" - exit 1 - ) + gpg --dry-run --list-keys ${OPENPGP_SIGNING_KEY_ID} >/dev/null 2>&1 || { + _err "${ERR}Missing OpenPGP public key. Fetch it with this command:"; + echo " wget https://sv.gnu.org/people/viewgpg.php?user_id=15145 -qO - | gpg --import -"; + exit 1; + } } chk_term() -- 2.26.2 ^ permalink raw reply related [flat|nested] 77+ messages in thread
* [bug#40601] [PATCH 11/28] guix-install.sh: Use a variable for GPG key URL. 2020-05-17 17:16 ` [bug#40601] [PATCH 01/28] nix/local.mk: Add missing comment to sysvinit section Vincent Legoll ` (8 preceding siblings ...) 2020-05-17 17:17 ` [bug#40601] [PATCH 10/28] guix-install.sh: Replace subshell-inducing command grouping Vincent Legoll @ 2020-05-17 17:17 ` Vincent Legoll 2020-05-17 17:17 ` [bug#40601] [PATCH 12/28] guix-install.sh: Rework user & group handling, adding busybox support Vincent Legoll ` (17 subsequent siblings) 27 siblings, 0 replies; 77+ messages in thread From: Vincent Legoll @ 2020-05-17 17:17 UTC (permalink / raw) To: 40601; +Cc: Vincent Legoll * etc/guix-install.sh (OPENPGP_SIGNING_KEY_URL): Add new variable. (chk_gpg_keyring): Use it here. --- etc/guix-install.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index d2e44e98b2..043357d9c4 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -59,6 +59,7 @@ INF="[ INFO ] " DEBUG=0 GNU_URL="https://ftp.gnu.org/gnu/guix/" OPENPGP_SIGNING_KEY_ID="3CE464558A84FDC69DB40CFB090B11993D9AEBB5" +OPENPGP_SIGNING_KEY_URL="https://sv.gnu.org/people/viewgpg.php?user_id=15145" # This script needs to know where root's home directory is. However, we # cannot simply use the HOME environment variable, since there is no guarantee @@ -112,7 +113,7 @@ chk_gpg_keyring() # systems where gpg has never been used, causing errors and confusion. gpg --dry-run --list-keys ${OPENPGP_SIGNING_KEY_ID} >/dev/null 2>&1 || { _err "${ERR}Missing OpenPGP public key. Fetch it with this command:"; - echo " wget https://sv.gnu.org/people/viewgpg.php?user_id=15145 -qO - | gpg --import -"; + echo " wget ${OPENPGP_SIGNING_KEY_URL} -qO - | gpg --import -"; exit 1; } } -- 2.26.2 ^ permalink raw reply related [flat|nested] 77+ messages in thread
* [bug#40601] [PATCH 12/28] guix-install.sh: Rework user & group handling, adding busybox support. 2020-05-17 17:16 ` [bug#40601] [PATCH 01/28] nix/local.mk: Add missing comment to sysvinit section Vincent Legoll ` (9 preceding siblings ...) 2020-05-17 17:17 ` [bug#40601] [PATCH 11/28] guix-install.sh: Use a variable for GPG key URL Vincent Legoll @ 2020-05-17 17:17 ` Vincent Legoll 2020-05-17 17:17 ` [bug#40601] [PATCH 13/28] guix-install.sh: Make grep & mktemp usage compatible with busybox Vincent Legoll ` (16 subsequent siblings) 27 siblings, 0 replies; 77+ messages in thread From: Vincent Legoll @ 2020-05-17 17:17 UTC (permalink / raw) To: 40601; +Cc: Vincent Legoll * etc/guix-install.sh (REQUIRE): Remove groupadd, add comment. (sys_create_build_user): Add adduser handling. (sys_create_build_group): New function, add addgroup handling... (main): ...call it here. --- etc/guix-install.sh | 57 +++++++++++++++++++++++++++++++++------------ 1 file changed, 42 insertions(+), 15 deletions(-) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index 043357d9c4..d6966f851a 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -32,6 +32,8 @@ set -e [ "$UID" -eq 0 ] || { echo "This script must be run as root."; exit 1; } +# groupadd, useradd, usermod, adduser, addgroup are handled in: +# sys_create_build_user & sys_create_build_group functions. REQUIRE=( "wget" "gpg" @@ -45,7 +47,6 @@ REQUIRE=( "rm" "chmod" "uname" - "groupadd" "tail" "realpath" "tar" @@ -298,31 +299,56 @@ sys_create_store() _msg "${PAS}activated root profile at ${ROOT_HOME}/.config/guix/current" } -sys_create_build_user() -{ # Create the group and user accounts for build users. +sys_create_build_group() +{ # Create the group for build users. _debug "--- [ $FUNCNAME ] ---" if getent group guixbuild >/dev/null 2>&1; then - _msg "${INF}group guixbuild exists" - else + _msg "${INF}group guixbuild already exists" + elif command -v groupadd &>/dev/null; then groupadd --system guixbuild _msg "${PAS}group <guixbuild> created" + elif command -v addgroup &>/dev/null; then + addgroup -S guixbuild + _msg "${PAS}group <guixbuild> created" + else + _err "${ERR}cannot add group for guix build users" + exit 1 fi +} + +sys_create_build_user() +{ # Create the user accounts for build users. + + _debug "--- [ $FUNCNAME ] ---" for i in $(seq -w 1 10); do if getent passwd "guixbuilder${i}" >/dev/null 2>&1; then - _msg "${INF}user is already in the system, reset" - usermod -g guixbuild -G guixbuild \ - -d /var/empty -s "$(which nologin)" \ - -c "Guix build user $i" \ - "guixbuilder${i}"; + if command -v usermod &>/dev/null; then + _msg "${INF}user is already in the system, resetting" + usermod -g guixbuild -G guixbuild \ + -d /var/empty -s "$(which nologin)" \ + -c "Guix build user $i" \ + "guixbuilder${i}" + else + _msg "${ERR}cannot reset user environment, doing nothing" + fi else - useradd -g guixbuild -G guixbuild \ - -d /var/empty -s "$(which nologin)" \ - -c "Guix build user $i" --system \ - "guixbuilder${i}"; - _msg "${PAS}user added <guixbuilder${i}>" + if command -v useradd &>/dev/null; then + useradd -g guixbuild -G guixbuild \ + -d /var/empty -s "$(which nologin)" \ + -c "Guix build user $i" --system \ + "guixbuilder${i}" + _msg "${PAS}user added <guixbuilder${i}>" + elif command -v adduser &>/dev/null; then + adduser -G guixbuild -h /var/empty -s "$(which nologin)" \ + -H -S "guixbuilder${i}" + _msg "${PAS}user added <guixbuilder${i}>" + else + _msg "${ERR}cannot add user: <guixbuilder${i}>" + exit 1 + fi fi done } @@ -509,6 +535,7 @@ main() TARBALL="$(realpath $1)" fi sys_create_store "${TARBALL}" "${tmp_path}" + sys_create_build_group sys_create_build_user sys_enable_guix_daemon sys_make_guix_available -- 2.26.2 ^ permalink raw reply related [flat|nested] 77+ messages in thread
* [bug#40601] [PATCH 13/28] guix-install.sh: Make grep & mktemp usage compatible with busybox. 2020-05-17 17:16 ` [bug#40601] [PATCH 01/28] nix/local.mk: Add missing comment to sysvinit section Vincent Legoll ` (10 preceding siblings ...) 2020-05-17 17:17 ` [bug#40601] [PATCH 12/28] guix-install.sh: Rework user & group handling, adding busybox support Vincent Legoll @ 2020-05-17 17:17 ` Vincent Legoll 2020-05-17 17:17 ` [bug#40601] [PATCH 14/28] guix-install.sh: Make tar " Vincent Legoll ` (15 subsequent siblings) 27 siblings, 0 replies; 77+ messages in thread From: Vincent Legoll @ 2020-05-17 17:17 UTC (permalink / raw) To: 40601; +Cc: Vincent Legoll The regex is not using pcre-specific syntax. Busybox requires the mktemp template to end with 6 "X". The longer template is harmless for other systems. * etc/guix-install.sh (guix_get_bin_list): Use grep -E instead of pcre. (main): Use template that is accepted by busybox mktemp. --- etc/guix-install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index d6966f851a..770ecfaf3f 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -219,7 +219,7 @@ guix_get_bin_list() | sort -Vu)") latest_ver="$(echo "$bin_ver_ls" \ - | grep -oP "([0-9]{1,2}\.){2}[0-9]{1,2}" \ + | grep -oE "([0-9]{1,2}\.){2}[0-9]{1,2}" \ | tail -n1)" default_ver="guix-binary-${latest_ver}.${ARCH_OS}" @@ -525,7 +525,7 @@ main() _msg "${INF}system is ${ARCH_OS}" umask 0022 - tmp_path="$(mktemp -t -d guix.XXX)" + tmp_path="$(mktemp -t -d guix.XXXXXX)" if [ -z "$1" ]; then guix_get_bin_list "${GNU_URL}" -- 2.26.2 ^ permalink raw reply related [flat|nested] 77+ messages in thread
* [bug#40601] [PATCH 14/28] guix-install.sh: Make tar usage compatible with busybox. 2020-05-17 17:16 ` [bug#40601] [PATCH 01/28] nix/local.mk: Add missing comment to sysvinit section Vincent Legoll ` (11 preceding siblings ...) 2020-05-17 17:17 ` [bug#40601] [PATCH 13/28] guix-install.sh: Make grep & mktemp usage compatible with busybox Vincent Legoll @ 2020-05-17 17:17 ` Vincent Legoll 2020-05-17 17:17 ` [bug#40601] [PATCH 15/28] guix-install.sh, guix-binary tarball: Handle openrc-based foreign distributions Vincent Legoll ` (14 subsequent siblings) 27 siblings, 0 replies; 77+ messages in thread From: Vincent Legoll @ 2020-05-17 17:17 UTC (permalink / raw) To: 40601; +Cc: Vincent Legoll The --warning option is not suported by busybox tar, but it does not emit missing timestamps warnings anyways. * etc/guix-install.sh (sys_create_store): Add --warning tar option only when supported. --- etc/guix-install.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index 770ecfaf3f..b5e8416610 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -274,10 +274,13 @@ sys_create_store() _debug "--- [ $FUNCNAME ] ---" - cd "$tmp_path" - tar --warning=no-timestamp \ - --extract \ - --file "$pkg" && + # Do not use the --warning option with busybox tar + TAROPTS=("-C" "${tmp_path}") + if tar c --warning=no-timestamp -f /dev/null /dev/null >&/dev/null; then + TAROPTS+=("--warning=no-timestamp") + fi + + tar x -f "${pkg}" "${TAROPTS[@]}" && _msg "${PAS}unpacked archive" if [[ -e "/var/guix" || -e "/gnu" ]]; then -- 2.26.2 ^ permalink raw reply related [flat|nested] 77+ messages in thread
* [bug#40601] [PATCH 15/28] guix-install.sh, guix-binary tarball: Handle openrc-based foreign distributions. 2020-05-17 17:16 ` [bug#40601] [PATCH 01/28] nix/local.mk: Add missing comment to sysvinit section Vincent Legoll ` (12 preceding siblings ...) 2020-05-17 17:17 ` [bug#40601] [PATCH 14/28] guix-install.sh: Make tar " Vincent Legoll @ 2020-05-17 17:17 ` Vincent Legoll 2020-05-17 17:17 ` [bug#40601] [PATCH 16/28] non-interactive mode, usage Vincent Legoll ` (13 subsequent siblings) 27 siblings, 0 replies; 77+ messages in thread From: Vincent Legoll @ 2020-05-17 17:17 UTC (permalink / raw) To: 40601; +Cc: Vincent Legoll * .gitignore: Add etc/openrc/guix-daemon.in. * etc/guix-install.sh (chk_init_sys): Add case to detect openrc. (sys_enable_guix_daemon): Add case to setup guix-daemon within openrc. * etc/openrc/guix-daemon.in: New file... * nix/local.mk (etc/openrc/guix-daemon): Add target to generate etc/openrc/guix-daemon from etc/openrc/guix-daemon.in. (CLEANFILES): ...add it here. (nodist_openrcservice_DATA): New variable... (openrcservicedir): New variable. (EXTRA_DIST): Add etc/openrc/guix-daemon.in. --- .gitignore | 1 + etc/guix-install.sh | 14 ++++++++++++++ etc/openrc/guix-daemon.in | 14 ++++++++++++++ nix/local.mk | 13 +++++++++++++ 4 files changed, 42 insertions(+) create mode 100644 etc/openrc/guix-daemon.in diff --git a/.gitignore b/.gitignore index 89a2c89e1e..6cd9fb4f17 100644 --- a/.gitignore +++ b/.gitignore @@ -72,6 +72,7 @@ /etc/guix-publish.conf /etc/guix-publish.service /etc/init.d/guix-daemon +/etc/openrc/guix-daemon /etc/runit/run /guix-daemon /guix/config.scm diff --git a/etc/guix-install.sh b/etc/guix-install.sh index b5e8416610..1c22ae95ee 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -149,6 +149,10 @@ chk_init_sys() _msg "${INF}init system is: systemd" INIT_SYS="systemd" return 0 + elif [[ $(rc -V 2>/dev/null) =~ OpenRC ]]; then + _msg "${INF}init system is: openrc" + INIT_SYS="openrc" + return 0 elif [[ -f /etc/init.d/cron && ! -h /etc/init.d/cron ]]; then _msg "${INF}init system is: sysv-init" INIT_SYS="sysv-init" @@ -396,6 +400,16 @@ sys_enable_guix_daemon() ln -s /etc/sv/guix-daemon /etc/runit/runsvdir/default/; } && _msg "${PAS}enabled Guix daemon via runit" ;; + openrc) + { mkdir -p /etc/init.d; + cp "${ROOT_HOME}/.config/guix/current/lib/openrc/guix-daemon/guix-daemon" \ + /etc/init.d/guix-daemon; + chmod 755 /etc/init.d/guix-daemon; + + rc-update add guix-daemon default && + rc-service guix-daemon start; } && + _msg "${PAS}enabled Guix daemon via openrc" + ;; sysv-init) { mkdir -p /etc/init.d; cp "${ROOT_HOME}/.config/guix/current/etc/init.d/guix-daemon" \ diff --git a/etc/openrc/guix-daemon.in b/etc/openrc/guix-daemon.in new file mode 100644 index 0000000000..9641dcfad6 --- /dev/null +++ b/etc/openrc/guix-daemon.in @@ -0,0 +1,14 @@ +#!/sbin/openrc-run + +# This is a service script file for the openrc init system to launch +# 'guix-daemon'. Copy it as /etc/init.d/guix-daemon to have 'guix-daemon' +# automatically started. + +command=@localstatedir@/guix/profiles/per-user/root/current-guix/bin/guix-daemon +command_args=--build-users-group=guixbuild +command_background=true +pidfile=/run/guix-daemon.pid + +GUIX_LOCPATH=@localstatedir@/guix/profiles/per-user/root/guix-profile/lib/locale +LC_ALL=en_US.utf8 + diff --git a/nix/local.mk b/nix/local.mk index 582ff16168..9d6f92ebc8 100644 --- a/nix/local.mk +++ b/nix/local.mk @@ -187,6 +187,17 @@ etc/runit/run: etc/runit/run.in \ "$<" > "$@.tmp"; \ mv "$@.tmp" "$@" +# The service script for openrc. +openrcservicedir = $(libdir)/openrc/guix-daemon +nodist_openrcservice_DATA = etc/openrc/guix-daemon + +etc/openrc/guix-daemon: etc/openrc/guix-daemon.in \ + $(top_builddir)/config.status + $(AM_V_GEN)$(MKDIR_P) "`dirname $@`"; \ + $(SED) -e 's|@''localstatedir''@|$(localstatedir)|' < \ + "$<" > "$@.tmp"; \ + mv "$@.tmp" "$@" + # The '.conf' jobs for Upstart. upstartjobdir = $(libdir)/upstart/system nodist_upstartjob_DATA = etc/guix-daemon.conf etc/guix-publish.conf @@ -202,6 +213,7 @@ CLEANFILES += \ $(nodist_systemdservice_DATA) \ $(nodist_upstartjob_DATA) \ $(nodist_runitservice_DATA) \ + $(nodist_openrcservice_DATA) \ $(nodist_sysvinitservice_DATA) EXTRA_DIST += \ @@ -212,6 +224,7 @@ EXTRA_DIST += \ etc/guix-publish.service.in \ etc/guix-publish.conf.in \ etc/runit/run.in \ + etc/openrc/guix-daemon.in \ etc/init.d/guix-daemon.in if CAN_RUN_TESTS -- 2.26.2 ^ permalink raw reply related [flat|nested] 77+ messages in thread
* [bug#40601] [PATCH 16/28] non-interactive mode, usage 2020-05-17 17:16 ` [bug#40601] [PATCH 01/28] nix/local.mk: Add missing comment to sysvinit section Vincent Legoll ` (13 preceding siblings ...) 2020-05-17 17:17 ` [bug#40601] [PATCH 15/28] guix-install.sh, guix-binary tarball: Handle openrc-based foreign distributions Vincent Legoll @ 2020-05-17 17:17 ` Vincent Legoll 2020-05-17 17:17 ` [bug#40601] [PATCH 17/28] fix variable quoting in sys_make_guix_available Vincent Legoll ` (12 subsequent siblings) 27 siblings, 0 replies; 77+ messages in thread From: Vincent Legoll @ 2020-05-17 17:17 UTC (permalink / raw) To: 40601; +Cc: Vincent Legoll --- etc/guix-install.sh | 68 +++++++++++++++++++++++++++++++++------------ 1 file changed, 51 insertions(+), 17 deletions(-) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index 1c22ae95ee..7fb9332e97 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -48,7 +48,6 @@ REQUIRE=( "chmod" "uname" "tail" - "realpath" "tar" "xz" ) @@ -454,17 +453,23 @@ sys_make_guix_available() sys_authorize_build_farms() { # authorize the public key of the build farm - while true; do - read -p "Permit downloading pre-built package binaries from the project's build farm? (yes/no) " yn - case $yn in - [Yy]*) guix archive --authorize < "${ROOT_HOME}/.config/guix/current/share/guix/ci.guix.gnu.org.pub" && - _msg "${PAS}Authorized public key for ci.guix.gnu.org"; - break;; - [Nn]*) _msg "${INF}Skipped authorizing build farm public keys" - break;; - *) _msg "Please answer yes or no."; - esac - done + _AUTHORIZE_BUILD_FARM=1 + if [ "$1" -eq 1 ]; then + while true; do + read -p "Permit downloading pre-built package binaries from the project's build farm? (yes/no) " yn + case "$yn" in + [Yy]*) _AUTHORIZE_BUILD_FARM=1; break;; + [Nn]*) _AUTHORIZE_BUILD_FARM=0; break;; + *) _msg "Please answer yes or no.";; + esac + done + fi + if [ "$_AUTHORIZE_BUILD_FARM" -eq 1 ]; then + guix archive --authorize < "${ROOT_HOME}/.config/guix/current/share/guix/ci.guix.gnu.org.pub" && + _msg "${PAS}Authorized public key for ci.guix.gnu.org"; + else + _msg "${INF}Skipped authorizing build farm public keys" + fi } sys_create_init_profile() @@ -526,10 +531,41 @@ EOF read -r ANSWER } +# Do not change the tabs in the HERE-DOCUMENT +usage() +{ + cat <<-EOF + $0: Wrong arguments: + $0 [-h|--help] [-n|--non-interactive] [LOCAL_GUIX_BIN_TARBALL] + + -h|--help Show this help + -n|--non-interactive Avoid asing interactive question, run unattended + automatically allow substitutes from guix build farm + + LOCAL_GUIX_BIN_TARBALL Use the given guix binary tarball file instead of + downloading latest released one +EOF +} + +handle_args() +{ + _INTERACTIVE=1 + while [ "$#" -gt 0 ]; do + case "$1" in + -h|--help) usage; exit 0;; + -n|--non-interactive) _INTERACTIVE=0; shift 1;; + + -*) echo "unknown option: $1" >&2; echo; usage; exit 1;; + *) TARBALL="$1"; shift 1;; + esac + done +} + main() { local tmp_path - welcome + handle_args "$@" + [ "${_INTERACTIVE}" -eq 1 ] && welcome _msg "Starting installation ($(date))" @@ -544,19 +580,17 @@ main() umask 0022 tmp_path="$(mktemp -t -d guix.XXXXXX)" - if [ -z "$1" ]; then + if [ -z "${TARBALL}" ]; then guix_get_bin_list "${GNU_URL}" guix_get_bin "${GNU_URL}" "${BIN_VER}" "${tmp_path}" TARBALL="${BIN_VER}.tar.xz" - else - TARBALL="$(realpath $1)" fi sys_create_store "${TARBALL}" "${tmp_path}" sys_create_build_group sys_create_build_user sys_enable_guix_daemon sys_make_guix_available - sys_authorize_build_farms + sys_authorize_build_farms "${_INTERACTIVE}" sys_create_init_profile _msg "${INF}cleaning up ${tmp_path}" -- 2.26.2 ^ permalink raw reply related [flat|nested] 77+ messages in thread
* [bug#40601] [PATCH 17/28] fix variable quoting in sys_make_guix_available 2020-05-17 17:16 ` [bug#40601] [PATCH 01/28] nix/local.mk: Add missing comment to sysvinit section Vincent Legoll ` (14 preceding siblings ...) 2020-05-17 17:17 ` [bug#40601] [PATCH 16/28] non-interactive mode, usage Vincent Legoll @ 2020-05-17 17:17 ` Vincent Legoll 2020-05-17 17:17 ` [bug#40601] [PATCH 18/28] Replace the use of "which" by "command -v" Vincent Legoll ` (11 subsequent siblings) 27 siblings, 0 replies; 77+ messages in thread From: Vincent Legoll @ 2020-05-17 17:17 UTC (permalink / raw) To: 40601; +Cc: Vincent Legoll --- etc/guix-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index 7fb9332e97..e350fdb052 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -446,7 +446,7 @@ sys_make_guix_available() ln -sf "${var_guix}/bin/guix" "$local_bin" [ -e "$info_path" ] || mkdir -p "$info_path" - for i in ${var_guix}/share/info/*; do + for i in "${var_guix}"/share/info/*; do ln -sf "$i" "$info_path" done } -- 2.26.2 ^ permalink raw reply related [flat|nested] 77+ messages in thread
* [bug#40601] [PATCH 18/28] Replace the use of "which" by "command -v" 2020-05-17 17:16 ` [bug#40601] [PATCH 01/28] nix/local.mk: Add missing comment to sysvinit section Vincent Legoll ` (15 preceding siblings ...) 2020-05-17 17:17 ` [bug#40601] [PATCH 17/28] fix variable quoting in sys_make_guix_available Vincent Legoll @ 2020-05-17 17:17 ` Vincent Legoll 2020-05-17 17:17 ` [bug#40601] [PATCH 19/28] Remove &> and >& bashisms Vincent Legoll ` (10 subsequent siblings) 27 siblings, 0 replies; 77+ messages in thread From: Vincent Legoll @ 2020-05-17 17:17 UTC (permalink / raw) To: 40601; +Cc: Vincent Legoll --- etc/guix-install.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index e350fdb052..596ceb5b39 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -38,7 +38,6 @@ REQUIRE=( "wget" "gpg" "grep" - "which" "sed" "sort" "getent" @@ -329,12 +328,13 @@ sys_create_build_user() _debug "--- [ $FUNCNAME ] ---" + NOLOGIN_SHELL="$(command -v nologin)" for i in $(seq -w 1 10); do if getent passwd "guixbuilder${i}" >/dev/null 2>&1; then if command -v usermod &>/dev/null; then _msg "${INF}user is already in the system, resetting" usermod -g guixbuild -G guixbuild \ - -d /var/empty -s "$(which nologin)" \ + -d /var/empty -s "${NOLOGIN_SHELL}" \ -c "Guix build user $i" \ "guixbuilder${i}" else @@ -343,12 +343,12 @@ sys_create_build_user() else if command -v useradd &>/dev/null; then useradd -g guixbuild -G guixbuild \ - -d /var/empty -s "$(which nologin)" \ + -d /var/empty -s "${NOLOGIN_SHELL}" \ -c "Guix build user $i" --system \ "guixbuilder${i}" _msg "${PAS}user added <guixbuilder${i}>" elif command -v adduser &>/dev/null; then - adduser -G guixbuild -h /var/empty -s "$(which nologin)" \ + adduser -G guixbuild -h /var/empty -s "${NOLOGIN_SHELL}" \ -H -S "guixbuilder${i}" _msg "${PAS}user added <guixbuilder${i}>" else -- 2.26.2 ^ permalink raw reply related [flat|nested] 77+ messages in thread
* [bug#40601] [PATCH 19/28] Remove &> and >& bashisms 2020-05-17 17:16 ` [bug#40601] [PATCH 01/28] nix/local.mk: Add missing comment to sysvinit section Vincent Legoll ` (16 preceding siblings ...) 2020-05-17 17:17 ` [bug#40601] [PATCH 18/28] Replace the use of "which" by "command -v" Vincent Legoll @ 2020-05-17 17:17 ` Vincent Legoll 2020-05-17 17:17 ` [bug#40601] [PATCH 20/28] Add missing variable quoting & curly-bracketing for dl_path Vincent Legoll ` (9 subsequent siblings) 27 siblings, 0 replies; 77+ messages in thread From: Vincent Legoll @ 2020-05-17 17:17 UTC (permalink / raw) To: 40601; +Cc: Vincent Legoll --- etc/guix-install.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index 596ceb5b39..5b82999bc5 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -94,7 +94,7 @@ chk_require() _debug "--- [ $FUNCNAME ] ---" for c in "$@"; do - command -v "$c" &>/dev/null || warn+=("$c") + command -v "$c" >/dev/null 2>&1 || warn+=("$c") done [ "${#warn}" -ne 0 ] && @@ -278,7 +278,7 @@ sys_create_store() # Do not use the --warning option with busybox tar TAROPTS=("-C" "${tmp_path}") - if tar c --warning=no-timestamp -f /dev/null /dev/null >&/dev/null; then + if tar c --warning=no-timestamp -f /dev/null /dev/null >/dev/null 2>&1; then TAROPTS+=("--warning=no-timestamp") fi @@ -311,10 +311,10 @@ sys_create_build_group() if getent group guixbuild >/dev/null 2>&1; then _msg "${INF}group guixbuild already exists" - elif command -v groupadd &>/dev/null; then + elif command -v groupadd >/dev/null 2>&1; then groupadd --system guixbuild _msg "${PAS}group <guixbuild> created" - elif command -v addgroup &>/dev/null; then + elif command -v addgroup >/dev/null 2>&1; then addgroup -S guixbuild _msg "${PAS}group <guixbuild> created" else @@ -331,7 +331,7 @@ sys_create_build_user() NOLOGIN_SHELL="$(command -v nologin)" for i in $(seq -w 1 10); do if getent passwd "guixbuilder${i}" >/dev/null 2>&1; then - if command -v usermod &>/dev/null; then + if command -v usermod >/dev/null 2>&1; then _msg "${INF}user is already in the system, resetting" usermod -g guixbuild -G guixbuild \ -d /var/empty -s "${NOLOGIN_SHELL}" \ @@ -341,13 +341,13 @@ sys_create_build_user() _msg "${ERR}cannot reset user environment, doing nothing" fi else - if command -v useradd &>/dev/null; then + if command -v useradd >/dev/null 2>&1; then useradd -g guixbuild -G guixbuild \ -d /var/empty -s "${NOLOGIN_SHELL}" \ -c "Guix build user $i" --system \ "guixbuilder${i}" _msg "${PAS}user added <guixbuilder${i}>" - elif command -v adduser &>/dev/null; then + elif command -v adduser >/dev/null 2>&1; then adduser -G guixbuild -h /var/empty -s "${NOLOGIN_SHELL}" \ -H -S "guixbuilder${i}" _msg "${PAS}user added <guixbuilder${i}>" -- 2.26.2 ^ permalink raw reply related [flat|nested] 77+ messages in thread
* [bug#40601] [PATCH 20/28] Add missing variable quoting & curly-bracketing for dl_path 2020-05-17 17:16 ` [bug#40601] [PATCH 01/28] nix/local.mk: Add missing comment to sysvinit section Vincent Legoll ` (17 preceding siblings ...) 2020-05-17 17:17 ` [bug#40601] [PATCH 19/28] Remove &> and >& bashisms Vincent Legoll @ 2020-05-17 17:17 ` Vincent Legoll 2020-05-17 17:17 ` [bug#40601] [PATCH 21/28] Remove unused variable Vincent Legoll ` (8 subsequent siblings) 27 siblings, 0 replies; 77+ messages in thread From: Vincent Legoll @ 2020-05-17 17:17 UTC (permalink / raw) To: 40601; +Cc: Vincent Legoll --- etc/guix-install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index 5b82999bc5..7616f3b82f 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -249,7 +249,7 @@ guix_get_bin() wget --help | grep -q '\--show-progress' && \ _PROGRESS_OPT="-q --show-progress" || _PROGRESS_OPT="" - wget $_PROGRESS_OPT -P "$dl_path" "${url}/${bin_ver}.tar.xz" "${url}/${bin_ver}.tar.xz.sig" + wget $_PROGRESS_OPT -P "${dl_path}" "${url}/${bin_ver}.tar.xz" "${url}/${bin_ver}.tar.xz.sig" if [[ "$?" -eq 0 ]]; then _msg "${PAS}download completed." @@ -258,7 +258,7 @@ guix_get_bin() exit 1 fi - pushd $dl_path >/dev/null + pushd "${dl_path}" >/dev/null gpg --verify "${bin_ver}.tar.xz.sig" >/dev/null 2>&1 if [[ "$?" -eq 0 ]]; then _msg "${PAS}Signature is valid." -- 2.26.2 ^ permalink raw reply related [flat|nested] 77+ messages in thread
* [bug#40601] [PATCH 21/28] Remove unused variable 2020-05-17 17:16 ` [bug#40601] [PATCH 01/28] nix/local.mk: Add missing comment to sysvinit section Vincent Legoll ` (18 preceding siblings ...) 2020-05-17 17:17 ` [bug#40601] [PATCH 20/28] Add missing variable quoting & curly-bracketing for dl_path Vincent Legoll @ 2020-05-17 17:17 ` Vincent Legoll 2020-05-17 17:17 ` [bug#40601] [PATCH 22/28] Remove local bashisms Vincent Legoll ` (7 subsequent siblings) 27 siblings, 0 replies; 77+ messages in thread From: Vincent Legoll @ 2020-05-17 17:17 UTC (permalink / raw) To: 40601; +Cc: Vincent Legoll --- etc/guix-install.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index 7616f3b82f..078081c08a 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -119,16 +119,12 @@ chk_gpg_keyring() chk_term() { # Check for ANSI terminal for color printing. - local ansi_term - if [ -t 2 ]; then if [ "${TERM+set}" = 'set' ]; then case "$TERM" in xterm*|rxvt*|urxvt*|linux*|vt*|eterm*|screen*) - ansi_term=true ;; *) - ansi_term=false ERR="[ FAIL ] " PAS="[ PASS ] " ;; -- 2.26.2 ^ permalink raw reply related [flat|nested] 77+ messages in thread
* [bug#40601] [PATCH 22/28] Remove local bashisms 2020-05-17 17:16 ` [bug#40601] [PATCH 01/28] nix/local.mk: Add missing comment to sysvinit section Vincent Legoll ` (19 preceding siblings ...) 2020-05-17 17:17 ` [bug#40601] [PATCH 21/28] Remove unused variable Vincent Legoll @ 2020-05-17 17:17 ` Vincent Legoll 2020-05-17 17:17 ` [bug#40601] [PATCH 23/28] Remove $UID bashism Vincent Legoll ` (6 subsequent siblings) 27 siblings, 0 replies; 77+ messages in thread From: Vincent Legoll @ 2020-05-17 17:17 UTC (permalink / raw) To: 40601; +Cc: Vincent Legoll --- etc/guix-install.sh | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index 078081c08a..c7144288c9 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -89,7 +89,6 @@ _debug() chk_require() { # Check that every required command is available. declare -a warn - local c _debug "--- [ $FUNCNAME ] ---" @@ -163,24 +162,22 @@ chk_init_sys() chk_sys_arch() { # Check for operating system and architecture type. - local os - local arch os="$(uname -s)" arch="$(uname -m)" case "$arch" in i386 | i486 | i686 | i786 | x86) - local arch=i686 + arch=i686 ;; x86_64 | x86-64 | x64 | amd64) - local arch=x86_64 + arch=x86_64 ;; aarch64) - local arch=aarch64 + arch=aarch64 ;; armv7l) - local arch=armhf + arch=armhf ;; *) _err "${ERR}Unsupported CPU type: ${arch}" @@ -189,7 +186,7 @@ chk_sys_arch() case "$os" in Linux | linux) - local os=linux + os=linux ;; *) _err "${ERR}Your operation system (${os}) is not supported." @@ -204,10 +201,7 @@ chk_sys_arch() guix_get_bin_list() { # Scan GNU archive and save list of binaries - local gnu_url="$1" - local -a bin_ver_ls - local latest_ver - local default_ver + gnu_url="$1" _debug "--- [ $FUNCNAME ] ---" @@ -235,9 +229,9 @@ guix_get_bin_list() guix_get_bin() { # Download and verify binary package. - local url="$1" - local bin_ver="$2" - local dl_path="$3" + url="$1" + bin_ver="$2" + dl_path="$3" _debug "--- [ $FUNCNAME ] ---" @@ -267,8 +261,8 @@ guix_get_bin() sys_create_store() { # Unpack and install /gnu/store and /var/guix - local pkg="$1" - local tmp_path="$2" + pkg="$1" + tmp_path="$2" _debug "--- [ $FUNCNAME ] ---" @@ -426,10 +420,6 @@ sys_enable_guix_daemon() sys_make_guix_available() { # add guix into PATH - local info_path - local local_bin - local var_guix - _debug "--- [ $FUNCNAME ] ---" info_path="/usr/local/share/info" @@ -559,7 +549,6 @@ handle_args() main() { - local tmp_path handle_args "$@" [ "${_INTERACTIVE}" -eq 1 ] && welcome -- 2.26.2 ^ permalink raw reply related [flat|nested] 77+ messages in thread
* [bug#40601] [PATCH 23/28] Remove $UID bashism 2020-05-17 17:16 ` [bug#40601] [PATCH 01/28] nix/local.mk: Add missing comment to sysvinit section Vincent Legoll ` (20 preceding siblings ...) 2020-05-17 17:17 ` [bug#40601] [PATCH 22/28] Remove local bashisms Vincent Legoll @ 2020-05-17 17:17 ` Vincent Legoll 2020-05-17 17:17 ` [bug#40601] [PATCH 24/28] Remove some "[[" bashisms Vincent Legoll ` (5 subsequent siblings) 27 siblings, 0 replies; 77+ messages in thread From: Vincent Legoll @ 2020-05-17 17:17 UTC (permalink / raw) To: 40601; +Cc: Vincent Legoll --- etc/guix-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index c7144288c9..431790709a 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -30,7 +30,7 @@ fi set -e -[ "$UID" -eq 0 ] || { echo "This script must be run as root."; exit 1; } +[ "$(id -u)" -eq 0 ] || { echo "This script must be run as root."; exit 1; } # groupadd, useradd, usermod, adduser, addgroup are handled in: # sys_create_build_user & sys_create_build_group functions. -- 2.26.2 ^ permalink raw reply related [flat|nested] 77+ messages in thread
* [bug#40601] [PATCH 24/28] Remove some "[[" bashisms 2020-05-17 17:16 ` [bug#40601] [PATCH 01/28] nix/local.mk: Add missing comment to sysvinit section Vincent Legoll ` (21 preceding siblings ...) 2020-05-17 17:17 ` [bug#40601] [PATCH 23/28] Remove $UID bashism Vincent Legoll @ 2020-05-17 17:17 ` Vincent Legoll 2020-05-17 17:17 ` [bug#40601] [PATCH 25/28] Remove unused variable set by "read" Vincent Legoll ` (4 subsequent siblings) 27 siblings, 0 replies; 77+ messages in thread From: Vincent Legoll @ 2020-05-17 17:17 UTC (permalink / raw) To: 40601; +Cc: Vincent Legoll --- etc/guix-install.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index 431790709a..cd33bf55bf 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -216,7 +216,7 @@ guix_get_bin_list() default_ver="guix-binary-${latest_ver}.${ARCH_OS}" - if [[ "${#bin_ver_ls}" -ne "0" ]]; then + if [ "${#bin_ver_ls}" -ne 0 ]; then _msg "${PAS}Release for your system: ${default_ver}" else _err "${ERR}Could not obtain list of Guix releases." @@ -241,7 +241,7 @@ guix_get_bin() _PROGRESS_OPT="-q --show-progress" || _PROGRESS_OPT="" wget $_PROGRESS_OPT -P "${dl_path}" "${url}/${bin_ver}.tar.xz" "${url}/${bin_ver}.tar.xz.sig" - if [[ "$?" -eq 0 ]]; then + if [ "$?" -eq 0 ]; then _msg "${PAS}download completed." else _err "${ERR}could not download ${url}/${bin_ver}.tar.xz." @@ -250,7 +250,7 @@ guix_get_bin() pushd "${dl_path}" >/dev/null gpg --verify "${bin_ver}.tar.xz.sig" >/dev/null 2>&1 - if [[ "$?" -eq 0 ]]; then + if [ "$?" -eq 0 ]; then _msg "${PAS}Signature is valid." popd >/dev/null else @@ -275,7 +275,7 @@ sys_create_store() tar x -f "${pkg}" "${TAROPTS[@]}" && _msg "${PAS}unpacked archive" - if [[ -e "/var/guix" || -e "/gnu" ]]; then + if [ -e "/var/guix" ] || [ -e "/gnu" ]; then _err "${ERR}A previous Guix installation was found. Refusing to overwrite." exit 1 else -- 2.26.2 ^ permalink raw reply related [flat|nested] 77+ messages in thread
* [bug#40601] [PATCH 25/28] Remove unused variable set by "read" 2020-05-17 17:16 ` [bug#40601] [PATCH 01/28] nix/local.mk: Add missing comment to sysvinit section Vincent Legoll ` (22 preceding siblings ...) 2020-05-17 17:17 ` [bug#40601] [PATCH 24/28] Remove some "[[" bashisms Vincent Legoll @ 2020-05-17 17:17 ` Vincent Legoll 2020-05-17 17:17 ` [bug#40601] [PATCH 26/28] Add _debug_func() helper function Vincent Legoll ` (3 subsequent siblings) 27 siblings, 0 replies; 77+ messages in thread From: Vincent Legoll @ 2020-05-17 17:17 UTC (permalink / raw) To: 40601; +Cc: Vincent Legoll --- etc/guix-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index cd33bf55bf..38f61de2f7 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -514,7 +514,7 @@ This script installs GNU Guix on your system https://www.gnu.org/software/guix/ EOF echo -n "Press return to continue..." - read -r ANSWER + read -r } # Do not change the tabs in the HERE-DOCUMENT -- 2.26.2 ^ permalink raw reply related [flat|nested] 77+ messages in thread
* [bug#40601] [PATCH 26/28] Add _debug_func() helper function 2020-05-17 17:16 ` [bug#40601] [PATCH 01/28] nix/local.mk: Add missing comment to sysvinit section Vincent Legoll ` (23 preceding siblings ...) 2020-05-17 17:17 ` [bug#40601] [PATCH 25/28] Remove unused variable set by "read" Vincent Legoll @ 2020-05-17 17:17 ` Vincent Legoll 2020-05-17 17:17 ` [bug#40601] [PATCH 27/28] Fix variable use in guix_get_bin_list() Vincent Legoll ` (2 subsequent siblings) 27 siblings, 0 replies; 77+ messages in thread From: Vincent Legoll @ 2020-05-17 17:17 UTC (permalink / raw) To: 40601; +Cc: Vincent Legoll --- etc/guix-install.sh | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index 38f61de2f7..4ee350a155 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -85,12 +85,17 @@ _debug() fi } +_debug_func() +{ + # Display _debug_func() caller's function name + _debug "--- [ ${FUNCNAME[1]} ] ---" +} chk_require() { # Check that every required command is available. declare -a warn - _debug "--- [ $FUNCNAME ] ---" + _debug_func for c in "$@"; do command -v "$c" >/dev/null 2>&1 || warn+=("$c") @@ -105,7 +110,7 @@ chk_require() chk_gpg_keyring() { # Check whether the Guix release signing public key is present. - _debug "--- [ $FUNCNAME ] ---" + _debug_func # Without --dry-run this command will create a ~/.gnupg owned by root on # systems where gpg has never been used, causing errors and confusion. @@ -203,7 +208,7 @@ guix_get_bin_list() { # Scan GNU archive and save list of binaries gnu_url="$1" - _debug "--- [ $FUNCNAME ] ---" + _debug_func # Filter only version and architecture bin_ver_ls=("$(wget -qO- "$gnu_url" \ @@ -233,7 +238,7 @@ guix_get_bin() bin_ver="$2" dl_path="$3" - _debug "--- [ $FUNCNAME ] ---" + _debug_func _msg "${INF}Downloading Guix release archive" @@ -264,7 +269,7 @@ sys_create_store() pkg="$1" tmp_path="$2" - _debug "--- [ $FUNCNAME ] ---" + _debug_func # Do not use the --warning option with busybox tar TAROPTS=("-C" "${tmp_path}") @@ -297,7 +302,7 @@ sys_create_store() sys_create_build_group() { # Create the group for build users. - _debug "--- [ $FUNCNAME ] ---" + _debug_func if getent group guixbuild >/dev/null 2>&1; then _msg "${INF}group guixbuild already exists" @@ -316,7 +321,7 @@ sys_create_build_group() sys_create_build_user() { # Create the user accounts for build users. - _debug "--- [ $FUNCNAME ] ---" + _debug_func NOLOGIN_SHELL="$(command -v nologin)" for i in $(seq -w 1 10); do @@ -352,7 +357,7 @@ sys_create_build_user() sys_enable_guix_daemon() { # Run the daemon, and set it to automatically start on boot. - _debug "--- [ $FUNCNAME ] ---" + _debug_func case "$INIT_SYS" in upstart) @@ -420,7 +425,7 @@ sys_enable_guix_daemon() sys_make_guix_available() { # add guix into PATH - _debug "--- [ $FUNCNAME ] ---" + _debug_func info_path="/usr/local/share/info" local_bin="/usr/local/bin" -- 2.26.2 ^ permalink raw reply related [flat|nested] 77+ messages in thread
* [bug#40601] [PATCH 27/28] Fix variable use in guix_get_bin_list() 2020-05-17 17:16 ` [bug#40601] [PATCH 01/28] nix/local.mk: Add missing comment to sysvinit section Vincent Legoll ` (24 preceding siblings ...) 2020-05-17 17:17 ` [bug#40601] [PATCH 26/28] Add _debug_func() helper function Vincent Legoll @ 2020-05-17 17:17 ` Vincent Legoll 2020-05-17 17:17 ` [bug#40601] [PATCH 28/28] Remove "[[" bashisms in chk_init_sys() Vincent Legoll 2020-05-23 12:36 ` [bug#40601] [PATCH 01/28] nix/local.mk: Add missing comment to sysvinit section Tobias Geerinckx-Rice via Guix-patches via 27 siblings, 0 replies; 77+ messages in thread From: Vincent Legoll @ 2020-05-17 17:17 UTC (permalink / raw) To: 40601; +Cc: Vincent Legoll - Add missing curly-brackets - Add implicit array zero-indexing --- etc/guix-install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index 4ee350a155..be2fd74905 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -215,7 +215,7 @@ guix_get_bin_list() | sed -n -e 's/.*guix-binary-\([0-9.]*\)\..*.tar.xz.*/\1/p' \ | sort -Vu)") - latest_ver="$(echo "$bin_ver_ls" \ + latest_ver="$(echo "${bin_ver_ls[0]}" \ | grep -oE "([0-9]{1,2}\.){2}[0-9]{1,2}" \ | tail -n1)" @@ -229,7 +229,7 @@ guix_get_bin_list() fi # Use default to download according to the list and local ARCH_OS. - BIN_VER="$default_ver" + BIN_VER="${default_ver}" } guix_get_bin() -- 2.26.2 ^ permalink raw reply related [flat|nested] 77+ messages in thread
* [bug#40601] [PATCH 28/28] Remove "[[" bashisms in chk_init_sys() 2020-05-17 17:16 ` [bug#40601] [PATCH 01/28] nix/local.mk: Add missing comment to sysvinit section Vincent Legoll ` (25 preceding siblings ...) 2020-05-17 17:17 ` [bug#40601] [PATCH 27/28] Fix variable use in guix_get_bin_list() Vincent Legoll @ 2020-05-17 17:17 ` Vincent Legoll 2020-05-23 12:36 ` [bug#40601] [PATCH 01/28] nix/local.mk: Add missing comment to sysvinit section Tobias Geerinckx-Rice via Guix-patches via 27 siblings, 0 replies; 77+ messages in thread From: Vincent Legoll @ 2020-05-17 17:17 UTC (permalink / raw) To: 40601; +Cc: Vincent Legoll --- etc/guix-install.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index be2fd74905..45b4c4b720 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -139,23 +139,23 @@ chk_term() chk_init_sys() { # Return init system type name. - if [[ $(/sbin/init --version 2>/dev/null) =~ upstart ]]; then + if /sbin/init --version 2>/dev/null | grep -q upstart; then _msg "${INF}init system is: upstart" INIT_SYS="upstart" return 0 - elif [[ $(systemctl 2>/dev/null) =~ -\.mount ]]; then + elif systemctl 2>/dev/null | grep -q -- -\.mount; then _msg "${INF}init system is: systemd" INIT_SYS="systemd" return 0 - elif [[ $(rc -V 2>/dev/null) =~ OpenRC ]]; then + elif rc -V 2>/dev/null | grep -q OpenRC; then _msg "${INF}init system is: openrc" INIT_SYS="openrc" return 0 - elif [[ -f /etc/init.d/cron && ! -h /etc/init.d/cron ]]; then + elif [ -f /etc/init.d/cron ] && [ ! -h /etc/init.d/cron ]; then _msg "${INF}init system is: sysv-init" INIT_SYS="sysv-init" return 0 - elif [[ -d /etc/sv ]]; then + elif [ -d /etc/sv ]; then _msg "${INF}init system is: runit" INIT_SYS="runit" return 0 -- 2.26.2 ^ permalink raw reply related [flat|nested] 77+ messages in thread
* [bug#40601] [PATCH 01/28] nix/local.mk: Add missing comment to sysvinit section. 2020-05-17 17:16 ` [bug#40601] [PATCH 01/28] nix/local.mk: Add missing comment to sysvinit section Vincent Legoll ` (26 preceding siblings ...) 2020-05-17 17:17 ` [bug#40601] [PATCH 28/28] Remove "[[" bashisms in chk_init_sys() Vincent Legoll @ 2020-05-23 12:36 ` Tobias Geerinckx-Rice via Guix-patches via 27 siblings, 0 replies; 77+ messages in thread From: Tobias Geerinckx-Rice via Guix-patches via @ 2020-05-23 12:36 UTC (permalink / raw) To: Vincent Legoll; +Cc: 40601 [-- Attachment #1: Type: text/plain, Size: 104 bytes --] Vincent Legoll 写道: > * nix/local.mk (sysvinit): Add comment. LGTM. Kind regards, T G-R [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 227 bytes --] ^ permalink raw reply [flat|nested] 77+ messages in thread
* [bug#40601] [guix-daemon now working on parabola with openrc] 2020-04-13 16:04 [bug#40601] [PATCH 0/5] Handle runit-based foreign distributions Vincent Legoll ` (2 preceding siblings ...) 2020-05-17 17:16 ` [bug#40601] [PATCH 01/28] nix/local.mk: Add missing comment to sysvinit section Vincent Legoll @ 2020-05-22 13:44 ` jgart--- via Guix-patches via 2020-05-22 18:40 ` Leo Famulari 2020-05-31 20:41 ` [bug#40601] New reduced patchset, the easy bits first Vincent Legoll ` (4 subsequent siblings) 8 siblings, 1 reply; 77+ messages in thread From: jgart--- via Guix-patches via @ 2020-05-22 13:44 UTC (permalink / raw) To: 40601 I have openrc working on parabola with guix-daemon. It successfully registers the following service. #! /sbin/openrc-run description="guix build daemon" command="/var/guix/profiles/per-user/root/current-guix/bin/guix-daemon" command_args="--build-users-group=guixbuild" command_background=true pidfile="/run/guix-daemon.pid" The above is a modification of Vincent's code in order to make it run for me without using the @localstatedir@ variable. If anybody has suggestions, corrections, and incites about this it would be greatly appreciated. I would like to get this working with the packaged version of guix in parabola https://www.parabola.nu/packages/?q=guix since that PKGBUILD does not support openrc currently. It also needs to be updated. ^ permalink raw reply [flat|nested] 77+ messages in thread
* [bug#40601] [guix-daemon now working on parabola with openrc] 2020-05-22 13:44 ` [bug#40601] [guix-daemon now working on parabola with openrc] jgart--- via Guix-patches via @ 2020-05-22 18:40 ` Leo Famulari 0 siblings, 0 replies; 77+ messages in thread From: Leo Famulari @ 2020-05-22 18:40 UTC (permalink / raw) To: 40601 On Fri, May 22, 2020 at 01:44:39PM +0000, jgart--- via Guix-patches via wrote: > I have openrc working on parabola with guix-daemon. It successfully registers the following service. > > #! /sbin/openrc-run > > description="guix build daemon" > command="/var/guix/profiles/per-user/root/current-guix/bin/guix-daemon" > command_args="--build-users-group=guixbuild" > command_background=true > pidfile="/run/guix-daemon.pid" Great! > The above is a modification of Vincent's code in order to make it run for me without using the @localstatedir@ variable. Does it still use the "correct" local state directory? Normally that's '/var/guix' but I'm not sure what Parabola does. > I would like to get this working with the packaged version of guix in parabola https://www.parabola.nu/packages/?q=guix Is it not working now? What remains to be done, aside from updating the packages? ^ permalink raw reply [flat|nested] 77+ messages in thread
* [bug#40601] New reduced patchset, the easy bits first 2020-04-13 16:04 [bug#40601] [PATCH 0/5] Handle runit-based foreign distributions Vincent Legoll ` (3 preceding siblings ...) 2020-05-22 13:44 ` [bug#40601] [guix-daemon now working on parabola with openrc] jgart--- via Guix-patches via @ 2020-05-31 20:41 ` Vincent Legoll 2020-12-18 12:28 ` Christopher Baines 2020-05-31 20:42 ` [bug#40601] [PATCH 1/7] guix-install.sh: Remove "[[" bashisms in chk_init_sys() Vincent Legoll ` (3 subsequent siblings) 8 siblings, 1 reply; 77+ messages in thread From: Vincent Legoll @ 2020-05-31 20:41 UTC (permalink / raw) To: 40601, Tobias Geerinckx-Rice Hello, The patch series is becoming long. So here is a batch of fairly easy ones, to lighten it a bit. -- Vincent Legoll ^ permalink raw reply [flat|nested] 77+ messages in thread
* [bug#40601] New reduced patchset, the easy bits first 2020-05-31 20:41 ` [bug#40601] New reduced patchset, the easy bits first Vincent Legoll @ 2020-12-18 12:28 ` Christopher Baines 2020-12-18 19:35 ` Vincent Legoll 0 siblings, 1 reply; 77+ messages in thread From: Christopher Baines @ 2020-12-18 12:28 UTC (permalink / raw) To: Vincent Legoll; +Cc: 40601 [-- Attachment #1: Type: text/plain, Size: 773 bytes --] Vincent Legoll <vincent.legoll@gmail.com> writes: > Hello, > > The patch series is becoming long. So here is a batch of fairly easy > ones, to lighten it a bit. Hi, Sorry for the delays in reviewing this. Thanks for sending a smaller set of patches, that makes reviewing easier. I made some tweaks, and pushed 4 commits to master as d2532317d136ac063a24baeec6688ea0e0ebe37b. I'm not sure about the bashisms stuff, given the script seems to depend on bash (see the exec bash bit at the start), I think using bash functionality is reasonable. What was your motivation behind these changes? (sorry if I've missed this earlier in the thread). Maybe once we've talked about the bashisms stuff, would you be able to send another set of patches for review? Thanks, Chris [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 987 bytes --] ^ permalink raw reply [flat|nested] 77+ messages in thread
* [bug#40601] New reduced patchset, the easy bits first 2020-12-18 12:28 ` Christopher Baines @ 2020-12-18 19:35 ` Vincent Legoll 2020-12-20 17:30 ` Vincent Legoll 0 siblings, 1 reply; 77+ messages in thread From: Vincent Legoll @ 2020-12-18 19:35 UTC (permalink / raw) To: Christopher Baines; +Cc: 40601 Hello, > Thanks for sending a smaller set of patches, that makes reviewing > easier. I made some tweaks, and pushed 4 commits to master as > d2532317d136ac063a24baeec6688ea0e0ebe37b. Thanks for taking care of this, I'll have a look. > I'm not sure about the bashisms stuff, given the script seems to depend > on bash (see the exec bash bit at the start), I think using bash > functionality is reasonable. What was your motivation behind these > changes? (sorry if I've missed this earlier in the thread). Some distributions that I intended to add support for don't default to bash (nor have it installed by default). I think this script should aim for the broadest possible support, but that is only my opinion. And the patch set was not finished, I wanted to tackle the low hanging fruits first (also to test the interest from the guix team before doing too much). > Maybe once we've talked about the bashisms stuff, would you be able to > send another set of patches for review? I'll try to revive the patch set, and submit other portions I should have lying somewhere. Tchuss -- Vincent Legoll ^ permalink raw reply [flat|nested] 77+ messages in thread
* [bug#40601] New reduced patchset, the easy bits first 2020-12-18 19:35 ` Vincent Legoll @ 2020-12-20 17:30 ` Vincent Legoll 0 siblings, 0 replies; 77+ messages in thread From: Vincent Legoll @ 2020-12-20 17:30 UTC (permalink / raw) To: Christopher Baines; +Cc: 40601 I rebased and sent the next batch On Fri, Dec 18, 2020 at 8:35 PM Vincent Legoll <vincent.legoll@gmail.com> wrote: > > Hello, > > > Thanks for sending a smaller set of patches, that makes reviewing > > easier. I made some tweaks, and pushed 4 commits to master as > > d2532317d136ac063a24baeec6688ea0e0ebe37b. > > Thanks for taking care of this, I'll have a look. > > > I'm not sure about the bashisms stuff, given the script seems to depend > > on bash (see the exec bash bit at the start), I think using bash > > functionality is reasonable. What was your motivation behind these > > changes? (sorry if I've missed this earlier in the thread). > > Some distributions that I intended to add support for don't default to bash > (nor have it installed by default). I think this script should aim for > the broadest > possible support, but that is only my opinion. > > And the patch set was not finished, I wanted to tackle the low hanging fruits > first (also to test the interest from the guix team before doing too much). > > > Maybe once we've talked about the bashisms stuff, would you be able to > > send another set of patches for review? > > I'll try to revive the patch set, and submit other portions I should have lying > somewhere. > > Tchuss > > -- > Vincent Legoll -- Vincent Legoll ^ permalink raw reply [flat|nested] 77+ messages in thread
* [bug#40601] [PATCH 1/7] guix-install.sh: Remove "[[" bashisms in chk_init_sys(). 2020-04-13 16:04 [bug#40601] [PATCH 0/5] Handle runit-based foreign distributions Vincent Legoll ` (4 preceding siblings ...) 2020-05-31 20:41 ` [bug#40601] New reduced patchset, the easy bits first Vincent Legoll @ 2020-05-31 20:42 ` Vincent Legoll 2020-05-31 20:42 ` [bug#40601] [PATCH 2/7] guix-install.sh: Remove $UID bashism Vincent Legoll ` (5 more replies) 2020-10-07 16:09 ` [bug#40601] [PATCH 0/5] Handle runit-based foreign distributions zimoun ` (2 subsequent siblings) 8 siblings, 6 replies; 77+ messages in thread From: Vincent Legoll @ 2020-05-31 20:42 UTC (permalink / raw) To: 40601; +Cc: Vincent Legoll * etc/guix-install.sh (chk_init_sys): Use `if something | grep' instead of "[[" pattern matching. --- etc/guix-install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index bf15aede21..455e021684 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -138,11 +138,11 @@ chk_term() chk_init_sys() { # Return init system type name. - if [[ $(/sbin/init --version 2>/dev/null) =~ upstart ]]; then + if /sbin/init --version 2>/dev/null | grep -q upstart; then _msg "${INF}init system is: upstart" INIT_SYS="upstart" return 0 - elif [[ $(systemctl 2>/dev/null) =~ -\.mount ]]; then + elif systemctl 2>/dev/null | grep -q -- -\.mount; then _msg "${INF}init system is: systemd" INIT_SYS="systemd" return 0 -- 2.26.2 ^ permalink raw reply related [flat|nested] 77+ messages in thread
* [bug#40601] [PATCH 2/7] guix-install.sh: Remove $UID bashism. 2020-05-31 20:42 ` [bug#40601] [PATCH 1/7] guix-install.sh: Remove "[[" bashisms in chk_init_sys() Vincent Legoll @ 2020-05-31 20:42 ` Vincent Legoll 2020-05-31 20:42 ` [bug#40601] [PATCH 3/7] guix-install.sh: Fix requirements Vincent Legoll ` (4 subsequent siblings) 5 siblings, 0 replies; 77+ messages in thread From: Vincent Legoll @ 2020-05-31 20:42 UTC (permalink / raw) To: 40601; +Cc: Vincent Legoll * etc/guix-install.sh: Use `id -u' instead of $UID. --- etc/guix-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index 455e021684..0d7a8c8d44 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -29,7 +29,7 @@ fi set -e -[ "$UID" -eq 0 ] || { echo "This script must be run as root."; exit 1; } +[ "$(id -u)" -eq 0 ] || { echo "This script must be run as root."; exit 1; } REQUIRE=( "dirname" -- 2.26.2 ^ permalink raw reply related [flat|nested] 77+ messages in thread
* [bug#40601] [PATCH 3/7] guix-install.sh: Fix requirements. 2020-05-31 20:42 ` [bug#40601] [PATCH 1/7] guix-install.sh: Remove "[[" bashisms in chk_init_sys() Vincent Legoll 2020-05-31 20:42 ` [bug#40601] [PATCH 2/7] guix-install.sh: Remove $UID bashism Vincent Legoll @ 2020-05-31 20:42 ` Vincent Legoll 2020-05-31 20:42 ` [bug#40601] [PATCH 4/7] guix-install.sh: trivial whitespace fix Vincent Legoll ` (3 subsequent siblings) 5 siblings, 0 replies; 77+ messages in thread From: Vincent Legoll @ 2020-05-31 20:42 UTC (permalink / raw) To: 40601; +Cc: Vincent Legoll There's no usage of "tr" in the script, whereas tar is used. * etc/guix-install.sh (REQUIRE): Change tr to tar, add ln, remove readlink & dirname. --- etc/guix-install.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index 0d7a8c8d44..28fcf831c5 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -32,8 +32,6 @@ set -e [ "$(id -u)" -eq 0 ] || { echo "This script must be run as root."; exit 1; } REQUIRE=( - "dirname" - "readlink" "wget" "gpg" "grep" @@ -41,13 +39,14 @@ REQUIRE=( "sed" "sort" "getent" + "ln" "mktemp" "rm" "chmod" "uname" "groupadd" "tail" - "tr" + "tar" "xz" ) -- 2.26.2 ^ permalink raw reply related [flat|nested] 77+ messages in thread
* [bug#40601] [PATCH 4/7] guix-install.sh: trivial whitespace fix. 2020-05-31 20:42 ` [bug#40601] [PATCH 1/7] guix-install.sh: Remove "[[" bashisms in chk_init_sys() Vincent Legoll 2020-05-31 20:42 ` [bug#40601] [PATCH 2/7] guix-install.sh: Remove $UID bashism Vincent Legoll 2020-05-31 20:42 ` [bug#40601] [PATCH 3/7] guix-install.sh: Fix requirements Vincent Legoll @ 2020-05-31 20:42 ` Vincent Legoll 2020-05-31 20:42 ` [bug#40601] [PATCH 5/7] guix-install.sh: Add variable quoting in sys_make_guix_available Vincent Legoll ` (2 subsequent siblings) 5 siblings, 0 replies; 77+ messages in thread From: Vincent Legoll @ 2020-05-31 20:42 UTC (permalink / raw) To: 40601; +Cc: Vincent Legoll Almost the entire file is indented with spaces, a few tabs slipped in, clean them up. Checked triviality with git diff -b. * etc/guix-install.sh(chk_sys_arch): Replace tabs with spaces. (sys_enable_guix_daemon): Likewise. --- etc/guix-install.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index 28fcf831c5..14616f790b 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -173,9 +173,9 @@ chk_sys_arch() aarch64) local arch=aarch64 ;; - armv7l) - local arch=armhf - ;; + armv7l) + local arch=armhf + ;; *) _err "${ERR}Unsupported CPU type: ${arch}" exit 1 @@ -355,15 +355,15 @@ sys_enable_guix_daemon() /etc/systemd/system/; chmod 664 /etc/systemd/system/guix-daemon.service; - # Work around <https://bugs.gnu.org/36074>, present in 1.0.1. - sed -i /etc/systemd/system/guix-daemon.service \ - -e "s/GUIX_LOCPATH='/'GUIX_LOCPATH=/"; + # Work around <https://bugs.gnu.org/36074>, present in 1.0.1. + sed -i /etc/systemd/system/guix-daemon.service \ + -e "s/GUIX_LOCPATH='/'GUIX_LOCPATH=/"; - # Work around <https://bugs.gnu.org/35671>, present in 1.0.1. - if ! grep en_US /etc/systemd/system/guix-daemon.service >/dev/null; - then sed -i /etc/systemd/system/guix-daemon.service \ - -e 's/^Environment=\(.*\)$/Environment=\1 LC_ALL=en_US.UTF-8'; - fi; + # Work around <https://bugs.gnu.org/35671>, present in 1.0.1. + if ! grep en_US /etc/systemd/system/guix-daemon.service >/dev/null; + then sed -i /etc/systemd/system/guix-daemon.service \ + -e 's/^Environment=\(.*\)$/Environment=\1 LC_ALL=en_US.UTF-8'; + fi; systemctl daemon-reload && systemctl start gnu-store.mount guix-daemon && -- 2.26.2 ^ permalink raw reply related [flat|nested] 77+ messages in thread
* [bug#40601] [PATCH 5/7] guix-install.sh: Add variable quoting in sys_make_guix_available. 2020-05-31 20:42 ` [bug#40601] [PATCH 1/7] guix-install.sh: Remove "[[" bashisms in chk_init_sys() Vincent Legoll ` (2 preceding siblings ...) 2020-05-31 20:42 ` [bug#40601] [PATCH 4/7] guix-install.sh: trivial whitespace fix Vincent Legoll @ 2020-05-31 20:42 ` Vincent Legoll 2020-05-31 20:42 ` [bug#40601] [PATCH 6/7] guix-install.sh: Fix variable uses in guix_get_bin_list() Vincent Legoll 2020-05-31 20:42 ` [bug#40601] [PATCH 7/7] guix-install.sh: Add missing variable quoting & curly-bracketing in guix_get_bin() Vincent Legoll 5 siblings, 0 replies; 77+ messages in thread From: Vincent Legoll @ 2020-05-31 20:42 UTC (permalink / raw) To: 40601; +Cc: Vincent Legoll * etc/guix-install.sh (sys_make_guix_available): Add variable quoting. --- etc/guix-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index 14616f790b..0e6e6842a1 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -393,7 +393,7 @@ sys_enable_guix_daemon() ln -sf "${var_guix}/bin/guix" "$local_bin" [ -e "$info_path" ] || mkdir -p "$info_path" - for i in ${var_guix}/share/info/*; do + for i in "${var_guix}"/share/info/*; do ln -sf "$i" "$info_path" done } -- 2.26.2 ^ permalink raw reply related [flat|nested] 77+ messages in thread
* [bug#40601] [PATCH 6/7] guix-install.sh: Fix variable uses in guix_get_bin_list(). 2020-05-31 20:42 ` [bug#40601] [PATCH 1/7] guix-install.sh: Remove "[[" bashisms in chk_init_sys() Vincent Legoll ` (3 preceding siblings ...) 2020-05-31 20:42 ` [bug#40601] [PATCH 5/7] guix-install.sh: Add variable quoting in sys_make_guix_available Vincent Legoll @ 2020-05-31 20:42 ` Vincent Legoll 2020-05-31 20:42 ` [bug#40601] [PATCH 7/7] guix-install.sh: Add missing variable quoting & curly-bracketing in guix_get_bin() Vincent Legoll 5 siblings, 0 replies; 77+ messages in thread From: Vincent Legoll @ 2020-05-31 20:42 UTC (permalink / raw) To: 40601; +Cc: Vincent Legoll * etc/guix-install.sh (guix_get_bin_list)[BIN_VER]: Add missing curly-brackets, [latest_ver]: Likewise & add explicit array zero-indexing. --- etc/guix-install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index 0e6e6842a1..7d635c2c38 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -210,7 +210,7 @@ guix_get_bin_list() | sed -n -e 's/.*guix-binary-\([0-9.]*\)\..*.tar.xz.*/\1/p' \ | sort -Vu)") - latest_ver="$(echo "$bin_ver_ls" \ + latest_ver="$(echo "${bin_ver_ls[0]}" \ | grep -oP "([0-9]{1,2}\.){2}[0-9]{1,2}" \ | tail -n1)" @@ -224,7 +224,7 @@ guix_get_bin_list() fi # Use default to download according to the list and local ARCH_OS. - BIN_VER="$default_ver" + BIN_VER="${default_ver}" } guix_get_bin() -- 2.26.2 ^ permalink raw reply related [flat|nested] 77+ messages in thread
* [bug#40601] [PATCH 7/7] guix-install.sh: Add missing variable quoting & curly-bracketing in guix_get_bin(). 2020-05-31 20:42 ` [bug#40601] [PATCH 1/7] guix-install.sh: Remove "[[" bashisms in chk_init_sys() Vincent Legoll ` (4 preceding siblings ...) 2020-05-31 20:42 ` [bug#40601] [PATCH 6/7] guix-install.sh: Fix variable uses in guix_get_bin_list() Vincent Legoll @ 2020-05-31 20:42 ` Vincent Legoll 2020-12-18 11:37 ` Christopher Baines 5 siblings, 1 reply; 77+ messages in thread From: Vincent Legoll @ 2020-05-31 20:42 UTC (permalink / raw) To: 40601; +Cc: Vincent Legoll * etc/guix-install.sh (guix_get_bin)[dl_path]: Add missing variable quoting and curly-bracketing, [_PROGRESS_OPT]: Likewise. --- etc/guix-install.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index 7d635c2c38..f0d4a38838 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -239,7 +239,8 @@ guix_get_bin() wget --help | grep -q '\--show-progress' && \ _PROGRESS_OPT="-q --show-progress" || _PROGRESS_OPT="" - wget $_PROGRESS_OPT -P "$dl_path" "${url}/${bin_ver}.tar.xz" "${url}/${bin_ver}.tar.xz.sig" + wget "${_PROGRESS_OPT}" -P "${dl_path}" "${url}/${bin_ver}.tar.xz" \ + "${url}/${bin_ver}.tar.xz.sig" if [[ "$?" -eq 0 ]]; then _msg "${PAS}download completed." @@ -248,7 +249,7 @@ guix_get_bin() exit 1 fi - pushd $dl_path >/dev/null + pushd "${dl_path}" >/dev/null gpg --verify "${bin_ver}.tar.xz.sig" >/dev/null 2>&1 if [[ "$?" -eq 0 ]]; then _msg "${PAS}Signature is valid." -- 2.26.2 ^ permalink raw reply related [flat|nested] 77+ messages in thread
* [bug#40601] [PATCH 7/7] guix-install.sh: Add missing variable quoting & curly-bracketing in guix_get_bin(). 2020-05-31 20:42 ` [bug#40601] [PATCH 7/7] guix-install.sh: Add missing variable quoting & curly-bracketing in guix_get_bin() Vincent Legoll @ 2020-12-18 11:37 ` Christopher Baines 0 siblings, 0 replies; 77+ messages in thread From: Christopher Baines @ 2020-12-18 11:37 UTC (permalink / raw) To: Vincent Legoll; +Cc: 40601 [-- Attachment #1: Type: text/plain, Size: 1567 bytes --] Vincent Legoll <vincent.legoll@gmail.com> writes: > * etc/guix-install.sh (guix_get_bin)[dl_path]: Add missing variable quoting and > curly-bracketing, [_PROGRESS_OPT]: Likewise. > --- > etc/guix-install.sh | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/etc/guix-install.sh b/etc/guix-install.sh > index 7d635c2c38..f0d4a38838 100755 > --- a/etc/guix-install.sh > +++ b/etc/guix-install.sh > @@ -239,7 +239,8 @@ guix_get_bin() > > wget --help | grep -q '\--show-progress' && \ > _PROGRESS_OPT="-q --show-progress" || _PROGRESS_OPT="" > - wget $_PROGRESS_OPT -P "$dl_path" "${url}/${bin_ver}.tar.xz" "${url}/${bin_ver}.tar.xz.sig" > + wget "${_PROGRESS_OPT}" -P "${dl_path}" "${url}/${bin_ver}.tar.xz" \ > + "${url}/${bin_ver}.tar.xz.sig" I believe the variable quoting here will break the wget command in the case where _PROGRESS_OPT="-q --show-progress" → wget "-q --show-progress" https://guix.gnu.org/ wget: invalid option -- ' ' wget: invalid option -- '-' wget: invalid option -- '-' wget: invalid option -- 's' Usage: wget [OPTION]... [URL]... Try `wget --help' for more options. > if [[ "$?" -eq 0 ]]; then > _msg "${PAS}download completed." > @@ -248,7 +249,7 @@ guix_get_bin() > exit 1 > fi > > - pushd $dl_path >/dev/null > + pushd "${dl_path}" >/dev/null > gpg --verify "${bin_ver}.tar.xz.sig" >/dev/null 2>&1 > if [[ "$?" -eq 0 ]]; then > _msg "${PAS}Signature is valid." [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 987 bytes --] ^ permalink raw reply [flat|nested] 77+ messages in thread
* [bug#40601] [PATCH 0/5] Handle runit-based foreign distributions 2020-04-13 16:04 [bug#40601] [PATCH 0/5] Handle runit-based foreign distributions Vincent Legoll ` (5 preceding siblings ...) 2020-05-31 20:42 ` [bug#40601] [PATCH 1/7] guix-install.sh: Remove "[[" bashisms in chk_init_sys() Vincent Legoll @ 2020-10-07 16:09 ` zimoun 2020-12-20 17:28 ` [bug#40601] [PATCH 1/5] guix-install.sh: Remove "[[" bashisms in chk_init_sys() Vincent Legoll 2021-09-02 17:51 ` [bug#40601] guix-daemon runit service on void jgart via Guix-patches via 8 siblings, 0 replies; 77+ messages in thread From: zimoun @ 2020-10-07 16:09 UTC (permalink / raw) To: Vincent Legoll; +Cc: 40601 Dear Vincent, I am working on Bug #43744 and Path #43769 and I hit these patches set. <http://issues.guix.gnu.org/43744> <http://issues.guix.gnu.org/43769> Well, I am a bit lost with the different series and I do not know which are still valid and which are now obsolete. Could you rebase and resent the patch set? And reroll with v5? Thank you in advance. All the best, simon ^ permalink raw reply [flat|nested] 77+ messages in thread
* [bug#40601] [PATCH 1/5] guix-install.sh: Remove "[[" bashisms in chk_init_sys(). 2020-04-13 16:04 [bug#40601] [PATCH 0/5] Handle runit-based foreign distributions Vincent Legoll ` (6 preceding siblings ...) 2020-10-07 16:09 ` [bug#40601] [PATCH 0/5] Handle runit-based foreign distributions zimoun @ 2020-12-20 17:28 ` Vincent Legoll 2020-12-20 17:28 ` [bug#40601] [PATCH 2/5] guix-install.sh: Remove $UID bashism Vincent Legoll ` (3 more replies) 2021-09-02 17:51 ` [bug#40601] guix-daemon runit service on void jgart via Guix-patches via 8 siblings, 4 replies; 77+ messages in thread From: Vincent Legoll @ 2020-12-20 17:28 UTC (permalink / raw) To: 40601; +Cc: Vincent Legoll * etc/guix-install.sh (chk_init_sys): Use `if something | grep' instead of "[[" pattern matching. --- etc/guix-install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index 9015f40bb6..26c8622855 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -143,11 +143,11 @@ chk_term() chk_init_sys() { # Return init system type name. - if [[ $(/sbin/init --version 2>/dev/null) =~ upstart ]]; then + if /sbin/init --version 2>/dev/null | grep -q upstart; then _msg "${INF}init system is: upstart" INIT_SYS="upstart" return 0 - elif [[ $(systemctl 2>/dev/null) =~ -\.mount ]]; then + elif systemctl 2>/dev/null | grep -q -- -\.mount; then _msg "${INF}init system is: systemd" INIT_SYS="systemd" return 0 -- 2.29.2 ^ permalink raw reply related [flat|nested] 77+ messages in thread
* [bug#40601] [PATCH 2/5] guix-install.sh: Remove $UID bashism. 2020-12-20 17:28 ` [bug#40601] [PATCH 1/5] guix-install.sh: Remove "[[" bashisms in chk_init_sys() Vincent Legoll @ 2020-12-20 17:28 ` Vincent Legoll 2020-12-23 12:17 ` Christopher Baines 2020-12-20 17:28 ` [bug#40601] [PATCH 3/5] guix-install.sh: Fix requirements Vincent Legoll ` (2 subsequent siblings) 3 siblings, 1 reply; 77+ messages in thread From: Vincent Legoll @ 2020-12-20 17:28 UTC (permalink / raw) To: 40601; +Cc: Vincent Legoll * etc/guix-install.sh: Use `id -u' instead of $UID. --- etc/guix-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index 26c8622855..0102901010 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -32,7 +32,7 @@ fi set -e -[ "$UID" -eq 0 ] || { echo "This script must be run as root."; exit 1; } +[ "$(id -u)" -eq 0 ] || { echo "This script must be run as root."; exit 1; } REQUIRE=( "dirname" -- 2.29.2 ^ permalink raw reply related [flat|nested] 77+ messages in thread
* [bug#40601] [PATCH 2/5] guix-install.sh: Remove $UID bashism. 2020-12-20 17:28 ` [bug#40601] [PATCH 2/5] guix-install.sh: Remove $UID bashism Vincent Legoll @ 2020-12-23 12:17 ` Christopher Baines 2020-12-23 14:59 ` Vincent Legoll 0 siblings, 1 reply; 77+ messages in thread From: Christopher Baines @ 2020-12-23 12:17 UTC (permalink / raw) To: Vincent Legoll; +Cc: 40601 [-- Attachment #1: Type: text/plain, Size: 636 bytes --] Vincent Legoll <vincent.legoll@gmail.com> writes: > * etc/guix-install.sh: Use `id -u' instead of $UID. > --- > etc/guix-install.sh | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/etc/guix-install.sh b/etc/guix-install.sh > index 26c8622855..0102901010 100755 > --- a/etc/guix-install.sh > +++ b/etc/guix-install.sh > @@ -32,7 +32,7 @@ fi > > set -e > > -[ "$UID" -eq 0 ] || { echo "This script must be run as root."; exit 1; } > +[ "$(id -u)" -eq 0 ] || { echo "This script must be run as root."; exit 1; } > > REQUIRE=( > "dirname" Should id be added as a requirement? [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 987 bytes --] ^ permalink raw reply [flat|nested] 77+ messages in thread
* [bug#40601] [PATCH 2/5] guix-install.sh: Remove $UID bashism. 2020-12-23 12:17 ` Christopher Baines @ 2020-12-23 14:59 ` Vincent Legoll 0 siblings, 0 replies; 77+ messages in thread From: Vincent Legoll @ 2020-12-23 14:59 UTC (permalink / raw) To: Christopher Baines; +Cc: 40601 Hello, On Wed, Dec 23, 2020 at 1:17 PM Christopher Baines <mail@cbaines.net> wrote: > > -[ "$UID" -eq 0 ] || { echo "This script must be run as root."; exit 1; } > > +[ "$(id -u)" -eq 0 ] || { echo "This script must be run as root."; exit 1; } > > > > REQUIRE=( > > "dirname" > > Should id be added as a requirement? good catch ! thanks, I'll respin after this round of feedback -- Vincent Legoll ^ permalink raw reply [flat|nested] 77+ messages in thread
* [bug#40601] [PATCH 3/5] guix-install.sh: Fix requirements. 2020-12-20 17:28 ` [bug#40601] [PATCH 1/5] guix-install.sh: Remove "[[" bashisms in chk_init_sys() Vincent Legoll 2020-12-20 17:28 ` [bug#40601] [PATCH 2/5] guix-install.sh: Remove $UID bashism Vincent Legoll @ 2020-12-20 17:28 ` Vincent Legoll 2020-12-20 17:28 ` [bug#40601] [PATCH 4/5] guix-install.sh: Fix detection of SysV init system Vincent Legoll 2020-12-20 17:28 ` [bug#40601] [PATCH 5/5] guix-install.sh: Check daemonize package presence for sysv-init Vincent Legoll 3 siblings, 0 replies; 77+ messages in thread From: Vincent Legoll @ 2020-12-20 17:28 UTC (permalink / raw) To: 40601; +Cc: Vincent Legoll There's no usage of "tr" in the script, whereas tar is used. * etc/guix-install.sh (REQUIRE): Change tr to tar, add ln, remove readlink & dirname. --- etc/guix-install.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index 0102901010..d40d90b377 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -35,8 +35,6 @@ set -e [ "$(id -u)" -eq 0 ] || { echo "This script must be run as root."; exit 1; } REQUIRE=( - "dirname" - "readlink" "wget" "gpg" "grep" @@ -44,13 +42,14 @@ REQUIRE=( "sed" "sort" "getent" + "ln" "mktemp" "rm" "chmod" "uname" "groupadd" "tail" - "tr" + "tar" "xz" ) -- 2.29.2 ^ permalink raw reply related [flat|nested] 77+ messages in thread
* [bug#40601] [PATCH 4/5] guix-install.sh: Fix detection of SysV init system. 2020-12-20 17:28 ` [bug#40601] [PATCH 1/5] guix-install.sh: Remove "[[" bashisms in chk_init_sys() Vincent Legoll 2020-12-20 17:28 ` [bug#40601] [PATCH 2/5] guix-install.sh: Remove $UID bashism Vincent Legoll 2020-12-20 17:28 ` [bug#40601] [PATCH 3/5] guix-install.sh: Fix requirements Vincent Legoll @ 2020-12-20 17:28 ` Vincent Legoll 2020-12-20 17:28 ` [bug#40601] [PATCH 5/5] guix-install.sh: Check daemonize package presence for sysv-init Vincent Legoll 3 siblings, 0 replies; 77+ messages in thread From: Vincent Legoll @ 2020-12-20 17:28 UTC (permalink / raw) To: 40601; +Cc: Vincent Legoll Checking the presence of a regular file & not symlink (/etc/init.d/cron) is not sufficient. Detect a sysvinit system by running `/sbin/init --version' and checking the output contains the string "SysV". * etc/guix-install.sh (chk_init_sys): fix sysvinit system detection. --- etc/guix-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index d40d90b377..307c42d3fb 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -150,7 +150,7 @@ chk_init_sys() _msg "${INF}init system is: systemd" INIT_SYS="systemd" return 0 - elif [[ -f /etc/init.d/cron && ! -h /etc/init.d/cron ]]; then + elif /sbin/init --version 2>/dev/null | grep -q SysV; then _msg "${INF}init system is: sysv-init" INIT_SYS="sysv-init" return 0 -- 2.29.2 ^ permalink raw reply related [flat|nested] 77+ messages in thread
* [bug#40601] [PATCH 5/5] guix-install.sh: Check daemonize package presence for sysv-init. 2020-12-20 17:28 ` [bug#40601] [PATCH 1/5] guix-install.sh: Remove "[[" bashisms in chk_init_sys() Vincent Legoll ` (2 preceding siblings ...) 2020-12-20 17:28 ` [bug#40601] [PATCH 4/5] guix-install.sh: Fix detection of SysV init system Vincent Legoll @ 2020-12-20 17:28 ` Vincent Legoll 3 siblings, 0 replies; 77+ messages in thread From: Vincent Legoll @ 2020-12-20 17:28 UTC (permalink / raw) To: 40601; +Cc: Vincent Legoll * etc/guix-install.sh (chk_init_sys): Call `chk_require daemonize'. --- etc/guix-install.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index 307c42d3fb..ecc86f3e76 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -153,6 +153,10 @@ chk_init_sys() elif /sbin/init --version 2>/dev/null | grep -q SysV; then _msg "${INF}init system is: sysv-init" INIT_SYS="sysv-init" + chk_require daemonize || { + _err "${ERR}Init system: sysv-init requires the 'daemonize' package." + exit 1 + } return 0 elif [[ $(openrc --version 2>/dev/null) =~ \(OpenRC\) ]]; then _msg "${INF}init system is: OpenRC" -- 2.29.2 ^ permalink raw reply related [flat|nested] 77+ messages in thread
* [bug#40601] guix-daemon runit service on void 2020-04-13 16:04 [bug#40601] [PATCH 0/5] Handle runit-based foreign distributions Vincent Legoll ` (7 preceding siblings ...) 2020-12-20 17:28 ` [bug#40601] [PATCH 1/5] guix-install.sh: Remove "[[" bashisms in chk_init_sys() Vincent Legoll @ 2021-09-02 17:51 ` jgart via Guix-patches via 8 siblings, 0 replies; 77+ messages in thread From: jgart via Guix-patches via @ 2021-09-02 17:51 UTC (permalink / raw) To: 40601 Hi, I just wanted to give some information about me runnning guix on void linux. I get the following error when I try to install with guix-install.sh: [ FAIL ] Init system could not be detected. That's probably to be expected since runit has not been added yet to the guix-install.sh script. Here is the guix-daemon runit service that I currently run on void linux in case it is useful to anyone else: /etc/sv/guix-daemon/run: ``` #!/bin/sh exec /var/guix/profiles/per-user/root/current-guix/bin/guix-daemon --build-users-group=guixbuild --substitute-urls=https://guix.bordeaux.inria.fr 2>&1 ``` Has anyone tried running guix on void linux? If so, are you running something different than above for your runit service? all best, jgart _________________________________________ / 3B1D 7F19 E36B B60C 0F5B 2CA9 A52A A2B4 \ \ 77B6 DD35 / ----------------------------------------- \ ^__^ \ (oo)\_______ (__)\ )\/\ ||----w | || || ^ permalink raw reply [flat|nested] 77+ messages in thread
* bug#39023: binary installation manual doesn't work on Alpine Linux @ 2020-01-07 21:29 symphonia 2020-01-08 12:34 ` Gábor Boskovits ` (2 more replies) 0 siblings, 3 replies; 77+ messages in thread From: symphonia @ 2020-01-07 21:29 UTC (permalink / raw) To: 39023 The commands in https://guix.gnu.org/manual/en/guix.html#Build-Environment-Setup do not work on busybox-based systems such as Alpine Linux by default. This is because they do not have 'groupadd' or 'useradd' by default (from 'shadow' package). # groupadd --system guixbuild # for i in `seq -w 1 10`; do useradd -g guixbuild -G guixbuild \ -d /var/empty -s `which nologin` \ -c "Guix build user $i" --system \ guixbuilder$i; done I suggest adding another example which works by default on busybox. Explanation: -S means 'add system group/user'; -h is 'home directory'; -g is 'GECOS field' Also, Alpine Linux fails to boot if /var/empty is not owned by root, so that needs to be fixed afterward as well. addgroup -S guixbuild for i in `seq -w 1 10`; do adduser -G guixbuild \ -h /var/empty -s `which nologin` \ -g "Guix build user $i" -S \ guixbuilder$i; done chown root:root /var/empty # /var/empty must be owned by root, fix permission after `adduser` modified it ^ permalink raw reply [flat|nested] 77+ messages in thread
* bug#39023: binary installation manual doesn't work on Alpine Linux 2020-01-07 21:29 bug#39023: binary installation manual doesn't work on Alpine Linux symphonia @ 2020-01-08 12:34 ` Gábor Boskovits 2020-01-22 3:53 ` Tobias Geerinckx-Rice via Bug reports for GNU Guix 2020-01-22 1:44 ` bug#39023: adduser/addgroup vs useradd/groupadd zimoun 2020-04-23 11:55 ` [bug#40601] " Vincent Legoll 2 siblings, 1 reply; 77+ messages in thread From: Gábor Boskovits @ 2020-01-08 12:34 UTC (permalink / raw) To: symphonia; +Cc: 39023 Hello, <symphonia@disroot.org> ezt írta (időpont: 2020. jan. 7., K, 22:32): > > The commands in https://guix.gnu.org/manual/en/guix.html#Build-Environment-Setup > do not work on busybox-based systems such as Alpine Linux by default. > This is because they do not have 'groupadd' or 'useradd' by default (from 'shadow' package). > > # groupadd --system guixbuild > # for i in `seq -w 1 10`; > do > useradd -g guixbuild -G guixbuild \ > -d /var/empty -s `which nologin` \ > -c "Guix build user $i" --system \ > guixbuilder$i; > done > > I suggest adding another example which works by default on busybox. > Explanation: -S means 'add system group/user'; -h is 'home directory'; -g is 'GECOS field' > Also, Alpine Linux fails to boot if /var/empty is not owned by root, so that needs to be fixed afterward as well. > > addgroup -S guixbuild > for i in `seq -w 1 10`; > do > adduser -G guixbuild \ > -h /var/empty -s `which nologin` \ > -g "Guix build user $i" -S \ > guixbuilder$i; > done > chown root:root /var/empty # /var/empty must be owned by root, fix permission after `adduser` modified it > > > I assume that the command you gave would work on non-busybox also. I would say we should replace the command we have with this more compatible one. I would wait for a few more responses, though. If that sounds good to you could you create a patch to that effect? Best regards, g_bor -- OpenPGP Key Fingerprint: 7988:3B9F:7D6A:4DBF:3719:0367:2506:A96C:CF63:0B21 ^ permalink raw reply [flat|nested] 77+ messages in thread
* bug#39023: binary installation manual doesn't work on Alpine Linux 2020-01-08 12:34 ` Gábor Boskovits @ 2020-01-22 3:53 ` Tobias Geerinckx-Rice via Bug reports for GNU Guix 2020-01-22 19:42 ` Gábor Boskovits 0 siblings, 1 reply; 77+ messages in thread From: Tobias Geerinckx-Rice via Bug reports for GNU Guix @ 2020-01-22 3:53 UTC (permalink / raw) To: 39023; +Cc: symphonia, Gábor Boskovits [-- Attachment #1: Type: text/plain, Size: 527 bytes --] Gábor, Gábor Boskovits 写道: > <symphonia@disroot.org> ezt írta (időpont: 2020. jan. 7., K, > 22:32): >> I suggest adding another example which works by default on >> busybox. […] >> addgroup -S guixbuild […] > I assume that the command you gave would work on non-busybox > also. I > would say we should replace the > command we have with this more compatible one. It doesn't even work on Guix: nckx@berlin ~$ adduser -bash: adduser: command not found Kind regards, T G-R [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 832 bytes --] ^ permalink raw reply [flat|nested] 77+ messages in thread
* bug#39023: binary installation manual doesn't work on Alpine Linux 2020-01-22 3:53 ` Tobias Geerinckx-Rice via Bug reports for GNU Guix @ 2020-01-22 19:42 ` Gábor Boskovits 2020-01-22 19:58 ` Tobias Geerinckx-Rice via Bug reports for GNU Guix 0 siblings, 1 reply; 77+ messages in thread From: Gábor Boskovits @ 2020-01-22 19:42 UTC (permalink / raw) To: Tobias Geerinckx-Rice; +Cc: symphonia, 39023 Oops, I missed that. Tobias Geerinckx-Rice <me@tobias.gr> ezt írta (időpont: 2020. jan. 22., Sze, 4:53): > > Gábor, > > Gábor Boskovits 写道: > > <symphonia@disroot.org> ezt írta (időpont: 2020. jan. 7., K, > > 22:32): > >> I suggest adding another example which works by default on > >> busybox. > > […] > > >> addgroup -S guixbuild > > […] > > > I assume that the command you gave would work on non-busybox > > also. I > > would say we should replace the > > command we have with this more compatible one. > > It doesn't even work on Guix: > > nckx@berlin ~$ adduser > -bash: adduser: command not found > > Kind regards, > I believe these can be implemented using simple manipulation of config files. Also useradd is part of the linux standard base, while adduser is not. We could add the busybox example, but it might be better to come up with something universal. There was some upstream discussion to get useradd and groupadd to busybox upstream, as this seems to be causing problems everywhere. They told that they are unwilling to include them as is, but would accept a wrapper thar forward to their adduser/addgroup implementation. > T G-R Best regards, g_bor -- OpenPGP Key Fingerprint: 7988:3B9F:7D6A:4DBF:3719:0367:2506:A96C:CF63:0B21 ^ permalink raw reply [flat|nested] 77+ messages in thread
* bug#39023: binary installation manual doesn't work on Alpine Linux 2020-01-22 19:42 ` Gábor Boskovits @ 2020-01-22 19:58 ` Tobias Geerinckx-Rice via Bug reports for GNU Guix 2020-01-22 20:03 ` Gábor Boskovits 0 siblings, 1 reply; 77+ messages in thread From: Tobias Geerinckx-Rice via Bug reports for GNU Guix @ 2020-01-22 19:58 UTC (permalink / raw) To: Gábor Boskovits; +Cc: symphonia, 39023 [-- Attachment #1: Type: text/plain, Size: 1306 bytes --] Gábor, Gábor Boskovits 写道: > Oops, I missed that. I'm suprised I haven't confused add* & *add once so far in this thread :-) > There was some upstream discussion to get useradd and groupadd > to > busybox upstream, > as this seems to be causing problems everywhere. They told that > they > are unwilling to include them as is, > but would accept a wrapper thar forward to their > adduser/addgroup > implementation. I don't know which discussion you're referring to, and much might have changed since 2016, but I read this[0] to mean the opposite: Busybox should provide the shadow-compatible *add variants, and reimplement their old add* as simple wrappers around that. That's from an upstream(ish) person. “adduser/addgroup tend to be symlinks or wrappers, if they exist at all, but by and large are deprecated. busybox should implement applets that mimic shadow here and deprecate the old ones, if not throw them out. although we can probably rename & massage the sources in these cases” Still, Busybox *add patches welcome, it would seem. We'll still have to deal with this for the lifetime of the older version. Kind regards, T G-R [0]: http://lists.busybox.net/pipermail/busybox/2016-February/083909.html [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 832 bytes --] ^ permalink raw reply [flat|nested] 77+ messages in thread
* bug#39023: binary installation manual doesn't work on Alpine Linux 2020-01-22 19:58 ` Tobias Geerinckx-Rice via Bug reports for GNU Guix @ 2020-01-22 20:03 ` Gábor Boskovits 2020-02-19 15:56 ` zimoun 0 siblings, 1 reply; 77+ messages in thread From: Gábor Boskovits @ 2020-01-22 20:03 UTC (permalink / raw) To: Tobias Geerinckx-Rice; +Cc: symphonia, 39023 Tobias Geerinckx-Rice <me@tobias.gr> ezt írta (időpont: 2020. jan. 22., Sze, 20:58): > > Gábor, > > Gábor Boskovits 写道: > > Oops, I missed that. > > I'm suprised I haven't confused add* & *add once so far in this > thread :-) Yes, I am also a bit confused. > > > There was some upstream discussion to get useradd and groupadd > > to > > busybox upstream, > > as this seems to be causing problems everywhere. They told that > > they > > are unwilling to include them as is, > > but would accept a wrapper thar forward to their > > adduser/addgroup > > implementation. > > I don't know which discussion you're referring to, and much might > have changed since 2016, but I read this[0] to mean the opposite: > Busybox should provide the shadow-compatible *add variants, and > reimplement their old add* as simple wrappers around that. That's > from an upstream(ish) person. > > “adduser/addgroup tend to be symlinks or wrappers, if they exist > at > all, but by and large are deprecated. busybox should implement > applets that mimic shadow here and deprecate the old ones, if > not > throw them out. although we can probably rename & massage the > sources in these cases” > > Still, Busybox *add patches welcome, it would seem. We'll still > have to deal with this for the lifetime of the older version. Yes, I referred to this, but I might have misunderstood something. > > Kind regards, > > T G-R > > [0]: > http://lists.busybox.net/pipermail/busybox/2016-February/083909.html -- OpenPGP Key Fingerprint: 7988:3B9F:7D6A:4DBF:3719:0367:2506:A96C:CF63:0B21 ^ permalink raw reply [flat|nested] 77+ messages in thread
* bug#39023: binary installation manual doesn't work on Alpine Linux 2020-01-22 20:03 ` Gábor Boskovits @ 2020-02-19 15:56 ` zimoun 0 siblings, 0 replies; 77+ messages in thread From: zimoun @ 2020-02-19 15:56 UTC (permalink / raw) To: Gábor Boskovits; +Cc: symphonia, 39023 Hi, I am a bit confused. At the end, what is the fix? From my knowledge, 'useradd/groupadd ' are the standard commands. The other ones, not. Personally, I am in favour of the option a/ that is described here [1]: write in the manual in a footnote it should be adapted for the underlining distro, i.e., mention 'adduser/addgroup'. Tobias mentioned [2] an option /d: provide in addition of the existing one a complete example using 'adduser/addgroup'. But then Tobias sent this message [3] explaining that BusyBox is doing wrong. ;-) Which IMHO leads to the option a/. :-) What is the consensus for the bug? [1] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=39023#11 [2] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=39023#17 [3] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=39023#26 All the best, simon ^ permalink raw reply [flat|nested] 77+ messages in thread
* bug#39023: adduser/addgroup vs useradd/groupadd 2020-01-07 21:29 bug#39023: binary installation manual doesn't work on Alpine Linux symphonia 2020-01-08 12:34 ` Gábor Boskovits @ 2020-01-22 1:44 ` zimoun 2020-01-22 4:03 ` Tobias Geerinckx-Rice via Bug reports for GNU Guix 2020-04-23 11:55 ` [bug#40601] " Vincent Legoll 2 siblings, 1 reply; 77+ messages in thread From: zimoun @ 2020-01-22 1:44 UTC (permalink / raw) To: 39023, Gábor Boskovits; +Cc: symphonia Dear, The bug [1] reports that useradd/groupadd are not provided on BusyBox. And for example, they had this discussion [2]. [1] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=39023 [2] http://lists.busybox.net/pipermail/busybox/2016-February/083907.html For example, on Debian, adduser is a Perl script calling useradd under the hood. And the current Guix manual says: << On a GNU/Linux system, a build user pool may be created like this (using Bash syntax and the shadow commands): >> where the parenthesis should be understood as: "adapt to your distribution". Two options: a/ explicitly notice in the parenthesis that the chunk needs to be adapted; mentioning adduser/addgroup instead of useradd/groupadd for example. b/ replace useradd/groupadd by adduser/addgroup using the corresponding options. The option b/ means that 'adduser/addgroup' is more portable (more chance to work on everywhere GNU/linux). I am not convinced. Personally, I am in favor for option a/. What do the *NIX gurus think? All the best, simon ^ permalink raw reply [flat|nested] 77+ messages in thread
* bug#39023: adduser/addgroup vs useradd/groupadd 2020-01-22 1:44 ` bug#39023: adduser/addgroup vs useradd/groupadd zimoun @ 2020-01-22 4:03 ` Tobias Geerinckx-Rice via Bug reports for GNU Guix 2020-01-22 8:31 ` zimoun 0 siblings, 1 reply; 77+ messages in thread From: Tobias Geerinckx-Rice via Bug reports for GNU Guix @ 2020-01-22 4:03 UTC (permalink / raw) To: 39023; +Cc: zimoun [-- Attachment #1: Type: text/plain, Size: 845 bytes --] Hullo Simon, zimoun 写道: > options: > > a/ explicitly notice in the parenthesis that the chunk needs to > be > adapted; mentioning adduser/addgroup instead of useradd/groupadd > for > example. There's also: c/ do nothing, or d/ include the complete code snippet provided by symphonia, but as an ‘out-of-band’ footnote to avoid confusion/blind copy-pasting/distracting the majority of (GNU) users with irrelevant variants. With a/, the user won't know which options to change, or how. They might not understand our ‘useradd’ syntax, and won't have its man page installed. As implied by my reply to Gábor, b/ isn't an option so I've snipped it. I strongly prefer option d/. > What do the *NIX gurus think? GNU's not *NIX! :o) (Nor is it POSIX.) Kind regards, T G-R [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 832 bytes --] ^ permalink raw reply [flat|nested] 77+ messages in thread
* bug#39023: adduser/addgroup vs useradd/groupadd 2020-01-22 4:03 ` Tobias Geerinckx-Rice via Bug reports for GNU Guix @ 2020-01-22 8:31 ` zimoun 0 siblings, 0 replies; 77+ messages in thread From: zimoun @ 2020-01-22 8:31 UTC (permalink / raw) To: Tobias Geerinckx-Rice; +Cc: 39023 Hi Tobias, On Wed, 22 Jan 2020 at 05:03, Tobias Geerinckx-Rice <me@tobias.gr> wrote: > zimoun 写道: > > a/ explicitly notice in the parenthesis that the chunk needs to > > be > > adapted; mentioning adduser/addgroup instead of useradd/groupadd > > for > > example. > > There's also: > > c/ do nothing, or It is not fair, IMHO. :-) > d/ include the complete code snippet provided by symphonia, but > as an ‘out-of-band’ footnote to avoid confusion/blind > copy-pasting/distracting the majority of (GNU) users with > irrelevant variants. Well, mixing the option a/ and b/. :-) - telling explicitly - providing copy/paste-able variant snippet Yes, it is a better option. > With a/, the user won't know which options to change, or how. > They might not understand our ‘useradd’ syntax, and won't have its > man page installed. Yes, and they would not know neither if their foreign distro comes with exotic 'adduser/addgroup'. > As implied by my reply to Gábor, b/ isn't an option so I've > snipped it. Yes, it is my assumption --based on my small experience-- that 'adduser/addgroup' is less portable than 'useradd/groupadd'. > I strongly prefer option d/. Let go to this one. :-) Hum? let see I am able to include the complete code snippet as an footnote using Texinfo... (Maybe someone will beat me. :-) > > What do the *NIX gurus think? > > GNU's not *NIX! :o) (Nor is it POSIX.) Héhé! Schrödinger's distro: by installing Guix on your foreign *NIX distro, the user will have in the same time "not *NIX" and *NIX. ;-) (Even if *NIX needs to run linux which mitigate the joke. :-)) ^ permalink raw reply [flat|nested] 77+ messages in thread
* bug#39023: binary installation manual doesn't work on Alpine Linux 2020-04-13 16:04 [bug#40601] [PATCH 0/5] Handle runit-based foreign distributions Vincent Legoll @ 2020-04-23 11:55 ` Vincent Legoll 2020-05-17 17:15 ` [bug#40601] [RFC, PATCH 0/28] guix-install.sh: port to other distros & init systems Vincent Legoll ` (7 subsequent siblings) 8 siblings, 0 replies; 77+ messages in thread From: Vincent Legoll @ 2020-04-23 11:55 UTC (permalink / raw) To: 39023; +Cc: symphonia, 40601 Hello, as I had been working on the installer lately [1], I tried to tackle this bug also, I have it mostly working. I added support for openrc-based init systems. I opted to support both adduser & useradd, changed some tool calls to work on busybox, etc... Then sprinkled a bit of cleanup & polish over the top. It's not finished, because I could not test it. I have a problem building the binary-tarball since I switched to the 1.1.0 release and I've yet to try to build on an earlier version. Stay tuned, patches incoming for review. [1] https://issues.guix.gnu.org/40601 -- Vincent Legoll ^ permalink raw reply [flat|nested] 77+ messages in thread
* [bug#40601] bug#39023: binary installation manual doesn't work on Alpine Linux @ 2020-04-23 11:55 ` Vincent Legoll 0 siblings, 0 replies; 77+ messages in thread From: Vincent Legoll @ 2020-04-23 11:55 UTC (permalink / raw) To: 39023; +Cc: symphonia, boskovits, me, 40601, zimon.toutoune Hello, as I had been working on the installer lately [1], I tried to tackle this bug also, I have it mostly working. I added support for openrc-based init systems. I opted to support both adduser & useradd, changed some tool calls to work on busybox, etc... Then sprinkled a bit of cleanup & polish over the top. It's not finished, because I could not test it. I have a problem building the binary-tarball since I switched to the 1.1.0 release and I've yet to try to build on an earlier version. Stay tuned, patches incoming for review. [1] https://issues.guix.gnu.org/40601 -- Vincent Legoll ^ permalink raw reply [flat|nested] 77+ messages in thread
* bug#39023: binary installation manual doesn't work on Alpine Linux 2020-04-23 11:55 ` [bug#40601] " Vincent Legoll (?) @ 2020-04-23 13:29 ` zimoun 2020-04-23 14:15 ` Vincent Legoll -1 siblings, 1 reply; 77+ messages in thread From: zimoun @ 2020-04-23 13:29 UTC (permalink / raw) To: Vincent Legoll; +Cc: symphonia, 39023, 40601 Hi Vincent, On Thu, 23 Apr 2020 at 13:55, Vincent Legoll <vincent.legoll@gmail.com> wrote: > as I had been working on the installer lately [1], > I tried to tackle this bug also, I have it mostly > working. > > I added support for openrc-based init systems. > > I opted to support both adduser & useradd, changed > some tool calls to work on busybox, etc... Then > sprinkled a bit of cleanup & polish over the top. > > It's not finished, because I could not test it. I > have a problem building the binary-tarball since I > switched to the 1.1.0 release and I've yet to try > to build on an earlier version. > > Stay tuned, patches incoming for review. > > [1] https://issues.guix.gnu.org/40601 Do you mean that the incoming patches will include an explanation in the manual about adduser/useradd? Do you mean that guix-install.sh will now include a conditional test on the kind of foreign distibution to use adduser or useradd? Thank you for working on that. Cheers, simon ^ permalink raw reply [flat|nested] 77+ messages in thread
* bug#39023: binary installation manual doesn't work on Alpine Linux 2020-04-23 13:29 ` zimoun @ 2020-04-23 14:15 ` Vincent Legoll 0 siblings, 0 replies; 77+ messages in thread From: Vincent Legoll @ 2020-04-23 14:15 UTC (permalink / raw) To: zimoun; +Cc: symphonia, 39023 Hello, On 23/04/2020 15:29, zimoun wrote: > Do you mean that the incoming patches will include an explanation in > the manual about adduser/useradd? I'll be writing new / amending existing doc after the patches have received the first round of review. ;-) > Do you mean that guix-install.sh will now include a conditional test > on the kind of foreign distibution to use adduser or useradd? guix-install.sh will include conditional test on the availability of the commands. Like that: ========================================================== if command -v groupadd &>/dev/null; then groupadd --system guixbuild _msg "${PAS}group <guixbuild> created" elif command -v addgroup &>/dev/null; then addgroup -S guixbuild _msg "${PAS}group <guixbuild> created" else _err "${ERR}cannot add group for guix build users" exit 1 fi ========================================================== Seems not too much bloated, and I tested it manually on alpine & another one (cannot remember, probably debian). Did not break the previously working & works fine on busybox-based (alpine). I'll test extensively (range of OS & range of HW archs) before submitting for review. I'll resume working on this, hoping the gromacs package is ok... I've removed the CC to 40601@debbugs.gnu.org as I just wanted to make a link between the two, but don't want to spam the other issue... I hope this was OK to do. -- Vincent Legoll ^ permalink raw reply [flat|nested] 77+ messages in thread
end of thread, other threads:[~2021-09-02 17:53 UTC | newest] Thread overview: 77+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2020-04-13 16:04 [bug#40601] [PATCH 0/5] Handle runit-based foreign distributions Vincent Legoll 2020-04-13 16:07 ` [bug#40601] [PATCH 1/5] nix/local.mk: Add missing comment to sysvinit section Vincent Legoll 2020-04-13 16:07 ` [bug#40601] [PATCH 2/5] guix-install.sh: Add xz to requirements Vincent Legoll 2020-04-13 16:07 ` [bug#40601] [PATCH 3/5] guix-install.sh: Fix systemctl not found error message at probe Vincent Legoll 2020-04-13 16:07 ` [bug#40601] [PATCH 4/5] guix-install.sh: Handle local binary tarball file Vincent Legoll 2020-04-13 16:07 ` [bug#40601] [PATCH 5/5] guix-install.sh, guix-binary tarball: Handle runit-based foreign distributions Vincent Legoll 2020-05-17 17:15 ` [bug#40601] [RFC, PATCH 0/28] guix-install.sh: port to other distros & init systems Vincent Legoll 2020-05-17 19:26 ` Julien Lepiller 2020-05-17 19:37 ` Vincent Legoll 2020-05-17 17:16 ` [bug#40601] [PATCH 01/28] nix/local.mk: Add missing comment to sysvinit section Vincent Legoll 2020-05-17 17:16 ` [bug#40601] [PATCH 02/28] guix-install.sh: Add xz to requirements Vincent Legoll 2020-05-17 17:17 ` [bug#40601] [PATCH 03/28] guix-install.sh: Fix systemctl not found error message at probe Vincent Legoll 2020-05-17 17:17 ` [bug#40601] [PATCH 04/28] guix-install.sh: Handle local binary tarball file Vincent Legoll 2020-05-23 13:42 ` Tobias Geerinckx-Rice via Guix-patches via 2020-05-23 21:37 ` Vincent Legoll 2020-05-17 17:17 ` [bug#40601] [PATCH 05/28] guix-install.sh, guix-binary tarball: Handle runit-based foreign distributions Vincent Legoll 2020-05-17 17:17 ` [bug#40601] [PATCH 06/28] guix-install.sh: trivial whitespace fix Vincent Legoll 2020-05-17 17:17 ` [bug#40601] [PATCH 07/28] guix-install.sh: Move code in a new function Vincent Legoll 2020-05-17 17:17 ` [bug#40601] [PATCH 08/28] guix-install.sh: Use getent for both user & group presence checking Vincent Legoll 2020-05-17 17:17 ` [bug#40601] [PATCH 09/28] guix-install.sh: Fix requirements Vincent Legoll 2020-05-17 17:17 ` [bug#40601] [PATCH 10/28] guix-install.sh: Replace subshell-inducing command grouping Vincent Legoll 2020-05-17 17:17 ` [bug#40601] [PATCH 11/28] guix-install.sh: Use a variable for GPG key URL Vincent Legoll 2020-05-17 17:17 ` [bug#40601] [PATCH 12/28] guix-install.sh: Rework user & group handling, adding busybox support Vincent Legoll 2020-05-17 17:17 ` [bug#40601] [PATCH 13/28] guix-install.sh: Make grep & mktemp usage compatible with busybox Vincent Legoll 2020-05-17 17:17 ` [bug#40601] [PATCH 14/28] guix-install.sh: Make tar " Vincent Legoll 2020-05-17 17:17 ` [bug#40601] [PATCH 15/28] guix-install.sh, guix-binary tarball: Handle openrc-based foreign distributions Vincent Legoll 2020-05-17 17:17 ` [bug#40601] [PATCH 16/28] non-interactive mode, usage Vincent Legoll 2020-05-17 17:17 ` [bug#40601] [PATCH 17/28] fix variable quoting in sys_make_guix_available Vincent Legoll 2020-05-17 17:17 ` [bug#40601] [PATCH 18/28] Replace the use of "which" by "command -v" Vincent Legoll 2020-05-17 17:17 ` [bug#40601] [PATCH 19/28] Remove &> and >& bashisms Vincent Legoll 2020-05-17 17:17 ` [bug#40601] [PATCH 20/28] Add missing variable quoting & curly-bracketing for dl_path Vincent Legoll 2020-05-17 17:17 ` [bug#40601] [PATCH 21/28] Remove unused variable Vincent Legoll 2020-05-17 17:17 ` [bug#40601] [PATCH 22/28] Remove local bashisms Vincent Legoll 2020-05-17 17:17 ` [bug#40601] [PATCH 23/28] Remove $UID bashism Vincent Legoll 2020-05-17 17:17 ` [bug#40601] [PATCH 24/28] Remove some "[[" bashisms Vincent Legoll 2020-05-17 17:17 ` [bug#40601] [PATCH 25/28] Remove unused variable set by "read" Vincent Legoll 2020-05-17 17:17 ` [bug#40601] [PATCH 26/28] Add _debug_func() helper function Vincent Legoll 2020-05-17 17:17 ` [bug#40601] [PATCH 27/28] Fix variable use in guix_get_bin_list() Vincent Legoll 2020-05-17 17:17 ` [bug#40601] [PATCH 28/28] Remove "[[" bashisms in chk_init_sys() Vincent Legoll 2020-05-23 12:36 ` [bug#40601] [PATCH 01/28] nix/local.mk: Add missing comment to sysvinit section Tobias Geerinckx-Rice via Guix-patches via 2020-05-22 13:44 ` [bug#40601] [guix-daemon now working on parabola with openrc] jgart--- via Guix-patches via 2020-05-22 18:40 ` Leo Famulari 2020-05-31 20:41 ` [bug#40601] New reduced patchset, the easy bits first Vincent Legoll 2020-12-18 12:28 ` Christopher Baines 2020-12-18 19:35 ` Vincent Legoll 2020-12-20 17:30 ` Vincent Legoll 2020-05-31 20:42 ` [bug#40601] [PATCH 1/7] guix-install.sh: Remove "[[" bashisms in chk_init_sys() Vincent Legoll 2020-05-31 20:42 ` [bug#40601] [PATCH 2/7] guix-install.sh: Remove $UID bashism Vincent Legoll 2020-05-31 20:42 ` [bug#40601] [PATCH 3/7] guix-install.sh: Fix requirements Vincent Legoll 2020-05-31 20:42 ` [bug#40601] [PATCH 4/7] guix-install.sh: trivial whitespace fix Vincent Legoll 2020-05-31 20:42 ` [bug#40601] [PATCH 5/7] guix-install.sh: Add variable quoting in sys_make_guix_available Vincent Legoll 2020-05-31 20:42 ` [bug#40601] [PATCH 6/7] guix-install.sh: Fix variable uses in guix_get_bin_list() Vincent Legoll 2020-05-31 20:42 ` [bug#40601] [PATCH 7/7] guix-install.sh: Add missing variable quoting & curly-bracketing in guix_get_bin() Vincent Legoll 2020-12-18 11:37 ` Christopher Baines 2020-10-07 16:09 ` [bug#40601] [PATCH 0/5] Handle runit-based foreign distributions zimoun 2020-12-20 17:28 ` [bug#40601] [PATCH 1/5] guix-install.sh: Remove "[[" bashisms in chk_init_sys() Vincent Legoll 2020-12-20 17:28 ` [bug#40601] [PATCH 2/5] guix-install.sh: Remove $UID bashism Vincent Legoll 2020-12-23 12:17 ` Christopher Baines 2020-12-23 14:59 ` Vincent Legoll 2020-12-20 17:28 ` [bug#40601] [PATCH 3/5] guix-install.sh: Fix requirements Vincent Legoll 2020-12-20 17:28 ` [bug#40601] [PATCH 4/5] guix-install.sh: Fix detection of SysV init system Vincent Legoll 2020-12-20 17:28 ` [bug#40601] [PATCH 5/5] guix-install.sh: Check daemonize package presence for sysv-init Vincent Legoll 2021-09-02 17:51 ` [bug#40601] guix-daemon runit service on void jgart via Guix-patches via -- strict thread matches above, loose matches on Subject: below -- 2020-01-07 21:29 bug#39023: binary installation manual doesn't work on Alpine Linux symphonia 2020-01-08 12:34 ` Gábor Boskovits 2020-01-22 3:53 ` Tobias Geerinckx-Rice via Bug reports for GNU Guix 2020-01-22 19:42 ` Gábor Boskovits 2020-01-22 19:58 ` Tobias Geerinckx-Rice via Bug reports for GNU Guix 2020-01-22 20:03 ` Gábor Boskovits 2020-02-19 15:56 ` zimoun 2020-01-22 1:44 ` bug#39023: adduser/addgroup vs useradd/groupadd zimoun 2020-01-22 4:03 ` Tobias Geerinckx-Rice via Bug reports for GNU Guix 2020-01-22 8:31 ` zimoun 2020-04-23 11:55 ` bug#39023: binary installation manual doesn't work on Alpine Linux Vincent Legoll 2020-04-23 11:55 ` [bug#40601] " Vincent Legoll 2020-04-23 13:29 ` zimoun 2020-04-23 14:15 ` Vincent Legoll
Code repositories for project(s) associated with this external index https://git.savannah.gnu.org/cgit/guix.git This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.