Sec, blogmal! - patches

Categories:

Everything

April '17

SoSoSoSoSoSoSo
272829303112
3456789
10111213141516
17181920212223
24252627282930

Archive:

Sat, 04 Dec 2010

German Keymap for the Vision Z

Auf meinem (neuen) Desire Z läuft ja nicht die Original-Firmware, sondern cyanogens ROM (derzeit die Version 6.1.0RC4.) Dieses hat leider eine kaputte deutsche Keymap.

Ich hab mich mal hingesetzt und diese nicht nur repariert, sondern gleich auch ein bisschen erweitert:

Reaparierte Tasten

FN+a => Euro     (+Shift => Euro)
FN+b => scharfes s
FN+j => a Umlaut (+Shift => A Umlaut)
FN+k => u Umlaut (+Shift => U Umlaut)
FN+l => o Umlaut (+Shift => O Umlaut)

FN+m => ' (war vorher = )
FN+? => = (war vorher ' )

Erweiterungen

Die meisten Shift+FN-Kombinationen sind bisher unbenutzt, also habe ich da mal ein paar nützliche Zeichen untergebracht:

Shift+FN+C => [ (merke: Shift+( = [ )
Shift+FN+V => ] (merke: Shift+) = ] )
Shift+FN+Y => ~ (merke: Shift+_ = ~ )
Shift+FN+X => ~ (merke: Shift+- = ~ ) [wie vorherige Taste]
Shift+FN+M => ` (merke: Shift+' = ` )
Shift+/    => \ (
Shift+FN+/ => | (alle geraden Striche auf einer Taste :-)
Shift+@    => ^ (^ ist normalerweise auch links oben )
FN+Enter   => ^m (Das "andere" newline)
Shift+,    => ; (genauso wie mit FN)
Shift+.    => : (genauso wie mit FN)

und zu guter Letzt:

Shift+FN+B => <
Shift+FN+N => >

Ich konnte keinen sinnvollen Platz dafür finden, daher habe ich die einfach auf die beiden Tasten rechts neben ( und ) gepackt.

Zahlen-Modus

Außerdem gibt es noch einen Zahlen-Modus, der z.b. in der Telefon-Applikation verwendet wird. Den habe ich auch repariert, so das die erste Zeile jeweils die richtigen Zahlen erzeugt:

qwertzuiop => 1234567890

Zusätzlich habe ich noch die in Telefonnummern verwendeten Sonderzeichen erlaubt:

C => (
H => *
N => +
S => #
V => )
X => -

Diese neue Keymap lässt sich mit adb leicht installieren:

adb remount
adb push vision-keypad-ger.kcm.bin /system/usr/keychars/vision-keypad-ger.kcm.bin

Mit dieser neuen Keymap sollte man nun auch nethack spielen können :-)

Wenn ihr noch irgendwelche Ideen oder verbesserungsvorschäge habt, kommentiert einfach hier, oder im entsprechenden Cyanogen-Bugreport.

– Sec

P.S.: Die Tools zum Keymap-Bauen sind hier, und das neue modifizierte Source-File hier.


posted at: 12:38 | Category: /patches | permanent link to this entry | 8 comments (trackback)

Sat, 21 Jan 2006

Large files on NTFS on FreeBSD.

Well, it seems its crappy software week all over again.

While trying to find out how to burn an .iso image on a DVD using only free(as in beer) software, I had interesting experiences with CD Burner XP on Windows, which simply ruined an empty disk in 37 seconds without even trying to write the actual data onto the disk, and some (patched) windows-cdrecord which spewed interesting error messages, and astonished me by interpreting the speed= command line in a creative way (so 1 means 4, 10 means 8 and 16 means 17? interesting ;) - but at least it didn't ruin another blank disk.

Then I tried using FreeBSD. cdrecord from the ports tells me that the Author has completely lost it which means I would have to jump some hoops before I could have the holy grail of DVD support.

Well. Some more digging led me to growisofs from the dvd+rw-tools package which, despite its name, is able to just burn an iso image with the following easy command line

 growisofs -dvd-compat -Z /dev/cd0=image.iso

It does however require device atapicam in your kernel config (see here in the FreeBSD Handbook for details).

This is where we finally touch the subject. Large Files on NTFS. The image was on my NTFS partition. And I was just assuming I could burn it directly. Well, I was wrong and so spent another blank disk on learning that the NTFS driver is not 64 bit clean. You just get the filesize modulo 4G. And yes, the problem is known but they didn't even bother to document it somewhere.

Well, some more searching led me to dimitry who tried to tackle that issue but got no help at all.

I updated the patch he wrote for FreeBSD-6_STABLE (had to fix one simple reject), but be warned, as he notes using mmap on such large files will lead to a panic (I didn't test that ;-). So just to be safe, I copied the file with

  dd if=/dos/.../image.img bs=4M of=/home/sec/image.img

Because dd is guaranteed not to use mmap ;)

If you want/need to use the patch, here is how to you do it:

cd
fetch http://blogmal.42.org/patches/freebsd-ntfs-largefile/FreeBSD-6-ntfs-largefile.patch
cd /usr/src
patch ~/FreeBSD-6-ntfs-largfile.patch
cd sys/modules/ntfs
make

If you already used ntfs, be sure to unmount all ntfs volumes, and kldunload ntfs.ko before the final step:

 kldload ./ntfs.ko
 mount -t ntfs /dev/ad0s1 /dos

Happy large filing…

– Sec

P.S.: There relevant bug report kern/73514 indicates that a fix for this was committed to FreeBSD-current in November. Yay! I do hope it gets merged to -STABLE soon.


posted at: 05:02 | Category: /patches | permanent link to this entry | 1 comment (trackback)

Sat, 10 Sep 2005

xpdf and copy&paste

Some time ago, a collegue of mine wanted to copy a few sentences from an pdf document he found on the web. Unfortunately the document was protected, so acrobat reader disabled copy&paste.

When he asked for some help, I replied that if he had used some open source viewer like xpdf he wouldn't have had that problem.

Well. As I quickly found out, this was untrue. The author(s) of xpdf had somehow gotten convinced to honor the "protection"-flags of pdf documents.

I spent some time (much more than it would have taken to retype these three sentences) understanding the source, and finally came up with a single-line patch to restore full functionality of xpdf.

Simply apply the following patch and feel unrestricted again.

--- xpdf/XRef.cc.org	Thu Jan 22 02:26:45 2004
+++ xpdf/XRef.cc	Fri Apr 29 12:15:57 2005
@@ -803,6 +803,7 @@
   // this flag has to be set *after* we read the O/U/P strings
   encrypted = encrypted1;
 
+  permFlags = defPermFlags;
   return ret;
 }
 #else

– Sec


posted at: 23:55 | Category: /patches | permanent link to this entry | 1 comment (trackback)

Sat, 03 Sep 2005

Smartmontools - letting sleeping disks sleep

As I wrote in an older entry I do check my disk temperature every minute to create nice Graphs. But this has a bad side-effect. If a disk is spun down (eg. with ataidle) it gets woken up by smartctl.

Some googling revealed, that smartd of the smartmontools has a feature to skip checks when a disk is idle, but smartctl does not. Some patching later, I had added a -n switch, to make smartctl skip reading, if a disk is in SUSPEND mode.

To my dismay, I found that the FreeBSD-specific code did not implement the CHECK_POWER_MODE function (see page 88 of the ATA spec), so I added that one, too.

Of course I have sent the patch with some explanation to the smartmontools developpers, but as usual, they don't even bother to respond to my mail.

So, for anyone who suffers from the same problem, here is the nospinup patch and the Freebsd CHECK_POWER_MODE patch

– Sec


posted at: 16:37 | Category: /patches | permanent link to this entry | 0 comments (trackback)

powered by blosxom
in 1.00 s