About Me

Michael Zucchi

 B.E. (Comp. Sys. Eng.)

  also known as Zed
  to his mates & enemies!

notzed at gmail >
fosstodon.org/@notzed >

Tags

android (44)
beagle (63)
biographical (104)
blogz (9)
business (1)
code (77)
compilerz (1)
cooking (31)
dez (7)
dusk (31)
esp32 (4)
extensionz (1)
ffts (3)
forth (3)
free software (4)
games (32)
gloat (2)
globalisation (1)
gnu (4)
graphics (16)
gsoc (4)
hacking (459)
haiku (2)
horticulture (10)
house (23)
hsa (6)
humour (7)
imagez (28)
java (231)
java ee (3)
javafx (49)
jjmpeg (81)
junk (3)
kobo (15)
libeze (7)
linux (5)
mediaz (27)
ml (15)
nativez (10)
opencl (120)
os (17)
panamaz (5)
parallella (97)
pdfz (8)
philosophy (26)
picfx (2)
players (1)
playerz (2)
politics (7)
ps3 (12)
puppybits (17)
rants (137)
readerz (8)
rez (1)
socles (36)
termz (3)
videoz (6)
vulkan (3)
wanki (3)
workshop (3)
zcl (4)
zedzone (26)
Thursday, 24 January 2019, 02:20

libeze - C utility library

This is announcing a new small project - libeze.

It is a small collection of C utilities as a static link library.

Goals:

Rather than copy the rest of it's current home page just go there and read it. There is much more in the README and source.

It's an offshoot (read: I got very distracted) of the mele music player i've been working on as well as some previous code from ezesdk.

Tagged code, hacking, libeze.
Saturday, 19 January 2019, 11:57

For the PlayerZ

Well i've been stuck in the house for various reasons so i've been doing a lot of solid work on the audio player software for the mele box.

It's not feature complete but it all works:

I'm using posix message queues for communicating between the processes with a simple C struct serialisation mechanism. I'm not using threads as yet, the player just runs as a single thread. This means it can block while reading from libavformat but it greatly simplifies the player logic.

At the moment i'm just running it on my 'workstation' so I don't know how much work - if any - will be required to get it going on the mele, or how it will handle the processes and so on. For example if the disk indexer will overload the cpu or i/o.

Anyway here is a high-level diagram of the processes and various bits that make it up. Sorry it's a bit shit, but well, openoffice draw is a fucking headache to work with.

For it to be feature complete there isn't much left. Some sort of playlist mechanism and/or other ways to navigate the files beyond disk+file-path order. Shuffle should be easy. Network streams would be nice.

With no user interface beyond 2 leds (and given they're in the same hole that just means 2 colours) it can't get too complicated without resorting to an additional service for external maniplation. But that is of course possible.

The things I want to look at are playlists and other ways to navigate the files (other than file-path order), and network streams.

Bored as Fuck

Haven't left the house for a full week at this point. I was sick for a few days but now i'm just miserable for other reasons. This stuff is keeping me well occupied but yeah it's kind of pointless. Even my knees fucking hurt.

I'm wondering whether i should just go back to work early since there's still a couple of weeks before I would otherwise. I don't think I could face it though.

I'm also a bit pissed off that I think I drowned and killed a chilli plant i've been growing for weeks just as it started to kick into gear. We had a couple of hot days and i overwatered it i think. Actually not much is growing very well this year and I can't seem to water it properly either. Too much or too little. Water is so expensive here.

Oh, I also wasted a couple of hours playing with yacy. The idea of decentralised internet services certainly appeals. But it was just slow and provided almost no relevant results to any search I tried - it just didn't work for me. Solr/Lucene just does a weighted sub-string index which isn't very sophisticated. It's also configured for some big server so running it on this little vps was difficult even after fighting with the complex configuration system.

I'm not eating much at least so maybe i can lose some of the weight I keep putting on.

Tagged hacking, linux, playerz.
Sunday, 06 January 2019, 03:38

Media Queries

I made a small change to the HTML and CSS to try to render a bit better on phones. Even though the text is all resizeable and reflowable they rendered at some massive resolution and then scaled down - making the text unredable and non-reflowable. Sigh.

Anyway, first I added:

      <meta name='viewport' content='width=device-width, initial-scale=1'>
    

But this made the text too big and interfered with the table-like layout. I tried using a width of 800 which sort of worked but wasn't very readable either.

So I added a media query and adjusted some of the main sections and the borders and so on. It's just a quick and dirty but it works better than it did. I've only tested on one phone so others may not have changed.

    /* bloody phones */
    @media (max-width: 480px) {
        div#site-menu, .tag-menu {
            float: none;
            width: 100%;
        }
        .post-footer, .post, .post-header {
            margin-right: 1em;
        }
    }
  

On the other hand i'm lucky to get one visitor per week (lots of crawlers, and plenty of hacking attempts) so who really cares eh?

Tagged zedzone.
Saturday, 29 December 2018, 22:26

Monitoring Removable USB Drives

I've been looking into writing some media player software and one function I want is to be able to detect inserted drives and do things with them.

inotify

First I looked at using inotify and just monitoring /dev. This is quite simple; you get IN_CREATE and IN_DELETE events when the directories are created or otherwise, and then you can do what is necessary.

Then came the problem of the doing bit - well you want to mount drives. You can use usbmount or udevd but at this point I was trying for an in-memory solution and I couldn't work out how to find out when they were mounted without having another script run.

libblkid & mount(2)

blkid is used by the usbmount script to determine if the device is a mountable partition; so I looked into libblkdid to do the same from code. It's a bit of a quirky api, and is poorly documented but not terribly difficult to use for what I want. The api is designed for implementing glue between kernel and scripts. The variables you get are again, pretty much undocumented as far as i can gather so it's just a process of run it and see what looks useful.

But using it isn't hard. Basically when a /dev/sd* appears I perform a probe and if it has the right variables set I call mount. I only want read-only access so that simplifies the mount options considerably.

Here's a partial prototype example of the inotify handler and mounting process. This is basically what usbmount does but it ignores any options in fstab and so forth.

static int mount_add(const char *name, blkid_probe p) {
        int idx = mount_alloc();

        if (idx >= 0) {
                int res;
                const char *type;
                size_t type_size;

                printf("checking mount %s\n", name);          
                if (blkid_probe_lookup_value(p, "TYPE", &type, &type_size) == 0) {
                        char point[(strlen("/var/run/usb-00") + 1)];

                        sprintf(point, "/var/run/usb-%02d", idx);
                        res = mkdir(point, 0777);
                        res = mount(name, point, type, MS_NOEXEC | MS_RDONLY | MS_NOSUID, NULL);
                        if (res != 0) {
                                perror("mount");
                                return -1;
                        }
                        printf("mounted: %s <- %s\n", point, name);
                        mounted[idx].name = strdup(name);
                        mounted[idx].point = strdup(point);

                        if (blkid_probe_lookup_value(p, "UUID", &type, &type_size) == 0)
                                mounted[idx].uuid = strdup(type);
                } else {
                        idx = -1;
                }
        }
        return idx;
}

static int mount_remove(const char *name) {
        int idx = mount_index(name);
        
        if (idx >= 0) {
                int res = umount2(mounted[idx].point, MNT_DETACH);
                if (res != 0)
                        perror("umount2");
                else
                        printf("unmounted: %s <- %s\n", mounted[idx].point, mounted[idx].name);

                free(mounted[idx].name);
                free(mounted[idx].point);
                free(mounted[idx].uuid);
                memset(&mounted[idx], 0, sizeof(struct mounted));
        }

        return idx;
}

static void
handle_events(int fd, int wd)
{
        char buf[4096]  __attribute__ ((aligned(__alignof__(struct inotify_event))));
        int i;
        ssize_t len;
        char *ptr;

        for (;;) {
                len = read(fd, buf, sizeof buf);
                if (len == -1 && errno != EAGAIN) {
                        perror("read");
                        exit(EXIT_FAILURE);
                }
                if (len <= 0)
                        break;

                for (ptr = buf; ptr < buf + len;) {
                        const struct inotify_event *event;
                        
                        event = (const struct inotify_event *) ptr;

                        if (event->len && strncmp(event->name, "sd", 2) == 0) {
                                char name[(event->len + 1 + strlen("/dev/"))];

                                sprintf(name, "/dev/%s", event->name);
                                
                                if (event->mask & IN_CREATE) {
                                        blkid_probe p = blkid_new_probe_from_filename(name);
                                        int rc;

                                        blkid_probe_enable_partitions(p, 0);
                                        blkid_probe_enable_superblocks(p, 1);
                                        rc = blkid_do_safeprobe(p);
                                        
                                        int idx = mount_add(name, p);
                                        if (idx >= 0) {
                                                // do something with added mount
                                        }
                                        blkid_free_probe(p);
                                }
                                if (event->mask & IN_DELETE) {
                                        int idx = mount_index(name);
                                        if (idx >= 0) {
                                                // do something with removed mount
                                        }
                                }
                        }
                        
                        ptr += sizeof(struct inotify_event) + event->len;
                }
        }
}

udevd, NETLINK_KOBJECT_UEVENT

But I was curious - just how are the dev entries created? I thought it must be udevd or something. The only articles or documentation I could find were unclear on the matter.

So first, NETLINK_KOBJECT_UEVENT, this unpleasantly named 'network' protocol is used these days to monitor kernel activities like usb hotplugging. So I took a small example and started dumping out what I got.

The documentation and examples talk about using a 'struct nmlsghdr' as the datagram payload, but this is in error. You just get the payload directly. And the payload appears to be list of NUL terminated strings; which surprise are just environment variable declarations (i'm noticing a trend here).

Anyway, here's a complete example which dumps out the messages.

#include <sys/types.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <linux/netlink.h>
#include <unistd.h>

#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>

int main(int argc, char **argv) {
        int s = socket(AF_NETLINK, SOCK_DGRAM, NETLINK_KOBJECT_UEVENT);
        struct sockaddr_nl addr = {
                .nl_family = AF_NETLINK,
                .nl_pid = getpid(),
                .nl_groups = ~0
        };
        int res;
        char data[8192];
        struct msghdr msg;
        struct iovec iov;

        bind(s, (void *)&addr, sizeof(addr));
        
        iov.iov_base = data;
        iov.iov_len = 8192;

        msg.msg_name = (void *)&(addr);
        msg.msg_namelen = sizeof(addr);
        msg.msg_iov = &iov;
        msg.msg_iovlen = 1;

        while ((res = recvmsg(s, &msg, 0)) >= 0) {
                if (strcmp(data, "libudev") != 0) {
                        unsigned char *x = data, *e = data+res;

                        while (x < e) {
                                printf(" %s\n", x);
                                x += strlen(x) + 1;
                        }
                        printf("\n");
                } else {
                        for (int i=0;i<res;i+=16) {
                                for (int j=i;j < i+16;j++)
                                        printf(j < res ? " %02x" : "   ", data[j]);
                                printf("  ");
                                for (int j=i;j < i+16;j++)
                                        putchar(j < res ? (isprint(data[j]) ? data[j] : '.') : ' ');
                                printf("\n");
                        }
                        printf("\n");
                }
        }
        
        return 0;
}

The libudev test is because udevd repackages the requests and sends them out again in some proprietary binary format for some reason which is unclear to me at this time.

And this is the output when I plug in a usb drive.

 add@/devices/pci0000:00/0000:00:10.0/usb6/6-2
 ACTION=add
 DEVPATH=/devices/pci0000:00/0000:00:10.0/usb6/6-2
 SUBSYSTEM=usb
 MAJOR=189
 MINOR=645
 DEVNAME=bus/usb/006/006
 DEVTYPE=usb_device
 PRODUCT=90c/1000/1100
 TYPE=0/0/0
 BUSNUM=006
 DEVNUM=006
 SEQNUM=7439

 add@/devices/pci0000:00/0000:00:10.0/usb6/6-2/6-2:1.0
 ACTION=add
 DEVPATH=/devices/pci0000:00/0000:00:10.0/usb6/6-2/6-2:1.0
 SUBSYSTEM=usb
 DEVTYPE=usb_interface
 PRODUCT=90c/1000/1100
 TYPE=0/0/0
 INTERFACE=8/6/80
 MODALIAS=usb:v090Cp1000d1100dc00dsc00dp00ic08isc06ip50in00
 SEQNUM=7440

 add@/devices/pci0000:00/0000:00:10.0/usb6/6-2/6-2:1.0/host6
 ACTION=add
 DEVPATH=/devices/pci0000:00/0000:00:10.0/usb6/6-2/6-2:1.0/host6
 SUBSYSTEM=scsi
 DEVTYPE=scsi_host
 SEQNUM=7441

 add@/devices/pci0000:00/0000:00:10.0/usb6/6-2/6-2:1.0/host6/scsi_host/host6
 ACTION=add
 DEVPATH=/devices/pci0000:00/0000:00:10.0/usb6/6-2/6-2:1.0/host6/scsi_host/host6
 SUBSYSTEM=scsi_host
 SEQNUM=7442

 bind@/devices/pci0000:00/0000:00:10.0/usb6/6-2/6-2:1.0
 ACTION=bind
 DEVPATH=/devices/pci0000:00/0000:00:10.0/usb6/6-2/6-2:1.0
 SUBSYSTEM=usb
 DEVTYPE=usb_interface
 DRIVER=usb-storage
 PRODUCT=90c/1000/1100
 TYPE=0/0/0
 INTERFACE=8/6/80
 MODALIAS=usb:v090Cp1000d1100dc00dsc00dp00ic08isc06ip50in00
 SEQNUM=7443

 bind@/devices/pci0000:00/0000:00:10.0/usb6/6-2
 ACTION=bind
 DEVPATH=/devices/pci0000:00/0000:00:10.0/usb6/6-2
 SUBSYSTEM=usb
 MAJOR=189
 MINOR=645
 DEVNAME=bus/usb/006/006
 DEVTYPE=usb_device
 DRIVER=usb
 PRODUCT=90c/1000/1100
 TYPE=0/0/0
 BUSNUM=006
 DEVNUM=006
 SEQNUM=7444

 6c 69 62 75 64 65 76 00 fe ed ca fe 28 00 00 00  libudev.....(...
 28 00 00 00 89 02 00 00 05 77 c5 e5 27 f8 f5 0c  (........w..'...
 00 00 00 00 00 00 00 00 41 43 54 49 4f 4e 3d 61  ........ACTION=a
 64 64 00 44 45 56 50 41 54 48 3d 2f 64 65 76 69  dd.DEVPATH=/devi
 63 65 73 2f 70 63 69 30 30 30 30 3a 30 30 2f 30  ces/pci0000:00/0
 30 30 30 3a 30 30 3a 31 30 2e 30 2f 75 73 62 36  000:00:10.0/usb6
 2f 36 2d 32 00 53 55 42 53 59 53 54 45 4d 3d 75  /6-2.SUBSYSTEM=u
 73 62 00 44 45 56 4e 41 4d 45 3d 2f 64 65 76 2f  sb.DEVNAME=/dev/
 62 75 73 2f 75 73 62 2f 30 30 36 2f 30 30 36 00  bus/usb/006/006.
 44 45 56 54 59 50 45 3d 75 73 62 5f 64 65 76 69  DEVTYPE=usb_devi
 63 65 00 50 52 4f 44 55 43 54 3d 39 30 63 2f 31  ce.PRODUCT=90c/1
 30 30 30 2f 31 31 30 30 00 54 59 50 45 3d 30 2f  000/1100.TYPE=0/
 30 2f 30 00 42 55 53 4e 55 4d 3d 30 30 36 00 44  0/0.BUSNUM=006.D
 45 56 4e 55 4d 3d 30 30 36 00 53 45 51 4e 55 4d  EVNUM=006.SEQNUM
 3d 37 34 33 39 00 4d 41 4a 4f 52 3d 31 38 39 00  =7439.MAJOR=189.
 4d 49 4e 4f 52 3d 36 34 35 00 55 53 45 43 5f 49  MINOR=645.USEC_I
 4e 49 54 49 41 4c 49 5a 45 44 3d 32 30 35 35 39  NITIALIZED=20559
 39 39 33 30 37 35 34 35 00 49 44 5f 56 45 4e 44  99307545.ID_VEND
 4f 52 3d 53 61 6d 73 75 6e 67 00 49 44 5f 56 45  OR=Samsung.ID_VE
 4e 44 4f 52 5f 45 4e 43 3d 53 61 6d 73 75 6e 67  NDOR_ENC=Samsung
 00 49 44 5f 56 45 4e 44 4f 52 5f 49 44 3d 30 39  .ID_VENDOR_ID=09
 30 63 00 49 44 5f 4d 4f 44 45 4c 3d 46 6c 61 73  0c.ID_MODEL=Flas
 68 5f 44 72 69 76 65 5f 44 55 4f 00 49 44 5f 4d  h_Drive_DUO.ID_M
 4f 44 45 4c 5f 45 4e 43 3d 46 6c 61 73 68 5c 78  ODEL_ENC=Flash\x
 32 30 44 72 69 76 65 5c 78 32 30 44 55 4f 00 49  20Drive\x20DUO.I
 44 5f 4d 4f 44 45 4c 5f 49 44 3d 31 30 30 30 00  D_MODEL_ID=1000.
 49 44 5f 52 45 56 49 53 49 4f 4e 3d 31 31 30 30  ID_REVISION=1100
 00 49 44 5f 53 45 52 49 41 4c 3d 53 61 6d 73 75  .ID_SERIAL=Samsu
 6e 67 5f 46 6c 61 73 68 5f 44 72 69 76 65 5f 44  ng_Flash_Drive_D
 55 4f 5f 30 33 33 31 35 31 36 30 37 30 30 31 38  UO_0331516070018
 38 31 31 00 49 44 5f 53 45 52 49 41 4c 5f 53 48  811.ID_SERIAL_SH
 4f 52 54 3d 30 33 33 31 35 31 36 30 37 30 30 31  ORT=033151607001
 38 38 31 31 00 49 44 5f 42 55 53 3d 75 73 62 00  8811.ID_BUS=usb.
 49 44 5f 55 53 42 5f 49 4e 54 45 52 46 41 43 45  ID_USB_INTERFACE
 53 3d 3a 30 38 30 36 35 30 3a 00 49 44 5f 56 45  S=:080650:.ID_VE
 4e 44 4f 52 5f 46 52 4f 4d 5f 44 41 54 41 42 41  NDOR_FROM_DATABA
 53 45 3d 53 69 6c 69 63 6f 6e 20 4d 6f 74 69 6f  SE=Silicon Motio
 6e 2c 20 49 6e 63 2e 20 2d 20 54 61 69 77 61 6e  n, Inc. - Taiwan
 20 28 66 6f 72 6d 65 72 6c 79 20 46 65 69 79 61   (formerly Feiya
 20 54 65 63 68 6e 6f 6c 6f 67 79 20 43 6f 72 70   Technology Corp
 2e 29 00 49 44 5f 4d 4f 44 45 4c 5f 46 52 4f 4d  .).ID_MODEL_FROM
 5f 44 41 54 41 42 41 53 45 3d 46 6c 61 73 68 20  _DATABASE=Flash 
 44 72 69 76 65 00 44 52 49 56 45 52 3d 75 73 62  Drive.DRIVER=usb
 00                                               .               

 6c 69 62 75 64 65 76 00 fe ed ca fe 28 00 00 00  libudev.....(...
 28 00 00 00 8f 01 00 00 05 77 c5 e5 b1 02 47 65  (........w....Ge
 00 00 00 00 00 00 00 00 41 43 54 49 4f 4e 3d 61  ........ACTION=a
 64 64 00 44 45 56 50 41 54 48 3d 2f 64 65 76 69  dd.DEVPATH=/devi
 63 65 73 2f 70 63 69 30 30 30 30 3a 30 30 2f 30  ces/pci0000:00/0
 30 30 30 3a 30 30 3a 31 30 2e 30 2f 75 73 62 36  000:00:10.0/usb6
 2f 36 2d 32 2f 36 2d 32 3a 31 2e 30 00 53 55 42  /6-2/6-2:1.0.SUB
 53 59 53 54 45 4d 3d 75 73 62 00 44 45 56 54 59  SYSTEM=usb.DEVTY
 50 45 3d 75 73 62 5f 69 6e 74 65 72 66 61 63 65  PE=usb_interface
 00 50 52 4f 44 55 43 54 3d 39 30 63 2f 31 30 30  .PRODUCT=90c/100
 30 2f 31 31 30 30 00 54 59 50 45 3d 30 2f 30 2f  0/1100.TYPE=0/0/
 30 00 49 4e 54 45 52 46 41 43 45 3d 38 2f 36 2f  0.INTERFACE=8/6/
 38 30 00 4d 4f 44 41 4c 49 41 53 3d 75 73 62 3a  80.MODALIAS=usb:
 76 30 39 30 43 70 31 30 30 30 64 31 31 30 30 64  v090Cp1000d1100d
 63 30 30 64 73 63 30 30 64 70 30 30 69 63 30 38  c00dsc00dp00ic08
 69 73 63 30 36 69 70 35 30 69 6e 30 30 00 53 45  isc06ip50in00.SE
 51 4e 55 4d 3d 37 34 34 30 00 55 53 45 43 5f 49  QNUM=7440.USEC_I
 4e 49 54 49 41 4c 49 5a 45 44 3d 32 30 35 35 39  NITIALIZED=20559
 39 39 33 30 39 32 38 36 00 49 44 5f 56 45 4e 44  99309286.ID_VEND
 4f 52 5f 46 52 4f 4d 5f 44 41 54 41 42 41 53 45  OR_FROM_DATABASE
 3d 53 69 6c 69 63 6f 6e 20 4d 6f 74 69 6f 6e 2c  =Silicon Motion,
 20 49 6e 63 2e 20 2d 20 54 61 69 77 61 6e 20 28   Inc. - Taiwan (
 66 6f 72 6d 65 72 6c 79 20 46 65 69 79 61 20 54  formerly Feiya T
 65 63 68 6e 6f 6c 6f 67 79 20 43 6f 72 70 2e 29  echnology Corp.)
 00 49 44 5f 4d 4f 44 45 4c 5f 46 52 4f 4d 5f 44  .ID_MODEL_FROM_D
 41 54 41 42 41 53 45 3d 46 6c 61 73 68 20 44 72  ATABASE=Flash Dr
 69 76 65 00 44 52 49 56 45 52 3d 75 73 62 2d 73  ive.DRIVER=usb-s
 74 6f 72 61 67 65 00                             torage.         

 6c 69 62 75 64 65 76 00 fe ed ca fe 28 00 00 00  libudev.....(...
 28 00 00 00 97 00 00 00 29 20 1a 28 a0 05 fb 58  (.......) .(...X
 00 00 00 00 00 00 00 00 41 43 54 49 4f 4e 3d 61  ........ACTION=a
 64 64 00 44 45 56 50 41 54 48 3d 2f 64 65 76 69  dd.DEVPATH=/devi
 63 65 73 2f 70 63 69 30 30 30 30 3a 30 30 2f 30  ces/pci0000:00/0
 30 30 30 3a 30 30 3a 31 30 2e 30 2f 75 73 62 36  000:00:10.0/usb6
 2f 36 2d 32 2f 36 2d 32 3a 31 2e 30 2f 68 6f 73  /6-2/6-2:1.0/hos
 74 36 00 53 55 42 53 59 53 54 45 4d 3d 73 63 73  t6.SUBSYSTEM=scs
 69 00 44 45 56 54 59 50 45 3d 73 63 73 69 5f 68  i.DEVTYPE=scsi_h
 6f 73 74 00 53 45 51 4e 55 4d 3d 37 34 34 31 00  ost.SEQNUM=7441.
 55 53 45 43 5f 49 4e 49 54 49 41 4c 49 5a 45 44  USEC_INITIALIZED
 3d 32 30 35 35 39 39 39 33 31 30 38 39 37 00     =2055999310897. 

 6c 69 62 75 64 65 76 00 fe ed ca fe 28 00 00 00  libudev.....(...
 28 00 00 00 9a 00 00 00 a0 05 fb 58 00 00 00 00  (..........X....
 00 00 00 00 00 00 00 00 41 43 54 49 4f 4e 3d 61  ........ACTION=a
 64 64 00 44 45 56 50 41 54 48 3d 2f 64 65 76 69  dd.DEVPATH=/devi
 63 65 73 2f 70 63 69 30 30 30 30 3a 30 30 2f 30  ces/pci0000:00/0
 30 30 30 3a 30 30 3a 31 30 2e 30 2f 75 73 62 36  000:00:10.0/usb6
 2f 36 2d 32 2f 36 2d 32 3a 31 2e 30 2f 68 6f 73  /6-2/6-2:1.0/hos
 74 36 2f 73 63 73 69 5f 68 6f 73 74 2f 68 6f 73  t6/scsi_host/hos
 74 36 00 53 55 42 53 59 53 54 45 4d 3d 73 63 73  t6.SUBSYSTEM=scs
 69 5f 68 6f 73 74 00 53 45 51 4e 55 4d 3d 37 34  i_host.SEQNUM=74
 34 32 00 55 53 45 43 5f 49 4e 49 54 49 41 4c 49  42.USEC_INITIALI
 5a 45 44 3d 32 30 35 35 39 39 39 33 31 31 38 36  ZED=205599931186
 31 00                                            1.              

 add@/devices/pci0000:00/0000:00:10.0/usb6/6-2/6-2:1.0/host6/target6:0:0
 ACTION=add
 DEVPATH=/devices/pci0000:00/0000:00:10.0/usb6/6-2/6-2:1.0/host6/target6:0:0
 SUBSYSTEM=scsi
 DEVTYPE=scsi_target
 SEQNUM=7445

 add@/devices/pci0000:00/0000:00:10.0/usb6/6-2/6-2:1.0/host6/target6:0:0/6:0:0:0
 ACTION=add
 DEVPATH=/devices/pci0000:00/0000:00:10.0/usb6/6-2/6-2:1.0/host6/target6:0:0/6:0:0:0
 SUBSYSTEM=scsi
 DEVTYPE=scsi_device
 MODALIAS=scsi:t-0x00
 SEQNUM=7446

 add@/devices/pci0000:00/0000:00:10.0/usb6/6-2/6-2:1.0/host6/target6:0:0/6:0:0:0/scsi_disk/6:0:0:0
 ACTION=add
 DEVPATH=/devices/pci0000:00/0000:00:10.0/usb6/6-2/6-2:1.0/host6/target6:0:0/6:0:0:0/scsi_disk/6:0:0:0
 SUBSYSTEM=scsi_disk
 SEQNUM=7447

 bind@/devices/pci0000:00/0000:00:10.0/usb6/6-2/6-2:1.0/host6/target6:0:0/6:0:0:0
 ACTION=bind
 DEVPATH=/devices/pci0000:00/0000:00:10.0/usb6/6-2/6-2:1.0/host6/target6:0:0/6:0:0:0
 SUBSYSTEM=scsi
 DEVTYPE=scsi_device
 DRIVER=sd
 MODALIAS=scsi:t-0x00
 SEQNUM=7448

 add@/devices/pci0000:00/0000:00:10.0/usb6/6-2/6-2:1.0/host6/target6:0:0/6:0:0:0/scsi_device/6:0:0:0
 ACTION=add
 DEVPATH=/devices/pci0000:00/0000:00:10.0/usb6/6-2/6-2:1.0/host6/target6:0:0/6:0:0:0/scsi_device/6:0:0:0
 SUBSYSTEM=scsi_device
 SEQNUM=7449

 add@/devices/pci0000:00/0000:00:10.0/usb6/6-2/6-2:1.0/host6/target6:0:0/6:0:0:0/scsi_generic/sg1
 ACTION=add
 DEVPATH=/devices/pci0000:00/0000:00:10.0/usb6/6-2/6-2:1.0/host6/target6:0:0/6:0:0:0/scsi_generic/sg1
 SUBSYSTEM=scsi_generic
 MAJOR=21
 MINOR=1
 DEVNAME=sg1
 SEQNUM=7450

 add@/devices/pci0000:00/0000:00:10.0/usb6/6-2/6-2:1.0/host6/target6:0:0/6:0:0:0/bsg/6:0:0:0
 ACTION=add
 DEVPATH=/devices/pci0000:00/0000:00:10.0/usb6/6-2/6-2:1.0/host6/target6:0:0/6:0:0:0/bsg/6:0:0:0
 SUBSYSTEM=bsg
 MAJOR=246
 MINOR=1
 DEVNAME=bsg/6:0:0:0
 SEQNUM=7451

 6c 69 62 75 64 65 76 00 fe ed ca fe 28 00 00 00  libudev.....(...
 28 00 00 00 a5 00 00 00 29 20 1a 28 f2 6a 9f 62  (.......) .(.j.b
 00 00 00 00 00 00 00 00 41 43 54 49 4f 4e 3d 61  ........ACTION=a
 64 64 00 44 45 56 50 41 54 48 3d 2f 64 65 76 69  dd.DEVPATH=/devi
 63 65 73 2f 70 63 69 30 30 30 30 3a 30 30 2f 30  ces/pci0000:00/0
 30 30 30 3a 30 30 3a 31 30 2e 30 2f 75 73 62 36  000:00:10.0/usb6
 2f 36 2d 32 2f 36 2d 32 3a 31 2e 30 2f 68 6f 73  /6-2/6-2:1.0/hos
 74 36 2f 74 61 72 67 65 74 36 3a 30 3a 30 00 53  t6/target6:0:0.S
 55 42 53 59 53 54 45 4d 3d 73 63 73 69 00 44 45  UBSYSTEM=scsi.DE
 56 54 59 50 45 3d 73 63 73 69 5f 74 61 72 67 65  VTYPE=scsi_targe
 74 00 53 45 51 4e 55 4d 3d 37 34 34 35 00 55 53  t.SEQNUM=7445.US
 45 43 5f 49 4e 49 54 49 41 4c 49 5a 45 44 3d 32  EC_INITIALIZED=2
 30 35 36 30 30 30 36 35 39 36 37 32 00           056000659672.   

 add@/devices/virtual/bdi/8:16
 ACTION=add
 DEVPATH=/devices/virtual/bdi/8:16
 SUBSYSTEM=bdi
 SEQNUM=7452

 6c 69 62 75 64 65 76 00 fe ed ca fe 28 00 00 00  libudev.....(...
 28 00 00 00 cc 00 00 00 29 20 1a 28 7d b5 06 b5  (.......) .(}...
 00 00 00 00 00 00 00 00 41 43 54 49 4f 4e 3d 61  ........ACTION=a
 64 64 00 44 45 56 50 41 54 48 3d 2f 64 65 76 69  dd.DEVPATH=/devi
 63 65 73 2f 70 63 69 30 30 30 30 3a 30 30 2f 30  ces/pci0000:00/0
 30 30 30 3a 30 30 3a 31 30 2e 30 2f 75 73 62 36  000:00:10.0/usb6
 2f 36 2d 32 2f 36 2d 32 3a 31 2e 30 2f 68 6f 73  /6-2/6-2:1.0/hos
 74 36 2f 74 61 72 67 65 74 36 3a 30 3a 30 2f 36  t6/target6:0:0/6
 3a 30 3a 30 3a 30 00 53 55 42 53 59 53 54 45 4d  :0:0:0.SUBSYSTEM
 3d 73 63 73 69 00 44 45 56 54 59 50 45 3d 73 63  =scsi.DEVTYPE=sc
 73 69 5f 64 65 76 69 63 65 00 4d 4f 44 41 4c 49  si_device.MODALI
 41 53 3d 73 63 73 69 3a 74 2d 30 78 30 30 00 53  AS=scsi:t-0x00.S
 45 51 4e 55 4d 3d 37 34 34 36 00 55 53 45 43 5f  EQNUM=7446.USEC_
 49 4e 49 54 49 41 4c 49 5a 45 44 3d 32 30 35 36  INITIALIZED=2056
 30 30 30 36 36 31 36 31 35 00 44 52 49 56 45 52  000661615.DRIVER
 3d 73 64 00                                      =sd.            

 6c 69 62 75 64 65 76 00 fe ed ca fe 28 00 00 00  libudev.....(...
 28 00 00 00 66 00 00 00 2a 18 84 a1 00 00 00 00  (...f...*.......
 00 00 00 00 00 00 00 00 41 43 54 49 4f 4e 3d 61  ........ACTION=a
 64 64 00 44 45 56 50 41 54 48 3d 2f 64 65 76 69  dd.DEVPATH=/devi
 63 65 73 2f 76 69 72 74 75 61 6c 2f 62 64 69 2f  ces/virtual/bdi/
 38 3a 31 36 00 53 55 42 53 59 53 54 45 4d 3d 62  8:16.SUBSYSTEM=b
 64 69 00 53 45 51 4e 55 4d 3d 37 34 35 32 00 55  di.SEQNUM=7452.U
 53 45 43 5f 49 4e 49 54 49 41 4c 49 5a 45 44 3d  SEC_INITIALIZED=
 32 30 35 36 30 30 30 36 36 32 34 30 31 00        2056000662401.  

 6c 69 62 75 64 65 76 00 fe ed ca fe 28 00 00 00  libudev.....(...
 28 00 00 00 b4 00 00 00 7d b5 06 b5 00 00 00 00  (.......}.......
 00 00 00 00 00 00 00 00 41 43 54 49 4f 4e 3d 61  ........ACTION=a
 64 64 00 44 45 56 50 41 54 48 3d 2f 64 65 76 69  dd.DEVPATH=/devi
 63 65 73 2f 70 63 69 30 30 30 30 3a 30 30 2f 30  ces/pci0000:00/0
 30 30 30 3a 30 30 3a 31 30 2e 30 2f 75 73 62 36  000:00:10.0/usb6
 2f 36 2d 32 2f 36 2d 32 3a 31 2e 30 2f 68 6f 73  /6-2/6-2:1.0/hos
 74 36 2f 74 61 72 67 65 74 36 3a 30 3a 30 2f 36  t6/target6:0:0/6
 3a 30 3a 30 3a 30 2f 73 63 73 69 5f 64 65 76 69  :0:0:0/scsi_devi
 63 65 2f 36 3a 30 3a 30 3a 30 00 53 55 42 53 59  ce/6:0:0:0.SUBSY
 53 54 45 4d 3d 73 63 73 69 5f 64 65 76 69 63 65  STEM=scsi_device
 00 53 45 51 4e 55 4d 3d 37 34 34 39 00 55 53 45  .SEQNUM=7449.USE
 43 5f 49 4e 49 54 49 41 4c 49 5a 45 44 3d 32 30  C_INITIALIZED=20
 35 36 30 30 30 36 36 35 31 34 31 00              56000665141.    

 add@/devices/pci0000:00/0000:00:10.0/usb6/6-2/6-2:1.0/host6/target6:0:0/6:0:0:0/block/sdb
 ACTION=add
 DEVPATH=/devices/pci0000:00/0000:00:10.0/usb6/6-2/6-2:1.0/host6/target6:0:0/6:0:0:0/block/sdb
 SUBSYSTEM=block
 MAJOR=8
 MINOR=16
 DEVNAME=sdb
 DEVTYPE=disk
 SEQNUM=7453

 add@/devices/pci0000:00/0000:00:10.0/usb6/6-2/6-2:1.0/host6/target6:0:0/6:0:0:0/block/sdb/sdb1
 ACTION=add
 DEVPATH=/devices/pci0000:00/0000:00:10.0/usb6/6-2/6-2:1.0/host6/target6:0:0/6:0:0:0/block/sdb/sdb1
 SUBSYSTEM=block
 MAJOR=8
 MINOR=17
 DEVNAME=sdb1
 DEVTYPE=partition
 PARTN=1
 SEQNUM=7454

 6c 69 62 75 64 65 76 00 fe ed ca fe 28 00 00 00  libudev.....(...
 28 00 00 00 b0 00 00 00 89 0e a9 0f 00 00 00 00  (...............
 00 00 00 00 00 00 00 00 41 43 54 49 4f 4e 3d 61  ........ACTION=a
 64 64 00 44 45 56 50 41 54 48 3d 2f 64 65 76 69  dd.DEVPATH=/devi
 63 65 73 2f 70 63 69 30 30 30 30 3a 30 30 2f 30  ces/pci0000:00/0
 30 30 30 3a 30 30 3a 31 30 2e 30 2f 75 73 62 36  000:00:10.0/usb6
 2f 36 2d 32 2f 36 2d 32 3a 31 2e 30 2f 68 6f 73  /6-2/6-2:1.0/hos
 74 36 2f 74 61 72 67 65 74 36 3a 30 3a 30 2f 36  t6/target6:0:0/6
 3a 30 3a 30 3a 30 2f 73 63 73 69 5f 64 69 73 6b  :0:0:0/scsi_disk
 2f 36 3a 30 3a 30 3a 30 00 53 55 42 53 59 53 54  /6:0:0:0.SUBSYST
 45 4d 3d 73 63 73 69 5f 64 69 73 6b 00 53 45 51  EM=scsi_disk.SEQ
 4e 55 4d 3d 37 34 34 37 00 55 53 45 43 5f 49 4e  NUM=7447.USEC_IN
 49 54 49 41 4c 49 5a 45 44 3d 32 30 35 36 30 30  ITIALIZED=205600
 30 36 36 36 30 33 30 00                          0666030.        

 6c 69 62 75 64 65 76 00 fe ed ca fe 28 00 00 00  libudev.....(...
 28 00 00 00 d4 00 00 00 3c e8 b1 f8 00 00 00 00  (.......<.......
 00 00 00 00 00 00 00 00 41 43 54 49 4f 4e 3d 61  ........ACTION=a
 64 64 00 44 45 56 50 41 54 48 3d 2f 64 65 76 69  dd.DEVPATH=/devi
 63 65 73 2f 70 63 69 30 30 30 30 3a 30 30 2f 30  ces/pci0000:00/0
 30 30 30 3a 30 30 3a 31 30 2e 30 2f 75 73 62 36  000:00:10.0/usb6
 2f 36 2d 32 2f 36 2d 32 3a 31 2e 30 2f 68 6f 73  /6-2/6-2:1.0/hos
 74 36 2f 74 61 72 67 65 74 36 3a 30 3a 30 2f 36  t6/target6:0:0/6
 3a 30 3a 30 3a 30 2f 73 63 73 69 5f 67 65 6e 65  :0:0:0/scsi_gene
 72 69 63 2f 73 67 31 00 53 55 42 53 59 53 54 45  ric/sg1.SUBSYSTE
 4d 3d 73 63 73 69 5f 67 65 6e 65 72 69 63 00 44  M=scsi_generic.D
 45 56 4e 41 4d 45 3d 2f 64 65 76 2f 73 67 31 00  EVNAME=/dev/sg1.
 53 45 51 4e 55 4d 3d 37 34 35 30 00 4d 41 4a 4f  SEQNUM=7450.MAJO
 52 3d 32 31 00 4d 49 4e 4f 52 3d 31 00 55 53 45  R=21.MINOR=1.USE
 43 5f 49 4e 49 54 49 41 4c 49 5a 45 44 3d 32 30  C_INITIALIZED=20
 35 36 30 30 30 36 36 36 35 39 35 00              56000666595.    

 6c 69 62 75 64 65 76 00 fe ed ca fe 28 00 00 00  libudev.....(...
 28 00 00 00 cf 00 00 00 0d df d8 a1 00 00 00 00  (...............
 00 00 00 00 00 00 00 00 41 43 54 49 4f 4e 3d 61  ........ACTION=a
 64 64 00 44 45 56 50 41 54 48 3d 2f 64 65 76 69  dd.DEVPATH=/devi
 63 65 73 2f 70 63 69 30 30 30 30 3a 30 30 2f 30  ces/pci0000:00/0
 30 30 30 3a 30 30 3a 31 30 2e 30 2f 75 73 62 36  000:00:10.0/usb6
 2f 36 2d 32 2f 36 2d 32 3a 31 2e 30 2f 68 6f 73  /6-2/6-2:1.0/hos
 74 36 2f 74 61 72 67 65 74 36 3a 30 3a 30 2f 36  t6/target6:0:0/6
 3a 30 3a 30 3a 30 2f 62 73 67 2f 36 3a 30 3a 30  :0:0:0/bsg/6:0:0
 3a 30 00 53 55 42 53 59 53 54 45 4d 3d 62 73 67  :0.SUBSYSTEM=bsg
 00 44 45 56 4e 41 4d 45 3d 2f 64 65 76 2f 62 73  .DEVNAME=/dev/bs
 67 2f 36 3a 30 3a 30 3a 30 00 53 45 51 4e 55 4d  g/6:0:0:0.SEQNUM
 3d 37 34 35 31 00 4d 41 4a 4f 52 3d 32 34 36 00  =7451.MAJOR=246.
 4d 49 4e 4f 52 3d 31 00 55 53 45 43 5f 49 4e 49  MINOR=1.USEC_INI
 54 49 41 4c 49 5a 45 44 3d 32 30 35 36 30 30 30  TIALIZED=2056000
 36 36 37 30 34 32 00                             667042.         

 6c 69 62 75 64 65 76 00 fe ed ca fe 28 00 00 00  libudev.....(...
 28 00 00 00 54 03 00 00 f0 03 1d b7 7b cb c5 ee  (...T.......{...
 02 00 04 00 10 80 00 00 41 43 54 49 4f 4e 3d 61  ........ACTION=a
 64 64 00 44 45 56 50 41 54 48 3d 2f 64 65 76 69  dd.DEVPATH=/devi
 63 65 73 2f 70 63 69 30 30 30 30 3a 30 30 2f 30  ces/pci0000:00/0
 30 30 30 3a 30 30 3a 31 30 2e 30 2f 75 73 62 36  000:00:10.0/usb6
 2f 36 2d 32 2f 36 2d 32 3a 31 2e 30 2f 68 6f 73  /6-2/6-2:1.0/hos
 74 36 2f 74 61 72 67 65 74 36 3a 30 3a 30 2f 36  t6/target6:0:0/6
 3a 30 3a 30 3a 30 2f 62 6c 6f 63 6b 2f 73 64 62  :0:0:0/block/sdb
 00 53 55 42 53 59 53 54 45 4d 3d 62 6c 6f 63 6b  .SUBSYSTEM=block
 00 44 45 56 4e 41 4d 45 3d 2f 64 65 76 2f 73 64  .DEVNAME=/dev/sd
 62 00 44 45 56 54 59 50 45 3d 64 69 73 6b 00 53  b.DEVTYPE=disk.S
 45 51 4e 55 4d 3d 37 34 35 33 00 55 53 45 43 5f  EQNUM=7453.USEC_
 49 4e 49 54 49 41 4c 49 5a 45 44 3d 32 30 35 36  INITIALIZED=2056
 30 30 30 37 33 36 33 35 39 00 4d 41 4a 4f 52 3d  000736359.MAJOR=
 38 00 4d 49 4e 4f 52 3d 31 36 00 49 44 5f 56 45  8.MINOR=16.ID_VE
 4e 44 4f 52 3d 53 61 6d 73 75 6e 67 00 49 44 5f  NDOR=Samsung.ID_
 56 45 4e 44 4f 52 5f 45 4e 43 3d 53 61 6d 73 75  VENDOR_ENC=Samsu
 6e 67 5c 78 32 30 00 49 44 5f 56 45 4e 44 4f 52  ng\x20.ID_VENDOR
 5f 49 44 3d 30 39 30 63 00 49 44 5f 4d 4f 44 45  _ID=090c.ID_MODE
 4c 3d 46 6c 61 73 68 5f 44 72 69 76 65 5f 44 55  L=Flash_Drive_DU
 4f 00 49 44 5f 4d 4f 44 45 4c 5f 45 4e 43 3d 46  O.ID_MODEL_ENC=F
 6c 61 73 68 5c 78 32 30 44 72 69 76 65 5c 78 32  lash\x20Drive\x2
 30 44 55 4f 5c 78 32 30 00 49 44 5f 4d 4f 44 45  0DUO\x20.ID_MODE
 4c 5f 49 44 3d 31 30 30 30 00 49 44 5f 52 45 56  L_ID=1000.ID_REV
 49 53 49 4f 4e 3d 31 31 30 30 00 49 44 5f 53 45  ISION=1100.ID_SE
 52 49 41 4c 3d 53 61 6d 73 75 6e 67 5f 46 6c 61  RIAL=Samsung_Fla
 73 68 5f 44 72 69 76 65 5f 44 55 4f 5f 30 33 33  sh_Drive_DUO_033
 31 35 31 36 30 37 30 30 31 38 38 31 31 2d 30 3a  1516070018811-0:
 30 00 49 44 5f 53 45 52 49 41 4c 5f 53 48 4f 52  0.ID_SERIAL_SHOR
 54 3d 30 33 33 31 35 31 36 30 37 30 30 31 38 38  T=03315160700188
 31 31 00 49 44 5f 54 59 50 45 3d 64 69 73 6b 00  11.ID_TYPE=disk.
 49 44 5f 49 4e 53 54 41 4e 43 45 3d 30 3a 30 00  ID_INSTANCE=0:0.
 49 44 5f 42 55 53 3d 75 73 62 00 49 44 5f 55 53  ID_BUS=usb.ID_US
 42 5f 49 4e 54 45 52 46 41 43 45 53 3d 3a 30 38  B_INTERFACES=:08
 30 36 35 30 3a 00 49 44 5f 55 53 42 5f 49 4e 54  0650:.ID_USB_INT
 45 52 46 41 43 45 5f 4e 55 4d 3d 30 30 00 49 44  ERFACE_NUM=00.ID
 5f 55 53 42 5f 44 52 49 56 45 52 3d 75 73 62 2d  _USB_DRIVER=usb-
 73 74 6f 72 61 67 65 00 44 45 56 4c 49 4e 4b 53  storage.DEVLINKS
 3d 2f 64 65 76 2f 64 69 73 6b 2f 62 79 2d 69 64  =/dev/disk/by-id
 2f 75 73 62 2d 53 61 6d 73 75 6e 67 5f 46 6c 61  /usb-Samsung_Fla
 73 68 5f 44 72 69 76 65 5f 44 55 4f 5f 30 33 33  sh_Drive_DUO_033
 31 35 31 36 30 37 30 30 31 38 38 31 31 2d 30 3a  1516070018811-0:
 30 20 2f 64 65 76 2f 64 69 73 6b 2f 62 79 2d 70  0 /dev/disk/by-p
 61 74 68 2f 70 63 69 2d 30 30 30 30 3a 30 30 3a  ath/pci-0000:00:
 31 30 2e 30 2d 75 73 62 2d 30 3a 32 3a 31 2e 30  10.0-usb-0:2:1.0
 2d 73 63 73 69 2d 30 3a 30 3a 30 3a 30 00 49 44  -scsi-0:0:0:0.ID
 5f 50 41 54 48 3d 70 63 69 2d 30 30 30 30 3a 30  _PATH=pci-0000:0
 30 3a 31 30 2e 30 2d 75 73 62 2d 30 3a 32 3a 31  0:10.0-usb-0:2:1
 2e 30 2d 73 63 73 69 2d 30 3a 30 3a 30 3a 30 00  .0-scsi-0:0:0:0.
 49 44 5f 50 41 54 48 5f 54 41 47 3d 70 63 69 2d  ID_PATH_TAG=pci-
 30 30 30 30 5f 30 30 5f 31 30 5f 30 2d 75 73 62  0000_00_10_0-usb
 2d 30 5f 32 5f 31 5f 30 2d 73 63 73 69 2d 30 5f  -0_2_1_0-scsi-0_
 30 5f 30 5f 30 00 49 44 5f 50 41 52 54 5f 54 41  0_0_0.ID_PART_TA
 42 4c 45 5f 54 59 50 45 3d 64 6f 73 00 54 41 47  BLE_TYPE=dos.TAG
 53 3d 3a 73 79 73 74 65 6d 64 3a 00              S=:systemd:.    

 6c 69 62 75 64 65 76 00 fe ed ca fe 28 00 00 00  libudev.....(...
 28 00 00 00 e5 04 00 00 f0 03 1d b7 cb 23 44 89  (............#D.
 02 00 04 00 10 80 00 00 41 43 54 49 4f 4e 3d 61  ........ACTION=a
 64 64 00 44 45 56 50 41 54 48 3d 2f 64 65 76 69  dd.DEVPATH=/devi
 63 65 73 2f 70 63 69 30 30 30 30 3a 30 30 2f 30  ces/pci0000:00/0
 30 30 30 3a 30 30 3a 31 30 2e 30 2f 75 73 62 36  000:00:10.0/usb6
 2f 36 2d 32 2f 36 2d 32 3a 31 2e 30 2f 68 6f 73  /6-2/6-2:1.0/hos
 74 36 2f 74 61 72 67 65 74 36 3a 30 3a 30 2f 36  t6/target6:0:0/6
 3a 30 3a 30 3a 30 2f 62 6c 6f 63 6b 2f 73 64 62  :0:0:0/block/sdb
 2f 73 64 62 31 00 53 55 42 53 59 53 54 45 4d 3d  /sdb1.SUBSYSTEM=
 62 6c 6f 63 6b 00 44 45 56 4e 41 4d 45 3d 2f 64  block.DEVNAME=/d
 65 76 2f 73 64 62 31 00 44 45 56 54 59 50 45 3d  ev/sdb1.DEVTYPE=
 70 61 72 74 69 74 69 6f 6e 00 50 41 52 54 4e 3d  partition.PARTN=
 31 00 53 45 51 4e 55 4d 3d 37 34 35 34 00 55 53  1.SEQNUM=7454.US
 45 43 5f 49 4e 49 54 49 41 4c 49 5a 45 44 3d 32  EC_INITIALIZED=2
 30 35 36 30 30 30 37 39 35 39 37 39 00 4d 41 4a  056000795979.MAJ
 4f 52 3d 38 00 4d 49 4e 4f 52 3d 31 37 00 49 44  OR=8.MINOR=17.ID
 5f 42 55 53 3d 75 73 62 00 49 44 5f 49 4e 53 54  _BUS=usb.ID_INST
 41 4e 43 45 3d 30 3a 30 00 49 44 5f 4d 4f 44 45  ANCE=0:0.ID_MODE
 4c 3d 46 6c 61 73 68 5f 44 72 69 76 65 5f 44 55  L=Flash_Drive_DU
 4f 00 49 44 5f 4d 4f 44 45 4c 5f 45 4e 43 3d 46  O.ID_MODEL_ENC=F
 6c 61 73 68 5c 78 32 30 44 72 69 76 65 5c 78 32  lash\x20Drive\x2
 30 44 55 4f 5c 78 32 30 00 49 44 5f 4d 4f 44 45  0DUO\x20.ID_MODE
 4c 5f 49 44 3d 31 30 30 30 00 49 44 5f 50 41 52  L_ID=1000.ID_PAR
 54 5f 54 41 42 4c 45 5f 54 59 50 45 3d 64 6f 73  T_TABLE_TYPE=dos
 00 49 44 5f 50 41 54 48 3d 70 63 69 2d 30 30 30  .ID_PATH=pci-000
 30 3a 30 30 3a 31 30 2e 30 2d 75 73 62 2d 30 3a  0:00:10.0-usb-0:
 32 3a 31 2e 30 2d 73 63 73 69 2d 30 3a 30 3a 30  2:1.0-scsi-0:0:0
 3a 30 00 49 44 5f 50 41 54 48 5f 54 41 47 3d 70  :0.ID_PATH_TAG=p
 63 69 2d 30 30 30 30 5f 30 30 5f 31 30 5f 30 2d  ci-0000_00_10_0-
 75 73 62 2d 30 5f 32 5f 31 5f 30 2d 73 63 73 69  usb-0_2_1_0-scsi
 2d 30 5f 30 5f 30 5f 30 00 49 44 5f 52 45 56 49  -0_0_0_0.ID_REVI
 53 49 4f 4e 3d 31 31 30 30 00 49 44 5f 53 45 52  SION=1100.ID_SER
 49 41 4c 3d 53 61 6d 73 75 6e 67 5f 46 6c 61 73  IAL=Samsung_Flas
 68 5f 44 72 69 76 65 5f 44 55 4f 5f 30 33 33 31  h_Drive_DUO_0331
 35 31 36 30 37 30 30 31 38 38 31 31 2d 30 3a 30  516070018811-0:0
 00 49 44 5f 53 45 52 49 41 4c 5f 53 48 4f 52 54  .ID_SERIAL_SHORT
 3d 30 33 33 31 35 31 36 30 37 30 30 31 38 38 31  =033151607001881
 31 00 49 44 5f 54 59 50 45 3d 64 69 73 6b 00 49  1.ID_TYPE=disk.I
 44 5f 55 53 42 5f 44 52 49 56 45 52 3d 75 73 62  D_USB_DRIVER=usb
 2d 73 74 6f 72 61 67 65 00 49 44 5f 55 53 42 5f  -storage.ID_USB_
 49 4e 54 45 52 46 41 43 45 53 3d 3a 30 38 30 36  INTERFACES=:0806
 35 30 3a 00 49 44 5f 55 53 42 5f 49 4e 54 45 52  50:.ID_USB_INTER
 46 41 43 45 5f 4e 55 4d 3d 30 30 00 49 44 5f 56  FACE_NUM=00.ID_V
 45 4e 44 4f 52 3d 53 61 6d 73 75 6e 67 00 49 44  ENDOR=Samsung.ID
 5f 56 45 4e 44 4f 52 5f 45 4e 43 3d 53 61 6d 73  _VENDOR_ENC=Sams
 75 6e 67 5c 78 32 30 00 49 44 5f 56 45 4e 44 4f  ung\x20.ID_VENDO
 52 5f 49 44 3d 30 39 30 63 00 44 45 56 4c 49 4e  R_ID=090c.DEVLIN
 4b 53 3d 2f 64 65 76 2f 64 69 73 6b 2f 62 79 2d  KS=/dev/disk/by-
 6c 61 62 65 6c 2f 53 61 6d 73 75 6e 67 5c 78 32  label/Samsung\x2
 30 55 53 42 20 2f 64 65 76 2f 64 69 73 6b 2f 62  0USB /dev/disk/b
 79 2d 70 61 74 68 2f 70 63 69 2d 30 30 30 30 3a  y-path/pci-0000:
 30 30 3a 31 30 2e 30 2d 75 73 62 2d 30 3a 32 3a  00:10.0-usb-0:2:
 31 2e 30 2d 73 63 73 69 2d 30 3a 30 3a 30 3a 30  1.0-scsi-0:0:0:0
 2d 70 61 72 74 31 20 2f 64 65 76 2f 64 69 73 6b  -part1 /dev/disk
 2f 62 79 2d 69 64 2f 75 73 62 2d 53 61 6d 73 75  /by-id/usb-Samsu
 6e 67 5f 46 6c 61 73 68 5f 44 72 69 76 65 5f 44  ng_Flash_Drive_D
 55 4f 5f 30 33 33 31 35 31 36 30 37 30 30 31 38  UO_0331516070018
 38 31 31 2d 30 3a 30 2d 70 61 72 74 31 20 2f 64  811-0:0-part1 /d
 65 76 2f 64 69 73 6b 2f 62 79 2d 75 75 69 64 2f  ev/disk/by-uuid/
 45 35 34 31 2d 43 30 44 44 00 49 44 5f 46 53 5f  E541-C0DD.ID_FS_
 4c 41 42 45 4c 3d 53 61 6d 73 75 6e 67 5f 55 53  LABEL=Samsung_US
 42 00 49 44 5f 46 53 5f 4c 41 42 45 4c 5f 45 4e  B.ID_FS_LABEL_EN
 43 3d 53 61 6d 73 75 6e 67 5c 78 32 30 55 53 42  C=Samsung\x20USB
 00 49 44 5f 46 53 5f 55 55 49 44 3d 45 35 34 31  .ID_FS_UUID=E541
 2d 43 30 44 44 00 49 44 5f 46 53 5f 55 55 49 44  -C0DD.ID_FS_UUID
 5f 45 4e 43 3d 45 35 34 31 2d 43 30 44 44 00 49  _ENC=E541-C0DD.I
 44 5f 46 53 5f 56 45 52 53 49 4f 4e 3d 46 41 54  D_FS_VERSION=FAT
 33 32 00 49 44 5f 46 53 5f 54 59 50 45 3d 76 66  32.ID_FS_TYPE=vf
 61 74 00 49 44 5f 46 53 5f 55 53 41 47 45 3d 66  at.ID_FS_USAGE=f
 69 6c 65 73 79 73 74 65 6d 00 49 44 5f 50 41 52  ilesystem.ID_PAR
 54 5f 45 4e 54 52 59 5f 53 43 48 45 4d 45 3d 64  T_ENTRY_SCHEME=d
 6f 73 00 49 44 5f 50 41 52 54 5f 45 4e 54 52 59  os.ID_PART_ENTRY
 5f 54 59 50 45 3d 30 78 63 00 49 44 5f 50 41 52  _TYPE=0xc.ID_PAR
 54 5f 45 4e 54 52 59 5f 4e 55 4d 42 45 52 3d 31  T_ENTRY_NUMBER=1
 00 49 44 5f 50 41 52 54 5f 45 4e 54 52 59 5f 4f  .ID_PART_ENTRY_O
 46 46 53 45 54 3d 36 34 00 49 44 5f 50 41 52 54  FFSET=64.ID_PART
 5f 45 4e 54 52 59 5f 53 49 5a 45 3d 31 32 35 33  _ENTRY_SIZE=1253
 30 34 37 36 38 00 49 44 5f 50 41 52 54 5f 45 4e  04768.ID_PART_EN
 54 52 59 5f 44 49 53 4b 3d 38 3a 31 36 00 54 41  TRY_DISK=8:16.TA
 47 53 3d 3a 73 79 73 74 65 6d 64 3a 00           GS=:systemd:.   

Ignoring the libudev snot there's basically a flurry of events, a short pause, and then the last couple of interesting events where the device nodes become available.

AS FAR AS I CAN GATHER ... there appears to be no documentation regarding the format or order of these kernel messages; what variables will be included and what they mean. Well there's always the kernel source but I could find nothing in [kernel-source]/Documnetation nor anywhere else.

I suppose it is relatively straightforward to just 'suck it and see' but documentation would be nice all the same.

At this point I went down a rabbit hole of trying to work out who ACTUALLY creates the /dev entries; it turns out it's the kernel. So infact udevd isn't really doing anything particularly useful on my system. Probably just as well now that the systemd developers have started 'maintaining' it.

systemd

So anyway i've done a bit of prototyping and I'm sure I can get away without needing udevd at all, systemd is thankfully not anywhere near the mele already. Then I went down another rabbit hole of finding out the current status of systemd.

It's still not good. And i'm pretty sure it never will be. With any luck IBM will pull their finger out and realise what a huge risk and waste of money the project is to their new acquisition and throw it in the bin where it belongs. But of course i'm not holding my breath, it's been designed to be unremovable and was agressively promoted and pushed onto 3rd party projects for a reason. As an aside, hopefully IBM can make jfs a first-class filesystem citizen rather than the red-headed step-child it seems to be these days.

The blog fromthecodefront has a very clear analysis of the situation. Grating narcissitic and abusive personalities aside, this is the first time i've come across any sourcode. It is not pretty. It looks exactly like the code I write when i'm developing prototypes; lots of cut and paste, poor modularisation, meaningless function names, etc. Although I usually tend to use more comments, meaningful labels, and fewer weird-arsed macros to 'save typing' (infact i almost never use macros for that anymore; inline or plain functions can usually be used). And because it's all in C, there's quite an impedence mismatch when a scripting language would be the better choice. This is not the type of code I force onto others, and certainly not any system-critical components.

The developers seem to be out of their depth and absolute arseholes when called out on it. The passive-aggressive and other psychopathic behaviours are very troublesome; I dont deal with abusers like that and neither should you. Multiple commenters say that's just ad-hominem and not important: but it is important, and these guys are not nice people.

Fortunately I usually dont have bother with systemd much anyway - I have few services and they are running already. Shutdown and/or suspsend are sometimes broken but I can always just pull the power plug. Asking for passwords on encrypted disks is also pretty shit (console output overflows the prompts); it's just something else I have to workaround.

Actually I tried using it to stop udevd so I could determine what if anything it was doing on my system: and it refused to let me turn it off or disable it (or mask it, whatever they fuck they want call it). I stopped, disabled, and masked every 'service' or 'socket' with udev in the name, no asusage. I had to chmod the systemd-udevd binary to non-executable in the end.

The only saving grace is that systemd-udevd doesn't really do anything so it can't really fuck it up. Even systemd doesn't really do much apart from run a few scripts in some order.

Where's this going

Well i'm not really sure if i'll stick to a simple monolothic music service or go the whole hog and work on a modularised multi-process (and significnalty more secure) design. Simple is nice but the other approach has some relatively interesting things to play with.

But it's all very time-consuming and too sedentry. My body is falling apart.

I need to get out of the house more; every time i get stuck into a coding project (most recently for work) I seem to rapidly stack on weight. It's related to some (medicinal) drugs once taken and now stopped and obviously some over-consumption and it's fucking pissing me off. The weight is also completely fucking up my sleep and that's pissing me off even more. I'm pissed off a lot lately!

Tagged code, hacking.
Friday, 28 December 2018, 00:12

X-MAS 2018

I wanted a nice quiet hassle-free xmas this year so I had it alone. My nephew (who migrated from the philippines and wont fucking leave) is away for the week so I had the house to myself. The rest of the family don't live in Adelaide anymore and mum can deal with my crazy twin brother on her own.

For the fist time I fired up the coopers bbq I won a few months ago. I used the fire grate I made a few weeks ago and the fire holders from the weber. Another modification I made was to add a socket to the battery powered motor so I ran it from a plugpack instead of a pair of D cells. It's pretty gutless but worked fine.

Fire started. To avoid flareups I was going to put the fire on the sides but it wasn't necessary.

And the pork shoulder on going. I wasn't sure if the fat would get out of hand but it worked very well, very little smoke and only small flareups each rotation with the heat directly under the meat.

I skewered simply the pork with lemongrass stalks and coated it in ample salt which is my go-to basic pork roast.

What's the time? Oh it's beer time!

Actually I normally start beer at 10am on xmas day but i'd been up since 6 (I did the last coat on the speakers, setup the bbq, and made bread) and ran out of other things to do and it just seemed about right.

The bread proofing. I added some semolina and didn't let it rise as much as I normally do - made very excellent dense bread.

About 2 hours later and it's done. Actually it's a bit overdone as it cooked faster than I expected but a shoulder is forgiving of being overcooked and regardless, the cracking was great.

I used a bit more charcoal than I would have in the weber but it was a fun way to cook the meat and i'll definltely do it again.

As I usually do with the weber I try to use up the remaining left-over heat to cook whatever else I have on hand. In this case some frozen skinless (spicy) sausages I made a few days ago. I used too much fat in them and they were a massively disgusting mess to make but they tasted pretty good.

Meanwhile the oven did its work. Just hitting midday at this point.

Last bit of heat. I also did a thick bit of rump.

Fucking hot day (40C) so I had the outdoor a/c going! Inside the house was very cool but it was too nice a day for that.

A `panroama' of the back yard.

I'm rather proud of that lawn, I grew it from a few rhizomes I took from the nature strip out on the road.

So that was xmas 2018. I didn't really drink much - i was too chock-full of food and too tired, but I had a few beers and a few gin and tonics (with cucumber from the garden).

But all-in-all about as low-stress and enjoyable as one could hope for.

Tagged biographical.
Thursday, 27 December 2018, 23:23

Making biltong made easy

After a few iterations i've managed to get biltong making down to a pretty streamlined, 'somehwat lazy' process. It relies on the butcher (aka supermarket) doing the brining.

First get the spices ready. This is both important and a bit arbitrary. You can find recipes on the net but the main ingredients are coriander seed and black pepper (and those starting with 'one whole freshly butchered springbok' aren't very practical).

Here's a simple one. It was enough for two small batches.

Recipe for Biltong Spices
AmountIngredient
1 cupcoriander seed
1 tbspblack pepper
1 tbspallspice
1 tspfennel seed
1 handfuldried thai birds-eye hot chillies

Actually I didn't write it down so these numbers might be a bit off but it's about right. Thigs like allspice, fennel seeds, ginger, cinnamon, paprika, and so on can add a nice tweak to the basic recipe. I always add hot chillies as a matter of course, of course.

Not terribly important here but an Australian metric tablespoon is 4x teaspoons (20ml), not the usual 3 in the rest of the western world.

Ideally give them all a bit of a dry-roast in a pan or the oven to bring out the flavours. It isn't necessary but its worth it and it smells great. Basically just keep stirring over low-medium heat until they become aromatic and the chillies gain a bit of colour. Here i've just started roasting them.

Then powder them. If you have the time and the equipment using a mortar and pestle will produce a more aromatic powder; but i usually just use a blender and keep going until it's done. Don't breath it in if you've used any really hot chillies.

I also have a small precious supply of dried habaneros i made a few years ago and I threw a couple of those into the blender.

Next the meat. I wait till corned silverside is on special ($8/Kg) at my local Foodland and grab a couple of them. I try to get the largest ones they have (>1Kg), and given the packaging is often opaque its a bit hit and miss as to the quality you get - ideally good solid meat with little fat and gristle. Here i've just unpackaged them and wiped off the slimey brine residue, these are good cuts to use. Each one here is about 1.5Kg.

Corned silverside - corned beef - done this way is apparently an Australian thing (according to my butcher brother), so if you're from some backward arsed country that doesn't have this you'll have to do it the long way.

So you basically just slice it into roughty 2cm thick blocks and trim off most of the fat. It's reasonably easy to slice squarely because the brining makes it go stiffer than raw meat. I usually fry up the trimmings - its sort of like shit bacon, chewy but tasty.

So that's the hardest and messiest bit out of the way. If making it from scratch you would then brine this meat before moving to the next stage. And you have to be concerned about brine concentration or amount of salt (none of the recipes I found ever say how MUCH salt to use), and so on. I haven't found the pre-pickled meat to be completely consistent but it's always edible once completed. Sometimes it can be a bit on the salty side, but that just means you drink more beer.

`dip the slices of brined meat in vinegar'

aka fuck that. Pour half a cup of vinegar into the container, put the lid on, and shake the shit out of it. Drain.

'roll in the spices to cover evenly'

Pour about 1/2 a cup of the spice mix over the meat ...

Cover, and shake the shit out of it again. Done.

I used to have a bowl of vinegar i'd dip it in, then a tray of spice to do the coating. Messy as fuck and unreliable.

Actually i'm still working on getting the ideal coating, I always seem to put too much on because when you're applying it it doesn't look like much but when it's dry it's heavily coated and falling off. Next time I do it I might also try leaving it in this state in the fridge overnight to let the flavours seep in a bit more before starting to dry.

It took a while (literally years!) but i found a small local caterers shop that sold small stainelss steel butchers hooks. Previously i'd used fishing line (fucking pain to work with) then some stainelss steel wire I fashioned into hooks (which was ok until i found the proper ones). I bought out the shop at the time and got 13, which was just enough for this batch.

Hang them up on the hooks. I have a small cpu fan running off an old nokia charger to keep the air flowing to help speed up drying and a fly-screen to keep the bugs out. I used to have a small 20W incandescent lightglobe to help with the drying but they keep burning out and it isn't necessary in summer.

They're ready for 'picking' 1-2 weeks later depending on the weather and how thick you cut the meat. It will lose about 50% of it's original weight and be very dry and hard - you need a biltong cutter to get through it. I've tried stopping a bit earlier so it isn't so hard but the flavour is muted and it wont keep anywhere near as long.

Cut into as thin slices as you could be bothered with, consume with beer. If it's too thick it'll take a lot of chewing, if it's too thin just cutting it becomes a chore!

It lasts forever in the fridge. I made a batch just before getting gout a few years ago so didn't touch it for about a year - it was still ok when I finally got through it all.

Tagged cooking.
Thursday, 27 December 2018, 22:16

Speaker Boxes and Music Players

I finally got around to mostly finishing the speakers I was making out of recovered drivers. Here's a bit of a photo-diary of the final stages.

Here we have the completed woodwork. It has been glued and sanded square. I'm mostly happy with how it turned out but I could have done a bit more sanding; I was over it by then. In each case I pretty much practiced on one and got better on the other one, hence a few differences here and there. The one on the left is unpainted and the one on the right has a coat of sanding sealer and also the binding post mounting mechanism.

Three undercoats, lots of sanding and two overcoats and it's ready to be put together.

Given the paint was so expensive ($90) I did a bit of a shit job in the end; I just got sick of dealing with everything. First I had a cheap throwaway brush which I should've just thrown away before I even started. Then the paint was too thick for the weather and needed more thinning, then I tried using a small roller - but again i got some cheap junk which left behind piles of dust and shit, and because I hadn't used a roller before I didn't apply it as well as I might have.

The next shot just shows the mounting point for the binding posts.

Even this I kinda fucked up. I tried using the drill press to drill the screw holes to mount it but to avoid scratching the paint I had it on a small block of foam. It moved when I wasn't looking and I drilled it in the wrong spot. It's hidden but I know it's there.

Soldering the wires.

Completed binding posts.

Connecting the driver.

Inserting the acoustic foam. I have 25mm at the read and 12.5mm down the sides - about as much as could fit in the small box.

A completed speaker (so far). The screws (all 24 of them) for the box are really only aesthetic as the box is very well glued. They did help when setting the glue though.

The pair. I've only redone the rubber surround on the right one so far, the one on the left is still a bit scratchy with high volume as a result. The mounting rubber washers/etc is still work in progress.

I'm still yet to get some fabric for the grilles. I did a quick peruse through lincraft but couldn't find any suitable, next time i'll ask and there's a couple of other places to try.

And finally a shot in testing. The plan is to put the electronics in another box with a battery pack. I've got the bits for the battery but am still working on the mechanics.

How do they sound? Well ok. They're not going to break any technical records; there's no engineering behind the boxes other than being a sealed box with a bit of foam in it. Each only has a woofer so the top-end is very retarded. The bottom end isn't too bad but it does have an echoey effect with some mid-tones, then again so do any other small speakers i've tried (including the $1000/pair units I just installed in the dining room). Quite ok for a bit of outside doof though!

It's been a good little project to get away from the screen so far, although finishing it off will not be.

Electronics and Software

I was looking around for hardware for the player but since I have the mele doing nothing I thought I may as well use that. Most of the other prototyping boards around now are either too high powered or missing some necessary bits; although the nanopi boards look quite attractive (on a side-note I can't believe how expensive raspberry pi shit is in australia). As this is nominally a 'portable' system based on recycled speakers (with no tweeters!) the audio quality isn't terribly important, the on-board dac/codec sounds good enough to me. I'm also considering an old phone or an old 7" tablet I have, although it's far less attractive to me if they can only run android (fuck that shit; yeah fuck you too google).

After spending most of a day on it I managed to get debian running on the mele. I tried the sunxi wiki and building my own kernel and bootloader but without any debug console I couldn't tell if it was working or not. I got this server image to work in the end, using the jessie image.

While trying to build using the sunxi instructions I discovered that the ubuntu maintainers have a really broken idea about what a cross-compiler should do. And they're really quite rude about it, hiding their rudeness behind the `code of conduct'.

To avoid dragging in gobs of junk and other poettering snot I built a basic SDL (1.2) and a cut-down ffmpeg (1.0) from source and have a basic console music player working. With a little more work I can control it with the mele airmouse although without a screen it's going to be difficult to do too many interesting things. Something to poke about with.

Tagged hacking, linux, workshop.
Thursday, 29 November 2018, 07:48

Dropper Fire Grill, and Firefox suxors too

So this came about because I was fighting with firefox and needed to get away from a screen for a while. I wrote a couple of plugins (oh sorry, 'addons', no hang on, web-extensions, WHATEVER THE FUCK YOU WANT TO CALL IT MOZILLA) and the experience was sour (can't you tell?).

The aforementioned BBQ/firepit thing I haven't gotten around to using yet, one reason is because I wanted to make a fire grate first because it's a bit too deep.

So a few droppers, a bit of hacksawing and some angle grinding later here it is. It just slots together with no fastening or welding.

It's even adjustable! No brick, brick flat, or brick on side!

Actually it might just work better as an esky, but i'll see.

More on the firefox plugins later, they're just for overriding site fonts and site colours. There do exist such plugins but they no longer work for some reason. OF course there's not much use distributing the source becuase you NEED A FUCKING MOZILLA ACCOUNT JUST TO INSTALL THEM.

Tagged rants, workshop.
Newer Posts | Older Posts
Copyright (C) 2019 Michael Zucchi, All Rights Reserved. Powered by gcc & me!