diff mbox series

[bug#51771,2/2] gnu: Add linux-libre-with-waydroid.

Message ID u_ib1orir8DkVGJMursHiPxOfqbl1Ltc1JOk1yo5z7NJPM2fbz1-Tc2WiPJ5BEoHC88RR4k4dgmGx_fK0EFDcuO7oivGtuf5JMn6NB_vFGM=@protonmail.com
State New
Headers show
Series None | expand

Commit Message

phodina Nov. 13, 2021, 10:49 a.m. UTC
[PATCH v2 1/2] gnu: linux: Support numbers and strings in options.

* gnu/packages/linux.scm: Match numbers and strings in options.

--
2.33.0

Comments

phodina Nov. 13, 2021, 10:53 a.m. UTC | #1
Hi,

here are the updated patches that:

- enable to set numbers and strings as options in kernel config
- define a new linux kernel which has support for waydroid

$ grep -E "ANDROID|ASHMEM" /run/current-system/kernel/.config
CONFIG_ASHMEM=y
CONFIG_ANDROID=y
CONFIG_ANDROID_BINDER_IPC=y
CONFIG_ANDROID_BINDERFS=y
CONFIG_ANDROID_BINDER_DEVICES="binder,hwbinder,vndbinder"
# CONFIG_ANDROID_BINDER_IPC_SELFTEST is not set

Huge thanks to Tobias Geerinckx-Rice for help with the parsing issue!

Petr
phodina March 24, 2022, 1:30 p.m. UTC | #2
Hi,

would it be possible to just review the first patch which adds support for strings in kernel options?

Unfortunately, there is no way to build just the kernel modules with support for ASHMEM as the coded misused the `kallsyms_lookup_name` [1].

Therefore the only way to have working waydroid is to build a kernel with the options enabled.

I'll leave the second patch for the other open issue [2].

[1] https://github.com/anbox/anbox-modules/issues/49#issuecomment-737091629
[2] https://issues.guix.gnu.org/51737

----
Petr
phodina April 14, 2022, 8:07 a.m. UTC | #3
Hi,

could you please share your thoughts on the parsing of the config and possibly also on waydroid?

Petr
diff mbox series

Patch

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index f386139638..cfc09580a3 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -724,12 +724,16 @@  (define %bpf-extra-linux-options

 (define (config->string options)
   (string-join (map (match-lambda
-                      ((option . 'm)
-                       (string-append option "=m"))
-                      ((option . #t)
-                       (string-append option "=y"))
                       ((option . #f)
-                       (string-append option "=n")))
+                       (format #f "# ~a is not set" option))
+                      ((option . #t)
+                       (format #f "~a=y" option))
+                      ((option . 'm)
+                       (format #f "~a=m" option))
+                      ((option . (? number? value))
+                       (format #f "~a=~a" option value))
+                      ((option . (? string? value))
+                       (format #f "~a=\"~a\"" option value)))
                     options)
                "\n"))