all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#28650] [PATCH] gnu: android: Add android-udev-rules package.
@ 2017-09-29 16:09 Maxim Cournoyer
  2017-10-03 13:23 ` bug#28650: " Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: Maxim Cournoyer @ 2017-09-29 16:09 UTC (permalink / raw)
  To: 28650

[-- Attachment #1: Type: text/plain, Size: 246 bytes --]

Hello!

This new package should make it easy for anyone to properly use adb
or the (not yet packaged fastboot) Android command line tools as a
user (rather than root).

It can be used directly in the rules list of the udev service to extend it.


[-- Attachment #2: 0001-gnu-android-Add-android-udev-rules-package.patch --]
[-- Type: text/x-patch, Size: 3171 bytes --]

From ea637a7b5adb5f88cb6dc62759f25e36c1ea1acf Mon Sep 17 00:00:00 2001
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Date: Fri, 29 Sep 2017 09:17:03 -0400
Subject: [PATCH] gnu: android: Add android-udev-rules package.

* gnu/packages/android.scm (android-udev-rules): Add package.
---
 gnu/packages/android.scm | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm
index be3f50add..bff6a6038 100644
--- a/gnu/packages/android.scm
+++ b/gnu/packages/android.scm
@@ -4,6 +4,7 @@
 ;;; Copyright © 2016 Marius Bakke <mbakke@fastmail.com>
 ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
 ;;; Copyright © 2017 Hartmut Goebel <h.goebel@crazy-compilers.com>
+;;; Copyright © 2017 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -21,10 +22,12 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages android)
+  #:use-module (guix gexp)
   #:use-module (guix packages)
   #:use-module (guix git-download)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system trivial)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (gnu packages)
   #:use-module (gnu packages gnupg)
@@ -305,6 +308,40 @@ of device actions, such as installing and debugging apps, and it provides access
 to a Unix shell that can run commands on the connected device or emulator.")
     (license license:asl2.0)))
 
+(define-public android-udev-rules
+  (package
+    (name "android-udev-rules")
+    (version "20170910")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/M0Rf30/android-udev-rules")
+             (commit version)))
+       (file-name (string-append name "-" version "-checkout"))
+       (sha256
+        (base32 "0vic40n3si0dxag3dyc3hi3pn7cjpm5q378x8v2ys19n3iz9fp1g"))))
+    (build-system trivial-build-system)
+    (native-inputs `(("source" ,source)))
+    (arguments
+     '(#:modules ((guix build utils))
+       #:builder
+       (begin
+         (use-modules (guix build utils))
+         (let ((source (assoc-ref %build-inputs "source")))
+           (install-file (string-append source "/51-android.rules")
+                         (string-append %output "/lib/udev/rules.d"))))))
+    (home-page "https://github.com/M0Rf30/android-udev-rules")
+    (synopsis "udev rules for Android devices")
+    (description "Provides a set of udev rules to allow using Android devices
+with tools such as @command{adb} and @command{fastboot} without root
+privileges.  This package is intended to be added as a rule to the
+@code{udev-service-type} in your @code{operating-system}
+configuration. Additionally, an @code{adbusers} group must be defined and your
+user added to it.  @emph{Simply installing this package will @strong{not} have
+an effect.}")
+    (license license:gpl3+)))
+
 (define-public git-repo
   (package
     (name "git-repo")
-- 
2.14.1


[-- Attachment #3: Type: text/plain, Size: 119 bytes --]


Here's a sample config that demonstrates how it can be used (pay
attention to the definition of the adbusers group).


[-- Attachment #4: config.scm --]
[-- Type: text/plain, Size: 3194 bytes --]

;; This is an operating system configuration template
;; for a "desktop" setup without full-blown desktop
;; environments.

(use-modules (gnu)
	     (gnu system nss)
	     (gnu services)
	     (gnu system shadow)	;for user-group
	     (guix download)		;for url-fetch
	     (guix gexp)		;for file-append
	     (guix packages)		;for origin
	     (guix store)		;for %default-substitute-urls
	     (srfi srfi-1))		;for the remove function

(use-service-modules base		;for nscd-service-type
		     desktop
		     networking		;for wicd-service-type
		     ssh)		;for lsh-service

(use-package-modules admin		;for wpa-supplicant
		     android  		;for android-udev-rules
		     ratpoison
		     certs)

(define 51-android-udev.rules
  (let ((version "20170910"))
   (origin
     (method url-fetch)
     (uri (string-append "https://raw.githubusercontent.com/M0Rf30/"
			 "android-udev-rules/" version "/51-android.rules"))
     (sha256
      (base32 "0lmmagpyb6xsq6zcr2w1cyx9qmjqmajkvrdbhjx32gqf1d9is003")))))

(operating-system
  (host-name "apteryx")
  (timezone "America/Montreal")	      ;America/Los_Angeles, Asia/Tokyo
  (locale "en_US.UTF-8")

  ;; Assuming /dev/sdX is the target hard disk, and "my-root"
  ;; is the label of the target root file system.
  (bootloader (bootloader-configuration
	       (bootloader grub-bootloader)
	       (target "/dev/sda")))

  (file-systems (cons (file-system
                        (device "my-root")
                        (title 'label)
                        (mount-point "/")
                        (type "ext4"))
                      %base-file-systems))

  (users (cons (user-account
                (name "maxim")
                (comment "Maxim Cournoyer")
                (group "users")
                (supplementary-groups
		 '("lp"			;for bluetooth
		   "adbusers"		;for adb
		   "wheel" "netdev" "audio" "video"))
                (home-directory "/home/maxim"))
               %base-user-accounts))

  ;; Add plugdev to %base-groups
  (groups (cons (user-group (system? #t) (name "adbusers")) %base-groups))
  
  ;; Add a bunch of window managers; we can choose one at
  ;; the log-in screen with F1.
  (packages (cons* ratpoison
                   nss-certs		;for HTTPS access
                   %base-packages))

  ;; Use the "desktop" services, which include the X11
  ;; log-in service and more.
  (services
   (cons*
    (bluetooth-service #:auto-enable? #t)
    (modify-services %desktop-services
      ;; Add a couple extra substitute servers.
      (guix-service-type config =>
                         (guix-configuration
                          (inherit config)
                          (substitute-urls
                           (cons* "https://bayfront.guixsd.org"
				  "https://berlin.guixsd.org"
                                  %default-substitute-urls))))
      ;; Enable using adb as a simple user with a multitude of devices.
      (udev-service-type
       config =>
       (udev-configuration
      	(inherit config)
      	(rules (cons* android-udev-rules
		      (udev-configuration-rules config))))))))

  ;; Allow resolution of '.local' host names with mDNS.
  (name-service-switch %mdns-host-lookup-nss))

[-- Attachment #5: Type: text/plain, Size: 19 bytes --]


Thank you,

Maxim

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

* bug#28650: [PATCH] gnu: android: Add android-udev-rules package.
  2017-09-29 16:09 [bug#28650] [PATCH] gnu: android: Add android-udev-rules package Maxim Cournoyer
@ 2017-10-03 13:23 ` Ludovic Courtès
  2017-10-03 15:25   ` [bug#28650] " Maxim Cournoyer
  0 siblings, 1 reply; 3+ messages in thread
From: Ludovic Courtès @ 2017-10-03 13:23 UTC (permalink / raw)
  To: Maxim Cournoyer; +Cc: 28650-done

[-- Attachment #1: Type: text/plain, Size: 380 bytes --]

Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis:

> From ea637a7b5adb5f88cb6dc62759f25e36c1ea1acf Mon Sep 17 00:00:00 2001
> From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
> Date: Fri, 29 Sep 2017 09:17:03 -0400
> Subject: [PATCH] gnu: android: Add android-udev-rules package.
>
> * gnu/packages/android.scm (android-udev-rules): Add package.

Committed with this change:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 1315 bytes --]

diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm
index bff6a6038..d9be335be 100644
--- a/gnu/packages/android.scm
+++ b/gnu/packages/android.scm
@@ -22,7 +22,6 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages android)
-  #:use-module (guix gexp)
   #:use-module (guix packages)
   #:use-module (guix git-download)
   #:use-module (guix build-system gnu)
@@ -336,10 +335,12 @@ to a Unix shell that can run commands on the connected device or emulator.")
     (description "Provides a set of udev rules to allow using Android devices
 with tools such as @command{adb} and @command{fastboot} without root
 privileges.  This package is intended to be added as a rule to the
-@code{udev-service-type} in your @code{operating-system}
-configuration. Additionally, an @code{adbusers} group must be defined and your
-user added to it.  @emph{Simply installing this package will @strong{not} have
-an effect.}")
+@code{udev-service-type} in your @code{operating-system} configuration.
+Additionally, an @code{adbusers} group must be defined and your user added to
+it.
+
+@emph{Simply installing this package will not have any effect.}  It is meant
+to be passed to the @code{udev} service.")
     (license license:gpl3+)))
 
 (define-public git-repo

[-- Attachment #3: Type: text/plain, Size: 23 bytes --]


Thanks!

Ludo’.

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

* [bug#28650] [PATCH] gnu: android: Add android-udev-rules package.
  2017-10-03 13:23 ` bug#28650: " Ludovic Courtès
@ 2017-10-03 15:25   ` Maxim Cournoyer
  0 siblings, 0 replies; 3+ messages in thread
From: Maxim Cournoyer @ 2017-10-03 15:25 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 28650-done

ludo@gnu.org (Ludovic Courtès) writes:

> Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis:
>
>> From ea637a7b5adb5f88cb6dc62759f25e36c1ea1acf Mon Sep 17 00:00:00 2001
>> From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
>> Date: Fri, 29 Sep 2017 09:17:03 -0400
>> Subject: [PATCH] gnu: android: Add android-udev-rules package.
>>
>> * gnu/packages/android.scm (android-udev-rules): Add package.
>
> Committed with this change:
>
> diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm
> index bff6a6038..d9be335be 100644
> --- a/gnu/packages/android.scm
> +++ b/gnu/packages/android.scm
> @@ -22,7 +22,6 @@
>  ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
>  
>  (define-module (gnu packages android)
> -  #:use-module (guix gexp)
>    #:use-module (guix packages)
>    #:use-module (guix git-download)
>    #:use-module (guix build-system gnu)
> @@ -336,10 +335,12 @@ to a Unix shell that can run commands on the connected device or emulator.")
>      (description "Provides a set of udev rules to allow using Android devices
>  with tools such as @command{adb} and @command{fastboot} without root
>  privileges.  This package is intended to be added as a rule to the
> -@code{udev-service-type} in your @code{operating-system}
> -configuration. Additionally, an @code{adbusers} group must be defined and your
> -user added to it.  @emph{Simply installing this package will @strong{not} have
> -an effect.}")
> +@code{udev-service-type} in your @code{operating-system} configuration.
> +Additionally, an @code{adbusers} group must be defined and your user added to
> +it.
> +
> +@emph{Simply installing this package will not have any effect.}  It is meant
> +to be passed to the @code{udev} service.")
>      (license license:gpl3+)))
>  
>  (define-public git-repo
>
>
> Thanks!
>
> Ludo’.

Thanks for the review!

Maxim

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

end of thread, other threads:[~2017-10-03 15:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-29 16:09 [bug#28650] [PATCH] gnu: android: Add android-udev-rules package Maxim Cournoyer
2017-10-03 13:23 ` bug#28650: " Ludovic Courtès
2017-10-03 15:25   ` [bug#28650] " Maxim Cournoyer

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.