]> pere.pagekite.me Git - homepage.git/blob - blog/archive/2015/12/12.rss
New post.
[homepage.git] / blog / archive / 2015 / 12 / 12.rss
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <rss version='2.0' xmlns:lj='http://www.livejournal.org/rss/lj/1.0/'>
3 <channel>
4 <title>Petter Reinholdtsen - Entries from December 2015</title>
5 <description>Entries from December 2015</description>
6 <link>http://people.skolelinux.org/pere/blog/</link>
7
8
9 <item>
10 <title>Using appstream with isenkram to install hardware related packages in Debian</title>
11 <link>http://people.skolelinux.org/pere/blog/Using_appstream_with_isenkram_to_install_hardware_related_packages_in_Debian.html</link>
12 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Using_appstream_with_isenkram_to_install_hardware_related_packages_in_Debian.html</guid>
13 <pubDate>Sun, 20 Dec 2015 12:20:00 +0100</pubDate>
14 <description>&lt;p&gt;Around three years ago, I created
15 &lt;a href=&quot;http://packages.qa.debian.org/isenkram&quot;&gt;the isenkram
16 system&lt;/a&gt; to get a more practical solution in Debian for handing
17 hardware related packages. A GUI system in the isenkram package will
18 present a pop-up dialog when some hardware dongle supported by
19 relevant packages in Debian is inserted into the machine. The same
20 lookup mechanism to detect packages is available as command line
21 tools in the isenkram-cli package. In addition to mapping hardware,
22 it will also map kernel firmware files to packages and make it easy to
23 install needed firmware packages automatically. The key for this
24 system to work is a good way to map hardware to packages, in other
25 words, allow packages to announce what hardware they will work
26 with.&lt;/p&gt;
27
28 &lt;p&gt;I started by providing data files in the isenkram source, and
29 adding code to download the latest version of these data files at run
30 time, to ensure every user had the most up to date mapping available.
31 I also added support for storing the mapping in the Packages file in
32 the apt repositories, but did not push this approach because while I
33 was trying to figure out how to best store hardware/package mappings,
34 &lt;a href=&quot;http://www.freedesktop.org/software/appstream/docs/&quot;&gt;the
35 appstream system&lt;/a&gt; was announced. I got in touch and suggested to
36 add the hardware mapping into that data set to be able to use
37 appstream as a data source, and this was accepted at least for the
38 Debian version of appstream.&lt;/p&gt;
39
40 &lt;p&gt;A few days ago using appstream in Debian for this became possible,
41 and today I uploaded a new version 0.20 of isenkram adding support for
42 appstream as a data source for mapping hardware to packages. The only
43 package so far using appstream to announce its hardware support is my
44 pymissile package. I got help from Matthias Klumpp with figuring out
45 how do add the required
46 &lt;a href=&quot;https://appstream.debian.org/html/sid/main/metainfo/pymissile.html&quot;&gt;metadata
47 in pymissile&lt;/a&gt;. I added a file debian/pymissile.metainfo.xml with
48 this content:&lt;/p&gt;
49
50 &lt;blockquote&gt;&lt;pre&gt;
51 &amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;
52 &amp;lt;component&amp;gt;
53 &amp;lt;id&amp;gt;pymissile&amp;lt;/id&amp;gt;
54 &amp;lt;metadata_license&amp;gt;MIT&amp;lt;/metadata_license&amp;gt;
55 &amp;lt;name&amp;gt;pymissile&amp;lt;/name&amp;gt;
56 &amp;lt;summary&amp;gt;Control original Striker USB Missile Launcher&amp;lt;/summary&amp;gt;
57 &amp;lt;description&amp;gt;
58 &amp;lt;p&amp;gt;
59 Pymissile provides a curses interface to control an original
60 Marks and Spencer / Striker USB Missile Launcher, as well as a
61 motion control script to allow a webcamera to control the
62 launcher.
63 &amp;lt;/p&amp;gt;
64 &amp;lt;/description&amp;gt;
65 &amp;lt;provides&amp;gt;
66 &amp;lt;modalias&amp;gt;usb:v1130p0202d*&amp;lt;/modalias&amp;gt;
67 &amp;lt;/provides&amp;gt;
68 &amp;lt;/component&amp;gt;
69 &lt;/pre&gt;&lt;/blockquote&gt;
70
71 &lt;p&gt;The key for isenkram is the component/provides/modalias value,
72 which is a glob style match rule for hardware specific strings
73 (modalias strings) provided by the Linux kernel. In this case, it
74 will map to all USB devices with vendor code 1130 and product code
75 0202.&lt;/p&gt;
76
77 &lt;p&gt;Note, it is important that the license of all the metadata files
78 are compatible to have permissions to aggregate them into archive wide
79 appstream files. Matthias suggested to use MIT or BSD licenses for
80 these files. A challenge is figuring out a good id for the data, as
81 it is supposed to be globally unique and shared across distributions
82 (in other words, best to coordinate with upstream what to use). But
83 it can be changed later or, so we went with the package name as
84 upstream for this project is dormant.&lt;/p&gt;
85
86 &lt;p&gt;To get the metadata file installed in the correct location for the
87 mirror update scripts to pick it up and include its content the
88 appstream data source, the file must be installed in the binary
89 package under /usr/share/appdata/. I did this by adding the following
90 line to debian/pymissile.install:&lt;/p&gt;
91
92 &lt;blockquote&gt;&lt;pre&gt;
93 debian/pymissile.metainfo.xml usr/share/appdata
94 &lt;/pre&gt;&lt;/blockquote&gt;
95
96 &lt;p&gt;With that in place, the command line tool isenkram-lookup will list
97 all packages useful on the current computer automatically, and the GUI
98 pop-up handler will propose to install the package not already
99 installed if a hardware dongle is inserted into the machine in
100 question.&lt;/p&gt;
101
102 &lt;p&gt;Details of the modalias field in appstream is available from the
103 &lt;a href=&quot;https://wiki.debian.org/DEP-11&quot;&gt;DEP-11&lt;/a&gt; proposal.&lt;/p&gt;
104
105 &lt;p&gt;To locate the modalias values of all hardware present in a machine,
106 try running this command on the command line:&lt;/p&gt;
107
108 &lt;blockquote&gt;&lt;pre&gt;
109 cat $(find /sys/devices/|grep modalias)
110 &lt;/pre&gt;&lt;/blockquote&gt;
111
112 &lt;p&gt;To learn more about the isenkram system, please check out
113 &lt;a href=&quot;http://people.skolelinux.org/pere/blog/tags/isenkram/&quot;&gt;my
114 blog posts tagged isenkram&lt;/a&gt;.&lt;/p&gt;
115 </description>
116 </item>
117
118 <item>
119 <title>Bokhandeldistribusjon av boken Fri kultur av Lawrence Lessig</title>
120 <link>http://people.skolelinux.org/pere/blog/Bokhandeldistribusjon_av_boken_Fri_kultur_av_Lawrence_Lessig.html</link>
121 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Bokhandeldistribusjon_av_boken_Fri_kultur_av_Lawrence_Lessig.html</guid>
122 <pubDate>Mon, 14 Dec 2015 12:10:00 +0100</pubDate>
123 <description>&lt;p&gt;&lt;strong&gt;Besøk
124 &lt;a href=&quot;https://www.lulu.com/shop/lawrence-lessig/fri-kultur/paperback/product-22441576.html&quot;&gt;lulu.com&lt;/a&gt;
125 eller
126 &lt;a href=&quot;https://www.amazon.com/Fri-kultur-Norwegian-Lawrence-Lessig/dp/8269018236/&quot;&gt;Amazon&lt;/a&gt;
127 for å kjøpe boken på papir, eller last ned ebook som
128 &lt;a href=&quot;https://github.com/petterreinholdtsen/free-culture-lessig/raw/master/archive/freeculture.nb.pdf&quot;&gt;PDF&lt;/a&gt;,
129 &lt;a href=&quot;https://github.com/petterreinholdtsen/free-culture-lessig/raw/master/archive/freeculture.nb.epub&quot;&gt;ePub&lt;/a&gt;
130 eller
131 &lt;a href=&quot;https://github.com/petterreinholdtsen/free-culture-lessig/raw/master/archive/freeculture.nb.mobi&quot;&gt;MOBI&lt;/a&gt;
132 fra
133 &lt;a href=&quot;https://github.com/petterreinholdtsen/free-culture-lessig/&quot;&gt;github&lt;/a&gt;.&lt;/strong&gt;&lt;/p&gt;
134
135 &lt;p&gt;Jeg ble gledelig overrasket i dag da jeg oppdaget at boken jeg har
136 gitt ut
137 &lt;a href=&quot;https://www.amazon.com/Fri-kultur-Norwegian-Lawrence-Lessig/dp/8269018236/&quot;&gt;hadde
138 dukket opp i Amazon&lt;/a&gt;. Jeg hadde trodd det skulle ta lenger tid, da
139 jeg fikk beskjed om at det skulle ta seks til åtte uker.
140 Amazonoppføringen er et resultat av at jeg for noen uker siden
141 diskuterte prissetting og håndtering av profitt med forfatteren. Det
142 måtte avklares da bruksvilkårene til boken har krav om
143 ikke-kommersiell bruk. Vi ble enige om at overskuddet fra salg av
144 boken skal sendes til
145 &lt;a href=&quot;https://creativecommons.org/&quot;&gt;Creative Commons-stiftelsen&lt;/a&gt;.
146 Med det på plass kunne jeg be
147 &lt;a href=&quot;https://www.lulu.com/shop/lawrence-lessig/fri-kultur/paperback/product-22441576.html&quot;&gt;lulu.com&lt;/a&gt;
148 om å gi boken «utvidet» distribusjon. Årsaken til at
149 bokhandeldistribusjon var litt utfordrende er at bokhandlere krever
150 mulighet for profitt på bøkene de selger (selvfølgelig), og dermed
151 måtte de få lov til å selge til høyere pris enn lulu.com. I tillegg
152 er det krav om samme pris på lulu.com og i bokhandlene, dermed blir
153 prisen økt også hos lulu.com. Hva skulle jeg gjøre med den profitten
154 uten å bryte med klausulen om ikkekommersiell? Løsningen var å gi
155 bort profitten til CC-stiftelsen. Prisen på boken ble nesten
156 tredoblet, til $19.99 (ca. 160,-) pluss frakt, men synligheten øker
157 betraktelig når den kan finnes i katalogene til store nettbokhandlere.
158 Det betyr at hvis du allerede har kjøpt boken har du fått den veldig
159 billig, og kjøper du den nå, får du den fortsatt billig samt donerer i
160 tillegg noen tiere til fremme av Creative Commons.&lt;/p&gt;
161
162 &lt;p&gt;Mens jeg var i gang med å titte etter informasjon om boken
163 oppdaget jeg at den også var dukket opp på
164 &lt;a href=&quot;https://books.google.no/books?id=uKUGCwAAQBAJ&quot;&gt;Google
165 Books&lt;/a&gt;, der en kan lese den på web. PDF-utgaven har ennå ikke
166 dukket opp hos &lt;a href=&quot;https://www.nb.no/&quot;&gt;Nasjonalbiblioteket&lt;/a&gt;,
167 men det regner jeg med kommer på plass i løpet av noen uker. Boken er
168 heller ikke dukket opp hos
169 &lt;a href=&quot;https://www.barnesandnoble.com/&quot;&gt;Barnes &amp; Noble&lt;/a&gt; ennå, men
170 jeg antar det bare er et tidsspørsmål før dette er på plass.&lt;/p&gt;
171
172 &lt;p&gt;Boken er dessverre ikke tilgjengelig fra norske bokhandlere, og
173 kommer neppe til å bli det med det første. Årsaken er at for å få det
174 til måtte jeg personlig håndtere bestilling av bøker, hvilket jeg ikke
175 er interessert i å bruke tid på. Jeg kunne betalt ca 2000,- til
176 &lt;a href=&quot;http://www.bokbasen.no/&quot;&gt;den norske bokbasen&lt;/a&gt;, en felles
177 database over bøker tilgjengelig for norske bokhandlere, for å få en
178 oppføring der, men da måtte jeg tatt imot bestillinger på epost og
179 sendt ut bøker selv. Det ville krevd at jeg var klar til å
180 sende ut bøker på kort varsel, dvs. holdt meg med ekstra bøker,
181 konvolutter og frimerker. Bokbasen har visst ikke opplegg for å be
182 bokhandlene bestille direkte via web, så jeg droppet oppføring der.
183 Jeg har spurt Haugen bok og Tronsmo direkte på epost om de er
184 interessert i å ta inn boken i sin bestillingskatalog, men ikke fått
185 svar, så jeg antar de ikke er interessert. Derimot har jeg fått en
186 hyggelig henvendelse fra Biblioteksentralen som fortalte at de har
187 lagt den inn i sin database slik at deres bibliotekskunder enkelt kan
188 bestille den via dem.&lt;/p&gt;
189
190 &lt;p&gt;Boken er i følge
191 &lt;a href=&quot;http://bibsys-almaprimo.hosted.exlibrisgroup.com/primo_library/libweb/action/display.do?tabs=detailsTab&amp;ct=display&amp;fn=search&amp;doc=BIBSYS_ILS71518423420002201&amp;indx=1&amp;recIds=BIBSYS_ILS71518423420002201&amp;recIdxs=0&amp;elementId=0&amp;renderMode=poppedOut&amp;displayMode=full&amp;frbrVersion=&amp;dscnt=0&amp;tab=library_catalogue&amp;dstmp=1448543801124&amp;vl(freeText0)=fri%20kultur&amp;vid=UBO&amp;mode=Basic&quot;&gt;Bibsys/Oria&lt;/a&gt;
192 og bokdatabasen til
193 &lt;a href=&quot;https://www.deich.folkebibl.no/cgi-bin/websok?tnr=1819617&quot;&gt;Deichmanske&lt;/a&gt;
194 tilgjengelig fra flere biblioteker allerede, og alle eksemplarer er
195 visst allerede utlånt med ventetid. Det synes jeg er veldig gledelig
196 å se. Jeg håper mange kommer til å lese boken. Jeg tror den er
197 spesielt egnet for foreldre og bekjente av oss nerder for å forklare
198 hva slags problemer vi ser med dagens opphavsrettsregime.&lt;/p&gt;
199 </description>
200 </item>
201
202 </channel>
203 </rss>