[DNG] automount Was: Re: A better default windows manager

2015-08-26 Thread Svante Signell
On Tue, 2015-08-25 at 17:29 +0200, Joerg Reisenweber wrote:
> On Sun 26 July 2015 23:18:58 Steve Litt wrote:
> > You can roll your own automount with one day's work using inotify-wait,
> > dmesg, sudo, lsblk, and the mount command. Works without X or window
> > manager. Heck, I'll do it myself if more than 20 people want it.
> 
> +1
> /j

Steve, what is the current development status of your promised tool?

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] netman GIT project

2015-08-26 Thread Irrwahn
On Wed, 26 Aug 2015 05:39:36 +0100, Edward Bartolo wrote:

> Today, if my concentration permits, I will try to add support for eth0
> and add code to display the device nodes in the list box. I can also
> add support for eth1 and wlan1, but this in my opinion is an overkill
> as mobile computers do not usually have more than one wired
> connection.

I don't think it's overkill. Since interface names can easily be changed 
could as well be almost anything, like wifi2 or frobz42. If you deem it 
appropriate to focus on just one interface, the name should at least be 
configurable. 
Or, even better, you could easily pass the IF name as an additional 
parameter to the backend (and possily even use it as additional component 
to construct the interface file names). 

-- 
Irrwahn
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] netman GIT project

2015-08-26 Thread Irrwahn
On Wed, 26 Aug 2015 02:24:05 -0400, Steve Litt wrote:
> On Wed, 26 Aug 2015 05:39:36 +0100
> Edward Bartolo  wrote:
> 
>> I am being suggested to do away with sudo dependency to run the
>> backend with root privileges. 
> 
> Wait a minute. Isn't the back end a daemon run at boot time? As such,
> why not run it as root, given that wpa_supplicant requires root
> privileges?

As it is now it is build as a one-shot executable run each time an 
action is required. I thought that was intentional. Shouldn't be a 
big deal to turn it into a daemon though.

--
Irrwahn
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] netman GIT project

2015-08-26 Thread tilt!

On 08/26/2015 01:36 PM, Irrwahn wrote:

[...]
Or, even better, you could easily pass the IF name as an additional
parameter to the backend (and possily even use it as additional component
to construct the interface file names).


An easy way to obtain a list of interface names on Linux is:

awk 'NR>2{gsub(/:/,"");print $1}' /proc/net/dev

For doing this in pure C, by the "rtnetlink" method, please see
attached file, which is based on .

Kind regards,
Tilman.


/* ifnames - On Linux, list available network interfaces, one by line.

   gcc -g -o ifnames ifnames.c
   ./ifnames

   Based on "nprocnetdev.c":
   https://gist.github.com/javiermon/43a0b9e1c07abd4b13df
   (javiermon. "nprocnetdev.c: print proc/net/dev via netlink sockets")

   Originally based on:
   http://www.iijlab.net/~jean/iflist.c
   Reference:
   http://iijean.blogspot.com/2010/03/howto-get-list-of-network-interfaces-in.html
*/

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 

#define IFLIST_REPLY_BUFFER 8192 // FIXME: is this defined somewhere?

typedef struct nl_req_s nl_req_t;

struct nl_req_s {
struct nlmsghdr hdr;
struct rtgenmsg gen;
};

void rtnl_print_link(struct nlmsghdr *h) {
struct ifinfomsg *iface;
struct rtattr *attribute;

int len;

iface = NLMSG_DATA(h);
len = h->nlmsg_len - NLMSG_LENGTH(sizeof(*iface));

for(
attribute = IFLA_RTA(iface); 
RTA_OK(attribute, len); 
attribute = RTA_NEXT(attribute, len)
) {
switch(attribute->rta_type) {
case IFLA_IFNAME:
printf("%s\n", (char *) RTA_DATA(attribute));
break;
default:
break;
}
}
}

int main(void) {
int fd;
struct sockaddr_nl local;
struct sockaddr_nl kernel;

struct msghdr rtnl_msg;
struct iovec io;

nl_req_t req;
char reply[IFLIST_REPLY_BUFFER]; 

pid_t pid = getpid();
unsigned int sleep_sec = 0;

fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE);

if(-1 == fd) {
fprintf(stderr, "ERROR: socket(): %s\n", strerror(errno));

return -1;
}

memset(&local, 0, sizeof(local));

local.nl_family = AF_NETLINK;
local.nl_pid = pid;
local.nl_groups = 0;

if(0 > bind(fd, (struct sockaddr *) &local, sizeof(local))) {
fprintf(stderr, "ERROR: bind(): %s\n", strerror(errno));

return -1;
}

int msg_done = 0;

memset(&rtnl_msg, 0, sizeof(rtnl_msg));
memset(&kernel, 0, sizeof(kernel));
memset(&req, 0, sizeof(req));

kernel.nl_family = AF_NETLINK;

req.hdr.nlmsg_len = NLMSG_LENGTH(sizeof(struct rtgenmsg));
req.hdr.nlmsg_type = RTM_GETLINK;
req.hdr.nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP;
req.hdr.nlmsg_seq = 1;
req.hdr.nlmsg_pid = pid;
req.gen.rtgen_family = AF_PACKET;

io.iov_base = &req;
io.iov_len = req.hdr.nlmsg_len;
rtnl_msg.msg_iov = &io;
rtnl_msg.msg_iovlen = 1;
rtnl_msg.msg_name = &kernel;
rtnl_msg.msg_namelen = sizeof(kernel);

if(sendmsg(fd, (struct msghdr *) &rtnl_msg, 0) < 0)
fprintf(stderr, "ERROR: sendmsg(): %s",  strerror(errno));

while (!msg_done) {
int len;
struct nlmsghdr *msg_ptr;
struct msghdr rtnl_reply;
struct iovec io_reply;

memset(&io_reply, 0, sizeof(io_reply));
memset(&rtnl_reply, 0, sizeof(rtnl_reply));

io.iov_base = reply;
io.iov_len = IFLIST_REPLY_BUFFER;
rtnl_reply.msg_iov = &io;
rtnl_reply.msg_iovlen = 1;
rtnl_reply.msg_name = &kernel;
rtnl_reply.msg_namelen = sizeof(kernel);

if ((len = recvmsg(fd, &rtnl_reply, 0)) != 0) {
for (
msg_ptr = (struct nlmsghdr *) reply; 
NLMSG_OK(msg_ptr, len); 
msg_ptr = NLMSG_NEXT(msg_ptr, len)
) {
switch(msg_ptr->nlmsg_type) {
case NLMSG_DONE:
msg_done = 1;
break;
case RTM_NEWLINK:
rtnl_print_link(msg_ptr);
break;
default:
break;
}
}
}
}

close(fd);

return 0;
}

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] netman GIT project

2015-08-26 Thread tilt!

On 08/26/2015 02:27 PM, tilt! wrote:

[...], which is based on


https://gist.github.com/javiermon/43a0b9e1c07abd4b13df

Sry,
T.

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] netman GIT project

2015-08-26 Thread aitor_czr

Hi Steve,

Connman runs without sudo privilegies, and it doesn't require any 
session-manager like slim, lightdm, etc...


Aitor.

On 26/08/15 14:00, Steve Litt  wrote:

On Wed, 26 Aug 2015 05:39:36 +0100
Edward Bartolo  wrote:


>I am being suggested to do away with sudo dependency to run the
>backend with root privileges.

Wait a minute. Isn't the back end a daemon run at boot time? As such,
why not run it as root, given that wpa_supplicant requires root
privileges?


SteveT


___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] netman GIT project

2015-08-26 Thread aitor_czr

I rectify: connman is a daemon run at boot time.

Aitor.

On 26/08/15 15:56, aitor_czr wrote:

Hi Steve,

Connman runs without sudo privilegies, and it doesn't require any 
session-manager like slim, lightdm, etc...


Aitor.

On 26/08/15 14:00, Steve Litt  wrote:

On Wed, 26 Aug 2015 05:39:36 +0100
Edward Bartolo  wrote:


>I am being suggested to do away with sudo dependency to run the
>backend with root privileges.

Wait a minute. Isn't the back end a daemon run at boot time? As such,
why not run it as root, given that wpa_supplicant requires root
privileges?


SteveT


___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


[DNG] replacing kernel 3.16.0-4

2015-08-26 Thread Haines Brown
I've already tried your patience with a query about why xrandr tells me
my display uses VGA 1024x768 when it shows my video card supports DVI
1920x1080. I hope you will bear with me if I pursue the matter.

I am told that because selection of optimal resolution is today done by
the kernel, my 3.16.0-4 kernel therefore has a bug. I find significant
that kernel.org skips this kernel for possible downloading. Is anyone
else experiencing this problem?

I'm loading fluxbox on devuan-jessie without a desktop environment. When
I edit the linux line in the GRUB menu by appending video=VGA-1:d, the
display comes up with the proper DVI 1920x1080 resolution. Does this not
show that the kernel is sick? 

So I'd like to use a different kernel, but there are no alternatives in
the devuan repository. How then should I install an alternative kernel?

Some time ago I tried to install devuan testing and it failed right away
for reasons I forget. Is the testing installation option actually
working?

Haines Brown
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] automount Was: Re: A better default windows manager

2015-08-26 Thread Steven W. Scott
If you want a quick hack, I'm using a couple commands in a perl script
kicked off from inittab that works pretty well for listing attached media
with a recognizable filesystem on an appliance I'm working on - its meant
to provide a list of mountable drives but wouldn't take much to perform the
mount since it's running as root anyways.
Source:

#!/usr/bin/perl

while (sleep 10) {
`blkid -c /dev/null > /tmp/dvols.txt`;
`fdisk -l > /tmp/fdl.txt 2> /dev/null`;
   }


the blkid gives a nice list of volumes and labels in dvols.txt, fdisk for
the partitions & filesystems.
for mounting everything needed is in the fdisk -l output - I just use the
blkid for presentation information and to exclude my appliance related
drives

Admittedly a crude approach, but it's worked fairly reliably for me.

 By directing the output from the fdisk command to an array one could
easily run through the output and mount anything not already mounted.



SWS

On Wed, Aug 26, 2015 at 6:58 AM, Svante Signell 
wrote:

> On Tue, 2015-08-25 at 17:29 +0200, Joerg Reisenweber wrote:
> > On Sun 26 July 2015 23:18:58 Steve Litt wrote:
> > > You can roll your own automount with one day's work using inotify-wait,
> > > dmesg, sudo, lsblk, and the mount command. Works without X or window
> > > manager. Heck, I'll do it myself if more than 20 people want it.
> >
> > +1
> > /j
>
> Steve, what is the current development status of your promised tool?
>
> ___
> Dng mailing list
> Dng@lists.dyne.org
> https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng
>
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] netman GIT project

2015-08-26 Thread Isaac Dunham
On Wed, Aug 26, 2015 at 02:27:57PM +0200, tilt! wrote:
> On 08/26/2015 01:36 PM, Irrwahn wrote:
> >[...]
> >Or, even better, you could easily pass the IF name as an additional
> >parameter to the backend (and possily even use it as additional component
> >to construct the interface file names).
> 
> An easy way to obtain a list of interface names on Linux is:
> 
> awk 'NR>2{gsub(/:/,"");print $1}' /proc/net/dev

Or "ls /sys/class/net".
For listing non-loopback devices only, use 
ls -d /sys/class/net/*/device | cut -d/ -f5

For wireless, check for the files "phy80211" or "wireless".

The equivalent can be done trivially in C with readdir(); ask if you'd like
an example.

HTH,
Isaac Dunham
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] automount Was: Re: A better default windows manager

2015-08-26 Thread Steve Litt
On Wed, 26 Aug 2015 12:58:14 +0200
Svante Signell  wrote:

> On Tue, 2015-08-25 at 17:29 +0200, Joerg Reisenweber wrote:
> > On Sun 26 July 2015 23:18:58 Steve Litt wrote:
> > > You can roll your own automount with one day's work using
> > > inotify-wait, dmesg, sudo, lsblk, and the mount command. Works
> > > without X or window manager. Heck, I'll do it myself if more than
> > > 20 people want it.
> > 
> > +1
> > /j
> 
> Steve, what is the current development status of your promised tool?

I haven't started it yet. Only about 4 people have said they wanted it.

SteveT

Steve Litt 
August 2015 featured book: Troubleshooting: Just the Facts
http://www.troubleshooters.com/tjust
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] automount Was: Re: A better default windows manager

2015-08-26 Thread Go Linux
On Wed, 8/26/15, Steve Litt  wrote:

 Subject: Re: [DNG] automount Was: Re:  A better default windows manager
 To: dng@lists.dyne.org
 Date: Wednesday, August 26, 2015, 11:31 AM
 
 On Wed, 26 Aug 2015
 12:58:14 +0200
 Svante Signell 
 wrote:
 
 > On Tue,
 2015-08-25 at 17:29 +0200, Joerg Reisenweber wrote:
> > On Sun 26 July 2015 23:18:58 Steve Litt wrote:
> > > You can roll your own automount with one day's work using
> > > inotify-wait, dmesg, sudo, lsblk, and the mount command. Works
> > > without X or window manager. Heck, I'll do it myself if more than
> > > 20 people want it.
> >
> > +1
> > /j
>
> Steve, what is the current development status of your promised tool?

I haven't started it yet. Only about 4 people have said they wanted it.

SteveT



Excuses, excuses . . .  ;)  OK.  Add me to the list.  I wanna see you do this!!

golinux

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] replacing kernel 3.16.0-4

2015-08-26 Thread Riccardo Boninsegna
On Wed, Aug 26, 2015 at 5:48 PM, Haines Brown  wrote:
> So I'd like to use a different kernel, but there are no alternatives in
> the devuan repository. How then should I install an alternative kernel?

You can compile one yourself:
→ Install the build tools ("build-essential" + "libncurses5-dev")
→ Download kernel from kernel.org or add a source for testing/unstable
and apt-get install linux-source
→ Extract source archive
→ Copy /boot/config-* to ".config" in root of extracted source
→ `make menuconfig` and change stuff if you want
→ `make deb-pkg`, go buy a pizza, return home, install debs from
parent folder :)

But I also think you can directly use a kernel (linux-image-*) from a
newer version of Debian/Devuan... not 100% sure about this though.

> Some time ago I tried to install devuan testing and it failed right away
> for reasons I forget. Is the testing installation option actually working?

I used it with no problems (from a homemade installer image, but using
our official kernel and ramdisk) about 3 weeks ago. Better do an
expert install and select nothing at the "select and install software"
step, as relativaly often a package download fails for random causes
(plus you can easily keep an eye on systemd -installed by default-,
pulseaudio, etc... if you use the aptitude interactive UI)!
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng