unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#51771] [PATCH 1/2] gnu: linux: Support numbers and strings in options.
@ 2021-11-11 19:02 phodina via Guix-patches via
  2021-11-11 19:04 ` [bug#51771] [PATCH 2/2] gnu: Add linux-libre-with-waydroid phodina via Guix-patches via
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: phodina via Guix-patches via @ 2021-11-11 19:02 UTC (permalink / raw)
  To: 51771

Hi,

this patch should add support for waydroid which requires certain options in the kernel enabled.

In order to enable the features the lambda-match has to be extended to support numbers and strings.

However, the kernel compiles and I can reconfigure the system, + reboot. But I do not see /dev/binder device. Details are in the last mail.

Petr

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

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index f386139638..ffbaed0c57 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -729,7 +729,11 @@ (define (config->string options)
                       ((option . #t)
                        (string-append option "=y"))
                       ((option . #f)
-                       (string-append option "=n")))
+                       (string-append option "=n"))
+                      ((option . number)
+                       (string-append option "=" number))
+                      ((option . string)
+                       (string-append option "=\"" string "\"")))
                     options)
                "\n"))

--
2.33.0




^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [bug#51771] [PATCH 2/2] gnu: Add linux-libre-with-waydroid.
  2021-11-11 19:02 [bug#51771] [PATCH 1/2] gnu: linux: Support numbers and strings in options phodina via Guix-patches via
@ 2021-11-11 19:04 ` phodina via Guix-patches via
  2021-11-13 10:49   ` phodina via Guix-patches via
  2021-11-11 19:31 ` [bug#51771] Binder kernel module missing phodina via Guix-patches via
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 9+ messages in thread
From: phodina via Guix-patches via @ 2021-11-11 19:04 UTC (permalink / raw)
  To: 51771@debbugs.gnu.org

* gnu/packages/linux.scm (linux-libre-with-waydroid,
* waydroid-extra-linux-options): New variables.

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index ffbaed0c57..2ec9c88ecb 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -722,6 +722,14 @@ (define %bpf-extra-linux-options
     ;; kheaders module
     ("CONFIG_IKHEADERS" . #t)))

+(define %waydroid-extra-linux-options
+  `(;; Modules required for waydroid:
+   ("CONFIG_ASHMEM" . m)
+   ("CONFIG_ANDROID" . #t)
+   ("CONFIG_ANDROID_BINDER_IPC" . m)
+   ("CONFIG_ANDROID_BINDERFS" . #f)
+   ("CONFIG_ANDROID_BINDER_DEVICES" . "binder,hwbinder,vndbinder")))
+
 (define (config->string options)
   (string-join (map (match-lambda
                       ((option . 'm)
@@ -1147,6 +1155,24 @@ (define-public linux-libre-mips64el-fuloong2e
                       `(("CONFIG_OVERLAY_FS" . m))
                       %default-extra-linux-options)))

+(define-public linux-libre-with-waydroid
+  (let ((base-linux-libre
+         (make-linux-libre*
+          linux-libre-5.14-version
+          linux-libre-5.14-gnu-revision
+          linux-libre-5.14-source
+          '("x86_64-linux" "i686-linux" "armhf-linux"
+            "aarch64-linux" "riscv64-linux")
+          #:extra-version "linux"
+          #:configuration-file kernel-config
+          #:extra-options
+          (append %waydroid-extra-linux-options
+                  %default-extra-linux-options))))
+    (package
+      (inherit base-linux-libre)
+         (name "linux-libre-waydroid")
+      (inputs `(("cpio" ,cpio) ,@(package-inputs base-linux-libre))))))
+
 (define-public linux-libre-with-bpf
   (let ((base-linux-libre
          (make-linux-libre*
--
2.33.0




^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [bug#51771] Binder kernel module missing
  2021-11-11 19:02 [bug#51771] [PATCH 1/2] gnu: linux: Support numbers and strings in options phodina via Guix-patches via
  2021-11-11 19:04 ` [bug#51771] [PATCH 2/2] gnu: Add linux-libre-with-waydroid phodina via Guix-patches via
@ 2021-11-11 19:31 ` phodina via Guix-patches via
  2021-11-13 10:50 ` [bug#51771] [PATCH v2 2/2] gnu: Add linux-libre-with-waydroid phodina via Guix-patches via
  2024-04-08 20:27 ` [bug#51771] %5BPATCH%201%2F2%5D%20gnu%3A%20linux%3A%20Support%20numbers%20and%20strings%20in%20options outlook user
  3 siblings, 0 replies; 9+ messages in thread
From: phodina via Guix-patches via @ 2021-11-11 19:31 UTC (permalink / raw)
  To: 51771@debbugs.gnu.org

Unfortunately, as stated above the binder interface is missing. I looked for the kernel module but couldn't find it. As the /proc/config.gz is not present I can't verify it's enabled.

$ find /run/booted-system/kernel/lib/modules/5.14.17-gnu/kernel/ -iname "*binder*"
$ cat /proc/cmdline
BOOT_IMAGE=/gnu/store/fr1cwmbn19hyrs3wxr5sqr7iy4cj674y-linux-libre-waydroid-5.14.17/bzImage --root=/dev/mapper/cryptsystem --system=/gnu/store/8g26gi6v9dni0cagc3l1ny8shyz8r38h-system --load=/gnu/store/8g26gi6v9dni0cagc3l1ny8shyz8r38h-system/boot modprobe.blacklist=usbmouse,usbkbd quiet

Therefore the waydroid userspace manager also doesn't work:

# waydroid.py init
[19:40:05] Failed to load binder driver
[19:40:06] modprobe: FATAL: Module binder_linux not found in directory /run/booted-system/kernel/lib/modules/5.14.17-gnu
[19:40:06] ERROR: Binder node "binder" for waydroid not found
[19:40:06] See also: <https://github.com/waydroid>
Run 'waydroid log' for details.

$ waydroid.py log
(006323) [19:40:05] % modprobe binder_linux devices="anbox-binder,anbox-vndbinder,anbox-hwbinder"
modprobe: FATAL: Module binder_linux not found in directory /run/booted-system/kernel/lib/modules/5.14.17-gnu
(006323) [19:40:05] Failed to load binder driver
(006323) [19:40:06] modprobe: FATAL: Module binder_linux not found in directory /run/booted-system/kernel/lib/modules/5.14.17-gnu
(006323) [19:40:06] ERROR: Binder node "binder" for waydroid not found
(006323) [19:40:06] See also: <https://github.com/waydroid>
(006323) [19:40:06] Traceback (most recent call last):
  File "/gnu/store/iprc2yqsx5zi8nc2g3nqvlmlqzbw7nrf-waydroid-1.2.0/lib/waydroid/tools/__init__.py", line 54, in main

My conclusion is the module is not enabled and built. It could be do the the extended match-lambda expression as I'm not Guile guru.

The patch related to waydroid can be find here [1].

[1] https://issues.guix.gnu.org/51737




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#51771] [PATCH 2/2] gnu: Add linux-libre-with-waydroid.
  2021-11-11 19:04 ` [bug#51771] [PATCH 2/2] gnu: Add linux-libre-with-waydroid phodina via Guix-patches via
@ 2021-11-13 10:49   ` phodina via Guix-patches via
  2021-11-13 10:53     ` [bug#51771] Linux-libre-with-waydroid phodina via Guix-patches via
  0 siblings, 1 reply; 9+ messages in thread
From: phodina via Guix-patches via @ 2021-11-13 10:49 UTC (permalink / raw)
  To: 51771@debbugs.gnu.org

[PATCH v2 1/2] gnu: linux: Support numbers and strings in options.

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

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"))

--
2.33.0




^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [bug#51771] [PATCH v2 2/2] gnu: Add linux-libre-with-waydroid.
  2021-11-11 19:02 [bug#51771] [PATCH 1/2] gnu: linux: Support numbers and strings in options phodina via Guix-patches via
  2021-11-11 19:04 ` [bug#51771] [PATCH 2/2] gnu: Add linux-libre-with-waydroid phodina via Guix-patches via
  2021-11-11 19:31 ` [bug#51771] Binder kernel module missing phodina via Guix-patches via
@ 2021-11-13 10:50 ` phodina via Guix-patches via
  2024-04-08 20:27 ` [bug#51771] %5BPATCH%201%2F2%5D%20gnu%3A%20linux%3A%20Support%20numbers%20and%20strings%20in%20options outlook user
  3 siblings, 0 replies; 9+ messages in thread
From: phodina via Guix-patches via @ 2021-11-13 10:50 UTC (permalink / raw)
  To: 51771@debbugs.gnu.org

* gnu/packages/linux.scm (linux-libre-with-waydroid,
* waydroid-extra-linux-options): New variables.

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index cfc09580a3..a5d95bf5d4 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -722,6 +722,14 @@ (define %bpf-extra-linux-options
     ;; kheaders module
     ("CONFIG_IKHEADERS" . #t)))

+(define %waydroid-extra-linux-options
+  `(;; Modules required for waydroid:
+   ("CONFIG_ASHMEM" . #t)
+   ("CONFIG_ANDROID" . #t)
+   ("CONFIG_ANDROID_BINDER_IPC" . #t)
+   ("CONFIG_ANDROID_BINDERFS" . #t)
+   ("CONFIG_ANDROID_BINDER_DEVICES" . "binder,hwbinder,vndbinder")))
+
 (define (config->string options)
   (string-join (map (match-lambda
                       ((option . #f)
@@ -1147,6 +1155,24 @@ (define-public linux-libre-mips64el-fuloong2e
                       `(("CONFIG_OVERLAY_FS" . m))
                       %default-extra-linux-options)))

+(define-public linux-libre-waydroid
+  (let ((base-linux-libre
+         (make-linux-libre*
+          linux-libre-5.14-version
+          linux-libre-5.14-gnu-revision
+          linux-libre-5.14-source
+          '("x86_64-linux" "i686-linux" "armhf-linux"
+            "aarch64-linux" "riscv64-linux")
+          #:extra-version "linux"
+          #:configuration-file kernel-config
+          #:extra-options
+          (append %waydroid-extra-linux-options
+                  %default-extra-linux-options))))
+    (package
+      (inherit base-linux-libre)
+         (name "linux-libre-waydroid")
+      (inputs `(("cpio" ,cpio) ,@(package-inputs base-linux-libre))))))
+
 (define-public linux-libre-with-bpf
   (let ((base-linux-libre
          (make-linux-libre*
--
2.33.0




^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [bug#51771] Linux-libre-with-waydroid.
  2021-11-13 10:49   ` phodina via Guix-patches via
@ 2021-11-13 10:53     ` phodina via Guix-patches via
  2022-03-24 13:30       ` phodina via Guix-patches via
  0 siblings, 1 reply; 9+ messages in thread
From: phodina via Guix-patches via @ 2021-11-13 10:53 UTC (permalink / raw)
  To: 51771@debbugs.gnu.org; +Cc: Tobias Geerinckx-Rice

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




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#51771] Linux-libre-with-waydroid.
  2021-11-13 10:53     ` [bug#51771] Linux-libre-with-waydroid phodina via Guix-patches via
@ 2022-03-24 13:30       ` phodina via Guix-patches via
  2022-04-14  8:07         ` phodina via Guix-patches via
  0 siblings, 1 reply; 9+ messages in thread
From: phodina via Guix-patches via @ 2022-03-24 13:30 UTC (permalink / raw)
  To: 51771@debbugs.gnu.org; +Cc: Tobias Geerinckx-Rice

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




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#51771] Linux-libre-with-waydroid.
  2022-03-24 13:30       ` phodina via Guix-patches via
@ 2022-04-14  8:07         ` phodina via Guix-patches via
  0 siblings, 0 replies; 9+ messages in thread
From: phodina via Guix-patches via @ 2022-04-14  8:07 UTC (permalink / raw)
  To: 51771@debbugs.gnu.org; +Cc: Efraim Flashner, jsoo1@asu.edu

Hi,

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

Petr




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#51771] %5BPATCH%201%2F2%5D%20gnu%3A%20linux%3A%20Support%20numbers%20and%20strings%20in%20options.
  2021-11-11 19:02 [bug#51771] [PATCH 1/2] gnu: linux: Support numbers and strings in options phodina via Guix-patches via
                   ` (2 preceding siblings ...)
  2021-11-13 10:50 ` [bug#51771] [PATCH v2 2/2] gnu: Add linux-libre-with-waydroid phodina via Guix-patches via
@ 2024-04-08 20:27 ` outlook user
  3 siblings, 0 replies; 9+ messages in thread
From: outlook user @ 2024-04-08 20:27 UTC (permalink / raw)
  To: 51771@debbugs.gnu.org

phodina: Is this 51737 duplicate?



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-04-08 20:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-11 19:02 [bug#51771] [PATCH 1/2] gnu: linux: Support numbers and strings in options phodina via Guix-patches via
2021-11-11 19:04 ` [bug#51771] [PATCH 2/2] gnu: Add linux-libre-with-waydroid phodina via Guix-patches via
2021-11-13 10:49   ` phodina via Guix-patches via
2021-11-13 10:53     ` [bug#51771] Linux-libre-with-waydroid phodina via Guix-patches via
2022-03-24 13:30       ` phodina via Guix-patches via
2022-04-14  8:07         ` phodina via Guix-patches via
2021-11-11 19:31 ` [bug#51771] Binder kernel module missing phodina via Guix-patches via
2021-11-13 10:50 ` [bug#51771] [PATCH v2 2/2] gnu: Add linux-libre-with-waydroid phodina via Guix-patches via
2024-04-08 20:27 ` [bug#51771] %5BPATCH%201%2F2%5D%20gnu%3A%20linux%3A%20Support%20numbers%20and%20strings%20in%20options outlook user

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).