all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: znavko@disroot.org
To: Ricardo Wurmus <rekado@elephly.net>
Cc: Help Guix <help-guix@gnu.org>
Subject: Re: wpa-supplicant service configuration. Guile is hard
Date: Sat, 06 Apr 2019 08:54:24 +0000	[thread overview]
Message-ID: <e33d08fd9bb13009d53a5c4afe6624ef@disroot.org> (raw)
In-Reply-To: <871s2gxv9d.fsf@elephly.net>

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

Hello! I've spent 3 hours reading emacs tutorial and searching for scheme mode but did not get result.
Pressing M-q on each paragraph of my config has broke it (attached file with suffix emacs).

> Why do you do this all manually instead of using
> wpa-supplicant-service-type and dhcp-client-service-type?

I do have wpa-supplicant-service-type and dhcp-client-service-type, and they do not work, cause wlan is soft blocked. I need to use `rfkill unblock wifi` in my script, but services do not do this.
After reboot I have `herd status` as in attach, networking is inactive there. I think soft blocking happens because there are 2 wlan in my system, a strange tun0 has appeared.

# ifconfig
enp3s0    Link encap:Ethernet  HWaddr xx:xx:xx:11
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0  TX bytes:0

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Bcast:0.0.0.0  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0  TX bytes:0

tun0      Link encap:(hwtype unknown)
          inet addr:10.14.0.26  Bcast:0.0.0.0  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:8911 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5637 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:8626006  TX bytes:703476

wlp2s0    Link encap:Ethernet  HWaddr xx:xx:xx:xx:22
          inet addr:192.168.1.33  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:10351 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5867 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:9765341  TX bytes:1265501

Also I attach some dmesg lines if it will give some info.
Now I have network services, but they do not manage the soft blocking of wifi. How to unblock automatically?


April 6, 2019 4:36 AM, "Ricardo Wurmus" <rekado@elephly.net> wrote:

> znavko@tutanota.com writes:
> 
>> Hello! I have several questions about wpa-supplicant + dhcpcd services.
>> 
>> First of all I do not want to use networkmanager and I usually get Internet working manually with
>> this:
>> # cat startnet
>> #!/bin/sh
>> #connect to wi-fi through wpa_supplicant
>> herd stop wpa-supplicant
>> rfkill unblock wifi
>> wpa_supplicant -B -i wlp2s0 -c /etc/wpa_supplicant/wpa_supplicant.conf
>> sleep 2
>> dhclient -v wlp2s0
> 
> Why do you do this all manually instead of using
> wpa-supplicant-service-type and dhcp-client-service-type?
> 
> Your configuration looks … adventurous. Here are some recommendations:
> 
> * don’t nest modify-services. Nothing good will come of this. It only
> serves to confuse you. “modify-services” can modify more than one
> service at once.
> 
> * don’t leave parentheses on lines all by themselves. They get lonely.
> 
> * don’t use dhcpd-service-type unless you want to run a DHCP server.
> Use dhcp-client-service-type for the DHCP *client*.
> 
> * you don’t need to add wpa-supplicant to the list of globally installed
> packages. The service is enough.
> 
> * maybe try fixing the indentation (Emacs can do this with M-q) — it’s
> very hard to understand the configuration when the indentation tries
> hard to mislead you.
> 
> --
> Ricardo

[-- Attachment #2: config-wpa-dhcp-client2.conf --]
[-- Type: text/plain, Size: 3025 bytes --]

;;this is znavko's cute config

(use-modules (gnu) (gnu system nss)
             (gnu system locale) ;;for locale-definition
             (gnu services desktop)
             (srfi srfi-1) ;;for remove function
             (gnu services networking) ;;for remove ntp
             (gnu services avahi) ;;for remove avahi
             (gnu services xorg)
             (gnu packages admin) ;;for wpa_supplicant
)
(use-service-modules desktop)
(use-package-modules certs gnome)

(operating-system (host-name "antelope") (timezone "Europe/Moscow") (locale "en_US.utf8")
  (bootloader (bootloader-configuration (bootloader grub-bootloader) (target "/dev/sda")))
  (file-systems (cons (file-system (device "/dev/sda1") (mount-point "/") (type "ext4")) %base-file-systems))
  (swap-devices '("/dev/sda2"))

  (users (cons* (user-account (name "bob") (group "users")
                (supplementary-groups '("wheel" "netdev" "audio" "video"))
                (home-directory "/home/bob"))
                (user-account (name "mom") (group "users")
                (supplementary-groups '("wheel" "netdev" "audio" "video"))
                (home-directory "/home/mom"))
               %base-user-accounts))

  ;; This is where we specify system-wide packages.
  (packages (cons* nss-certs         ;for HTTPS access
                   gvfs              ;for user mounts
		   wpa-supplicant
                   %base-packages))

  (services (cons* 
              (service xfce-desktop-service-type)
              (service dhcp-client-service-type)

              (modify-services      
                (remove (lambda (service)
                  (member (service-kind service)
                    (list ntp-service-type avahi-service-type 
                          bluetooth-service network-manager-service-type)))
                  %desktop-services)  ;end of remove lambda services

                (wpa-supplicant-service-type config =>
                  (wpa-supplicant-configuration
                    (interface "wlp2s0")
                    (config-file "/etc/wpa_supplicant/wpa_supplicant.conf")))

                (gdm-service-type config =>
                  (gdm-configuration
                    (xorg-configuration
                      (xorg-configuration
                        (extra-config  
                          '("Section \"InputClass\"
                              Identifier \"touchpad\"
                              Driver \"libinput\"
                              MatchIsTouchpad \"on\"
                              Option \"Tapping\" \"on\"
                              EndSection")
                )))))

                (elogind-service-type
                  c => (elogind-configuration (handle-lid-switch 'ignore)))
              );;end of modify-services
  ));;end of services

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

 (kernel-arguments '("modprobe.blacklist=pcspkr,snd_pcsp,wmi,bluetooth,pata_acpi"))

);;end of operating-system

  


[-- Attachment #3: config-wpa-dhcp-client2--emacs.conf --]
[-- Type: text/plain, Size: 2674 bytes --]

;;this is znavko's cute config

(use-modules (gnu) (gnu system nss) (gnu system locale) ;;for
             locale-definition (gnu services desktop) (srfi srfi-1)
             ;;for remove function (gnu services networking) ;;for
             remove ntp (gnu services avahi) ;;for remove avahi (gnu
             services xorg) (gnu packages admin) ;;for wpa_supplicant
             ) (use-service-modules desktop) (use-package-modules
             certs gnome)

(operating-system (host-name "antelope") (timezone "Europe/Moscow")
  (locale "en_US.utf8") (bootloader (bootloader-configuration
  (bootloader grub-bootloader) (target "/dev/sda"))) (file-systems
  (cons (file-system (device "/dev/sda1") (mount-point "/") (type
  "ext4")) %base-file-systems)) (swap-devices '("/dev/sda2"))

  (users (cons* (user-account (name "bob") (group "users")
                (supplementary-groups '("wheel" "netdev" "audio"
                "video")) (home-directory "/home/bob")) (user-account
                (name "mom") (group "users") (supplementary-groups
                '("wheel" "netdev" "audio" "video")) (home-directory
                "/home/mom")) %base-user-accounts))

  ;; This is where we specify system-wide packages.  (packages (cons*
  nss-certs ;for HTTPS access gvfs ;for user mounts wpa-supplicant
  %base-packages))

  (services (cons* (service xfce-desktop-service-type) (service
              dhcp-client-service-type)

              (modify-services (remove (lambda (service) (member
                (service-kind service) (list ntp-service-type
                avahi-service-type bluetooth-service
                network-manager-service-type))) %desktop-services)
                ;end of remove lambda services

                (wpa-supplicant-service-type config =>
                  (wpa-supplicant-configuration (interface "wlp2s0")
                  (config-file
                  "/etc/wpa_supplicant/wpa_supplicant.conf")))

                (gdm-service-type config => (gdm-configuration
                  (xorg-configuration (xorg-configuration
                  (extra-config '("Section \"InputClass\" Identifier
                  \"touchpad\" Driver \"libinput\" MatchIsTouchpad
                  \"on\" Option \"Tapping\" \"on\" EndSection") )))))

                (elogind-service-type c => (elogind-configuration
                  (handle-lid-switch 'ignore))) );;end of
                  modify-services ));;end of services

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

 (kernel-arguments
 '("modprobe.blacklist=pcspkr,snd_pcsp,wmi,bluetooth,pata_acpi"))

);;end of operating-system

  


[-- Attachment #4: herd-status.txt --]
[-- Type: text/plain, Size: 1052 bytes --]

# herd status
Started:
 + console-font-tty1
 + console-font-tty2
 + console-font-tty3
 + console-font-tty4
 + console-font-tty5
 + console-font-tty6
 + dbus-system
 + elogind
 + file-system-/dev/pts
 + file-system-/dev/shm
 + file-system-/gnu/store
 + file-system-/run/systemd
 + file-system-/run/user
 + file-system-/sys/fs/cgroup
 + file-system-/sys/fs/cgroup/blkio
 + file-system-/sys/fs/cgroup/cpu
 + file-system-/sys/fs/cgroup/cpuacct
 + file-system-/sys/fs/cgroup/cpuset
 + file-system-/sys/fs/cgroup/devices
 + file-system-/sys/fs/cgroup/elogind
 + file-system-/sys/fs/cgroup/freezer
 + file-system-/sys/fs/cgroup/memory
 + file-system-/sys/fs/cgroup/perf_event
 + file-systems
 + guix-daemon
 + host-name
 + loopback
 + nscd
 + root
 + root-file-system
 + swap-/dev/sda2
 + syslogd
 + term-tty1
 + term-tty2
 + term-tty3
 + term-tty4
 + term-tty5
 + term-tty6
 + udev
 + upower-daemon
 + urandom-seed
 + user-file-systems
 + user-processes
 + virtual-terminal
 + wpa-supplicant
 + xorg-server
Stopped:
 - networking
 - term-auto
 - user-homes


[-- Attachment #5: dmesg-lines.txt --]
[-- Type: text/plain, Size: 1446 bytes --]

[    6.436738] Bluetooth: HCI UART protocol Marvell registered
[    6.445066] 1-1.4.3: Missing Free firmware (non-Free firmware loading is disabled)
[    6.449163] cfg80211: Loaded X.509 cert 'sforshee: 00b11111111'
[    6.453753] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[    6.453837] cfg80211: failed to load regulatory.db
[    6.455260] Bluetooth: Patch file not found /*(DEBLOBBED)*/
[    6.455358] Bluetooth: Loading patch file failed
[    6.455476] ath3k: probe of 1-1.4.3:1.0 failed with error -2
[    6.455608] usbcore: registered new interface driver ath3k
[    6.462512] libphy: r8169: probed
...
[    6.802155] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[    6.802755] ieee80211 phy0: Atheros AR9565 Rev:1 mem=0x111111111, irq=18
[    6.807723] ath9k 0000:02:00.0 wlp2s0: renamed from wlan0
..
[    9.162302] shepherd[1]: Service guix-daemon has been started.
[    9.757077] random: crng init done
[    9.758506] random: 1 urandom warning(s) missed due to ratelimiting
[   10.853034] 0000:03:00.0: Missing Free firmware (non-Free firmware loading is disabled)
[   10.854867] r8169 0000:03:00.0 enp3s0: unable to load firmware patch /*(DEBLOBBED)*/ (-2)
[   10.856611] Generic PHY r8169-300:00: attached PHY driver [Generic PHY] (mii_bus:phy_addr=r8169-300:00, irq=IGNORE)
[   10.957616] r8169 0000:03:00.0 enp3s0: Link is Down
[   25.073090] fuse init (API version 7.28)



  parent reply	other threads:[~2019-04-06  8:54 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <LbdoDpd--3-1@tutanota.com-LbdrIe9----1>
2019-04-04 20:36 ` wpa-supplicant service configuration. Guile is hard znavko
     [not found] ` <Lbe0PNU--3-1@tutanota.com-Lbe3LhE----1>
2019-04-05  9:41   ` znavko
2019-04-05 16:38     ` Ricardo Wurmus
2019-04-06  8:54     ` znavko [this message]
2019-04-06  8:57     ` znavko
2019-04-06 17:55     ` znavko
2019-04-05 13:49   ` jbranso
2019-04-05 14:34     ` znavko
2019-04-04 19:26 znavko
2019-04-04 20:01 ` Quiliro Ordonez
2019-04-05 16:47 ` Ricardo Wurmus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e33d08fd9bb13009d53a5c4afe6624ef@disroot.org \
    --to=znavko@disroot.org \
    --cc=help-guix@gnu.org \
    --cc=rekado@elephly.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.