GNU bug report logs - #51771
[PATCH 1/2] gnu: linux: Support numbers and strings in options.

Previous Next

Package: guix-patches;

Reported by: phodina <phodina <at> protonmail.com>

Date: Thu, 11 Nov 2021 19:03:02 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 51771 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#51771; Package guix-patches. (Thu, 11 Nov 2021 19:03:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to phodina <phodina <at> protonmail.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Thu, 11 Nov 2021 19:03:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: phodina <phodina <at> protonmail.com>
To: Guix Patches <guix-patches <at> gnu.org>
Subject: [PATCH 1/2] gnu: linux: Support numbers and strings in options.
Date: Thu, 11 Nov 2021 19:02:25 +0000
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




Information forwarded to guix-patches <at> gnu.org:
bug#51771; Package guix-patches. (Thu, 11 Nov 2021 19:06:01 GMT) Full text and rfc822 format available.

Message #8 received at 51771 <at> debbugs.gnu.org (full text, mbox):

From: phodina <phodina <at> protonmail.com>
To: "51771 <at> debbugs.gnu.org" <51771 <at> debbugs.gnu.org>
Subject: [PATCH 2/2] gnu: Add linux-libre-with-waydroid.
Date: Thu, 11 Nov 2021 19:04:55 +0000
* 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




Information forwarded to guix-patches <at> gnu.org:
bug#51771; Package guix-patches. (Thu, 11 Nov 2021 19:32:01 GMT) Full text and rfc822 format available.

Message #11 received at 51771 <at> debbugs.gnu.org (full text, mbox):

From: phodina <phodina <at> protonmail.com>
To: "51771 <at> debbugs.gnu.org" <51771 <at> debbugs.gnu.org>
Subject: Binder kernel module missing
Date: Thu, 11 Nov 2021 19:31:07 +0000
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




Information forwarded to guix-patches <at> gnu.org:
bug#51771; Package guix-patches. (Sat, 13 Nov 2021 10:50:01 GMT) Full text and rfc822 format available.

Message #14 received at 51771 <at> debbugs.gnu.org (full text, mbox):

From: phodina <phodina <at> protonmail.com>
To: "51771 <at> debbugs.gnu.org" <51771 <at> debbugs.gnu.org>
Subject: Re: [PATCH 2/2] gnu: Add linux-libre-with-waydroid.
Date: Sat, 13 Nov 2021 10:49:29 +0000
[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




Information forwarded to guix-patches <at> gnu.org:
bug#51771; Package guix-patches. (Sat, 13 Nov 2021 10:51:02 GMT) Full text and rfc822 format available.

Message #17 received at 51771 <at> debbugs.gnu.org (full text, mbox):

From: phodina <phodina <at> protonmail.com>
To: "51771 <at> debbugs.gnu.org" <51771 <at> debbugs.gnu.org>
Subject: [PATCH v2 2/2] gnu: Add linux-libre-with-waydroid.
Date: Sat, 13 Nov 2021 10:50:27 +0000
* 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




Information forwarded to guix-patches <at> gnu.org:
bug#51771; Package guix-patches. (Sat, 13 Nov 2021 10:55:01 GMT) Full text and rfc822 format available.

Message #20 received at 51771 <at> debbugs.gnu.org (full text, mbox):

From: phodina <phodina <at> protonmail.com>
To: "51771 <at> debbugs.gnu.org" <51771 <at> debbugs.gnu.org>
Cc: Tobias Geerinckx-Rice <me <at> tobias.gr>
Subject: Linux-libre-with-waydroid.
Date: Sat, 13 Nov 2021 10:53:53 +0000
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




Information forwarded to guix-patches <at> gnu.org:
bug#51771; Package guix-patches. (Thu, 24 Mar 2022 13:31:01 GMT) Full text and rfc822 format available.

Message #23 received at 51771 <at> debbugs.gnu.org (full text, mbox):

From: phodina <phodina <at> protonmail.com>
To: "51771 <at> debbugs.gnu.org" <51771 <at> debbugs.gnu.org>
Cc: Tobias Geerinckx-Rice <me <at> tobias.gr>
Subject: Re: Linux-libre-with-waydroid.
Date: Thu, 24 Mar 2022 13:30:29 +0000
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




Information forwarded to guix-patches <at> gnu.org:
bug#51771; Package guix-patches. (Thu, 14 Apr 2022 08:08:02 GMT) Full text and rfc822 format available.

Message #26 received at 51771 <at> debbugs.gnu.org (full text, mbox):

From: phodina <phodina <at> protonmail.com>
To: "51771 <at> debbugs.gnu.org" <51771 <at> debbugs.gnu.org>
Cc: Efraim Flashner <efraim <at> flashner.co.il>, "jsoo1 <at> asu.edu" <jsoo1 <at> asu.edu>
Subject: Linux-libre-with-waydroid.
Date: Thu, 14 Apr 2022 08:07:38 +0000
Hi,

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

Petr




Information forwarded to guix-patches <at> gnu.org:
bug#51771; Package guix-patches. (Mon, 08 Apr 2024 20:28:01 GMT) Full text and rfc822 format available.

Message #29 received at 51771 <at> debbugs.gnu.org (full text, mbox):

From: outlook user <RACP <at> outlook.fr>
To: "51771 <at> debbugs.gnu.org" <51771 <at> debbugs.gnu.org>
Subject: %5BPATCH%201%2F2%5D%20gnu%3A%20linux%3A%20Support%20numbers%20and%20strings%20in%20options.
Date: Mon, 8 Apr 2024 20:27:31 +0000
phodina: Is this 51737 duplicate?



This bug report was last modified 1 year and 64 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.