Add Waydroid

  • Open
  • quality assurance status badge
Details
8 participants
  • Denis 'GNUtoo' Carikli
  • outlook user
  • dan
  • Julien Lepiller
  • Liliana Marie Prikler
  • Maxime Devos
  • Bruno Victal
  • phodina
Owner
unassigned
Submitted by
phodina
Severity
normal
P
P
phodina wrote on 10 Nov 2021 02:33
(name . Guix Patches)(address . guix-patches@gnu.org)
iYmPmvusAplbe5X4cU55Ujwo5l9cWEZ8e6PRtK6Md65HdM-bvo-sGnvm_ZkmbBfsRk6LLJLvaRe4VxgqiEOxnd0VzqKMiua4DfkhuQYNLMo=@protonmail.com
Hi,

in the following patches there's added support for Waydroid [1]- allowing you to run Android applications in LXC containers.

However, there is still issue that the following kernel options need to be enabled.

CONFIG_ASHMEM=m
CONFIG_ANDROID=y
CONFIG_ANDROID_BINDER_IPC=m
CONFIG_ANDROID_BINDERFS=n
CONFIG_ANDROID_BINDER_DEVICES="binder,hwbinder,vndbinder"

I'd like to ask how to proceed. Probably add these as configuration in the gnu/packages/linux.scm and then create a new kernel with these enabled, right?

Should I then add dependency of waydroid package on this kernel?

Petr

Attachment: file
P
P
phodina wrote on 10 Nov 2021 02:37
[PATCH 1/4] gnu: Add libglibutil.
(name . 51737@debbugs.gnu.org)(address . 51737@debbugs.gnu.org)
OdeTLBG5QlqX97nEBGy9o2DKstnFnEwvfDLIL2C3dLf0fw846OHRNPnYM1TyJybcYoEe0K_4wBUM4RAzozLjPdMPIF9Fp7eVD-03hJg7jg4=@protonmail.com
* gnu/packages/glib.scm (libglibutil): New variable.

Toggle diff (70 lines)
diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm
index 8ed1e3a944..6d8a6801da 100644
--- a/gnu/packages/glib.scm
+++ b/gnu/packages/glib.scm
@@ -14,6 +14,7 @@
;;; Copyright © 2019, 2020 Marius Bakke <mbakke@fastmail.com>
;;; Copyright © 2020 Nicolò Balzarotti <nicolo@nixo.xyz>
;;; Copyright © 2020 Arthur Margerit <ruhtra.mar@gmail.com>
+;;; Copyright © 2021 Petr Hodina <phodina@protonmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -68,6 +69,7 @@ (define-module (gnu packages glib)
#:use-module (guix build-system perl)
#:use-module (guix build-system python)
#:use-module (guix download)
+ #:use-module (guix git-download)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix packages)
#:use-module (guix utils)
@@ -749,6 +751,49 @@ (define-public glibmm-2.64
`(("libsigc++" ,libsigc++)
("glib" ,glib)))))

+(define-public libglibutil
+ (package
+ (name "libglibutil")
+ (version "1.0.55")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://git.sailfishos.org/mer-core/libglibutil")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0zrxccpyfz4jf14zr6fj9b88p340s66lw5cnqkapfa72kl1rnp4q"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:make-flags (list (string-append "CC=" ,(cc-for-target))
+ (string-append "DESTDIR=" %output))
+ #:phases
+ (modify-phases %standard-phases
+ (delete 'configure)
+ (add-after 'unpack 'remove-usr-prefix
+ (lambda* _
+ (substitute* "libglibutil.pc.in"
+ (("/usr/include") (string-append %output "/include")))
+ (substitute* "Makefile"
+ (("usr/") ""))))
+ (add-after 'install 'install-dev
+ (lambda* _
+ (invoke "make" "install-dev" (string-append "DESTDIR=" %output))))
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (chdir "test")
+ (invoke "make" (string-append "CC=" ,(cc-for-target)))
+ (chdir "..") #t))))))
+ (native-inputs `(("pkg-config" ,pkg-config)))
+ (inputs `(("glib" ,glib)))
+ (home-page "https://git.sailfishos.org/mer-core/libglibutil")
+ (synopsis "GLib utilites")
+ (description "This package provides library of glib utilities.")
+ (license license:bsd-3)))
+
(define-public python2-pygobject-2
(package
(name "python2-pygobject")
--
2.33.1
P
P
phodina wrote on 10 Nov 2021 02:38
[PATCH 2/4] gnu: Add libgbinder.
(name . 51737@debbugs.gnu.org)(address . 51737@debbugs.gnu.org)
f0X-fmjm6HpduBHb9LOM6szjKRf30FPp9PkW4LfeCuokGHn0dwF36saOvMdaodwMl0Bo0sncib1Etr7ZZANwLu6-sV6c7SWCzlEH8wGaBOc=@protonmail.com
* gnu/packages/glib.scm (libgbinder): New variable.

Toggle diff (64 lines)
diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm
index 6d8a6801da..4f3e026d1b 100644
--- a/gnu/packages/glib.scm
+++ b/gnu/packages/glib.scm
@@ -751,6 +751,59 @@ (define-public glibmm-2.64
`(("libsigc++" ,libsigc++)
("glib" ,glib)))))

+(define-public libgbinder
+ (package
+ (name "libgbinder")
+ (version "1.1.13")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/mer-hybris/libgbinder")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "054kghsyyxk7lbsgwis1fczbgjlh0g0x6smwvcczd8dqacfclvpy"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:make-flags (list (string-append "CC=" ,(cc-for-target))
+ (string-append "DESTDIR=" %output))
+ #:phases
+ (modify-phases %standard-phases
+ (delete 'configure)
+ (add-after 'unpack 'fix-pkg-config-in
+ (lambda* _
+ (substitute* "Makefile"
+ (("usr/") ""))
+ (substitute* "libgbinder.pc.in"
+ (("@libdir@") (string-append (assoc-ref %outputs "out") "/lib"))
+ (("/usr/include") (string-append %output "/include")))))
+ (add-after 'install 'install-dev
+ (lambda* _
+ (invoke "make" "install-dev" (string-append "DESTDIR=" %output))))
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (chdir "test")
+ (invoke "make" (string-append "CC=" ,(cc-for-target)))
+ (chdir "..") #t))))))
+ (native-inputs `(("bison" ,bison)
+ ("flex" ,flex)
+ ("pkg-config" ,pkg-config)))
+ (inputs `(("glib" ,glib)
+ ("libglibutil" ,libglibutil)))
+ (home-page "https://github.com/mer-hybris/libgbinder")
+ (synopsis "GLib-style interface to binder")
+ (description "This package provides GLib-style interface to binder:
+@enumerate
+@item Integration with GLib event loop
+@item Detection of 32 vs 64 bit kernel at runtime
+@item Asynchronous transactions that don't block the event thread
+@item Stable service manager and low-level transation APIs
+@end enumerate")
+ (license license:bsd-3)))
+
(define-public libglibutil
(package
(name "libglibutil")
--
2.33.1
P
P
phodina wrote on 10 Nov 2021 02:38
[PATCH 3/4] gnu: Add python-gbinder.
(name . 51737@debbugs.gnu.org)(address . 51737@debbugs.gnu.org)
7QtNhomJeWJORkBXmW-URZhK86zqNDlMhu0kJCfLqCylsZc9rK48bBPumKeMQFh1BZzYulgZMpgSrbRV7soqEvKx1CmHbyh_ymrTceqeVZc=@protonmail.com
* gnu/packages/glib.scm (python-gbinder): New variable.

Toggle diff (42 lines)
diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm
index 4f3e026d1b..d9e50a69c8 100644
--- a/gnu/packages/glib.scm
+++ b/gnu/packages/glib.scm
@@ -847,6 +847,37 @@ (define-public libglibutil
(description "This package provides library of glib utilities.")
(license license:bsd-3)))

+(define-public python-gbinder
+ (package
+ (name "python-gbinder")
+ (version "1.0.0")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/erfanoabdi/gbinder-python")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0jgblzakjgsy0cj93bmh5gr7qnl2xgsrm0wzc6xjvzry9lrbs360"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (replace 'build
+ (lambda* _
+ (invoke "python" "setup.py" "build_ext" "--inplace" "--cython"))))))
+ (native-inputs `(("python-cython" ,python-cython)
+ ("pkg-config" ,pkg-config)))
+ (inputs `(("glib" ,glib)
+ ("libgbinder" ,libgbinder)
+ ("libglibutil" ,libglibutil)))
+ (home-page "https://github.com/erfanoabdi/gbinder-python")
+ (synopsis "Python bindings for libgbinder")
+ (description "This package provides Python bindings for libgbinder.")
+ (license license:gpl3+)))
+
(define-public python2-pygobject-2
(package
(name "python2-pygobject")
--
2.33.1
P
P
phodina wrote on 10 Nov 2021 02:39
[PATCH 4/4] gnu: Add waydroid.
(name . 51737@debbugs.gnu.org)(address . 51737@debbugs.gnu.org)
5RLyma8o5V0_Xhn_sSJGxZYF4XMzJtrEna-xE5UU-suoRiBa7vaxBdDUEBgKSBMb94O68CnqEzPkcuFA4qasS4rHR4lh-ch-S1k-mFn6d4U=@protonmail.com
* gnu/packages/virtualization.scm (waydroid): New variable.

Toggle diff (77 lines)
diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm
index 1817f6dc22..d47d8402f6 100644
--- a/gnu/packages/virtualization.scm
+++ b/gnu/packages/virtualization.scm
@@ -2005,6 +2005,72 @@ (define-public bochs
DOS or Microsoft Windows.")
(license license:lgpl2.0+)))

+(define-public waydroid
+ (package
+ (name "waydroid")
+ (version "1.2.0")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/waydroid/waydroid")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "03d87sh443kn0j2mpih1g909khkx3wgb04h605f9jhd0znskkbmw"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (delete 'build) ; no setup.py
+ (delete 'check) ; no test suite
+ (replace 'install
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (lib (string-append out "/lib/waydroid"))
+ (tools (string-append lib "/tools"))
+ (data (string-append lib "/data"))
+ (apps (string-append out "/share/applications"))
+ (bin (string-append out "/bin"))
+ (site (string-append out "/lib/python"
+ ,(version-major+minor
+ (package-version python))
+ "/site-packages"))
+ (path (getenv "PYTHONPATH")))
+ (mkdir-p tools)
+ (mkdir-p data)
+ (mkdir-p apps)
+ (mkdir-p bin)
+ (copy-recursively "tools" tools)
+ (copy-recursively "data" data)
+ (install-file (string-append data "/Waydroid.desktop")
+ (string-append apps))
+ (substitute* (string-append apps "/Waydroid.desktop")
+ (("/usr") lib))
+ (install-file "waydroid.py" lib)
+ (symlink (string-append lib "/waydroid.py") (string-append bin
+ "/waydroid.py"))
+ (wrap-program (string-append bin "/waydroid.py")
+ `("PYTHONPATH" ":" prefix (,site ,path)))))))))
+ (inputs `(("bash-minimal" ,bash-minimal)
+ ("dnsmasq" ,dnsmasq)
+ ("libgbinder" ,libgbinder)
+ ("lxc" ,lxc)
+ ("nftables" ,nftables)
+ ("python" ,python)
+ ("python-gbinder" ,python-gbinder)
+ ("python-pygobject" ,python-pygobject)))
+ (home-page "https://waydro.id")
+ (synopsis "Container-based approach to boot a full Android system")
+ (description "Waydroid uses Linux namespaces @code{(user, pid, uts, net,
+mount, ipc)} to run a full Android system in a container and provide Android
+applications. The Android inside the container has direct access to needed
+underlying hardware. The Android runtime environment ships with a minimal
+customized Android system image based on LineageOS. The used image is
+currently based on Android 10.")
+ (license license:gpl3)))
+
(define-public xen
(package
(name "xen")
--
2.33.1
L
L
Liliana Marie Prikler wrote on 15 Nov 2021 21:03
0bf1daa639bbc322ac0653da7699c005766cc0ad.camel@gmail.com
Hi,

Am Mittwoch, den 10.11.2021, 01:39 +0000 schrieb phodina:
Toggle quote (12 lines)
> [...]
> + (description "Waydroid uses Linux namespaces @code{(user, pid,
> uts, net,
> +mount, ipc)} to run a full Android system in a container and provide
> Android
> +applications. The Android inside the container has direct access to
> needed
> +underlying hardware. The Android runtime environment ships with a
> minimal
> +customized Android system image based on LineageOS. The used image
> is
> +currently based on Android 10.")
How exactly/when is this RTE built? Is it just included as a blob?
P
P
phodina wrote on 15 Nov 2021 23:30
(name . 51737@debbugs.gnu.org)(address . 51737@debbugs.gnu.org)
vMf9WQUigGEQAYfNaISeMXbINkVbvnj8h55D54uJPRIiSzMv1ZsKVr2vHkVegQSQ6tqr-KAWWtYq77qhJVYNrtKhw6ctNcrTs5jpCYQwcy8=@protonmail.com
Hi Liliana,

On Monday, November 15th, 2021 at 9:03 PM, Liliana Marie Prikler <liliana.prikler@gmail.com> wrote:

Toggle quote (30 lines)
> Hi,
>
> Am Mittwoch, den 10.11.2021, 01:39 +0000 schrieb phodina:
>
> > [...]
> >
> > - (description "Waydroid uses Linux namespaces @code{(user, pid,
> >
> > uts, net,
> >
> > +mount, ipc)} to run a full Android system in a container and provide
> >
> > Android
> >
> > +applications. The Android inside the container has direct access to
> >
> > needed
> >
> > +underlying hardware. The Android runtime environment ships with a
> >
> > minimal
> >
> > +customized Android system image based on LineageOS. The used image
> >
> > is
> >
> > +currently based on Android 10.")
>
> How exactly/when is this RTE built? Is it just included as a blob?

Nope, it's downloaded as part of the =waydroid init= command.

You can see the RTE here:
$ ls /var/lib/waydroid/images/
system.img vendor.img

On waydroid website [1] they provide instructions on how to create this runtime environment - basically "+-" Android rootfs.

I cameacross a channel [2] with Android support but haven't had the chance to test it yet. Then again I'm not sure if that's the right way as there are phones that run close to vanilla Linux [3]. Though this technological solution enables Android apps to run on those phones.

But it also has drawback as it requires custom kernel.

Though these patches require support in the kernel [3] and LXD service running [4] at least.

Currently I'm able to run the waydroid container and get shell over adb.

However, for some unknown reason I can't launch the UI.

That might be due to the fact I run Sway VM. I'll test this with GDM as this is recommended in the issues on github and report back.

Petr

P
P
phodina wrote on 3 Dec 2021 16:00
(name . 51737@debbugs.gnu.org)(address . 51737@debbugs.gnu.org)
1IgTsyR1Izq-_tDhbSbaUt57O-ElCeseDKi6urdyGx7-FJLkmBi90YhpOoBAl3KMmuvPZfSKPm9ay89-OVGIhDmjN5vycEMnoY-ibSi7yRI=@protonmail.com
ping
P
P
phodina wrote on 25 Jun 2022 15:08
[PATCH v2 1/7] gnu: Add linux-libre-waydroid.
(name . 51737@debbugs.gnu.org)(address . 51737@debbugs.gnu.org)(name . Ludovic Courtès)(address . ludo@gnu.org)
6DHjUMqjMoW-JFxyBmViVrNgl6CjM63WJ5vn4bejvkbXWdkQa_NSI1l2lfluy4q_PMSinz3DdOq5mM5oVsuoHsrDzMKEqjcUTQ_R7NpAYp0=@protonmail.com
Hi Ludo',

here's updated patch set.

Indeede it's adding another linux-libre kernel since this opens the attack surface for anybody not using the binder and ashmem interface. However, it bring the support for Android apps on Linux which might be necessary on mobile platforms such as PinePhone.

Any thoughts about upstreaming this?

FIY There are also open source implementation of Andorid apps that can be downloaded from F-Droid [1]


Kind regards,
Petr
Attachment: file
From 0e0d1655ebc3474454471449298bd7b6c8d739da Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Thu, 11 Nov 2021 19:26:41 +0100
Subject: [PATCH v2 1/7] gnu: Add linux-libre-waydroid.

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

Toggle diff (46 lines)
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 8f7b4f4f5b..d094c529cb 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -729,6 +729,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 . 'm)
@@ -1156,6 +1164,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-version
+ linux-libre-gnu-revision
+ linux-libre-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.36.1
From 316f4cd48468ee5d2230e976aca24135fbb6af99 Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Tue, 9 Nov 2021 22:34:39 +0100
Subject: [PATCH v2 3/7] gnu: Add libglibutil.

* gnu/packages/glib.scm (libglibutil): New variable.

Toggle diff (77 lines)
diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm
index 98267fcee5..6686a51fa1 100644
--- a/gnu/packages/glib.scm
+++ b/gnu/packages/glib.scm
@@ -17,6 +17,7 @@
;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2020 Arthur Margerit <ruhtra.mar@gmail.com>
;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
+;;; Copyright © 2021 Petr Hodina <phodina@protonmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -75,6 +76,7 @@ (define-module (gnu packages glib)
#:use-module (guix build-system perl)
#:use-module (guix build-system python)
#:use-module (guix download)
+ #:use-module (guix git-download)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix packages)
#:use-module (guix utils)
@@ -848,6 +850,54 @@ (define-public glibmm-2.64
(modify-inputs (package-propagated-inputs glibmm)
(replace "libsigc++" libsigc++-2)))))
+(define-public libglibutil
+ (package
+ (name "libglibutil")
+ (version "1.0.65")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://git.sailfishos.org/mer-core/libglibutil")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0sc8xw5cbxcicipjp6ycbgqppn31lzsll4r9j6b0zxd747dziv54"))))
+ (build-system gnu-build-system)
+ (arguments
+ (list #:make-flags #~(list (string-append "CC="
+ #$(cc-for-target))
+ (string-append "DESTDIR="
+ #$output))
+ #:phases #~(modify-phases %standard-phases
+ (delete 'configure)
+ (add-after 'unpack 'remove-usr-prefix
+ (lambda* _
+ (substitute* "libglibutil.pc.in"
+ (("/usr/include") (string-append #$output
+ "/include")))
+ (substitute* "Makefile"
+ (("usr/") ""))))
+ (add-after 'install 'install-dev
+ (lambda* _
+ (invoke "make" "install-dev"
+ (string-append "DESTDIR="
+ #$output))))
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (chdir "test")
+ (invoke "make"
+ (string-append "CC="
+ #$(cc-for-target)))
+ (chdir "..")))))))
+ (native-inputs (list pkg-config))
+ (inputs (list glib))
+ (home-page "https://git.sailfishos.org/mer-core/libglibutil")
+ (synopsis "GLib utilites")
+ (description "This package provides library of glib utilities.")
+ (license license:bsd-3)))
+
(define-public python-pygobject
(package
(name "python-pygobject")
--
2.36.1
From e7e3af766279d4e3e87cfe9eeb6458afb1f3bfe4 Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Wed, 22 Dec 2021 21:31:59 +0100
Subject: [PATCH v2 7/7] services: Add lxd-service-type.

* gnu/services/virtualization.scm (lxd-configuration): New type.
(%lxd-accounts, lxd-service-type): New variables.
(%lxd-activation, lxd-shepherd-service): New procedures.
* gnu/system/file-systems.scm (%elogind-file-systems): Add
"/sys/fs/cgroup/systemd" file-system.

Toggle diff (108 lines)
diff --git a/gnu/services/virtualization.scm b/gnu/services/virtualization.scm
index 41afe451c1..15ee30f8e0 100644
--- a/gnu/services/virtualization.scm
+++ b/gnu/services/virtualization.scm
@@ -76,6 +76,9 @@ (define-module (gnu services virtualization)
virtlog-configuration
virtlog-service-type
+ lxd-configuration
+ lxd-service-type
+
%qemu-platforms
lookup-qemu-platforms
qemu-platform?
@@ -562,6 +565,69 @@ (define (generate-libvirt-documentation)
`((libvirt-configuration ,libvirt-configuration-fields))
'libvirt-configuration))
+
+;;;
+;;; LXD linux container daemon.
+;;;
+
+(define-configuration lxd-configuration
+ (lxd
+ (package lxd)
+ "LXD package.")
+ (debug?
+ (boolean #f)
+ "Enable or disable debug messages.")
+ (verbose?
+ (boolean #f)
+ "Enable or disable information messages."))
+
+(define %lxd-accounts
+ (list (user-group (name "lxd") (system? #t))))
+
+(define (%lxd-activation config)
+ #~(begin
+ (use-modules (guix build utils))
+ (mkdir-p "/var/log/lxd")))
+
+(define (lxd-shepherd-service config)
+ (let* ((lxd (lxd-configuration-lxd config))
+ (debug? (lxd-configuration-debug? config))
+ (verbose? (lxd-configuration-verbose? config)))
+ (list
+ (shepherd-service
+ (documentation "LXD daemon.")
+ (provision '(lxd))
+ (requirement '(dbus-system
+ elogind
+ file-system-/sys/fs/cgroup/blkio
+ file-system-/sys/fs/cgroup/cpu
+ file-system-/sys/fs/cgroup/cpuset
+ file-system-/sys/fs/cgroup/devices
+ file-system-/sys/fs/cgroup/memory
+ file-system-/sys/fs/cgroup/pids
+ file-system-/sys/fs/cgroup/systemd
+ networking
+ udev))
+ (start #~(make-forkexec-constructor
+ (list (string-append #$lxd "/bin/lxd")
+ "--group=lxd"
+ "--logfile=/var/log/lxd/lxd.log"
+ #$@(if debug? '("--debug") '())
+ #$@(if verbose? '("--verbose") '()))))
+ (stop #~(make-kill-destructor))))))
+
+(define lxd-service-type
+ (service-type
+ (name 'lxd)
+ (extensions
+ (list (service-extension activation-service-type
+ %lxd-activation)
+ (service-extension shepherd-root-service-type
+ lxd-shepherd-service)
+ (service-extension account-service-type
+ (const %lxd-accounts))))
+ (default-value (lxd-configuration))))
+
;;;
;;; Transparent QEMU emulation via binfmt_misc.
diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm
index f8f4276283..01e36268df 100644
--- a/gnu/system/file-systems.scm
+++ b/gnu/system/file-systems.scm
@@ -561,6 +561,17 @@ (define %elogind-file-systems
(check? #f)
(options "none,name=elogind")
(create-mount-point? #t)
+ (dependencies (list (car %control-groups))))
+ ;; The systemd cgroup needs to exist to run systemd inside linux
+ ;; containers (eg. via LXD). This is *not* required for elogind, but
+ ;; keeping it with the other systemd hacks seemed sensible, for now.
+ (file-system
+ (device "cgroup")
+ (mount-point "/sys/fs/cgroup/systemd")
+ (type "cgroup")
+ (check? #f)
+ (options "none,name=systemd")
+ (create-mount-point? #t)
(dependencies (list (car %control-groups)))))
%control-groups))
--
2.36.1
From 7fecdc80b10c9a9b64b461486b1117acb7785ca1 Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Tue, 9 Nov 2021 22:41:30 +0100
Subject: [PATCH v2 4/7] gnu: Add libgbinder.

* gnu/packages/glib.scm (libgbinder): New variable.

Toggle diff (69 lines)
diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm
index 6686a51fa1..82765f60f0 100644
--- a/gnu/packages/glib.scm
+++ b/gnu/packages/glib.scm
@@ -850,6 +850,62 @@ (define-public glibmm-2.64
(modify-inputs (package-propagated-inputs glibmm)
(replace "libsigc++" libsigc++-2)))))
+(define-public libgbinder
+ (package
+ (name "libgbinder")
+ (version "1.1.23")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/mer-hybris/libgbinder")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "12nw2ihd2xhpvdh0jlyacskqmbdxhnrm5pnz30v4mkyg9kz4xhdc"))))
+ (build-system gnu-build-system)
+ (arguments
+ (list #:make-flags #~(list (string-append "CC="
+ #$(cc-for-target))
+ (string-append "DESTDIR="
+ #$output))
+ #:phases #~(modify-phases %standard-phases
+ (delete 'configure)
+ (add-after 'unpack 'fix-pkg-config-in
+ (lambda* _
+ (substitute* "Makefile"
+ (("usr/") ""))
+ (substitute* "libgbinder.pc.in"
+ (("@libdir@") (string-append #$output "/lib"))
+ (("/usr/include") (string-append #$output
+ "/include")))))
+ (add-after 'install 'install-dev
+ (lambda* _
+ (invoke "make" "install-dev"
+ (string-append "DESTDIR="
+ #$output))))
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (chdir "test")
+ (invoke "make"
+ (string-append "CC="
+ #$(cc-for-target)))
+ (chdir "..")))))))
+ (native-inputs (list bison flex pkg-config))
+ (inputs (list glib libglibutil))
+ (home-page "https://github.com/mer-hybris/libgbinder")
+ (synopsis "GLib-style interface to binder")
+ (description
+ "This package provides GLib-style interface to binder:
+@enumerate
+@item Integration with GLib event loop
+@item Detection of 32 vs 64 bit kernel at runtime
+@item Asynchronous transactions that don't block the event thread
+@item Stable service manager and low-level transation APIs
+@end enumerate")
+ (license license:bsd-3)))
+
(define-public libglibutil
(package
(name "libglibutil")
--
2.36.1
From b0c14635a2ee8afee561ce7c34904ecd15ac59b5 Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Wed, 10 Nov 2021 01:25:52 +0100
Subject: [PATCH v2 5/7] gnu: Add python-gbinder.

* gnu/packages/glib.scm (python-gbinder): New variable.

Toggle diff (40 lines)
diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm
index 82765f60f0..adad0313b2 100644
--- a/gnu/packages/glib.scm
+++ b/gnu/packages/glib.scm
@@ -954,6 +954,33 @@ (define-public libglibutil
(description "This package provides library of glib utilities.")
(license license:bsd-3)))
+(define-public python-gbinder
+ (package
+ (name "python-gbinder")
+ (version "1.0.0")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/erfanoabdi/gbinder-python")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0jgblzakjgsy0cj93bmh5gr7qnl2xgsrm0wzc6xjvzry9lrbs360"))))
+ (build-system python-build-system)
+ (arguments
+ (list #:phases #~(modify-phases %standard-phases
+ (replace 'build
+ (lambda* _
+ (invoke "python" "setup.py" "build_ext"
+ "--inplace" "--cython"))))))
+ (native-inputs (list python-cython pkg-config))
+ (inputs (list glib libgbinder libglibutil))
+ (home-page "https://github.com/erfanoabdi/gbinder-python")
+ (synopsis "Python bindings for libgbinder")
+ (description "This package provides Python bindings for libgbinder.")
+ (license license:gpl3+)))
+
(define-public python-pygobject
(package
(name "python-pygobject")
--
2.36.1
From cc27e2dbe2d68a337db8706d701c3cc43a4e0b1f Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Wed, 22 Dec 2021 02:35:46 +0100
Subject: [PATCH v2 2/7] gnu: Add linux-libre-arm64-waydroid.

* gnu/packages/linux.scm (linux-libre-arm64-waydroid): New variable.

Toggle diff (40 lines)
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index d094c529cb..30738bbad9 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -1080,6 +1080,33 @@ (define-public linux-libre-arm-omap2plus-4.14
#:defconfig "omap2plus_defconfig"
#:extra-version "arm-omap2plus"))
+(define-public linux-libre-arm64-waydroid
+ (make-linux-libre* linux-libre-version
+ linux-libre-gnu-revision
+ linux-libre-source
+ '("aarch64-linux")
+ #:defconfig "defconfig"
+ #:extra-version "arm64-generic"
+ #:extra-options
+ (append
+ `(;; needed to fix the RTC on rockchip platforms
+ ("CONFIG_RTC_DRV_RK808" . #t)
+ ;; Pinebook display, battery, charger and usb
+ ("CONFIG_DRM_ANALOGIX_ANX6345" . m)
+ ("CONFIG_CHARGER_AXP20X" . m)
+ ("CONFIG_INPUT_AXP20X_PEK" . m)
+ ("CONFIG_CHARGER_AXP20X" . m)
+ ("CONFIG_BATTERY_AXP20X" . m)
+ ("CONFIG_PINCTRL_AXP209" . m)
+ ("CONFIG_AXP20X_POWER" . m)
+ ("CONFIG_AXP20X_ADC" . m)
+ ;; Pinebook PRO battery and sound support
+ ("CONFIG_BATTERY_CW2015" . m)
+ ("CONFIG_CHARGER_GPIO" . m)
+ ("CONFIG_SND_SOC_ES8316" . m))
+ %waydroid-extra-linux-options
+ %default-extra-linux-options)))
+
(define-public linux-libre-arm64-generic
(make-linux-libre* linux-libre-version
linux-libre-gnu-revision
--
2.36.1
M
M
Maxime Devos wrote on 25 Jun 2022 18:46
(name . Ludovic Courtès)(address . ludo@gnu.org)
b9c645cb175c3642fd40a55ac3cc9622c8ef3524.camel@telenet.be
phodina via Guix-patches via schreef op za 25-06-2022 om 13:08 [+0000]:
Toggle quote (3 lines)
> +                                (string-append "DESTDIR="
> +                                               #$output))

DESTDIR is for staged installation, which Guix doesn't do, so set
DESTDIR=/ or don't set it at all (maybe PREFIX or prefix is what you
need to set instead?). Likewise for other packages.

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYrc74xccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7rXoAQDJ5psfyKvPLXoMmjHIkHxQDvBZ
pMkddtdDZC54FTgibAEA8gFgxS0mebt5cSlDtc/f0yL5abDUhVSJIp+F//7l7wQ=
=EL0D
-----END PGP SIGNATURE-----


P
P
phodina wrote on 27 Jun 2022 09:07
(name . Maxime Devos)(address . maximedevos@telenet.be)
lbP0QVU9mwtTxmuAPngJtIICmV7r53RWXBaW0YM0CuhxCW6_fbcdctV3S9OFH3_yXMX8AuOAZCQLBReEAzGxlBdfKGa7ZNIKUWv23XaHvBA=@protonmail.com
Hi Maxime,
Toggle quote (12 lines)
>
> > +                                (string-append "DESTDIR="
> > +                                               #$output))
>
>
> DESTDIR is for staged installation, which Guix doesn't do, so set
> DESTDIR=/ or don't set it at all (maybe PREFIX or prefix is what you
> need to set instead?). Likewise for other packages.
>
> Greetings,
> Maxime.

I packaged it this way as at that time was the simples solution. Now I switched to substitution in Makefile itself.

Also there's fix for waydroid package as I mistakenly send old patch.

Should I also create a service for waydroid + test to check it's running?

----
Petr
From ef52a2ac20b691d3eac6614c94787c8bf2daa523 Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Tue, 9 Nov 2021 22:41:30 +0100
Subject: [PATCH v3 4/6] gnu: Add libgbinder.

* gnu/packages/glib.scm (libgbinder): New variable.

Toggle diff (68 lines)
diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm
index 19f69b3a5c..8b91aac41a 100644
--- a/gnu/packages/glib.scm
+++ b/gnu/packages/glib.scm
@@ -850,6 +850,61 @@ (define-public glibmm-2.64
(modify-inputs (package-propagated-inputs glibmm)
(replace "libsigc++" libsigc++-2)))))
+(define-public libgbinder
+ (package
+ (name "libgbinder")
+ (version "1.1.23")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/mer-hybris/libgbinder")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "12nw2ihd2xhpvdh0jlyacskqmbdxhnrm5pnz30v4mkyg9kz4xhdc"))))
+ (build-system gnu-build-system)
+ (arguments
+ (list #:make-flags #~(list (string-append "CC="
+ #$(cc-for-target)))
+ #:phases #~(modify-phases %standard-phases
+ (delete 'configure)
+ (add-after 'unpack 'fix-pkg-config-in
+ (lambda* _
+ (substitute* "Makefile"
+ (("\\$\\(DESTDIR\\)") #$output)
+ (("usr/") ""))
+ (substitute* "libgbinder.pc.in"
+ (("@libdir@") (string-append #$output "/lib"))
+ (("/usr/include") (string-append #$output
+ "/include")))))
+ (add-after 'install 'install-dev
+ (lambda* _
+ (invoke "make" "install-dev"
+ (string-append "DESTDIR="
+ #$output))))
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (chdir "test")
+ (invoke "make"
+ (string-append "CC="
+ #$(cc-for-target)))
+ (chdir "..")))))))
+ (native-inputs (list bison flex pkg-config))
+ (inputs (list glib libglibutil))
+ (home-page "https://github.com/mer-hybris/libgbinder")
+ (synopsis "GLib-style interface to binder")
+ (description
+ "This package provides GLib-style interface to binder:
+@enumerate
+@item Integration with GLib event loop
+@item Detection of 32 vs 64 bit kernel at runtime
+@item Asynchronous transactions that don't block the event thread
+@item Stable service manager and low-level transation APIs
+@end enumerate")
+ (license license:bsd-3)))
+
(define-public libglibutil
(package
(name "libglibutil")
--
2.36.1
From faedb7a4beb492fd024982655a844fb049ba538d Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Wed, 22 Dec 2021 02:35:46 +0100
Subject: [PATCH v3 2/6] gnu: Add linux-libre-arm64-waydroid.

* gnu/packages/linux.scm (linux-libre-arm64-waydroid): New variable.

Toggle diff (40 lines)
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 3d58f8a2c6..7c57ec0d68 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -1080,6 +1080,33 @@ (define-public linux-libre-arm-omap2plus-4.14
#:defconfig "omap2plus_defconfig"
#:extra-version "arm-omap2plus"))
+(define-public linux-libre-arm64-waydroid
+ (make-linux-libre* linux-libre-version
+ linux-libre-gnu-revision
+ linux-libre-source
+ '("aarch64-linux")
+ #:defconfig "defconfig"
+ #:extra-version "arm64-generic"
+ #:extra-options
+ (append
+ `(;; needed to fix the RTC on rockchip platforms
+ ("CONFIG_RTC_DRV_RK808" . #t)
+ ;; Pinebook display, battery, charger and usb
+ ("CONFIG_DRM_ANALOGIX_ANX6345" . m)
+ ("CONFIG_CHARGER_AXP20X" . m)
+ ("CONFIG_INPUT_AXP20X_PEK" . m)
+ ("CONFIG_CHARGER_AXP20X" . m)
+ ("CONFIG_BATTERY_AXP20X" . m)
+ ("CONFIG_PINCTRL_AXP209" . m)
+ ("CONFIG_AXP20X_POWER" . m)
+ ("CONFIG_AXP20X_ADC" . m)
+ ;; Pinebook PRO battery and sound support
+ ("CONFIG_BATTERY_CW2015" . m)
+ ("CONFIG_CHARGER_GPIO" . m)
+ ("CONFIG_SND_SOC_ES8316" . m))
+ %waydroid-extra-linux-options
+ %default-extra-linux-options)))
+
(define-public linux-libre-arm64-generic
(make-linux-libre* linux-libre-version
linux-libre-gnu-revision
--
2.36.1
From a416098d46b7ca5963d835d2603d9d525f0ca236 Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Thu, 11 Nov 2021 19:26:41 +0100
Subject: [PATCH v3 1/6] gnu: Add linux-libre-waydroid.

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

Toggle diff (46 lines)
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 9c59d4ef9b..3d58f8a2c6 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -729,6 +729,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 . 'm)
@@ -1156,6 +1164,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-version
+ linux-libre-gnu-revision
+ linux-libre-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.36.1
From fceafa6fefd82d0968781ed03cf5565af76dc7eb Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Wed, 10 Nov 2021 01:25:52 +0100
Subject: [PATCH v3 5/6] gnu: Add python-gbinder.

* gnu/packages/glib.scm (python-gbinder): New variable.

Toggle diff (40 lines)
diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm
index 8b91aac41a..205c24a909 100644
--- a/gnu/packages/glib.scm
+++ b/gnu/packages/glib.scm
@@ -952,6 +952,33 @@ (define-public libglibutil
(description "This package provides library of glib utilities.")
(license license:bsd-3)))
+(define-public python-gbinder
+ (package
+ (name "python-gbinder")
+ (version "1.0.0")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/erfanoabdi/gbinder-python")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0jgblzakjgsy0cj93bmh5gr7qnl2xgsrm0wzc6xjvzry9lrbs360"))))
+ (build-system python-build-system)
+ (arguments
+ (list #:phases #~(modify-phases %standard-phases
+ (replace 'build
+ (lambda* _
+ (invoke "python" "setup.py" "build_ext"
+ "--inplace" "--cython"))))))
+ (native-inputs (list python-cython pkg-config))
+ (inputs (list glib libgbinder libglibutil))
+ (home-page "https://github.com/erfanoabdi/gbinder-python")
+ (synopsis "Python bindings for libgbinder")
+ (description "This package provides Python bindings for libgbinder.")
+ (license license:gpl3+)))
+
(define-public python-pygobject
(package
(name "python-pygobject")
--
2.36.1
From 9f9dbbfed1d8b7f999c92d940740b478d8d082a8 Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Tue, 9 Nov 2021 22:34:39 +0100
Subject: [PATCH v3 3/6] gnu: Add libglibutil.

* gnu/packages/glib.scm (libglibutil): New variable.

Toggle diff (76 lines)
diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm
index 98267fcee5..19f69b3a5c 100644
--- a/gnu/packages/glib.scm
+++ b/gnu/packages/glib.scm
@@ -17,6 +17,7 @@
;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2020 Arthur Margerit <ruhtra.mar@gmail.com>
;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
+;;; Copyright © 2021 Petr Hodina <phodina@protonmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -75,6 +76,7 @@ (define-module (gnu packages glib)
#:use-module (guix build-system perl)
#:use-module (guix build-system python)
#:use-module (guix download)
+ #:use-module (guix git-download)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix packages)
#:use-module (guix utils)
@@ -848,6 +850,53 @@ (define-public glibmm-2.64
(modify-inputs (package-propagated-inputs glibmm)
(replace "libsigc++" libsigc++-2)))))
+(define-public libglibutil
+ (package
+ (name "libglibutil")
+ (version "1.0.65")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://git.sailfishos.org/mer-core/libglibutil")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0sc8xw5cbxcicipjp6ycbgqppn31lzsll4r9j6b0zxd747dziv54"))))
+ (build-system gnu-build-system)
+ (arguments
+ (list #:make-flags #~(list (string-append "CC="
+ #$(cc-for-target)))
+ #:phases #~(modify-phases %standard-phases
+ (delete 'configure)
+ (add-after 'unpack 'remove-usr-prefix
+ (lambda* _
+ (substitute* "libglibutil.pc.in"
+ (("/usr/include") (string-append #$output
+ "/include")))
+ (substitute* "Makefile"
+ (("\\$\\(DESTDIR\\)") #$output)
+ (("usr/") ""))))
+ (add-after 'install 'install-dev
+ (lambda* _
+ (invoke "make" "install-dev"
+ (string-append "DESTDIR="
+ #$output))))
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (chdir "test")
+ (invoke "make"
+ (string-append "CC="
+ #$(cc-for-target)))
+ (chdir "..")))))))
+ (native-inputs (list pkg-config))
+ (inputs (list glib))
+ (home-page "https://git.sailfishos.org/mer-core/libglibutil")
+ (synopsis "GLib utilites")
+ (description "This package provides library of glib utilities.")
+ (license license:bsd-3)))
+
(define-public python-pygobject
(package
(name "python-pygobject")
--
2.36.1
M
M
Maxime Devos wrote on 19 Jul 2022 16:56
(name . phodina)(address . phodina@protonmail.com)
e973571d213a94fdca17ad9461cc17ab21f4778c.camel@telenet.be
phodina schreef op ma 27-06-2022 om 07:07 [+0000]:
Toggle quote (3 lines)
> Should I also create a service for waydroid + test to check it's
> running?

That would be nice but Waydroid seems useful by itself even without a
service so not required I think.

Greetings,
Maxime.
M
M
Maxime Devos wrote on 19 Jul 2022 16:57
(name . phodina)(address . phodina@protonmail.com)
95979f80d53295fa999af83919909ee786fde125.camel@telenet.be
phodina schreef op ma 27-06-2022 om 07:07 [+0000]:
Toggle quote (2 lines)
> "Waydroid uses Linux namespace

In that case, sounds like you can restrict the 'supported-systems'
field to Linux systems, as it is pointless to try to install it on the
Hurd.

Greetings,
Maxime.
D
Add Waydroid
(address . 51737@debbugs.gnu.org)
52a59b9b-38c0-05c8-6595-92ffd4c5fa8c@dan.games
hi,
just found this useful tool and would like to have it on guix. what is
currently blocking us from merging the patch series?
--
dan
Attachment: OpenPGP_signature
P
P
phodina wrote on 29 Oct 2022 21:28
Re: [bug#51737] [PATCH v3 1/8] gnu: Add linux-libre-waydroid.
(name . 51737@debbugs.gnu.org)(address . 51737@debbugs.gnu.org)
k9gWQoN4xnFyDW5lKjrSQ0GrqIGIOuPSIUZrp3cBT-yxfVeCCBdWLzhuUbgNnJrOZdIWNBc4A8R2lQPHc6nDuOjkTnDsjQZ1YQ8soOwqhgk=@protonmail.com
Hello,

here're are updated patches.

The waydroid package now has field supported systems.

Also there is template for OS which adds important file in /etc/gbinder.d/anbox.conf.

The biggest concern is the hardcoded string for the Android LineageOS image (currently v17). It's possible to specifyt throught command line the URI for the images.

```
$ waydroid init --help
usage: waydroid init [-h] [-i IMAGES_PATH] [-f]
[-c SYSTEM_CHANNEL] [-v VENDOR_CHANNEL]
[-r ROM_TYPE] [-s SYSTEM_TYPE]

optional arguments:
-h, --help show this help message and exit
-i IMAGES_PATH, --images_path IMAGES_PATH
custom path to waydroid images (default
in /var/lib/waydroid/images)
-f, --force re-initialize configs and images
-c SYSTEM_CHANNEL, --system_channel SYSTEM_CHANNEL
custom system channel (options: OTA
channel URL; default is Official OTA
server)
-v VENDOR_CHANNEL, --vendor_channel VENDOR_CHANNEL
custom vendor channel (options: OTA
channel URL; default is Official OTA
server)
-r ROM_TYPE, --rom_type ROM_TYPE
rom type (options: "lineage", "bliss" or
OTA channel URL; default is LineageOS)
-s SYSTEM_TYPE, --system_type SYSTEM_TYPE
system type (options: VANILLA, FOSS or
GAPPS; default is VANILLA)
```

The definition of the hardcoded URI can be found here [1]. If needed this can be patched out. User will specify the source themselves. There is section on how to build the Lineage OS image with waydroid patches. [2]

Also the image and other files are stored under the `/var/lib/waydroid`. Maybe the image can be stored in the store (once we can build the Android images).

Since some of the operations such as `waydroid init` and `waydroid container start` require elevated priviledges it might be good to create a service as well.

The lxc is not directly input for the waydroid package but has to be in the profile. Do you think it might be better to put it as direct dependency?

Since Linux 5.18 the support for ASHMEM has been dropped [3] and you'll see some warning messages in the console. But the Waydroid project already works on MEMFD which is enabled in the kernel.

```
# waydroid container start
[18:15:51] Failed to load ashmem driver
[18:15:51] modprobe: FATAL: Module ashmem_linux not found in directory /run/booted-system/kernel/lib/modules/5.19.11
[18:15:51] Failed to load Ashmem driver
[18:15:51] Found session config on state: RUNNING, restart session
[gbinder] Service manager /dev/binder has appeared
```

Here you can see the screenshot


----
Petr
From bc0c9a3b0d172946a29d4cd648c0f357703221db Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Wed, 22 Dec 2021 02:35:46 +0100
Subject: [PATCH v3 2/8] gnu: Add linux-libre-arm64-waydroid.

* gnu/packages/linux.scm (linux-libre-arm64-waydroid): New variable.

Toggle diff (40 lines)
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index a75ca8229e..5327d2721d 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -1097,6 +1097,33 @@ (define-public linux-libre-arm-omap2plus-4.14
#:defconfig "omap2plus_defconfig"
#:extra-version "arm-omap2plus"))
+(define-public linux-libre-arm64-waydroid
+ (make-linux-libre* linux-libre-version
+ linux-libre-gnu-revision
+ linux-libre-source
+ '("aarch64-linux")
+ #:defconfig "defconfig"
+ #:extra-version "arm64-generic"
+ #:extra-options
+ (append
+ `(;; needed to fix the RTC on rockchip platforms
+ ("CONFIG_RTC_DRV_RK808" . #t)
+ ;; Pinebook display, battery, charger and usb
+ ("CONFIG_DRM_ANALOGIX_ANX6345" . m)
+ ("CONFIG_CHARGER_AXP20X" . m)
+ ("CONFIG_INPUT_AXP20X_PEK" . m)
+ ("CONFIG_CHARGER_AXP20X" . m)
+ ("CONFIG_BATTERY_AXP20X" . m)
+ ("CONFIG_PINCTRL_AXP209" . m)
+ ("CONFIG_AXP20X_POWER" . m)
+ ("CONFIG_AXP20X_ADC" . m)
+ ;; Pinebook PRO battery and sound support
+ ("CONFIG_BATTERY_CW2015" . m)
+ ("CONFIG_CHARGER_GPIO" . m)
+ ("CONFIG_SND_SOC_ES8316" . m))
+ %waydroid-extra-linux-options
+ %default-extra-linux-options)))
+
(define-public linux-libre-arm64-generic
(make-linux-libre* linux-libre-version
linux-libre-gnu-revision
--
2.37.2
From c696fc516bf7406d342594c1326f271172033568 Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Wed, 10 Nov 2021 01:25:52 +0100
Subject: [PATCH v3 5/8] gnu: Add python-gbinder.

* gnu/packages/glib.scm (python-gbinder): New variable.

Toggle diff (40 lines)
diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm
index 7155856cf3..7dd32d5b73 100644
--- a/gnu/packages/glib.scm
+++ b/gnu/packages/glib.scm
@@ -1034,6 +1034,33 @@ (define-public libglibutil
(description "This package provides library of glib utilities.")
(license license:bsd-3)))
+(define-public python-gbinder
+ (package
+ (name "python-gbinder")
+ (version "1.0.0")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/erfanoabdi/gbinder-python")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0jgblzakjgsy0cj93bmh5gr7qnl2xgsrm0wzc6xjvzry9lrbs360"))))
+ (build-system python-build-system)
+ (arguments
+ (list #:phases #~(modify-phases %standard-phases
+ (replace 'build
+ (lambda* _
+ (invoke "python" "setup.py" "build_ext"
+ "--inplace" "--cython"))))))
+ (native-inputs (list python-cython pkg-config))
+ (inputs (list glib libgbinder libglibutil))
+ (home-page "https://github.com/erfanoabdi/gbinder-python")
+ (synopsis "Python bindings for libgbinder")
+ (description "This package provides Python bindings for libgbinder.")
+ (license license:gpl3+)))
+
(define-public python-pygobject
(package
(name "python-pygobject")
--
2.37.2
From c17f86882f11fbbc90dc125d0971894f865b513a Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Sat, 29 Oct 2022 10:05:53 +0200
Subject: [PATCH v3 6/8] gnu: Add python-pyclip.

* gnu/packages/python-xyz.scm (python-pyclip):New variable.

Toggle diff (43 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 1c2f9d7b73..be4b93cb34 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -21296,6 +21296,36 @@ (define-public python-setuptools-rust
Rust Python extensions implemented with @code{PyO3} or @code{rust-cpython}.")
(license license:expat)))
+(define-public python-pyclip
+ (package
+ (name "python-pyclip")
+ (version "0.6.0")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append
+ "https://github.com/spyoungtech/pyclip/archive/refs/tags/v" version ".tar.gz"))
+ (sha256
+ (base32
+ "05psqms1varh0q9dlcp0wz6rpd79y7jhjpx1wk24vqnqdn9jrc30"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (replace 'check
+ (lambda* (#:key tests? inputs outputs #:allow-other-keys)
+ (when tests?
+ (add-installed-pythonpath inputs outputs)
+ (system "Xvfb :1 &")
+ (setenv "DISPLAY" ":1")
+ (invoke "dbus-run-session" "--" "pytest")))))))
+ (native-inputs (list dbus python-pytest xorg-server-for-tests))
+ (inputs (list xclip wl-clipboard))
+ (home-page "https://github.com/aristocratos/btop")
+ (synopsis "Clipboard utilities supporting both binary and text data")
+ (description "This package provides clipboard dor both X11 and Wayland that
+supports binary and text data.")
+ (license license:asl2.0)))
+
(define-public python-pyclipper
(package
(name "python-pyclipper")
--
2.37.2
From c4412fbc65f1992909cc45ed66ebcb018c66a377 Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Tue, 9 Nov 2021 22:34:39 +0100
Subject: [PATCH v3 3/8] gnu: Add libglibutil.

* gnu/packages/glib.scm (libglibutil): New variable.

Toggle diff (77 lines)
diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm
index 61040c91e7..8c024c2df6 100644
--- a/gnu/packages/glib.scm
+++ b/gnu/packages/glib.scm
@@ -17,6 +17,7 @@
;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2020 Arthur Margerit <ruhtra.mar@gmail.com>
;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
+;;; Copyright © 2021 Petr Hodina <phodina@protonmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -76,6 +77,7 @@ (define-module (gnu packages glib)
#:use-module (guix build-system perl)
#:use-module (guix build-system python)
#:use-module (guix download)
+ #:use-module (guix git-download)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix packages)
#:use-module (guix utils)
@@ -928,6 +930,54 @@ (define-public glibmm-2.64
(modify-inputs (package-propagated-inputs glibmm)
(replace "libsigc++" libsigc++-2)))))
+(define-public libglibutil
+ (package
+ (name "libglibutil")
+ (version "1.0.65")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://git.sailfishos.org/mer-core/libglibutil")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0sc8xw5cbxcicipjp6ycbgqppn31lzsll4r9j6b0zxd747dziv54"))))
+ (build-system gnu-build-system)
+ (arguments
+ (list #:make-flags #~(list (string-append "CC="
+ #$(cc-for-target))
+ (string-append "DESTDIR="
+ #$output))
+ #:phases #~(modify-phases %standard-phases
+ (delete 'configure)
+ (add-after 'unpack 'remove-usr-prefix
+ (lambda* _
+ (substitute* "libglibutil.pc.in"
+ (("/usr/include") (string-append #$output
+ "/include")))
+ (substitute* "Makefile"
+ (("usr/") ""))))
+ (add-after 'install 'install-dev
+ (lambda* _
+ (invoke "make" "install-dev"
+ (string-append "DESTDIR="
+ #$output))))
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (chdir "test")
+ (invoke "make"
+ (string-append "CC="
+ #$(cc-for-target)))
+ (chdir "..")))))))
+ (native-inputs (list pkg-config))
+ (inputs (list glib))
+ (home-page "https://git.sailfishos.org/mer-core/libglibutil")
+ (synopsis "GLib utilites")
+ (description "This package provides library of glib utilities.")
+ (license license:bsd-3)))
+
(define-public python-pygobject
(package
(name "python-pygobject")
--
2.37.2
From cd790fe1c9d29c65ba5a05bdd5d82410c6a3d040 Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Sun, 23 Oct 2022 17:08:03 +0200
Subject: [PATCH v3 8/8] gnu: Add waydroid template.

* gnu/system/examples/waydroid.tmpl: New file.

Toggle diff (122 lines)
diff --git a/gnu/system/examples/waydroid.tmpl b/gnu/system/examples/waydroid.tmpl
new file mode 100644
index 0000000000..f9145e88b6
--- /dev/null
+++ b/gnu/system/examples/waydroid.tmpl
@@ -0,0 +1,114 @@
+;; This is an operating system configuration template
+;; for a "desktop" setup with GNOME and Xfce where the
+;; root partition is encrypted with LUKS, and a swap file.
+
+(use-modules (gnu) (gnu system nss) (guix utils))
+(use-service-modules desktop sddm xorg)
+(use-package-modules certs gnome linux virtualization)
+
+(operating-system
+ (host-name "antelope")
+ (timezone "Europe/Paris")
+ (locale "en_US.utf8")
+
+ ;; Choose US English keyboard layout. The "altgr-intl"
+ ;; variant provides dead keys for accented characters.
+ (keyboard-layout (keyboard-layout "us" "altgr-intl"))
+
+ (kernel linux-libre-waydroid)
+ ;; Use the UEFI variant of GRUB with the EFI System
+ ;; Partition mounted on /boot/efi.
+ (bootloader (bootloader-configuration
+ (bootloader grub-efi-bootloader)
+ (targets '("/boot/efi"))
+ (keyboard-layout keyboard-layout)))
+
+ ;; Specify a mapped device for the encrypted root partition.
+ ;; The UUID is that returned by 'cryptsetup luksUUID'.
+ (mapped-devices
+ (list (mapped-device
+ (source (uuid "12345678-1234-1234-1234-123456789abc"))
+ (target "my-root")
+ (type luks-device-mapping))))
+
+ (file-systems (append
+ (list (file-system
+ (device (file-system-label "my-root"))
+ (mount-point "/")
+ (type "ext4")
+ (dependencies mapped-devices))
+ (file-system
+ (device (uuid "1234-ABCD" 'fat))
+ (mount-point "/boot/efi")
+ (type "vfat")))
+ %base-file-systems))
+
+ ;; Specify a swap file for the system, which resides on the
+ ;; root file system.
+ (swap-devices (list (swap-space
+ (target "/swapfile"))))
+
+ ;; Create user `bob' with `alice' as its initial password.
+ (users (cons (user-account
+ (name "bob")
+ (comment "Alice's brother")
+ (password (crypt "alice" "$6$abc"))
+ (group "students")
+ (supplementary-groups '("wheel" "netdev"
+ "audio" "video")))
+ %base-user-accounts))
+
+ ;; Add the `students' group
+ (groups (cons* (user-group
+ (name "students"))
+ %base-groups))
+
+ ;; This is where we specify system-wide packages.
+ (packages (append (list
+ ;; Waydroid
+ waydroid
+ lxc
+ ;; for HTTPS access
+ nss-certs
+ ;; for user mounts
+ gvfs)
+ %base-packages))
+
+ ;; Add GNOME and Xfce---we can choose at the log-in screen
+ ;; by clicking the gear. Use the "desktop" services, which
+ ;; include the X11 log-in service, networking with
+ ;; NetworkManager, and more.
+ (services (if (target-x86-64?)
+ (append (list (service gnome-desktop-service-type)
+ (service special-files-service-type
+ `(("/etc/gbinder.d/anbox.conf" ,(plain-file "anbox.conf"
+"
+[Protocol]
+/dev/binder = aidl2
+/dev/vndbinder = aidl2
+/dev/hwbinder = hidl
+
+[ServiceManager]
+/dev/binder = aidl2
+/dev/vndbinder = aidl2
+/dev/hwbinder = hidl
+"))))
+ (set-xorg-configuration
+ (xorg-configuration
+ (keyboard-layout keyboard-layout))))
+ %desktop-services)
+
+ ;; FIXME: Since GDM depends on Rust (gdm -> gnome-shell -> gjs
+ ;; -> mozjs -> rust) and Rust is currently unavailable on
+ ;; non-x86_64 platforms, we use SDDM and Mate here instead of
+ ;; GNOME and GDM.
+ (append (list (service mate-desktop-service-type)
+ (service xfce-desktop-service-type)
+ (set-xorg-configuration
+ (xorg-configuration
+ (keyboard-layout keyboard-layout))
+ sddm-service-type))
+ %desktop-services)))
+
+ ;; Allow resolution of '.local' host names with mDNS.
+ (name-service-switch %mdns-host-lookup-nss))
--
2.37.2
From 958ed4e0679d397c0ecd5c3728f120a8129d5b30 Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Tue, 9 Nov 2021 22:41:30 +0100
Subject: [PATCH v3 4/8] gnu: Add libgbinder.

* gnu/packages/glib.scm (libgbinder): New variable.

Toggle diff (69 lines)
diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm
index 8c024c2df6..7155856cf3 100644
--- a/gnu/packages/glib.scm
+++ b/gnu/packages/glib.scm
@@ -930,6 +930,62 @@ (define-public glibmm-2.64
(modify-inputs (package-propagated-inputs glibmm)
(replace "libsigc++" libsigc++-2)))))
+(define-public libgbinder
+ (package
+ (name "libgbinder")
+ (version "1.1.23")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/mer-hybris/libgbinder")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "12nw2ihd2xhpvdh0jlyacskqmbdxhnrm5pnz30v4mkyg9kz4xhdc"))))
+ (build-system gnu-build-system)
+ (arguments
+ (list #:make-flags #~(list (string-append "CC="
+ #$(cc-for-target))
+ (string-append "DESTDIR="
+ #$output))
+ #:phases #~(modify-phases %standard-phases
+ (delete 'configure)
+ (add-after 'unpack 'fix-pkg-config-in
+ (lambda* _
+ (substitute* "Makefile"
+ (("usr/") ""))
+ (substitute* "libgbinder.pc.in"
+ (("@libdir@") (string-append #$output "/lib"))
+ (("/usr/include") (string-append #$output
+ "/include")))))
+ (add-after 'install 'install-dev
+ (lambda* _
+ (invoke "make" "install-dev"
+ (string-append "DESTDIR="
+ #$output))))
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (chdir "test")
+ (invoke "make"
+ (string-append "CC="
+ #$(cc-for-target)))
+ (chdir "..")))))))
+ (native-inputs (list bison flex pkg-config))
+ (inputs (list glib libglibutil))
+ (home-page "https://github.com/mer-hybris/libgbinder")
+ (synopsis "GLib-style interface to binder")
+ (description
+ "This package provides GLib-style interface to binder:
+@enumerate
+@item Integration with GLib event loop
+@item Detection of 32 vs 64 bit kernel at runtime
+@item Asynchronous transactions that don't block the event thread
+@item Stable service manager and low-level transation APIs
+@end enumerate")
+ (license license:bsd-3)))
+
(define-public libglibutil
(package
(name "libglibutil")
--
2.37.2
Attachment: waydroid.png
P
P
phodina wrote on 31 Oct 2022 20:30
(name . 51737@debbugs.gnu.org)(address . 51737@debbugs.gnu.org)
8fzx37ONySCMqGXHR4oPO5rd9PWHkHEZVvAb7fGF4EY8pcYugP0Sc8WyO2odhu5SJBfPDbnjkOjxga5n91wMcEKWdSOYYlYKX-ITndH2WUM=@protonmail.com
Regarding the Waydroid (Android) image.

We are currently unable to build the whole image due to the issues summarized by Julien Lepiller on the 10 Years of Guix. Thanks for the presentation! [1]

However, there is project in Nix that allows to build the image. [2]

Would it be possible to use that instead of the one hardcoded in Waydroid?

It's not the perfect solution but definitely better than a random Andorid image pulled from the network.


--
Petr
L
L
Liliana Marie Prikler wrote on 1 Nov 2022 07:51
9768fe9c925723795a7b9c24504cfec57f5bfde4.camel@gmail.com
Am Montag, dem 31.10.2022 um 19:30 +0000 schrieb phodina:
Toggle quote (10 lines)
> Regarding the Waydroid (Android) image.
>
> We are currently unable to build the whole image due to the issues
> summarized by Julien Lepiller on the 10 Years of Guix. Thanks for the
> presentation! [1]
>
> However, there is project in Nix that allows to build the image. [2]
>
> Would it be possible to use that instead of the one hardcoded in
> Waydroid?
IIUC you would have to translate the nix packages there into guix
packages, assuming there's a 1:1 translation (which might not be the
case since everything's just a derivation in Nix). You also have to
take into account different quality guidelines between Guix and Nix –
Guix tends to be more stringent.

Since it's possible to specify the URLs via command line, how about
simply removing the defaults and making the respective command line
options required for the time being?

Cheers
J
J
Julien Lepiller wrote on 1 Nov 2022 08:04
A63322B3-B4F2-487E-A581-3DE48C09C715@lepiller.eu
That sounds good to me. We could have a default, though we must at least make sure we don't advertise for a non-free image.

Concerning my own work, I'm currently trying to build some base system libraries. I managed to get a working cross-compiler for x86_64-linux-android, and I managed to cross-build a couple libraries. I'm hopeful I'll be able to build bionic (android's libc) by the end of the week, then a complete cross toolchain that will help build the rest of the system.

Le 1 novembre 2022 07:51:17 GMT+01:00, Liliana Marie Prikler <liliana.prikler@gmail.com> a écrit :
Toggle quote (22 lines)
>Am Montag, dem 31.10.2022 um 19:30 +0000 schrieb phodina:
>> Regarding the Waydroid (Android) image.
>>
>> We are currently unable to build the whole image due to the issues
>> summarized by Julien Lepiller on the 10 Years of Guix. Thanks for the
>> presentation! [1]
>>
>> However, there is project in Nix that allows to build the image. [2]
>>
>> Would it be possible to use that instead of the one hardcoded in
>> Waydroid?
>IIUC you would have to translate the nix packages there into guix
>packages, assuming there's a 1:1 translation (which might not be the
>case since everything's just a derivation in Nix). You also have to
>take into account different quality guidelines between Guix and Nix –
>Guix tends to be more stringent.
>
>Since it's possible to specify the URLs via command line, how about
>simply removing the defaults and making the respective command line
>options required for the time being?
>
>Cheers
Attachment: file
D
D
Denis 'GNUtoo' Carikli wrote on 4 Nov 2022 04:03
(name . Julien Lepiller)(address . julien@lepiller.eu)
20221104040308.770e2853@primary_laptop
On Tue, 01 Nov 2022 08:04:03 +0100
Julien Lepiller <julien@lepiller.eu> wrote:

Toggle quote (10 lines)
> That sounds good to me. We could have a default, though we must at
> least make sure we don't advertise for a non-free image.
>
> Concerning my own work, I'm currently trying to build some base
> system libraries. I managed to get a working cross-compiler for
> x86_64-linux-android, and I managed to cross-build a couple
> libraries. I'm hopeful I'll be able to build bionic (android's libc)
> by the end of the week, then a complete cross toolchain that will
> help build the rest of the system.

Sorry for catching up late, I was really busy before.

Note that I'm not familiar with Waydroid. Reviewing the Android part
and the overall architecture it was on my TODO list[5] but I've not yet
got the time to do that[1].

I'm also not a Guix maintainer and I don't know if the project already
took decisions or not with what I'm about to discuss.

What I wonder is that if Waydroid gets added as-is, it might be useful
to at least be able to test its functionalities with some FSDG
compliant image.

For instance if users report that audio is broken, it would probably be
a good idea to be able to run test ourselves. And if there is a bug in
binder, we could also do security testing ourselves for instance.

If I compare with another similar Guix functionality: we can
produce software for Microsoft Windows with "guix build -t
x86_64-w64-mingw32 hello" but we at least have Wine for testing.

As I see it, there might be several approaches to solve this testing
issue.

(1) Use GNU/Linux and Guix to make that FSDG compliant image.

For instance we could have:
+-----------------------------------------------+
| Guix host |
| |
| Waydroid (the host/container tools) |
| ^ |
| | |
| v |
| The communication protocols (like Pulseaudio) |
| ^ |
| | |
+---+-------------------------------------------+
|
+---+------------------------------------------------------+
| | Guix guest |
| v |
| Android HAL like hardware/waydroid/audio |
| ^ |
| | |
| v |
| Libhybris or compatibility software that can run Android |
| libraries on GNU/Linux. |
| ^ |
| | |
| v |
| GNU/Linux audio stack or software that can use the |
| Android audio API somehow. |
+----------------------------------------------------------+

I'm unsure how much work that would be, and I've also not looked if
some GNU/Linux distributions are already using libhybris with Android
10 HAL. I'm also unsure if we need to use glibc or bionic (guix can
build Android components with glibc and libhybris probably expects
bionic).

The advantage of this approach that it might be possible to do
automatic testing within Guix as Guix would be used everywhere.

(2) Another approach would be to look more closely at lineage-17.1 and
make a stripped down version that is hopefuly FSDG compliant. It
should normally build fine on top of Trisquel.

In Replicant we moved to AOSP for our work on Android 11, so we
didn't do extensive research on what needs to be removed in
LineageOS 17.1.

However there is at least low hanging fruits that could be removed
easily like:
- The Linux kernel
- The unused hardware support code, like vendor specific libraries
in hardware/ or device repositories in device/.

The waydroid additions probably need to be reviewed too.

The downside here is probably maintenance: users need a way to
report FSDG compliance issue, and there needs to be a way to fix
that.

(3) Porting the Waydroid modifications[2][3] on top of Replicant 11 (and
reviewing these modifications too).

While Replicant 11 is not really usable yet on real devices yet
(telephony support for the GT-I9300 (Galaxy SIII) isn't complete for
instance, sound support is very basic, etc), Replicant 11 status
shouldn't affect the ability to add Waydroid support.

The advantage of Replicant here is that there is already a community
and infrastructure and Replicant is already listed in the FSDG
compliant distributions.

An issue with Replicant would probably be with boringdroid[4]:
It ships a binary apk (though it's released under the Apache 2.0).
Building it from source within the Replicant source code would fix
that, and the boringdroid seems to be doing something like that
already. However we also need to deactivate it for real devices, so
that seems to require more code integration work as boringdroid
seems to patch core android components like
platform/frameworks/base[4].

By the way, does someone knows where to find information about the
architecture of Waydroid. For instance is there some document that
explains how it works (like that it uses a HAL that use alsa that
then somehow talks to the host pulseaudio?, what modifications it did
for graphics, etc).

References:
-----------
[1]In Replicant 11, we now use a kernel based on upstream Linux (more
precisely a Debian kernel with our patches on top). So we need to
understand which projects we can share (maintenance) work with.

Denis.
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEeC+d2+Nrp/PU3kkGX138wUF34mMFAmNkgOwACgkQX138wUF3
4mMj8A//cPIooMHMOR7MsdNBCQbisbScgZrEeDiY1+Wxj7CD6F0Egl0rI1EDej39
FLHQxB0I62naz0TKq+WNVO4+Nkoy23qrTYp3skZPCMTR9Q0xEIPVKuF/FrVLPWgD
krFXvZpNW7eim9U1oq33gXuY4CIJoTaQGpLkz15U4fYbVWnW96u7525Dlen7C8vm
3hMBZHExyvb94nDi3MdNAxjcFn2zBHA3N88PjzWIKf9zv/wbUGutBtHGvJi3T8fk
tvycjStRgoraNWcvssTRYuSKXiCta1YQiXfdhfabxUWvx0ZT21Mq9jjVjpadGPfO
DHbBfMFk4w9FJgvtcYm5XyexLJthGvShGK08yx0iZ3OdVFq3qQZthuKZGvaZiGBt
Rg6jeAsPKN3IfdXfN/+4N+fsOTUhRMQRTE8Tylrb1YXHnNtQIBdKNgbvYsNEBywG
4zQUTPPB+4/EhhsaDvTT0mgCPUPHjjBr/UbVswSimTtmebcT2Fe0COZNvokNtRzE
/Q7+66evDMAUoEIXTxTVynXI9loJeWRr7EajJgso62xslMaCfcGn6DaTkg2Ie0ZX
JenKjIcH6erAUsXmVmrQXG3I14ai3rARSbSIGdnQH27bOJj2LQ6iTk3+P7dN6Tnd
qDsZp4K5Ikqa/YIqIY7PTxqcYB+iIbjQMdGug7ZCZCKy5dcbXtM=
=F98M
-----END PGP SIGNATURE-----


D
D
Denis 'GNUtoo' Carikli wrote on 4 Nov 2022 12:38
(name . Julien Lepiller)(address . julien@lepiller.eu)
20221104123857.4df5bfaa@primary_laptop
On Fri, 4 Nov 2022 04:03:08 +0100
Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> wrote:
Toggle quote (2 lines)
> (1) Use GNU/Linux and Guix to make that FSDG compliant image.

I've looked into more details for audio and it uses the alsa
interface exported by pulseaudio[1][2]:
Toggle quote (2 lines)
> ret = snd_pcm_open(&out->pcm, "pulse", SND_PCM_STREAM_PLAYBACK, 0);

I'm not sure if "pulse" is the host name for the interface or not
though[3][4].

So here using plain GNU/Linux and "mplayer -ao alsa <file>" could
probably work for testing.

I'll try to look into some other interfaces later on.

References:
-----------
[4]They use a modified version of the real alsa library[5], so the
API documentation should be the same.

Denis.
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEeC+d2+Nrp/PU3kkGX138wUF34mMFAmNk+dEACgkQX138wUF3
4mOuLRAAqC1FgEl1k7yPP+W0KxiucYuKsjRyTK8qgbMCGQ6SqyFOzC6y8tToXNGc
LuYQ2rWhS7ufsmFb4Sp7sAYDXPXxtMuM1RAPZF6pSTqoT+6BOWLeePpxb7OC71nH
nDU2X5IySIXtqJUMAOFNMASSIoMOXhuPTGkAybPvO/2Qp23L/MhqRq1ryTDhv1w3
0OuEcpPHSfw6BmjsI2jnde6o1/dc/ZwGJ/7+tVFRtsYYJWRccKbCdNOwZ5bpq5/6
N+iCiQwloGuvEy1N2Cv1eUcstBlz50oGThHpUTaDW/fDCVzdnryZZGJv9/JwHbSb
l/89sARfxPPzk6keKRX4C47sY42nA7cvY+sORzH8XxDo3+Y9mfpxewbt3xXvtgLn
2uN/UAKJMsZdrYwQphp6BInYKsTxFvjq5SIVOqP6j8lyrkNz9ftruiSrdDfnTlTf
rSMoJ9n+Nwx3173AO9xvcFsLSotw4x17y88TaU5WrUpgOGxKZLBM58Dc96EehZY9
l0MKbzsHMJNb+oEfB8/w3ffPpQT6a9qm1CpkacG3MMDKGPHezYBVYHRBdfwiy5Ta
XrR+XVxxWY4u1jMB6g6TqDHGmqnst9I04K7d0pLQMH//t3Ej9luG1h/6ya0TPWIq
Y63RSSPZ+oY8ooIkv1+3yD8BkG937zOHjk9e1xr5HbvMK2/Lv6A=
=msgF
-----END PGP SIGNATURE-----


D
D
Denis 'GNUtoo' Carikli wrote on 4 Nov 2022 12:51
(name . Julien Lepiller)(address . julien@lepiller.eu)
20221104125131.787be088@primary_laptop
On Fri, 4 Nov 2022 04:03:08 +0100
Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> wrote:
Toggle quote (2 lines)
> (1) Use GNU/Linux and Guix to make that FSDG compliant image.

For graphics GNU/Linux probably works out of the box too[1]:
Toggle quote (10 lines)
> make_entry(tools.helpers.gpu.getDriNode(args),
> "dev/dri/renderD128")
>
> for n in glob.glob("/dev/fb*"):
> make_entry(n)
> for n in glob.glob("/dev/graphics/fb*"):
> make_entry(n)
> for n in glob.glob("/dev/video*"):
> make_entry(n)

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEeC+d2+Nrp/PU3kkGX138wUF34mMFAmNk/MMACgkQX138wUF3
4mOkZhAAk+3Pzo54KGnqa99FhvmUteAnVOQzXE0Ukh13m4sKa4RTBvo/4Ff4MJOu
zPkndfxHZH7QyPgyofHEp1O+PhDHmnOox38p3Jc/eVu64BORQNvzUEXIuBH0Xze4
vJkW0IGhIeclWdWyEN8q5Mi7CSx9gIPOyq1jaVQwa2k0SBsECL+tFiwrV64eCYn9
/WYOv5vI1eQ7LcXrGhuEcc6o71HqVRcZsW6mQF+3KBNLbXvO7pb4K4lngu0LB7ZE
K9TfxT1XJOZttuDyEtHdgU0DPo8l7PAzCRnAaRU+N8WJlxJAUe6l4g0wgQAuNfNg
5ut6QkG9QT4KfGeHhpxWm9vYi6c4BFeI5nYylJ/Jp6JfYiiUu7KcZHcN8F53ej7X
AkE4yDhdcPfapPbUqzn1XVRPFaTZMpid2jYv2U9zI2idhURL6LK+XuxOM+zR+Cvw
2rSZ6zd6FXzTnD6SzqxSPMMKkB1VLJtdtblPJnDfH9BmFxCSci/XgSFtNVa5bFAq
1kSRAeS5trqonF/HSr/ZltwEBBBQQ3qKFqut3sXsGIeWSTRx5Xl/vqCXs+Oty276
Ux8sv6x3LIbN52sZvTc1HTj99L7htWq444S67lJ6f3Wh6OOvD+ukBBuX1x+aswQb
VNMIqAmCaoNv+3YWwKsC7lOpQAVJjCbOG8/7z0EMhljdptgPlyI=
=Hh2w
-----END PGP SIGNATURE-----


D
D
Denis 'GNUtoo' Carikli wrote on 4 Nov 2022 13:26
(name . Julien Lepiller)(address . julien@lepiller.eu)
20221104132652.418038da@primary_laptop
On Fri, 4 Nov 2022 04:03:08 +0100
Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> wrote:
Toggle quote (2 lines)
> (1) Use GNU/Linux and Guix to make that FSDG compliant image.

I found projects that have test code for binder under GNU/Linux[1][2],
however it seems to require selinux.

For getting a shell, it uses lxc directly[3]:
Toggle quote (13 lines)
> def shell(args):
> if status(args) != "RUNNING":
> logging.error("WayDroid container is {}".format(status(args)))
> return
> command = ["lxc-attach", "-P", tools.config.defaults["lxc"],
> "-n", "waydroid", "--"]
> if args.COMMAND:
> command.append(args.COMMAND)
> else:
> command.append("/system/bin/sh")
> subprocess.run(command, env={"PATH": os.environ['PATH'] +
> ":/system/bin:/vendor/bin"})

Though it uses Android specific paths. If we add a symlink from /bin/sh
to /system/bin/sh, it might work.

So it's probably not that hard to somehow generate an image where the
non-android specific functions could at least work for testing.

It might also be possible to use that as a starting point to later on
switch to Android images built with Guix.

As for building applications, beside the technical part that Julien is
working on as far as I understand, there is also the practical issue of
finding applications that are easy to review (without tons of
dependencies and so on) and that could work in Waydroid (Silence
requires a telephony stack to be useful, and Waydroid doesn't seem to
have one).

We started doing code review long time ago in Replicant[4] but I didn't
manage to complete a single review yet due to the lack of time.

References:
-----------

Denis.
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEeC+d2+Nrp/PU3kkGX138wUF34mMFAmNlBQwACgkQX138wUF3
4mM+AxAAokCadmapeGNvsLoACwqCrxG8PJWKFdHYpeJM5BPjK60OSM9BfKVY4sWW
MwAqOmbQlPKDi3Gu/8ofz9pwnX/ttFpL7sTqA6EnZnTkBrA9VLXeqaiasqW4fXi0
7Y40lKLy9z4P3s8A7rlrlls9RLkgLhi07qWkGCiLrqydEHaSQDfYfBT3/HzH4f6Q
KNJVgucxa0ZTBcgI26wQzlLUlpdgnxegeZPoCmm60rfqpFR5N2B/ACLcCjaQf6Ek
L7fnWj3573IpTAc2R3sTWKyUd3zyd5Ek9hZujbIwilGC+r/zkZIyOd3ElKM/pisi
dn0VEdfK2z2av6qvMrA9dx3jPbSTGFjXhdUwUxhpwnV8FzFnzjUMLIvGuovh+zp0
kzHu6C7Q6GFFtz4r+4LXfOfYURDD7qVRLFML6Jqa42JmR5YZOaD8OW9QH/5HMsk0
8gQX4QTS48g8vgDMP9z43Rn7x0NCRJaOLEe/7sQlX/nFFsPBrP5FXpI9oR2Y1arz
/DkAgFc3CkzHeb6c3WncnaE16jdpVa+TUHwQ9qkMQXYvGQ1R1bsjKoQEXqWMz7pQ
CakOT3roTgYDkSP0RUF6x54PYCWtt/dLLryemC0OnsWtvBGUXLWOJeBY5rnKcBFd
v85PnE38MB6IunBMvD0x5zGWHAg0HQG6AlY8ch+xk2xMNlagRRc=
=9a//
-----END PGP SIGNATURE-----


D
D
Denis 'GNUtoo' Carikli wrote on 12 Nov 2022 16:54
(name . Julien Lepiller)(address . julien@lepiller.eu)
20221112165414.6ad49394@primary_laptop
On Fri, 4 Nov 2022 04:03:08 +0100
Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> wrote:
Toggle quote (7 lines)
> (3) Porting the Waydroid modifications[2][3] on top of Replicant 11
> (and reviewing these modifications too).
>
> While Replicant 11 is not really usable yet on real devices yet
> (telephony support for the GT-I9300 (Galaxy SIII) isn't complete
> for instance, sound support is very basic, etc), Replicant 11 status
> shouldn't affect the ability to add Waydroid support.
I've tried a very quick approach to evaluate how complicated that would
be:
- The device repositories and HAL related code can be imported pretty
easily. Some minor changes are needed as there is no lineageOS
distribution.
- The repositories that are replaced (like mesa, minigbm, etc) seem to
be needed somehow. If I use the Replicant ones I've get some errors
about missing headers. I'm unsure what is the best approach here
between making a stripped down version of these repositories just for
the header or figuring out another way to integrate the changes
somehow.
- There is still the boringdroid apk that I didn't look into. While
it's a separate APK, it looks complicated to build in the sources.

Denis.
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEeC+d2+Nrp/PU3kkGX138wUF34mMFAmNvwaYACgkQX138wUF3
4mMOrxAAo0lBH+6cXXvk9hrpZHUbENf2l+ZgKKKHqGFKyxvRzNAqTVtflTenBU5W
7usOdCK1jw5VbRLJCzyYXN1qj1PKADFuzxAocuOHct2S6uSa8L6lENfXMUqs7ym8
fIFB5xIOx2NC9ud17E4gthgB8BXiWsTrtR+/f0cFCFG+Wtx6jE1prQwHPMrrG//M
Z3nEvahPBqVx/nQSFuYZH8KuOrgn0Zip8yz4kRnren5w/5eR82kC+WUN70mLbcfL
6UJLHQHclQSa5eCgMG2CEdsnoUkQW/CEVaCD81gbBsihravv3CPE9NuiZw9QeMMj
DtsNMi1+ibkK9PgYf1afe2o6ttMfuX39rswipx3LbZErkYCKQTcfvNOzpfSrVbxw
XgnOI9cHoIjaih2WKKQ7rYWOOyNYO3E+MhFhMsfSeUizP2vrzllZaArhkHZ+olG3
vSkGdEkCJNZnBC723aNLJ3cMM4HjamY6HAoL4r5dhBgCzzYSY5Yac67xY+QDpU3s
eQcBcjMjgUOhKmpTrXNawgqGyk1IfUVNQ4llHHFyeyXPFeYiCOZ4mVbkzoSHQVFF
QThhnNZxa7SYxaASTTWA9O8BdGgghoR5fDWJhNImZjjq+37zTlqrw/V+zthyDQz+
m+rkjIAUdGd5fBMk+tU2WxrhWJ5rwIzfCPoPpn5GFrGU9aJ/FTU=
=XYNz
-----END PGP SIGNATURE-----


P
P
phodina wrote on 13 Dec 2022 17:49
(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)
RD2l23g12bR-nKiwVkIoKpGStp4AgPmohLqmYtDf1_g42BD-kGI5WPgamA4Flq9jyqHYkjqiKD_Q9dZT5WtHd2tx_i6rUnvpGU23fpnJ2FA=@protonmail.com
Sent with Proton Mail secure email.

------- Original Message -------
On Tuesday, November 1st, 2022 at 7:51 AM, Liliana Marie Prikler <liliana.prikler@gmail.com> wrote:


Toggle quote (23 lines)
> Am Montag, dem 31.10.2022 um 19:30 +0000 schrieb phodina:
>
> > Regarding the Waydroid (Android) image.
> >
> > We are currently unable to build the whole image due to the issues
> > summarized by Julien Lepiller on the 10 Years of Guix. Thanks for the
> > presentation! [1]
> >
> > However, there is project in Nix that allows to build the image. [2]
> >
> > Would it be possible to use that instead of the one hardcoded in
> > Waydroid?
>
> IIUC you would have to translate the nix packages there into guix
> packages, assuming there's a 1:1 translation (which might not be the
> case since everything's just a derivation in Nix). You also have to
> take into account different quality guidelines between Guix and Nix –
> Guix tends to be more stringent.
>
> Since it's possible to specify the URLs via command line, how about
> simply removing the defaults and making the respective command line
> options required for the time being?

I agree with you to submit a patch which will remove the default image and require the user to pass the image as argument.

In order to build the image and not just blindly download and run some off the internet I suggest to use Robotnix project, which is a way how to build the whole Android image.

Once we have all the necessary components in Guix we can build the image ourselves.

----
Petr
P
P
phodina wrote on 13 Dec 2022 18:10
(name . Julien Lepiller)(address . julien@lepiller.eu)
TSZ3KbW8pWiHR-s7n0KMq8YnQkWyCLL6DOlHb477XwK-felNqipGaELLOM8ADrtJjJcgg5jlDN2MTWkAKP79QwxaNVxd952QBiP4sXf5EfM=@protonmail.com
Hi Julien,

agreed, though rather than being non-free the issue is more of being opaque as we shouldn't trust what's inside.

There's documentation on how to build one based on Lineage OS. [1]

Do you think if LineageOS would build the Waydroid image as another device it would be acceptable for Guix to download the artifact directly? [2]

Also how's the bionic library going?


----
Petr
------- Original Message -------
On Tuesday, November 1st, 2022 at 8:04 AM, Julien Lepiller <julien@lepiller.eu> wrote:

Toggle quote (39 lines)
> That sounds good to me. We could have a default, though we must at least make sure we don't advertise for a non-free image.
>
> Concerning my own work, I'm currently trying to build some base system libraries. I managed to get a working cross-compiler for x86_64-linux-android, and I managed to cross-build a couple libraries. I'm hopeful I'll be able to build bionic (android's libc) by the end of the week, then a complete cross toolchain that will help build the rest of the system.
>
> Le 1 novembre 2022 07:51:17 GMT+01:00, Liliana Marie Prikler <liliana.prikler@gmail.com> a écrit :
>
>> Am Montag, dem 31.10.2022 um 19:30 +0000 schrieb phodina:
>>
>>> Regarding the Waydroid (Android) image.
>>>
>>> We are currently unable to build the whole image due to the issues
>>>
>>> summarized by Julien Lepiller on the 10 Years of Guix. Thanks for the
>>>
>>> presentation! [1]
>>>
>>> However, there is project in Nix that allows to build the image. [2]
>>>
>>> Would it be possible to use that instead of the one hardcoded in
>>>
>>> Waydroid?
>>
>> IIUC you would have to translate the nix packages there into guix
>>
>> packages, assuming there's a 1:1 translation (which might not be the
>>
>> case since everything's just a derivation in Nix). You also have to
>>
>> take into account different quality guidelines between Guix and Nix –
>>
>> Guix tends to be more stringent.
>>
>> Since it's possible to specify the URLs via command line, how about
>>
>> simply removing the defaults and making the respective command line
>>
>> options required for the time being?
>>
>> Cheers
Attachment: file
P
P
phodina wrote on 13 Dec 2022 18:48
(name . Denis 'GNUtoo' Carikli)(address . GNUtoo@cyberdimension.org)
mtjh0EZY1D6QEA_rp_-kN4aE42A48plvqGCwgm_l3eDtg8oMT4PY-eSazWczQ2e6UDeqjAYj3GjdxzMvDzyZLgCf7htrhTDfTGUyUZRKVYI=@protonmail.com
Hi Denis,

Toggle quote (4 lines)
> What I wonder is that if Waydroid gets added as-is, it might be useful
> to at least be able to test its functionalities with some FSDG
> compliant image.

Agreed, the question is what to add as the Waydroid runs the Android Userspace in a container
- therefore the HW specific part can be removed, Guix (or foreign kernel) will be used.

I haven't done research into the FSDG compliant Android images. I'm familiar with Graphene OS
on my phone, previously LineageOS and before Cyanogenmod.

I'm aware of Replicant but haven't had the chance to look into it unfortunately yet.


Toggle quote (5 lines)
>
> For instance if users report that audio is broken, it would probably be
> a good idea to be able to run test ourselves. And if there is a bug in
> binder, we could also do security testing ourselves for instance.

Nice idea. There could be file e.g. 'guix/gnu/tests/waydroid.scm' with tests which would run
each time the image or the waydroid would be changed.

Toggle quote (5 lines)
>
> If I compare with another similar Guix functionality: we can
> produce software for Microsoft Windows with "guix build -t
> x86_64-w64-mingw32 hello" but we at least have Wine for testing.

You can think of waydroid of a "Wine" also. You launch the container and then you can
develop using normal tools such as ADB to get shell etc.

Waydroid can show the whole UI screen or just the application.

The only issue is that the apps are more designed for touch than mouse since most laptops
and PCs don't have a touchscreen.

Toggle quote (44 lines)
>
> As I see it, there might be several approaches to solve this testing
> issue.
>
> (1) Use GNU/Linux and Guix to make that FSDG compliant image.
>
> For instance we could have:
> +-----------------------------------------------+
> | Guix host |
> | |
> | Waydroid (the host/container tools) |
> | ^ |
> | | |
> | v |
> | The communication protocols (like Pulseaudio) |
> | ^ |
> | | |
> +---+-------------------------------------------+
> |
> +---+------------------------------------------------------+
> | | Guix guest |
> | v |
> | Android HAL like hardware/waydroid/audio |
> | ^ |
> | | |
> | v |
> | Libhybris or compatibility software that can run Android |
> | libraries on GNU/Linux. |
> | ^ |
> | | |
> | v |
> | GNU/Linux audio stack or software that can use the |
> | Android audio API somehow. |
> +----------------------------------------------------------+
>
> I'm unsure how much work that would be, and I've also not looked if
> some GNU/Linux distributions are already using libhybris with Android
> 10 HAL. I'm also unsure if we need to use glibc or bionic (guix can
> build Android components with glibc and libhybris probably expects
> bionic).
>
> The advantage of this approach that it might be possible to do
> automatic testing within Guix as Guix would be used everywhere.

This is perphaps the solution in the long run. It tould offer a lot of integration
into Guix and nice way to build, test and interact with the image.

Toggle quote (4 lines)
> (2) Another approach would be to look more closely at lineage-17.1 and
> make a stripped down version that is hopefuly FSDG compliant. It
> should normally build fine on top of Trisquel.

This is probably the best approach atm. What's missing is the host - Trisquel, Robotnix
and the base image (AOSP, LineageOS, Replicant ...).


Toggle quote (2 lines)
> The waydroid additions probably need to be reviewed too.

Agreed. As users want to pack other proprietary stuff inside e.g. GApps and others.


Toggle quote (3 lines)
> (3) Porting the Waydroid modifications[2][3] on top of Replicant 11 (and
> reviewing these modifications too).

Well IMHO I'd rather focus in another direction - PostmarketOS[1].

It's GNU/Linux on Phones and works quite good. The downside are the Apps. As most
corporations and developers won't port their apps the Waydroid fills in quite nicely
with the ability to launch the Android app.

However, if you are interested somebody already asked about different base images [2]

Toggle quote (6 lines)
> By the way, does someone knows where to find information about the
> architecture of Waydroid. For instance is there some document that
> explains how it works (like that it uses a HAL that use alsa that
> then somehow talks to the host pulseaudio?, what modifications it did
> for graphics, etc).

Haven't found any architecture wiki or document that would describe in greater detail
how it exactly works. Just issue on github which is already closed :-( [3]



----
Petr
J
J
Julien Lepiller wrote on 13 Dec 2022 19:23
(name . phodina)(address . phodina@protonmail.com)
3294542A-ABDB-4C8A-A2C8-C8A55EDECC57@lepiller.eu
I managed to build bionic in the time frame I envisionned, but I have some issues with recursive module imports when trying to define the base inputs for the gnu-build-system (and ultimately the blueprint-build-system).

One concern I have is that Lineage OS includes some non free components, though I'm not sure what exactly (at least non-free firmware in the kernel, probably drivers too).

Le 13 décembre 2022 18:10:38 GMT+01:00, phodina <phodina@protonmail.com> a écrit :
Toggle quote (56 lines)
>Hi Julien,
>
>agreed, though rather than being non-free the issue is more of being opaque as we shouldn't trust what's inside.
>
>There's documentation on how to build one based on Lineage OS. [1]
>
>Do you think if LineageOS would build the Waydroid image as another device it would be acceptable for Guix to download the artifact directly? [2]
>
>Also how's the bionic library going?
>
>[1] https://docs.waydro.id/development/compile-waydroid-lineage-os-based-images[2] https://wiki.lineageos.org/devices/
>
>----
>Petr
>------- Original Message -------
>On Tuesday, November 1st, 2022 at 8:04 AM, Julien Lepiller <julien@lepiller.eu> wrote:
>
>> That sounds good to me. We could have a default, though we must at least make sure we don't advertise for a non-free image.
>>
>> Concerning my own work, I'm currently trying to build some base system libraries. I managed to get a working cross-compiler for x86_64-linux-android, and I managed to cross-build a couple libraries. I'm hopeful I'll be able to build bionic (android's libc) by the end of the week, then a complete cross toolchain that will help build the rest of the system.
>>
>> Le 1 novembre 2022 07:51:17 GMT+01:00, Liliana Marie Prikler <liliana.prikler@gmail.com> a écrit :
>>
>>> Am Montag, dem 31.10.2022 um 19:30 +0000 schrieb phodina:
>>>
>>>> Regarding the Waydroid (Android) image.
>>>>
>>>> We are currently unable to build the whole image due to the issues
>>>>
>>>> summarized by Julien Lepiller on the 10 Years of Guix. Thanks for the
>>>>
>>>> presentation! [1]
>>>>
>>>> However, there is project in Nix that allows to build the image. [2]
>>>>
>>>> Would it be possible to use that instead of the one hardcoded in
>>>>
>>>> Waydroid?
>>>
>>> IIUC you would have to translate the nix packages there into guix
>>>
>>> packages, assuming there's a 1:1 translation (which might not be the
>>>
>>> case since everything's just a derivation in Nix). You also have to
>>>
>>> take into account different quality guidelines between Guix and Nix –
>>>
>>> Guix tends to be more stringent.
>>>
>>> Since it's possible to specify the URLs via command line, how about
>>>
>>> simply removing the defaults and making the respective command line
>>>
>>> options required for the time being?
>>>
>>> Cheers
Attachment: file
D
D
Denis 'GNUtoo' Carikli wrote on 15 Dec 2022 17:38
(name . Julien Lepiller)(address . julien@lepiller.eu)
20221215173836.49271218@primary_laptop
On Tue, 13 Dec 2022 19:23:06 +0100
Julien Lepiller <julien@lepiller.eu> wrote:

Toggle quote (8 lines)
> I managed to build bionic in the time frame I envisionned, but I have
> some issues with recursive module imports when trying to define the
> base inputs for the gnu-build-system (and ultimately the
> blueprint-build-system).
>
> One concern I have is that Lineage OS includes some non free
> components, though I'm not sure what exactly (at least non-free
> firmware in the kernel, probably drivers too).
Part of the work of making an FSDG compliant LineageOS derivative can
be really easy:
- The kernel can be removed as it's not needed here. I'm not sure where
the kernel headers are but they are most likely separate.
- Most of the device repositories (in device/<vendor>/<product>) contain
scripts whose only goal is to download (from the device) the required
nonfree software.
- All hardware related HAL that depends on these nonfree software can
be removed.

Here in practice it means forking the LineageOS manifest and removing
the offending repositories.

The hard part is with the rest of the code: With Android, knowing the
license of the repositories is not easy because you don't have package
definitions and you probably don't have very strict copyright
requirements (like in Debian).

There are empty files like LICENSE_APACHE2 in some repositories, and
that is used to indicate the license (it's the closest we have to a
license field in a package definition), but I've no idea how precise
they are. These are used by code that generate the list of licenses
displayed in the phone settings, but I didn't look yet how it works.

So if we want to do it right we'd probably need to review at least the
usual suspect ourselves (like libraries with fat code, AAC related
code, try to look if there are nonfree binaries left, etc).

If people want to use LineageOS as a base, they need to check the
DivestOS project as they have a script that can partially deblob more
recent versions of LineageOS (they also informed Replicant of some of
the blobs Replicant missed). They don't remove all the blobs though, so
it might be a good idea to check with them what blobs still need to be
removed.

Replicant 6.0 is based on LineageOS 13.0 which is based on Android
6.0.1, and over time we found and/or were notified of freedom and
privacy issues (that both conflicted with the FSDG). And none of these
issues were present in AOSP. At least some of these issues came from
CyanogenMod, so maybe they are not present anymore.

Another option is to use AOSP instead of LineageOS. This could make
FSDG compliance easier as there won't be any potential issues with
LineageOS additions.

It will also enable to share more work because several Android
distributions using AOSP and kernels based on upstream Linux started to
create a community[1] to share work. So for instance the vibrator HAL
of Waydroid could be replaced by the "Force Feedback haptic hal" that
is generic. Replicant has applied for funding through NLnet to improve
the sharing of work through that community. So for the long term
maintenance of such a project, using AOSP might be a better bet,
especially if distributions like Guix start packaging more and more
AOSP components (this way we'd share more and more work on reviewing
licensing information).

As for linux-libre-waydroid itself, if the only change is to enable
Android drivers, maybe the kernel could be renamed to something more
generic like linux-libre-android.

And if for instance we package for instance userspace tools to test the
binder driver, and with that we might already have a use case and be
able to test this kernel anyway. And I've not reviewed the patch but
the maintenance here could be completely automatized (so when somebody
updates linux-libre, linux-libre-android gets updated automatically).

PS: To all readers: I'm not a Guix maintainer, so I can't decide if
patches get in or not.

References:
-----------

Denis.
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEeC+d2+Nrp/PU3kkGX138wUF34mMFAmObTYwACgkQX138wUF3
4mOQZxAAhlbP2zUwMvrilYUVRM26pGSv6lbTbRP1kZN9gYFqi+YU5m86pysxBCpS
zPu0/q+epHVTxtQ33YiKJilAcOpGryAK8OFRW/wfiCRB97Umx+VxN48b40CwSIAF
6gdyyPKfwANdUVDSTtl9oT43plsA9Crq0N4SqlYjx6amYjLRd4w04+Od+trvuUWa
ljrentxvW26zC96P+YtmAVSD5SBL5ZOFaORWXZSfZ4eNHfD4XjHJg+I/VGIQm6S2
rdqz39N9aQlDVMCyYkZEqdotUbZpEsmPGw0sDiDj4EBwevmr45aue4oR2D7W3EeV
rTbs8Lg60tITXyjm+bZUr3VeN4s/VGaH23CwPm/PMmOKkP3ImO5O8YR1Qhk+Alq9
0BouJaB+KsatL8Itd6lh/mO63hIDeSDpFP4yT8H8MvTprD/pCBlp2J9drtI+R9QU
crOsX3LUO8HgsaE3uZp+jrolWVo0VoOxCp62JslNK0dBlv3dqbKcva/Ij0MTGaql
ZYi0uLlPpI+i2+SwxuJuJCze9aOzhcnUuGgIRXXtrmkVkVmbFT8yIkYdEMS9pWHb
xfHKQu+lId5fqtxT2IPY8X/y1DyHuxHSt72mKBtzqkg8lvVpNgnLZiXPWdJ/SA1X
RTOLn2WSXicrr6MGnhtivo92xafxZA6Y4lokdc7gCoRoOR3NJbg=
=zHzt
-----END PGP SIGNATURE-----


D
D
Denis 'GNUtoo' Carikli wrote on 15 Dec 2022 17:44
(name . phodina)(address . phodina@protonmail.com)
20221215174418.2d296f99@primary_laptop
On Tue, 13 Dec 2022 16:49:00 +0000
phodina <phodina@protonmail.com> wrote:
Toggle quote (7 lines)
>
> I agree with you to submit a patch which will remove the default
> image and require the user to pass the image as argument.
>
> In order to build the image and not just blindly download and run
> some off the internet I suggest to use Robotnix project, which is a
> way how to build the whole Android image.
I've looked at it some time ago and as far as I understand it depends on
NixOS which is not FSDG compliant, but at least it might give us better
information than the AOSP source code as there are package definitions
in Robotnix.

Does someone knows how accurate the licensing information is in
Robotnix?

In any case there are already FSDG distributions like Parabola that
rely on upstream packages that are less strict with license compliance,
so maybe we could use that as a base to find potential issues way
faster than by going through the AOSP code, and maybe a quick look
would be good enough.

PS: Note that I'm not a guix maintainer.

Denis.
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEeC+d2+Nrp/PU3kkGX138wUF34mMFAmObTuIACgkQX138wUF3
4mNRBQ/9HSa66m6F92P1Gf9tlNAxBfNT+AHl6Jai5usopgr+OdSma+BIC9rwaHaf
IUWiwnqLrMD7h76SP7xjbPaGodixrxzwmQnS6Of1/XZlsLO+Ur8rXQEAD0s4sy20
+QyWIngTsN+LEuixnAcrbc4pthBHsVkUU6mst/Y9Zx/H32QrRSeal5RMmbKE5isE
xTI/3MQxMvlRlhZ2CgDIj+qb8B3L9WbTo4vYq+sggr/+tlqo060wRFoW9zX6vTpZ
rrmkff9dCdO4QJUqw+4FPwbepE8ZN86AWg53P465+ksndDjjjLgbU8p0XUcwJhd9
rK78KHWMWdcXtFqJWMLBAKayXybN+U6kl1Cecz0G/agdnSUn9EKmLlp7N5WrzoVJ
qTjho4xNkdYB+Vj68NdZMdgKaCC53ffTHFJ+IIY+FgMndMDdQw+PumFN++5at+Vm
yfwNofu1sCORs3WxvMQMIlSGBJSXWwtVsJUZ848t3ZfEvSNLhMYgV8Q6/EZ9c35g
qYFdT4ihlRQt4YJ8q3iwhKPsmrPm4OPWPwS84qq25l9UhMuXALtOc5Pl8fwOAOk3
VZM8kOuxJ0q/+gPt+zMUjBULMowFQnSh9K6pF9o5uz4ojZnk7dVJnvxYv3QpLFHv
9ug+7qr61smIAdRJBsz0FD105ZvFfOMKAPm1L55i3VzIMilAbNg=
=wZwo
-----END PGP SIGNATURE-----


D
D
Denis 'GNUtoo' Carikli wrote on 15 Dec 2022 18:02
(name . phodina)(address . phodina@protonmail.com)
20221215180251.471501c9@primary_laptop
On Tue, 13 Dec 2022 17:48:28 +0000
phodina <phodina@protonmail.com> wrote:

Toggle quote (1 lines)
> Hi Denis,
Hi,

Toggle quote (4 lines)
> Waydroid can show the whole UI screen or just the application.
>
> The only issue is that the apps are more designed for touch than
> mouse since most laptops and PCs don't have a touchscreen.
I think there are more limitations. For instance the "silence"
application will probably not work as it requires a modem stack that
would somehow be able to interact with GNU/Linux modem stack.

But applications like Replica Island will probably work.

Toggle quote (13 lines)
> > (2) Another approach would be to look more closely at lineage-17.1
> > and make a stripped down version that is hopefuly FSDG compliant. It
> > should normally build fine on top of Trisquel.
>
> This is probably the best approach atm. What's missing is the host -
> Trisquel, Robotnix and the base image (AOSP, LineageOS, Replicant
> ...).
>
>
> > The waydroid additions probably need to be reviewed too.
>
> Agreed. As users want to pack other proprietary stuff inside e.g.
> GApps and others.
I was more thinking about (1) the code that they added, like their
HAL etc. That code is probably fine and fast to review. And (2)
the apk they bundle in to get their windowing system working. That
might be harder to review but it has more probability to be
problematic.

Toggle quote (4 lines)
> > (3) Porting the Waydroid modifications[2][3] on top of Replicant 11
> > (and reviewing these modifications too).
>
> Well IMHO I'd rather focus in another direction - PostmarketOS[1].
I wasn't implying to use Replicant as the operating system controlling
the computer, but rather to reuse Replicant 11 to make a base image to
be used with Waydroid. The advantage here is to share the maintenance
of the FSDG compliance. The downside is that it requires porting the
Waydroid changes in ways that don't confilict with the current Replicant
source code.
Toggle quote (4 lines)
> It's GNU/Linux on Phones and works quite good. The downside are the
> Apps. As most corporations and developers won't port their apps the
> Waydroid fills in quite nicely with the ability to launch the Android
> app.
The nice thing about PostmarketOS is that they also work to upstream
their work, so for instance Guix could also package what they use to
make the Pinephone work for instance.

In Replicant we also collaborate with PostmarketOS to try to support the
devices supported by Replicant 6.0 with upstream kernels, so you can
even collaborate with them if you're using a completely different
userspace (and without having to run postmarketOS).

Toggle quote (12 lines)
> However, if you are interested somebody already asked about different
> base images [2]
>
> > By the way, does someone knows where to find information about the
> > architecture of Waydroid. For instance is there some document that
> > explains how it works (like that it uses a HAL that use alsa that
> > then somehow talks to the host pulseaudio?, what modifications it
> > did for graphics, etc).
>
> Haven't found any architecture wiki or document that would describe
> in greater detail how it exactly works. Just issue on github which is
> already closed :-( [3]
Thanks, I'll look into it.

Denis.
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEeC+d2+Nrp/PU3kkGX138wUF34mMFAmObUzsACgkQX138wUF3
4mPmKxAAnbb0wjGhc7QrznA8KyDjGvUpnrUCE22kLcg7nzKVTSiD6xVDw9j96B3u
PcP7aNwVQNAIUn7Ah/BsAvPfoNIfmWrFAe93Y0Rt+e5ux9wY4dbnzeZVpf20R3RF
mYOmD9nt8UbDualHf5flDaZOzPyZFEzTiSXsOeYCFM7LVrwzKEo5gLwAA8I8Wt7C
QJlionJQ6PaJrIqrvjpbaGhsuTVGaXgZiRCPUHxDkvoIBUDpNllhhkYtJiG69SmL
Y1/EW3Kbt9bZfh7jn5hx112bQvYw/fislbyNqjo3R8NCzCH7Bs3jDw43e4s+fT5b
H1uZsQBaHVshzycaDYIHmCgY6eMPv/8i9Kdn3czRxhzD/oYyINIBevmLVODFIYE8
GK00ub+cQn9/PFJ8u0u687+eiYq2QmfIlMa2UYJv6cCzOOZKKbFB2K+/X9F8RbnC
6W+7Uj6MrqqhiiDU8iMEJG/iaWCUA/geLOo+dDv6xJmjiRcjsN6jmM+ZHXSrVHPe
j0+k0K1lk+Hf2CHeq3LJ4X4Mxcc6gA2pDzoP7eB8DYXRWNrwoMbIjRvomiz4muj2
0sKS+4mQP7Mi1c2ZFeqAO9xlVd2fZ3h45PyNvTmt+lGQbkM+nVXW782DyU9RFzRC
RynlF5U98Q1b98paZ7Wkidgsez8qlYSmLytavmH5pQvvANoXfoI=
=MKJ3
-----END PGP SIGNATURE-----


B
B
Bruno Victal wrote on 4 Apr 2023 15:31
control-msg
(name . control)(address . control@debbugs.gnu.org)
b1c28681-d877-2cdd-db09-0895fa9a8a72@makinata.eu
tags 62324 patch
tags 61462 patch
tags 60788 - pending
tags 59971 wishlist
tags 51737 patch

tags 62624 + security
tags 49817 + security

# resend control-msg
close 37740


quit
O
O
outlook user wrote on 20 Mar 14:56 +0100
Add Waydroid
(name . 51737@debbugs.gnu.org)(address . 51737@debbugs.gnu.org)
AS8P251MB0854519A5B15BDAF32CC743597332@AS8P251MB0854.EURP251.PROD.OUTLOOK.COM
On which branch all that was pushed? Where is it available? How to apply all those patches at once?
Attachment: file
?