tag:blogger.com,1999:blog-19206049942023253432024-03-05T07:57:58.349+01:00hajmaAnonymoushttp://www.blogger.com/profile/13323801844414342161noreply@blogger.comBlogger248125tag:blogger.com,1999:blog-1920604994202325343.post-60783005893473633102018-07-26T22:41:00.001+02:002018-07-26T22:41:42.935+02:00Vacation in Gdansk - notesWe used the <a href="http://www.ceskedrahy.cz/tiskove-centrum/tiskove-zpravy/-30066/">Wydmy</a> fast train from Bohumín - get the tickets and couchette reservations well in advance, especially when you want to go during or near weekends. There are two types of coupes - three or two bedded. If the complimentary muffin is not visible, check the cabinet above the washbasin (hidden inside the table in the coupe). The morning herbata is free. The return train leaves too late in the evening (11 p.m.) and ours was 20 minutes delayed, next time consider going further to the north so we can leave earlier.<br />
<br />
<a href="https://sk.gis.gov.pl/index.php/strona/content/7">Current state of all polish beaches</a>; also <a href="http://www.wsse.gda.pl/">wsse</a>.<br />
<a href="https://play.google.com/store/apps/details?id=com.inno.epodroznik.android">Polish public transport lookup for android (buses+trains)</a><br />
<a href="http://www.ztm.gda.pl/">Public transport in Gdansk</a> - buy enough tickets in advance, they are more expensive from the driver and some stations don't have vending machines.<br />
<a href="http://www.ztm.gda.pl/hmvc/index.php/test/wieceji/74">Tramwaje wodne</a> - F5 only makes sense to board at Żabi Kruk, it only has 50 places and is full immediately; it'd be a shame to miss. The port is the best. Latarnia is nice. Need to visit Westerplatte the next time. <br />
Weather - <a href="https://play.google.com/store/apps/details?id=com.windyty.android&hl=en">Windy</a> seems to be better, also contains waves prediction<br />
Maps - <a href="https://play.google.com/store/apps/details?id=cz.seznam.mapy&hl=en">mapy.cz</a> with offline maps are unbeatable<br />
<a href="https://www.sportgdansk.pl/">Local sport events in Gdansk</a><br />
<a href="https://www.gdansk.pl/wiadomosci/Skimbording-na-Stogach-Kto-ma-ochote-poskimic,a,118334">Skimboarding</a> - free on Wednesdays<br />
<a href="https://triathlongdansk.eu/">Triathlon Gdansk</a><br />
<a href="http://www.harpagan.pl/"><span>Pomorski Klub Orientacji</span></a><span>, <a href="https://www.harpagan.pl/harpus/">Harpus</a> </span><br />
<span><a href="http://www.parkowebno.pl/">Rodzinne Gry Parkowe na Orientację</a> </span><br />
<span><a href="http://visitmalbork.pl/262,Malbork-najwiekszy-zamek-gotycki-na-swiecie.html">Malbork</a> - when going by train, get off at Malbork Kałdowo. Forget the audioguide, the people guides rock. 4 hours might be enough. On the other hand there's reduced entry after 17:15.</span><br />
<a href="https://camping-gdansk.pl/">Camp Stogi</a> - crowded and the tent area is very hilly. Not really quiet before 10-11 p.m., but we've been to worse. Mosquitoes in the forest<br />
<br />
<br />
<br />
<br />
<br />Anonymoushttp://www.blogger.com/profile/13323801844414342161noreply@blogger.com0tag:blogger.com,1999:blog-1920604994202325343.post-77224208840753831162018-01-11T23:44:00.000+01:002018-01-11T23:44:29.271+01:00GPS coordinates of all Slovak villagesWhile I could get more or less complete <a href="https://github.com/33bcdd/souradnice-mest" target="_blank">GPS coordinates for Czech villages</a>, I had little luck finding the same for Slovakia. In the end I downloaded <a href="http://download.geofabrik.de/europe.html" target="_blank">OpenStreetMap data</a> for Slovakia, cloned <a href="https://imposm.org/docs/imposm.parser/latest/">imposm.parser</a><a href="https://www.blogger.com/null"><span id="goog_561439588"></span><span id="goog_561439589"></span></a>, and wrote a simple script to get comma separated values:<br />
<br />
<span style="font-size: xx-small;"><span style="font-family: "Courier New",Courier,monospace;">hajma@debian:~/bin/osm$ cat extract-towns.py <br />from imposm.parser import OSMParser<br />import codecs<br />import locale<br />import sys<br /><br /># simple class that handles the parsed OSM data.<br />class HighwayCounter(object):<br /><br /> def coords_callback(tags, coords):<br /> for x in coords:<br /> if 'place' in x[1].keys():<br /> if x[1]['place'] == 'village':<br /> if 'is_in' in x[1].keys():<br /> print("\"%s, %s\", %s, %s" % (x[1]['name'], x[1]['is_in'], x[2][0], x[2][1]))<br /> else:<br /> print("\"%s, Slovensko\", %s, %s" % (x[1]['name'], x[2][0], x[2][1]))<br /> <br />sys.stdout = codecs.getwriter(locale.getpreferredencoding())(sys.stdout) <br /># instantiate counter and parser and start parsing<br />counter = HighwayCounter()<br />p = OSMParser(concurrency=1, nodes_callback=counter.coords_callback)<br />p.parse('slovakia-latest.osm')</span></span><br />
<br />
#learningpythonAnonymoushttp://www.blogger.com/profile/13323801844414342161noreply@blogger.com0tag:blogger.com,1999:blog-1920604994202325343.post-19022827476124410762018-01-11T23:12:00.002+01:002018-01-11T23:12:57.478+01:00TRBP 2017, mission accomplishedI've joined the <a href="http://www.trbp.eu/" target="_blank">Trebic runners cup</a> a bit late in the game, but I managed to get within the first ten in my category. Let's see how 2018 will be.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLA825w33-V1AEoFeDt2Yi6rslBDUYzOOVUUzhKeOyQEmOhcJ55KqIn_cb_c3DbYh6vWqwJmtQekBscFzV7IkZa_HkflU8bWdPF6NI3kmpQ9Pty3FLROQurNeAp9kaWUD5wsJp_u2A7as/s1600/Untitled.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="816" data-original-width="1294" height="402" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLA825w33-V1AEoFeDt2Yi6rslBDUYzOOVUUzhKeOyQEmOhcJ55KqIn_cb_c3DbYh6vWqwJmtQekBscFzV7IkZa_HkflU8bWdPF6NI3kmpQ9Pty3FLROQurNeAp9kaWUD5wsJp_u2A7as/s640/Untitled.png" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://scontent-bru2-1.xx.fbcdn.net/v/t31.0-8/26173144_1585929901487214_4103029197759566323_o.jpg?oh=d0a4548579770031a24d957d41ad4b1e&oe=5AF3DE32" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="600" data-original-width="800" height="240" src="https://scontent-bru2-1.xx.fbcdn.net/v/t31.0-8/26173144_1585929901487214_4103029197759566323_o.jpg?oh=d0a4548579770031a24d957d41ad4b1e&oe=5AF3DE32" width="320" /></a></div>
<br />Anonymoushttp://www.blogger.com/profile/13323801844414342161noreply@blogger.com0tag:blogger.com,1999:blog-1920604994202325343.post-81006897695188701402017-11-06T16:20:00.001+01:002017-11-06T16:20:57.292+01:00HROB 2017My goals for this year's <a href="http://hrob2017.obvizovice.cz/" target="_blank">Mountain Orienteering Championship</a>:<br />
<ul>
<li>Don't get lost - check</li>
<li>Don't be the last one - check</li>
<li>Finish at worst as fifth from the end - check</li>
</ul>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzQH431anuAtoWmayzAXbz7UVODAErkHmWNJX6cymD1rURN3ma0aII6JX5yC2m0nwihXh1hNGVF4Kj3QQ9fFkb1is6gcVr0W3m85mIAKi8-KJ54g4tAbANCOSfctO1FLK5cyBX7w1OSTw/s1600/hrob.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="873" data-original-width="1200" height="290" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzQH431anuAtoWmayzAXbz7UVODAErkHmWNJX6cymD1rURN3ma0aII6JX5yC2m0nwihXh1hNGVF4Kj3QQ9fFkb1is6gcVr0W3m85mIAKi8-KJ54g4tAbANCOSfctO1FLK5cyBX7w1OSTw/s400/hrob.jpg" width="400" /></a></div>
<br />Anonymoushttp://www.blogger.com/profile/13323801844414342161noreply@blogger.com1tag:blogger.com,1999:blog-1920604994202325343.post-59193044395251184202017-11-01T10:02:00.000+01:002017-11-01T10:02:16.495+01:00Restoring Windows backupA relative of mine asked me to restore a couple of files from backup CDs created by the windows native backup utility.<br />
It turned out more difficult than I initially expected.<br />
<br />
First, unlike other tools, the windows backup utility zips the files using the backslash as a directory separator and none of the Linux decompression tools can handle that.<br />
<br />
Second, the files were encoded with one of the Windows native encodings, and none of the Linux decompression tools handle that (apparently unzip on Ubuntu is patched to add support for filename encodings, but Debian, as usual, is lacking).<br />
<br />
What a mess ... <br />
<br />
1. unzip with bsdtar as unzip would scramble the non-ascii filenames<br />
<span style="font-family: "Courier New",Courier,monospace;">$ bsdtar xf ../Backup\ files\ 7.zip</span><br />
<span style="font-family: "Courier New",Courier,monospace;">2. convert filenames to utf-8</span><br />
<span style="font-family: "Courier New",Courier,monospace;">$ convmv -r -f cp852 -t utf-8 --notest .</span><br />
<span style="font-family: "Courier New",Courier,monospace;">3. <a href="https://unix.stackexchange.com/questions/166159/convert-a-windows-created-zip-to-linux-internal-paths-issue" target="_blank">recreate the directory structure</a> </span><br />
<span style="font-family: "Courier New",Courier,monospace;">$ cat y.py <br />#! /usr/bin/env python<br /><br />import os<br />import errno<br /><br /># already created directories, walk works topdown, so a child dir<br /># never creates a directory if there is a parent dir with a file.<br />made_dirs = set()<br /><br />for root, dir_names, file_names in os.walk('.'):<br /> for file_name in file_names:<br /> if '\\' not in file_name:<br /> continue<br /> alt_file_name = file_name.replace('\\', '/')<br /> if alt_file_name.startswith('/'):<br /> alt_file_name = alt_file_name[1:] # cut of starting dir separator<br /> alt_dir_name, alt_base_name = alt_file_name.rsplit('/', 1)<br /> print('alt_dir', alt_dir_name)<br /> full_dir_name = os.path.join(root, alt_dir_name)<br /> if full_dir_name not in made_dirs:<br /> try:<br /> os.makedirs(full_dir_name)<br /> except OSError as exc:<br /> if exc.errno == errno.EEXIST and os.path.isdir(full_dir_name):<br /> # the pass already exists and is a folder, let's just ignore it<br /> pass<br /> else:<br /> raise <br /> made_dirs.add(full_dir_name)<br /> os.rename(os.path.join(root, file_name),<br /> os.path.join(root, alt_file_name))</span><br />
<span style="font-family: "Courier New",Courier,monospace;">$ python y.py</span>Anonymoushttp://www.blogger.com/profile/13323801844414342161noreply@blogger.com0tag:blogger.com,1999:blog-1920604994202325343.post-39485219288316883822017-03-10T16:14:00.001+01:002017-03-10T16:14:32.937+01:00Turris becomes mineThree years ago I was lent one of the <a href="https://www.abclinuxu.cz/zpravicky/cz.nic-dnes-predstavil-projekt-turris-drive-cz.nic-router" target="_blank">test Turris routers</a>, that later became <a href="https://omnia.turris.cz/" target="_blank">Turris Omnia</a>. As promised, I'm now able to buy the machine for a symbolic prize of 1 CZK (0.04 USD).<br />
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmavTGD9lpGNH4Od1kMy_XVysAMRNkpvqVqMsa75q43nxC_MwXrEMgEOfSzQ3l4XThPNo5Nq71i5syJ7mghBWUyYr5Nq4QdWGPF6_grO7YDBp76fLDJvkB4YrIO46MeymaktjKTPwVENM/s1600/turris.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="561" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmavTGD9lpGNH4Od1kMy_XVysAMRNkpvqVqMsa75q43nxC_MwXrEMgEOfSzQ3l4XThPNo5Nq71i5syJ7mghBWUyYr5Nq4QdWGPF6_grO7YDBp76fLDJvkB4YrIO46MeymaktjKTPwVENM/s640/turris.png" width="640" /></a></div>
<br />Anonymoushttp://www.blogger.com/profile/13323801844414342161noreply@blogger.com0tag:blogger.com,1999:blog-1920604994202325343.post-9326149324472426972017-01-26T10:35:00.001+01:002017-01-26T10:35:55.526+01:00LineageOSIt looks like my phone is one of the first few to receive regular <a href="https://download.lineageos.org/nicki" target="_blank">LineageOS builds</a>.<br />
Yay!Anonymoushttp://www.blogger.com/profile/13323801844414342161noreply@blogger.com0tag:blogger.com,1999:blog-1920604994202325343.post-61267662902595780312017-01-11T15:35:00.001+01:002017-01-11T15:35:46.175+01:00[SOLVED] Microphone stops working when I plug in my headsetRecently I joined a phone meeting and only after a while I realized the other participants couldn't hear me.<br />
Rather an embarrassing experience...<br />
<br />
The laptop's built in microphone works fine, but as soon as I plug in my headset it's muted.<br />
<br />
Apparently Windows, or the audio driver, think the device I plugged in has a microphone when it hasn't or vice versa.<br />
<br />
The solution is to go to Control Panels, Realtek HD Audio Manager, in the top left corner click the Folder icon next to the analog hole image, and tick the 'Enable auto popup dialog' checkbox.<br />
With this done, when one plugs a headset, windows will ask what type it is and act accordingly.<br />
<br />
Yay!Anonymoushttp://www.blogger.com/profile/13323801844414342161noreply@blogger.com0tag:blogger.com,1999:blog-1920604994202325343.post-32512910422740361712016-09-30T00:24:00.001+02:002016-09-30T00:24:03.989+02:00Where to put update zips for CyanogenMod 13On my nicki device, the cyanogenmod updater downloads the updates to <span style="font-family: "Courier New",Courier,monospace;">/storage/emulated/0/cmupdater</span>, so when it reboots to recovery, they aren't available.<br />
They have to be moved to <span style="font-family: "Courier New",Courier,monospace;">/data/media</span> to be usable.<br />
<br />Anonymoushttp://www.blogger.com/profile/13323801844414342161noreply@blogger.com0tag:blogger.com,1999:blog-1920604994202325343.post-92213316180848604852016-09-13T23:17:00.001+02:002016-09-13T23:17:18.443+02:00Living without Google PlayAmid the news about <a href="http://www.theregister.co.uk/2016/09/12/turn_off_location_services_go_ahead_says_google_well_still_track_you/" target="_blank">Google Play turning on location tracking without consent</a>, let me share how to avoid it.<br />
Step one - install <a href="http://www.cyanogenmod.org/" target="_blank">CyanogenMod</a> on your phone. <br />
Step two - do not install Google Play.<br />
<br />
Now you have a clean foundation to build on, but how to install apps without Google Play? That's actually quite easy - most opensource apps can be had at the <a href="https://f-droid.org/" target="_blank">F-Droid</a> store.<br />
To install proprietary apps, I use <a href="http://www.onyxbits.de/raccoon" target="_blank">Raccoon</a> on my desktop to download the apk files from Google Play. Once I move them to the phone they can be installed by tapping on them in the file manager.<br />
<br />
<br />Anonymoushttp://www.blogger.com/profile/13323801844414342161noreply@blogger.com0tag:blogger.com,1999:blog-1920604994202325343.post-26501049551233971982016-09-08T23:43:00.000+02:002016-09-08T23:43:49.505+02:00Sony headphones useful againThe headphones from my old Xperia Ray turned out to be <a href="http://www.xperiablog.net/2012/02/27/2012-xperia-range-uses-different-3-5mm-headset-standard/" target="_blank">incompatible</a> with my new Xperia M. They are still fine, but I can't use them with the new phone.<br />
Also they can't be used with a simple MP3 player as the TRRS jack passes the audio output through the microphone, so it's barely audible. <br />
There's the 'press mute button' workaround, but it's quite user unfriendly to keep holding it while cycling...<br />
<br />
So, to fix them permanently, I opened the microphone enclosure (a fingernail works well).<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgq7cRyOhQ7mA7dmnAU4RBeeomF_omXR6qDjzbXQxcqO5nM8gVXgmq1MDGYuf1yILoktpBRF0TXHAtp-QLXecXq2tIn3NI7xNJ62s-GHoiIWee-T8pvZIrTE7x0OFOj3rwsmpAEh0wkQGA/s1600/1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="478" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgq7cRyOhQ7mA7dmnAU4RBeeomF_omXR6qDjzbXQxcqO5nM8gVXgmq1MDGYuf1yILoktpBRF0TXHAtp-QLXecXq2tIn3NI7xNJ62s-GHoiIWee-T8pvZIrTE7x0OFOj3rwsmpAEh0wkQGA/s640/1.jpg" width="640" /></a></div>
<br />
You'll notice the two wires marked G and R that connect the mute button.<br />
When shorted, the effect is the same as if the mute button was pressed permanently. And that's what I've done.<br />
A blip of the solder gun and the headphones can be used!<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnoQCYABtnBqa4dTofWEO9C8kd6BIjA9mqrhyphenhyphen2EeKHrA20A_cTfKnXbeF74Wz8vEeiqifX8in6D85hBTW2Z1jfsEXk_5fquI9Irb4zdFXfcqIwincKbNAXPAl0RH3KmU8yjmRiratdM2E/s1600/2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="397" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnoQCYABtnBqa4dTofWEO9C8kd6BIjA9mqrhyphenhyphen2EeKHrA20A_cTfKnXbeF74Wz8vEeiqifX8in6D85hBTW2Z1jfsEXk_5fquI9Irb4zdFXfcqIwincKbNAXPAl0RH3KmU8yjmRiratdM2E/s640/2.jpg" width="640" /></a></div>
<br />Anonymoushttp://www.blogger.com/profile/13323801844414342161noreply@blogger.com0tag:blogger.com,1999:blog-1920604994202325343.post-55887619606401220182016-07-15T22:27:00.000+02:002016-07-15T22:27:20.830+02:00Flipping a GPIO bit on OrangePi PCHere's the header pinout: http://www.cnx-software.com/2015/09/26/status-of-orange-pi-boards-gpio-support/<br />
<br />
Here's the steps: https://linux-sunxi.org/GPIO<br />
<br />
So, to up pin 12, a.k.a. PD14 I do:<br />
<br />
<span style="font-family: "Courier New",Courier,monospace;">echo 110 > /sys/class/gpio/export</span><br />
<span style="font-family: "Courier New",Courier,monospace;">echo "out" > /sys/class/gpio/gpio110/direction</span><br />
<span style="font-family: "Courier New",Courier,monospace;">echo "1" > /sys/class/gpio/gpio110/value</span>Anonymoushttp://www.blogger.com/profile/13323801844414342161noreply@blogger.com0tag:blogger.com,1999:blog-1920604994202325343.post-57400512337127988122016-06-27T00:41:00.002+02:002016-06-27T00:41:12.796+02:00Prince of Persia: The Sands of Time - startup errorI got my <a href="http://www.cnet.com/news/get-your-free-prince-of-persia-game-now/" target="_blank">free copy of Prince of Persia: The Sands of Time</a>. It installed just fine, but upon startup it'd show a window with "The local sound file is missing please see Readme.txt file for technical support." and quit.<br />
<br />
Googling didn't help, so I started looking around.<br />
I found it interesting that there were <span style="font-family: "Courier New",Courier,monospace;">soundlocal.big</span> and <span style="font-family: "Courier New",Courier,monospace;">soundlocal.fat</span> files under the <span style="font-family: "Courier New",Courier,monospace;">Support\inst\data\EN</span> game subdirectory, but there was only <span style="font-family: "Courier New",Courier,monospace;">soundlocal.fat</span> under the <span style="font-family: "Courier New",Courier,monospace;">Sound </span>subdirectory. And indeed copying the missing file to <span style="font-family: "Courier New",Courier,monospace;">Sound </span>fixed the issue.<br />
I'm not sure what happened, but there wasn't much space available wile I was installing it. Perhaps the installer didn't do a proper job of assuring there was enough space and this file got lost as a result.<br />
<br />
So far this was the only issue, the game ran smoothly from then on, but after five minutes I found out I don't like the game at all and wiped it :-)Anonymoushttp://www.blogger.com/profile/13323801844414342161noreply@blogger.com0tag:blogger.com,1999:blog-1920604994202325343.post-62962924814926602382016-02-22T23:41:00.001+01:002016-02-22T23:41:54.565+01:00[SOLVED] gqrx crash on startupI plugged the SDR dongle in and launched <a href="http://gqrx.dk/" target="_blank">gqrx</a>. All seemed to go well, however as soon as I git the 'Start DSP' button, it crashed with<br />
<pre>gqrx: symbol lookup error: /usr/lib/x86_64-linux-gnu/librtlsdr.so.0: undefined symbol: libusb_handle_events_timeout_completed
</pre>
Googling for the error message found just a few hits:
An <a href="https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=732043" target="_blank">ages old bug</a> caused by bad versioning and a <a href="https://groups.google.com/forum/#!topic/gqrx/ytPwciC8efM" target="_blank">newer question</a> without answer.
<br />
If the web doesn't have the answer, I'll need to find it myself, so ...
<br />
<pre>hajma@debian:~$ ldd -d /usr/lib/x86_64-linux-gnu/librtlsdr.so.0
linux-vdso.so.1 (0x00007ffc29380000)
libusb-1.0.so.0 => /usr/local/lib/libusb-1.0.so.0 (0x00007f9ea0fd7000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f9ea0c2c000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f9ea0a24000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f9ea0807000)
/lib64/ld-linux-x86-64.so.2 (0x00007f9ea13f3000)
hajma@debian:~$ readelf -s /usr/local/lib/libusb-1.0.so.0|grep libusb_handle_events_
60: 0000000000005e70 215 FUNC GLOBAL DEFAULT 12 libusb_handle_events_time
80: 00000000000058a0 92 FUNC GLOBAL DEFAULT 12 libusb_handle_events_lock
237: 0000000000005e70 215 FUNC GLOBAL DEFAULT 12 libusb_handle_events_time
258: 00000000000058a0 92 FUNC GLOBAL DEFAULT 12 libusb_handle_events_lock
</pre>
Indeed, there's no libusb_handle_events_timeout_completed in there.<br />
<pre>hajma@debian:~$ grep libusb_handle_events_timeout_completed /usr/include/libusb-1.0/libusb.h
int LIBUSB_CALL libusb_handle_events_timeout_completed(libusb_context *ctx,
</pre>
but the header file has it, what's up?
It took me a minute or two to realize that the library resides in <b>/usr/local/lib</b>. That's an unusual place for a Debian library, isn't it?<br />
<pre>hajma@debian:~$ ls -l /usr/local/lib/libusb-1.0.so.0
lrwxrwxrwx 1 root root 17 Jan 25 2014 /usr/local/lib/libusb-1.0.so.0 -> libmchpusb-1.0.so
</pre>
and googling for libmchpusb-1.0.so found me the answer:<br />
<br />
This is actually a library supplied with Microchip's MPLAB-X software I installed two years ago. It seems to be an <a href="https://www.microchip.com/forums/m729021.aspx" target="_blank">ongoing source of frustration for their users</a> :-)<br />
/usr/local/lib is included by default on Debian: <br />
<pre>hajma@debian:~$ cat /etc/ld.so.conf.d/libc.conf
# libc default configuration
/usr/local/lib
</pre>
For the time being I workarounded this with simply removing /usr/local/lib/libusb-1.0.so.0 and it works quite well:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsoGnvhnLowqp3xeu6W4fISmOFgOG0cI1bxV0K5dIx7Fo517yUnD0WJNdRWTN_5opFJkdq853mctbzHzzzQGyeNF1ADU_XURUYr2FVOWGkI4a2I3MqH6DVinyC5WRdgLymVj81WDQBazs/s1600/shot.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="209" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsoGnvhnLowqp3xeu6W4fISmOFgOG0cI1bxV0K5dIx7Fo517yUnD0WJNdRWTN_5opFJkdq853mctbzHzzzQGyeNF1ADU_XURUYr2FVOWGkI4a2I3MqH6DVinyC5WRdgLymVj81WDQBazs/s320/shot.png" width="320" /></a></div>
Anonymoushttp://www.blogger.com/profile/13323801844414342161noreply@blogger.com0tag:blogger.com,1999:blog-1920604994202325343.post-46956515802078934122016-02-06T23:47:00.002+01:002016-02-06T23:47:33.978+01:00A new screen for Xperia RayAfter three plus years, the screen of my Ray was seriously scratched.<br />
I got a <a href="http://www.aliexpress.com/item/for-Sony-Ericsson-Xperia-ray-ST18i-ST18-LCD-screen-display-with-touch-screen-digitizer-assembly-full/1045388796.html" target="_blank">replacement one from Aliexpress </a>for 16 USD some time ago and have just found enough time and courage to install it.<br />
I followed <a href="https://www.youtube.com/watch?v=HWRFFGge-Jk" target="_blank">this disassembly guide</a>, but with the slight modification suggested by Ιωάννης-Πάρις in the first comment below the video.<br />
All went well though there are bits of glue coming out at the edges here and there :-)<br />
I prolonged the useful life of the device by a year or two, not too bad.
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxz-PBWlHhJNbkWTIXD0ceA4VcLVZU2JsqsNeFkWh3z8JC6ub4U_CYFXV1OXbm2rXAWEs9GId3xWMaj4jfvzJhYjxTFPTyM9mPmYNIQ8FuvKYEJn9fwcZ9_FBxol_-7gfeeib3NSSXzZk/s1600/FILE1308.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxz-PBWlHhJNbkWTIXD0ceA4VcLVZU2JsqsNeFkWh3z8JC6ub4U_CYFXV1OXbm2rXAWEs9GId3xWMaj4jfvzJhYjxTFPTyM9mPmYNIQ8FuvKYEJn9fwcZ9_FBxol_-7gfeeib3NSSXzZk/s640/FILE1308.JPG" /></a></div>
Anonymoushttp://www.blogger.com/profile/13323801844414342161noreply@blogger.com0tag:blogger.com,1999:blog-1920604994202325343.post-66231332426630905612015-12-13T00:59:00.001+01:002015-12-13T00:59:31.982+01:00Which OpenWRT version to use?If you want a relief from the never-ending stories about flaws in router firmware and the incompetence of vendors to deliver fixes, OpenWRT is about the only relatively sane option and I've been using it for almost a decade, since the White Russian release.<br />
<br />
OpenWRT has a development branch or trunk which may be a bit experimental and a Stable branch. A Stable branch is released <a href="https://wiki.openwrt.org/about/history#release_history">about once a year</a>. Their documentation says that basically <a href="https://downloads.openwrt.org/">anything beyond the current stable release is unmaintained</a>.
Is it really so? Well, it's open source, so it should be easy to find out.<br />
<br />
Attitude Adjustment, or OpenWRT 12.09, has seen its <a href="http://git.openwrt.org/?p=12.09/openwrt.git;a=shortlog">last commit</a> in September 2014, so it's dead indeed.<br />
Barrier Breaker, or OpenWRT 14.07, on the other hand has seen an <a href="http://git.openwrt.org/?p=14.07/openwrt.git;a=shortlog">update five days ago</a>, so it's certainly moving. But is it still fresh and safe to use?
I did a quick and simple check to find out.<br />
<br />
There were twelve security vulnerabilities (possibly more, but these were easy to filter) fixed in Chaos Calmer (OpenWRT 15.05, the current stable release) during its lifetime. I grepped for them in the Barrier Breaker sources and here's the result:<br />
<br />
<br />
<table border="0" cellspacing="0">
<colgroup width="140"></colgroup>
<colgroup width="150"></colgroup>
<colgroup width="214"></colgroup>
<tbody>
<tr>
<td align="left" height="17"><br /></td>
<td align="left">Fixed in <br />
Chaos Calmer</td>
<td align="left">Fixed in <br />
Barrier Breaker</td>
</tr>
<tr>
<td align="left" height="17"><a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-3193">CVE-2015-3193</a></td>
<td align="left">12/03/15</td>
<td align="left"><span style="background-color: lime;">12/07/15</span></td>
</tr>
<tr>
<td align="left" height="17"><a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-3194">CVE-2015-3194</a></td>
<td align="left">12/03/15</td>
<td align="left"><span style="background-color: lime;">12/07/15</span></td>
</tr>
<tr>
<td align="left" height="17"><a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-3195">CVE-2015-3195</a></td>
<td align="left">12/03/15</td>
<td align="left"><span style="background-color: lime;">12/07/15</span></td>
</tr>
<tr>
<td align="left" height="17"><a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-5291">CVE-2015-5291</a></td>
<td align="left">10/18/15</td>
<td align="left"><span style="background-color: red;">Still vulnerable!</span></td>
</tr>
<tr>
<td align="left" height="17"><a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-3143">CVE-2015-3143</a></td>
<td align="left">07/12/15</td>
<td align="left"><span style="background-color: red;">Still vulnerable!</span></td>
</tr>
<tr>
<td align="left" height="17"><a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-3144">CVE-2015-3144</a></td>
<td align="left">07/12/15</td>
<td align="left"><span style="background-color: red;">Still vulnerable!</span></td>
</tr>
<tr>
<td align="left" height="17"><a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-3145">CVE-2015-3145</a></td>
<td align="left">07/12/15</td>
<td align="left"><span style="background-color: red;">Still vulnerable!</span></td>
</tr>
<tr>
<td align="left" height="17"><a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-3148">CVE-2015-3148</a></td>
<td align="left">07/12/15</td>
<td align="left"><span style="background-color: red;">Still vulnerable!</span></td>
</tr>
<tr>
<td align="left" height="17"><a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-3153">CVE-2015-3153</a></td>
<td align="left">07/12/15</td>
<td align="left"><span style="background-color: red;">Still vulnerable!</span></td>
</tr>
<tr>
<td align="left" height="17"><a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-3236">CVE-2015-3236</a></td>
<td align="left">07/12/15</td>
<td align="left"><span style="background-color: lime;">Wasn't vulnerable</span></td>
</tr>
<tr>
<td align="left" height="17"><a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-3237">CVE-2015-3237</a></td>
<td align="left">07/12/15</td>
<td align="left"><span style="background-color: lime;"><span style="background-color: lime;">Wasn'</span>t vulnerable</span></td>
</tr>
<tr>
<td align="left" height="17"><a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-1793">CVE-2015-1793</a></td>
<td align="left">07/09/15</td>
<td align="left"><span style="background-color: lime;">07/09/15</span></td>
</tr>
</tbody></table>
<br />
There's a bunch of security issues lurking in the code unfixed.<br />
It looks like an older release may still get some support in the first few months after it's been replaced, but it's not really wise to delay the update.
Anonymoushttp://www.blogger.com/profile/13323801844414342161noreply@blogger.com1tag:blogger.com,1999:blog-1920604994202325343.post-4327485586421522672015-11-26T01:10:00.001+01:002015-11-26T01:10:35.103+01:00Arduino development in Solaris StudioThe unbeatable advantage of the Arduino IDE is that it just works, together with the large library of examples. However it really sucks as a source code editor.<br />
Fortunately there's an <a href="http://plugins.netbeans.org/plugin/46054/arduino" target="_blank">Arduino plugin for Netbeans</a> (and therefore for Solaris Studio, which is just thinly veiled Netbeans bundled with the Oracle compilers).<br />
<br />
The trouble is the Netbeans plugin URL download button gets you the Windows version, but do not despair. The author apparently plays with Linux too, and there's a tmp/linux folder in the repository, containing a functional <a href="https://github.com/jaquesclaudino/arduino-netbeans/blob/master/tmp/linux/arduino-plugin/build/arduino.nbm" target="_blank">Linux version of the plugin</a>.<br />
<br />
I only had to alter the default Makefile slightly to adjust for Debian's packaging of the Arduino software and my version of the chip:<br />
<br />
<pre>8,9c8,9
8,9c8,9
< COM_PORT = /dev/ttyACM0
< BAUD_RATE = 115200
---
> COM_PORT = /dev/ttyUSB0
> BAUD_RATE = 19200
11,12c11,12
< ARDUINO_BASE_DIR = /home/jaques/opt/arduino-1.6.5-r5
< ARDUINO_CORE_DIR = ${ARDUINO_BASE_DIR}/hardware/arduino/avr/cores/arduino
---
> ARDUINO_BASE_DIR = /usr/share/arduino
> ARDUINO_CORE_DIR = ${ARDUINO_BASE_DIR}/hardware/arduino/cores/arduino
20c20
< ARDUINO_MODEL = atmega328p
---
> ARDUINO_MODEL = atmega168
22c22
< ARDUINO_PINS_DIR = ${ARDUINO_BASE_DIR}/hardware/arduino/avr/variants/standard
---
> ARDUINO_PINS_DIR = ${ARDUINO_BASE_DIR}/hardware/arduino/variants/standard
38c38
< AVR_DUDE = ${ARDUINO_BASE_DIR}/hardware/tools/avr/bin/avrdude -C ${ARDUINO_BASE_DIR}/hardware/tools/avr/etc/avrdude.conf
---
> AVR_DUDE = ${ARDUINO_BASE_DIR}/hardware/tools/avrdude -C ${ARDUINO_BASE_DIR}/hardware/tools/avrdude.conf
</pre>
Anonymoushttp://www.blogger.com/profile/13323801844414342161noreply@blogger.com0tag:blogger.com,1999:blog-1920604994202325343.post-58417297470593772532015-11-16T18:52:00.000+01:002015-11-16T18:52:10.362+01:00What can go wrong with Debian upgradeWhen I <a href="http://blog.hajma.cz/2015/04/fixating-testing-to-jessie.html" target="_blank">moved from testing to stable</a> I thought it'd be enough to just stop updating testing a while before the release, modify the apt sources and dist-upgrade.<br />
And indeed all seemed to be working well.<br />
<br />
Until now.<br />
<br />
I wanted to install wine32, but there were all sorts of errors popping up.<br />
I narrowed it down to libxml2 - it wasn't possible to install the 32-bit part:<br />
<br />
<span style="font-family: "Courier New", Courier, monospace;"># apt-get install libxml2:i386<br />Reading package lists... Done<br />Building dependency tree <br />Reading state information... Done<br />Some packages could not be installed. This may mean that you have<br />requested an impossible situation or if you are using the unstable<br />distribution that some required packages have not yet been created<br />or been moved out of Incoming.<br />The following information may help to resolve the situation:<br /><br />The following packages have unmet dependencies:<br /> apache2-bin : Depends: libxml2 (>= 2.7.4) but it is not going to be installed<br /> libabw-0.1-1 : Depends: libxml2 (>= 2.7.4) but it is not going to be installed<br /> libaugeas0 : Depends: libxml2 (>= 2.7.4) but it is not going to be installed<br /> libe-book-0.1-1 : Depends: libxml2 (>= 2.7.4) but it is not going to be installed<br /> libepub0 : Depends: libxml2 (>= 2.7.4) but it is not going to be installed<br /> libetonyek-0.1-1 : Depends: libxml2 (>= 2.7.4) but it is not going to be installed<br /> libfontforge1 : Depends: libxml2 (>= 2.7.4) but it is not going to be installed<br /> libgdraw4 : Depends: libxml2 (>= 2.6.27) but it is not going to be installed<br /> libgeoclue0 : Depends: libxml2 (>= 2.7.4) but it is not going to be installed<br /> libgtk2.0-0 : Depends: shared-mime-info<br /> Recommends: libgtk2.0-bin<br /> libgupnp-dlna-2.0-3 : Depends: libxml2 (>= 2.7.4) but it is not going to be installed<br /> libmate-window-settings1 : Depends: libxml2 (>= 2.6.27) but it is not going to be installed<br /> libopenconnect3 : Depends: libxml2 (>= 2.7.4) but it is not going to be installed<br /> libplist1 : Depends: libxml2 (>= 2.7.4) but it is not going to be installed<br /> libstoken1 : Depends: libxml2 (>= 2.7.4) but it is not going to be installed<br /> libxml-libxml-perl : Depends: libxml2 (>= 2.7.4) but it is not going to be installed<br /> marco : Depends: libmarco-private0 (= 1.8.2+dfsg1-6) but it is not going to be installed<br /> Depends: zenity<br /> mate-media : Depends: mate-media-pulse (>= 1.8.0+dfsg1-3) but it is not going to be installed or<br /> mate-media-gstreamer (>= 1.8.0+dfsg1-3) but it is not going to be installed<br /> mate-settings-daemon : Depends: mate-settings-daemon-pulse (>= 1.8.2-4) but it is not going to be installed or<br /> mate-settings-daemon-gstreamer (>= 1.8.2-4) but it is not going to be installed<br /> python-libxml2 : Depends: libxml2 (>= 2.9.1) but it is not going to be installed<br />E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.</span><br />
It took me a while to realize that my libxml2 was actually of higher version than the one in Jessie! As soon as I downgraded it, the installation of wine32 went well...<br />
<br />
# dpkg -l |grep libxml2<br />
ii libxml2:amd64 2.9.2+dfsg1-1+b1<br />
<span style="font-family: "Courier New", Courier, monospace;"># apt-get install libxml2=2.9.1+dfsg1-5<br />Reading package lists... Done<br />Building dependency tree <br />Reading state information... Done<br />The following packages will be DOWNGRADED:<br /> libxml2<br />0 upgraded, 0 newly installed, 1 downgraded, 0 to remove and 0 not upgraded.<br />Need to get 800 kB of archives.<br />After this operation, 413 kB disk space will be freed.<br />Do you want to continue? [Y/n] <br />Get:1 http://ftp.cz.debian.org/debian/ jessie/main libxml2 amd64 2.9.1+dfsg1-5 [800 kB]<br />Fetched 800 kB in 0s (2,198 kB/s)<br />dpkg: warning: downgrading libxml2:amd64 from 2.9.2+dfsg1-1+b1 to 2.9.1+dfsg1-5<br />(Reading database ... 285067 files and directories currently installed.)<br />Preparing to unpack .../libxml2_2.9.1+dfsg1-5_amd64.deb ...<br />Unpacking libxml2:amd64 (2.9.1+dfsg1-5) over (2.9.2+dfsg1-1+b1) ...<br />Setting up libxml2:amd64 (2.9.1+dfsg1-5) ...<br />Processing triggers for libc-bin (2.19-18+deb8u1) ...</span><br />
<br />
<span style="font-family: "Courier New", Courier, monospace;"># apt-get install libxml2:i386<br />Reading package lists... Done<br />Building dependency tree <br />Reading state information... Done<br />Recommended packages:<br /> xml-core:i386<br />The following NEW packages will be installed:<br /> libxml2:i386<br />0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.<br />Need to get 833 kB of archives.<br />After this operation, 1,910 kB of additional disk space will be used.<br />Get:1 http://ftp.cz.debian.org/debian/ jessie/main libxml2 i386 2.9.1+dfsg1-5 [833 kB]<br />Fetched 833 kB in 4s (168 kB/s) <br />Selecting previously unselected package libxml2:i386.<br />(Reading database ... 285066 files and directories currently installed.)<br />Preparing to unpack .../libxml2_2.9.1+dfsg1-5_i386.deb ...<br />Unpacking libxml2:i386 (2.9.1+dfsg1-5) ...<br />Setting up libxml2:i386 (2.9.1+dfsg1-5) ...<br />Processing triggers for libc-bin (2.19-18+deb8u1) ...</span># <br />
<br />
http://blog.hajma.cz/2015/04/fixating-testing-to-jessie.htmlAnonymoushttp://www.blogger.com/profile/13323801844414342161noreply@blogger.com0tag:blogger.com,1999:blog-1920604994202325343.post-76907408174455397622015-10-25T09:36:00.002+01:002015-10-25T09:36:52.838+01:00Současná umělecká díla v krajině - mappedAs much as I like <a href="http://www.academia.cz/soucasna-umelecka-dila-v-krajine.html" target="_blank">the book</a>,it's got one major flaw - there's no map with the location of the objects, so it's a poor choice for trip planning.<br />
So I created a custom map with <a href="http://mapy.cz/">mapy.cz</a> using their custom point feature.<br />
Initially I included names of the authors, but I quickly ran into length limitations (they store all the info in the URL and impose their own limits; a sign of poor QA, the limit to save the map is somewhat longer than the limit to load it), so there're just the names of the objects.<br />
<a href="https://mapy.cz/s/m8TR" target="_blank">Here's the map</a>.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkxZGVLNSMh_8NgJzMLfpoA8cXkHscRsQXY305efjPR0Si1c8HyqP2UMijrKlOW8Unfup8lSFsRv_utm-8ZtakDvvtdQJnEY5GyluMP5A_R-pumILPvbx0HWjOyrInXsnneBtD13runr4/s1600/soucasna-umelecka-dila-v-krajine.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkxZGVLNSMh_8NgJzMLfpoA8cXkHscRsQXY305efjPR0Si1c8HyqP2UMijrKlOW8Unfup8lSFsRv_utm-8ZtakDvvtdQJnEY5GyluMP5A_R-pumILPvbx0HWjOyrInXsnneBtD13runr4/s320/soucasna-umelecka-dila-v-krajine.jpg" width="207" /></a></div>
<br />Anonymoushttp://www.blogger.com/profile/13323801844414342161noreply@blogger.com0tag:blogger.com,1999:blog-1920604994202325343.post-27661603103365362602015-10-11T22:26:00.001+02:002015-10-11T22:26:43.571+02:00Disable MMS auto-retrieve in the sourceOkay, so this is no rocket science, but here's how to set the default to something sane, in the sources:<br />
<span style="font-family: "Courier New", Courier, monospace;">~/android/system-ics/packages/apps/Mms$ git diff res/xml/preferences.xml <br />diff --git a/res/xml/preferences.xml b/res/xml/preferences.xml<br />index bdae567..92bae55 100644<br />--- a/res/xml/preferences.xml<br />+++ b/res/xml/preferences.xml<br />@@ -64,7 +64,7 @@<br /> android:key="pref_key_mms_read_reports"<br /> android:summary="@string/pref_summary_mms_read_reports"<br /> android:title="@string/pref_title_mms_read_reports" /><br />- <checkboxpreference android:defaultvalue="true" br="">+ <checkboxpreference android:defaultvalue="false" br=""> android:key="pref_key_mms_auto_retrieval"<br /> android:title="@string/pref_title_mms_auto_retrieval"<br /> android:summary="@string/pref_summary_mms_auto_retrieval" /></checkboxpreference></checkboxpreference></span>Anonymoushttp://www.blogger.com/profile/13323801844414342161noreply@blogger.com0tag:blogger.com,1999:blog-1920604994202325343.post-43054503584823127392015-08-10T00:23:00.000+02:002015-08-10T00:23:55.115+02:00Fix for Stagefright in Cyanogenmod 9.1 for Xperia RayHaving recently gone from the stock Sony ROM to CM 9.1 I found the <a href="https://en.wikipedia.org/wiki/Stagefright_%28bug%29">Stagefright</a> stuff a good excuse to start hacking Cyanogenmod.
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLwlAyQtIjUwU9QgFVIjzgn_hL05V5_a5fcP_lihHkYkUigu1t5ryTXq9Ow0fq-wY8ezazAIEJBcqe4L5blNyOSgLXxERqERzXV_xJOpW0dx_PyeZfiSuomdOa-0diFBikMaSPns9YUso/s1600/Screenshot_2015-08-07-22-52-52.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLwlAyQtIjUwU9QgFVIjzgn_hL05V5_a5fcP_lihHkYkUigu1t5ryTXq9Ow0fq-wY8ezazAIEJBcqe4L5blNyOSgLXxERqERzXV_xJOpW0dx_PyeZfiSuomdOa-0diFBikMaSPns9YUso/s320/Screenshot_2015-08-07-22-52-52.png" /></a></div>
Long story short - I've backported the fixes for the Stagefright vulnerabilities to the cm9.1 branch and built a private ROM for my Ray out of that.<br />
<br />
It works acceptably well on my device and while I'm quite sure the CM9.1 libstagefright code contains many horrors that might have been fixed along the long way from Android 4.0.4, at least now I should be relatively safe should a massive exploit be unleashed:
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGDUsBgh7ob_px8uYimQyEL3qYXrxObIYON86rtj2LNBTUPc2kVNQ_cw73oinq6RlaZx_nptegZceDZgHDzFRhGy3KBXDOWO9r3G3nQhu2vJIFnAL_yPW1kIULyPbvND22P0mkEzxJxPE/s1600/Screenshot_2015-08-08-03-05-33.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGDUsBgh7ob_px8uYimQyEL3qYXrxObIYON86rtj2LNBTUPc2kVNQ_cw73oinq6RlaZx_nptegZceDZgHDzFRhGy3KBXDOWO9r3G3nQhu2vJIFnAL_yPW1kIULyPbvND22P0mkEzxJxPE/s320/Screenshot_2015-08-08-03-05-33.png" /></a></div>
I'll try to push the changes upstream. In the meantime, <a href="http://uloz.to/xfcs4x87/cm-9-20150804-unofficial-urushi-zip" target="_blank">here's the ROM</a> (sha1sum: 54ae08ffb080767336faa430d7ad0a14558d6ad5).Anonymoushttp://www.blogger.com/profile/13323801844414342161noreply@blogger.com0tag:blogger.com,1999:blog-1920604994202325343.post-81853015578393848602015-08-05T00:27:00.000+02:002015-08-05T00:27:28.136+02:00More breakage:<br />
<pre>
hajma@c:~/android/system-ics$ brunch urushi
host C++: libdvm <= dalvik/vm/native/dalvik_system_Zygote.cpp
host C++: libdvm <= dalvik/vm/native/java_lang_Class.cpp
host C++: libdvm <= dalvik/vm/native/java_lang_Double.cpp
host C++: libdvm <= dalvik/vm/native/java_lang_Float.cpp
dalvik/vm/native/dalvik_system_Zygote.cpp: In function ‘int setrlimitsFromArray(ArrayObject*)’:
dalvik/vm/native/dalvik_system_Zygote.cpp:199:19: error: aggregate ‘setrlimitsFromArray(ArrayObject*)::rlimit rlim’ has incomplete type and cannot be defined
struct rlimit rlim;
^
dalvik/vm/native/dalvik_system_Zygote.cpp:222:43: error: ‘setrlimit’ was not declared in this scope
err = setrlimit(contents[0], &rlim);
^
build/core/binary.mk:347: recipe for target 'out/host/linux-x86/obj/SHARED_LIBRARIES/libdvm_intermediates/native/dalvik_system_Zygote.o' failed
make: *** [out/host/linux-x86/obj/SHARED_LIBRARIES/libdvm_intermediates/native/dalvik_system_Zygote.o] Error 1
make: *** Waiting for unfinished jobs....
hajma@c:~/android/system-ics$
</pre>
and a fix:
<pre>
diff --git a/vm/native/dalvik_system_Zygote.cpp b/vm/native/dalvik_system_Zygote.cpp
index 8224656..648bd58 100644
--- a/vm/native/dalvik_system_Zygote.cpp
+++ b/vm/native/dalvik_system_Zygote.cpp
@@ -21,7 +21,7 @@
#include "native/InternalNativePriv.h"
#include <signal.h>
-#if (__GNUC__ == 4 && __GNUC_MINOR__ == 7)
+#if (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)
#include <sys/resource.h>
#endif
#include <sys/types.h>
</pre>Anonymoushttp://www.blogger.com/profile/13323801844414342161noreply@blogger.com0tag:blogger.com,1999:blog-1920604994202325343.post-1217544933106607392015-08-04T20:45:00.002+02:002015-08-04T20:45:25.823+02:00my next breakage is due to Debian Jessie having fresher and pickier version of make:<br />
<br />
<pre>hajma@chrastavec:~/android/system-ics$ brunch urushi
including vendor/cm/vendorsetup.sh
Looking for dependencies
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.0.4
TARGET_PRODUCT=cm_urushi
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=IMM76L
============================================
build/core/main.mk:43: ********************************************************************************
build/core/main.mk:44: * You are using version 4.0 of make.
build/core/main.mk:45: * Android can only be built by versions 3.81 and 3.82.
build/core/main.mk:46: * see http://source.android.com/source/download.html
build/core/main.mk:47: ********************************************************************************
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.0.4
TARGET_PRODUCT=cm_urushi
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=IMM76L
============================================
Checking build tools versions...
build/core/prebuilt.mk:143: *** recipe commences before first target. Stop. </pre>
<br />
Fortunately, the Firefox OS folks hit it too and have a <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1031593" target="_blank">patch</a>.
Anonymoushttp://www.blogger.com/profile/13323801844414342161noreply@blogger.com0tag:blogger.com,1999:blog-1920604994202325343.post-77696001562661220452015-08-04T20:16:00.001+02:002015-08-05T00:27:00.004+02:00The next step is to get the closed binaries. The script device/semc/urushi/extract-files.sh does that by downloading them from the phone via adb.
I no longer have Sony firmware in my phone so there's no need to connect the phone when the Cyanogenmod zip I used to flash it has the same contents, right?
The below patch changes the source to the zip:
<br />
<pre>hajma@c:~/android/system-ics/device/semc/urushi$ git diff ./extract-files.sh
diff --git a/extract-files.sh b/extract-files.sh
index f3aaa2c..192ea96 100755
--- a/extract-files.sh
+++ b/extract-files.sh
@@ -5,10 +5,11 @@ DEVICE=urushi
BASE=../../../vendor/$VENDOR/$DEVICE/proprietary
-while getopts ":nh" options
+while getopts ":nzh" options
do
case $options in
n ) NC=1 ;;
+ z ) FROMZIP=1;;
h ) echo "Usage: `basename $0` [OPTIONS] "
echo " -n No clenup"
echo " -h Show this help"
@@ -27,7 +28,11 @@ for FILE in `cat proprietary-files.txt | grep -v ^# | grep -v ^$`; do
if [ ! -d $BASE/$DIR ]; then
mkdir -p $BASE/$DIR
fi
- adb pull /system/$FILE $BASE/$FILE
+ if [ "$FROMZIP" = "1" ]; then
+ unzip $2 system/$FILE -d $BASE
+ else
+ adb pull /system/$FILE $BASE/$FILE
+ fi
done
./setup-makefiles.sh
</pre>
...
and more breakage:
<br />
<pre>hajma@c:~/android/system-ics$ brunch urushi
...
make: *** No rule to make target 'vendor/cm/proprietary/lib/armeabi/libjackpal-androidterm4.so', needed by 'out/target/product/urushi/system/lib/libjackpal-androidterm4.so'. Stop.
make: *** Waiting for unfinished jobs....
target thumb C: calibrator <= hardware/ti/wlan/mac80211/ti-utils/ini.c
hajma@c:~/android/system-ics$
</pre>
The file was supposed to be delivered with get-prebuilts:
<br />
<pre>hajma@c:~/android/system-ics/vendor/cm$ ./get-prebuilts
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 3347k 100 3347k 0 0 175k 0 0:00:19 0:00:19 --:--:-- 205k
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 178 100 178 0 0 296 0 --:--:-- --:--:-- --:--:-- 295
100 551k 100 551k 0 0 373k 0 0:00:01 0:00:01 --:--:-- 1375k
Archive: ./proprietary/Term.apk
caution: filename not matched: lib/armeabi/libjackpal-androidterm4.so
</pre>
but the Term.apk now has a newer version:
<br />
<pre>hajma@c:~/android/system-ics/vendor/cm$ unzip -l proprietary/Term.apk |grep libjackpal-androidterm
13532 2015-04-15 08:09 lib/armeabi/libjackpal-androidterm5.so
5648 2015-04-15 08:09 lib/mips/libjackpal-androidterm5.so
5240 2015-04-15 08:09 lib/x86/libjackpal-androidterm5.so
</pre>
I'll have a look at updating the term later, for now I'll use the zip one:
<br />
<pre>hajma@c:~/android/system-ics/vendor/cm$ mkdir -p proprietary/lib/armeabi/
hajma@c:~/android/system-ics/vendor/cm$ unzip -j ~/Downloads/cm-9.1.0-urushi.zip -d proprietary/lib/armeabi system/lib/libjackpal-androidterm4.so
</pre>
<pre>external/llvm/include/llvm/ADT/PointerUnion.h:64:39: error: comparison between ‘enum llvm::PointerLikeTypeTraits<clang::templatedecl>::<anonymous>’ and ‘enum llvm::PointerLikeTypeTraits<clang::uncommontemplatenamestorage>::<anonymous>’ [-Werror=enum-compare]
NumLowBitsAvailable = PT1BitsAv < PT2BitsAv ? PT1BitsAv : PT2BitsAv
</anonymous></clang::uncommontemplatenamestorage></anonymous></clang::templatedecl></pre>
while everybody on the Internet just removes -Wall from the makefile, it can be fixed in a simpler manner, as it has been workarounded before apparently:
<br />
<pre>hajma@c:~/android/system-ics/external/llvm$ git diff include/llvm/ADT/PointerUnion.h
diff --git a/include/llvm/ADT/PointerUnion.h b/include/llvm/ADT/PointerUnion.h
index 3e3f214..6450bdb 100644
--- a/include/llvm/ADT/PointerUnion.h
+++ b/include/llvm/ADT/PointerUnion.h
@@ -54,7 +54,7 @@ namespace llvm {
static inline void *getAsVoidPointer(void *P) { return P; }
static inline void *getFromVoidPointer(void *P) { return P; }
enum {
-#if (__GNUC__ == 4 && __GNUC_MINOR__ == 7)
+#if (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)
PT1BitsAv = static_cast< int >(PointerLikeTypeTraits<PT1>::NumLowBitsAvailable),
PT2BitsAv = static_cast< int >(PointerLikeTypeTraits<PT2>::NumLowBitsAvailable),
#else
</pre>
...
and more:
<br />
<pre>In file included from system/extras/ext4_utils/output_file.c:30:0:
/usr/include/zlib.h:34:19: fatal error: zconf.h: No such file or directory
#include "zconf.h"
^
compilation terminated.
</pre>
The cause is <a href="https://bugs.launchpad.net/ubuntu/+source/zlib/+bug/1155307" target="_blank">ugly</a> and the solution is <a href="https://bugs.launchpad.net/ubuntu/+source/zlib/+bug/1155307/comments/5" target="_blank">uglier</a>.
<br />
getting closer...
<br />
<pre>Boot image: out/target/product/urushi/boot.img
error: unsupported page size 131072
device/semc/msm7x30-common/custombootimg.mk:5: recipe for target 'out/target/product/urushi/boot.img' failed
make: *** [out/target/product/urushi/boot.img] Error 255
</pre>
Now this is caused by a second part of a <a href="http://review.cyanogenmod.org/#/c/33214/" target="_blank">changeset</a> missing in the cm9.1 branch ... this <a href="http://review.cyanogenmod.org/#/c/33216/1/mkbootimg/mkbootimg.c" target="_blank">changeset</a> has to be applied.<br />
<br />
aaaand here it is:
<pre>
Package complete: /home/hajma/android/system-ics/out/target/product/urushi/cm-9-20150804-UNOFFICIAL-urushi.zip
41ef84db95dc7b24f78c8d0788fc1bcd cm-9-20150804-UNOFFICIAL-urushi.zip
</pre>
I don't dare to flash this yet though ;-)Anonymoushttp://www.blogger.com/profile/13323801844414342161noreply@blogger.com0tag:blogger.com,1999:blog-1920604994202325343.post-25816371599960438182015-08-04T02:02:00.000+02:002015-08-04T02:46:38.927+02:00While following Cyanogenmod's <a href="http://wiki.cyanogenmod.org/w/Build_for_urushi" target="_blank">steps to build CM for my Ray</a>, the repo sync command froze. 'ps -ef --forest', the Linux' take on ptree, told me it was stuck doing 'git-remote-https github https://github.com/CyanogenMod/android_external_svox' and a quick google search took me to http://forum.cyanogenmod.org/topic/103527-cannot-repo-source-code-as-android-external-svox-repository-meets-dmca-issue/<br />
ugh...<br />
<br />
So, here's the first workaround:<br />
<br />
<pre>
<project path="external/srtp" name="platform/external/srtp" remote="aosp" revision="refs/tags/android-4.0.4_r2.1" />
<project path="external/stlport" name="CyanogenMod/android_external_stlport" />
<project path="external/strace" name="CyanogenMod/android_external_strace" />
- <project path="external/svox" name="CyanogenMod/android_external_svox" />
+ <project path="external/svox" name="platform/external/svox" remote="aosp" revision="refs/tags/android-4.0.4_r2.1" />
<project path="external/tagsoup" name="CyanogenMod/android_external_tagsoup" />
<project path="external/tcpdump" name="CyanogenMod/android_external_tcpdump" />
<project path="external/tinyalsa" name="platform/external/tinyalsa" remote="aosp" revision="refs/tags/android-4.0.4_r2.1" />
</pre>
and I also had to issue<br />
<span style="font-family: "Courier New", Courier, monospace;">rm external/svox/</span><br />
<span style="font-family: inherit;">before running sync again</span>Anonymoushttp://www.blogger.com/profile/13323801844414342161noreply@blogger.com0