2011-06-18

Thinkpad T60 and Debian Wheezy

I recently decided to upgrade my main laptop. This is a bit of notes on the process as I remember it. I've put up a page about running Debian on the t60.

After toying around with the hardware and checking BIOS settings, I downloaded the Debian 6.0.1a netinst.iso for amd64 and burnt it on a small cdrw. I made another one for the latest BIOS update. Installed the BIOS and then installed minimal Debian Squeeze. After first boot, I switched the sources to Wheezy (testing) and upgraded packages in small batches from within aptsh (upgrade and install, never dist-upgrade). I removed aptitude immediately and installed sudo, zsh, vim, ssh, sshfs, and other necessaries.

I installed memtest86+ and it appeared in GRUB. I left it running over night and found 100% pass (over 7 hours running) on all tests, no logged errors.

I run postfix and logcheck, apt-listchanges (show both mode) and apt-listbugs everywhere; debfoster, deborphan, debian-goodies, popularity-contest.

I installed X and awesome. I didn't bother with the details. Most things worked. I used my old awesome, X resources and other things. ACPI (battery status, temperature) and other meters worked with my old config on the new laptop just as well. Getting X to start with no configuration at all required only installing xserver-xorg-video-radeon and xserver-xorg-video-ati (for autodetect).

I plugged in the printer (Samsung ML-1640), logged into CUPS with a browser and ran Add Printer and it Just Worked. I had installed splix for the drivers earlier. I also installed libreoffice in case I need it.

I installed gphotofs for easy emptying of cameras; geeqie, gimp, and especially ufraw.

Installing fprint-demo let me try out the fingerprint reader (Just Works). I installed libpam-fprint (off sid, pinned) and did dpkg-reconfigure libpam-runtime to enable it. It will now ask for a fingerprint first instead of user password when using sudo or logging in (getty or gdm).

I installed wine and tried spotify (current version crashes ofetn) and used it to extract (install) the ICC profiles (TPFLX.ICM) from Lenovo. I haven't looked into colour calibration more closely yet.

I've blacklisted pcspkr, since for some reason loading that makes the system beep incredibly loud. Normal beeps go through the mixer now. The mixer is clean and all channels seem to work (haven't tried recording or SPDIF). Correct chipset variation was autodetected, unlike on an Amilo.

I installed qemu-kvm, created a logical volume, and installed the OEM licensed windows XP in it. The mouse seems to get extra accelerated while in the qemu window. The system works quite nicely and installing didn't require any trickery. I intend to see if I can run some difficult software on it (such as Dynamic C).

2011-04-06

Chumby gets a new card

Bought an 8GB Sandisk C4 MicroSDHC card to use with the chumby.

[261960.474288] sd 6:0:0:1: [sdc] 3854336 512-byte logical blocks: (1.97 GB/1.83 GiB)
[261960.487488]  sdc: sdc1 sdc2 sdc3 sdc4 < sdc5 sdc6 >

iofiel% fdisk -l /dev/sdc

Disk /dev/sdc: 1973 MB, 1973420032 bytes
5 heads, 4 sectors/track, 192716 cylinders
Units = cylinders of 20 * 512 = 10240 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1       14670      146697+  53  OnTrack DM6 Aux3
/dev/sdc2            1563       14063      125000+  83  Linux
/dev/sdc3           14063       26563      125000+  83  Linux
/dev/sdc4           26563      192308     1657444    5  Extended
/dev/sdc5           26564       39063      124998+  83  Linux
/dev/sdc6           39064      192308     1532441+  83  Linux

iofiel% dd if=/dev/sdc of=chumby2G.img
3854336+0 records in
3854336+0 records out
1973420032 bytes (2.0 GB) copied, 119.449 s, 16.5 MB/s
iofiel% eject sdc
And the new card...
[262427.694384] sd 7:0:0:1: [sdc] 15523840 512-byte logical blocks: (7.94 GB/7.40 GiB)
iofiel% dd if=chumby2G.img of=/dev/sdc
3854336+0 records in
3854336+0 records out
1973420032 bytes (2.0 GB) copied, 1041.09 s, 1.9 MB/s
You have new mail.                                                                                                  
iofiel% sync
iofiel% eject sdc
Plug back in...
[263569.155489]  sdc: sdc1 sdc2 sdc3 sdc4 < sdc5 sdc6 >

iofiel% sudo fdisk /dev/sdc       

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): p

Disk /dev/sdc: 7948 MB, 7948206080 bytes
5 heads, 4 sectors/track, 776192 cylinders
Units = cylinders of 20 * 512 = 10240 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1       14670      146697+  53  OnTrack DM6 Aux3
/dev/sdc2            1563       14063      125000+  83  Linux
/dev/sdc3           14063       26563      125000+  83  Linux
/dev/sdc4           26563      192308     1657444    5  Extended
/dev/sdc5           26564       39063      124998+  83  Linux
/dev/sdc6           39064      192308     1532441+  83  Linux

Command (m for help): v
Warning: partition 1 overlaps partition 2.
Warning: partition 1 overlaps partition 3.
Remaining 11677702 unallocated 512-byte sectors

Command (m for help): d
Partition number (1-6): 4

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
e
Selected partition 4
First cylinder (26563-776192, default 26563): 
Using default value 26563
Last cylinder, +cylinders or +size{K,M,G} (26563-776192, default 776192): 
Using default value 776192

Command (m for help): n
First cylinder (26564-776192, default 26564): 
Using default value 26564
Last cylinder, +cylinders or +size{K,M,G} (26564-776192, default 776192): 39063

Command (m for help): n
First cylinder (39064-776192, default 39064): 
Using default value 39064
Last cylinder, +cylinders or +size{K,M,G} (39064-776192, default 776192): 
Using default value 776192

Command (m for help): v
Warning: partition 1 overlaps partition 2.
Warning: partition 1 overlaps partition 3.
Remaining 7 unallocated 512-byte sectors

Command (m for help): p

Disk /dev/sdc: 7948 MB, 7948206080 bytes
5 heads, 4 sectors/track, 776192 cylinders
Units = cylinders of 20 * 512 = 10240 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1       14670      146697+  53  OnTrack DM6 Aux3
/dev/sdc2            1563       14063      125000+  83  Linux
/dev/sdc3           14063       26563      125000+  83  Linux
/dev/sdc4           26563      776192     7496291+   5  Extended
/dev/sdc5           26564       39063      124999+  83  Linux
/dev/sdc6           39064      776192     7371288   83  Linux

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.


iofiel% resize2fs /dev/sdc6 
resize2fs 1.41.12 (17-May-2010)
resize2fs: Bad magic number in super-block while trying to open /dev/sdc6
Couldn't find valid filesystem superblock.

Ok, not quite as planned. Parted also can't seem to cope with the funky overlapping first partition. So I'm trying fdisk. I have a dump of /mnt/storage, so I made a new ext3fs and restored the files. Reassemble partly, power up and hold breath...
chumby:~# dmesg -c
gcc version 4.3.2 (Sourcery G++ Lite 2008q3-72) ) #1 PREEMPT Tue Mar 2 16:09:35 PST 2010
[    0.000000] CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
[    0.000000] CPU: VIVT data cache, VIVT instruction cache
[    0.000000] Machine: STMP378X
...
[    1.530000] Waiting for root device /dev/mmcblk0p2...
[    1.580000] mmc0: new SDHC card at address e624
[    1.590000] mmcblk0: mmc0:e624 SU08G 3.40 GiB 
[    1.590000]  mmcblk0: p1 p2 p3 p4 < p5 p6 >
...

chumby:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/mmcblk0p2          118.2M     97.1M     15.0M  87% /
tmpfs                    29.3M    640.0k     28.7M   2% /tmp
none                     32.0M     60.0k     31.9M   0% /var
none                     32.0M         0     32.0M   0% /mnt
/dev/mmcblk0p5          122.0M      4.1M    111.8M   4% /psp
/dev/mmcblk0p6            6.9G    247.8M      6.3G   4% /mnt/storage
none                     32.0M     44.0k     32.0M   0% /dev
Ok, now I should have a new card to play with, a backup image, and the old card to boot in case of bricking incidents.

Edit: It might be safe to fix the partition table.

2011-04-02

Building some Chumby software

Some time ago I bought a Chumby One with a cracked screen (and practically dead touchscreen) to play with. Cracked chumby I can't run any of the normal Flash/Chumby stuff on it because of the screen, but it is still a functional little ARM box with a small screen, speaker, rotary controller, 802.11, USB, button etc.

Sometime back, I installed the required scratchbox, unbroke wine (SBOX_CONF_BIN_W32=0 in scratchbox-configuration) and built some stuff. Today, I finally got around to trying things out on the device.
I also took the opportunity to have a closer look at mksh.
I'll try to write down some instructions and programs for the Chumby.

2010-10-14

AVR universal displays

A random project idea for the record: Universal displays.

I thought I should take a controller and attach a moving coil meter to its PWM output that will show anything given to it (by UART probably, or I2C) as a value. A few other things would be easy to add even if I start with something like a tiny AVR or msp430.

Another similar thing would be a 7-segment LED (and/or LCD) display with a tiny2313 or such.

Just a few general purpose modules instead of a complete self-contained device.

2009-12-02

Bringing up the UART

I spent a moment with the mega8515 again. This time I'm using a small dev board I made. It contains a level shifter and a ready header you can plug an old PC serial port to. I read a bit on how avr-libc does stdio and with a few lines, the cylon light now prints out the state in the main loop. You could easily compare the state to a previous one or some flag and just print the value when it changes but the point was mostly just to get some text out. Another exercise might be to use backspacing to make a character dance on the terminal like the LED does on the board. My current goal is some minimal command line I can use to fiddle with the system without having to constantly do the write-compile-flash-test loop. It goes something like this:

   printf_P(PSTR("Command prompt test\n"));
   printf_P(PSTR("p x: print x"));
   printf_P(PSTR("l:   show state of port A"));
   while(1) {
       printf_P(PSTR("cmd> ")); // prompt

       if (fgets(buf, sizeof buf - 1, stdin) == NULL) // ^C, maybe EOF
           break;
       if (tolower(buf[0]) == 'q') // q)uit
           break;

       switch (tolower(buf[0])) {
           default:
               printf("Unknown command: %s\n", buf);
               break;

           case 'p':
               if (sscanf(buf, "%*s %s", s) > 0)
                   printf("Got %s\n", s);
               else
                   printf("scanf failed\n");
               break;

           case 'l':
               printf("Porta: 0x%02X\n", (uint8_t) ~PORTA);
               break;
       }
   }
   printf("Bye!\n");

It's kind of neat how the familiar Unixy string stuff is largely there.

2009-11-05

A+, would buy again!

I thought I'd sign praises for some products I've come across. Off the top of my head in no particular order.

Nikkormat FTn

Nikkormat FTn body The term "built like a tank" pretty much qualifies. Match needle metering is very nice. The shutter speed ring can be a bit odd. 625 battery is certainly a downside, but it appears to work quite well with just an LR-44 dropped in.

Today: If you can afford it and want all-manual film, this is an excellent option.

Nikon D40

Carenar mounted It was the cheapest (D)SLR body in the market at the time. It's turned out to be a real jewel. Conservative design cut down. Small and light but comfortable to use. Well thought-out and fast operation, most options at your fingertips. Comfortable size screen. Last model made with this sensor, so quite likely the best model made with this sensor. Many seem to think this outclasses many "pro" bodies that are cumbersome and bulky and the extra features aren't worth the huge price leap. That probably depends on the features you need. Fast 1/500 top flash sync speed. Fits almost every F-mount lens ever made (including pre-AI!) plus anyhing else you can safely attach of course. Doesn't do D-TTL (does i-TTL), screw drive AF (does AF-S), or AI metering (does electronic metering). Sadly not stop-down metering either.

Today: Still as good as ever. Discontinued but you can still find some and they'll be very affordable because it's seen as an old low-end camera. 6mp is sufficient for me. Easy to carry but not a pocket camera. Depends on your use. No dynamic range trickery, auto bracketing or LCD viewfinder. Perfect mate for any 50/1.8 Nikkor or 100/2.8 Series E!

Vintage Micro-Nikkor 55/2.8 AI-S

I paid a fair bit for this and whatever it was, it wasn't enough. This is a dream. All micro-Nikkors are spectacular and 55mm is a very general purpose one. Reliable manual action, f/2.8, very very long throw focus ring. Good working distance. Scary sharp. Absolute dream lens for closeups.

Today: As good as it ever was, unless yours has been damaged by oil migration, physical trauma or excessive use. And even still it probably works and may be repairable. Today, old models (and there are only old models, the new ones are a different splendid animl) can occasionally be found for very reasonable price. You can't have mine.

Nikon SB-20 Speedlight flash

Progress with flashes Funky old-ish unit. Auto flash in several steps (set ISO and aperture). Manual flash in several powers. PC sync connector. Pretty good power. Vertical bounce angle with odd rotary head, three fresnel patterns. Probably does D-TTL too, I don't know. Bulletproof exposure for many ranges and subjects.

Today: A real winner for off-camera and other manual use along with SB-28 and some Vivitars. Handy bounceable flash. A bit bulky perhaps. Seems reliable. Low trigger voltage of course. Subtitute another good flash and you still get a lot.

Asus P2B motherboard

ECC ram, Piii with a little overkill cooling. Quite possibly the most stable "beige" PC ever. Affordable x86-ricer cpu power in its day.

Today: Quite obsolete. Pci isn't compatbile with everything, little underpowered and slot1 has no upgrade path. USB1.1, UDMA33.. And it's still just a pc.

Biltema bit-box

Small belt-clipped plastic box with screwdriver bits and an extender. Size of a matchbox or so and attaches together as a handy screwdriver. Saved me a lot of trouble as a sysadmin and I still take it along occasionally. You can switch some of the bits for strange ones if you need them. I have a hex bit for furniture and a torx that fit certain compaq parts. It was cheap, too, IIRC.

Today: Still working perfectly though it's probably easy to damage the plastics with excessive force. You can probably find various models and variations of this. They're a good idea. Swiss rmy knives and multitools aren't. They just don't work.

Miltec civilian version of a bundeswehr shoulder bag

Black, square, has no clips or obnoxious bits. The shoulder strap ring has a tendency to turn sideways if loaded. I've added pockets for a cellphone and pen case. Inconspicuous and practical.

Today: Better than new with the pocket hack. Carries books, Ti-86, bags, clothes, tools, smaller laptops, cameras and whatnot.

Frost's #121 knife (puukko)

Puukko From the "perfection is achieved when there's nothing more to remove" school of design. Sure grip, good sized blade for woodwork. Very accurate to work with. When sharpened properly, very sharp and still durable. Sheath is the swedish utilitarian plastic type. I've made a new one for fun.

Today: As good as ever and best I've met.

Kenwood Trio oscilloscope

Oscilloscope Well, any old (or new, but older ones are affordable) scope in good repair. Doesn't have flashy features and sometimes you miss storage or image capture, but that's the way it is. Takes some space, too. I've wanted one since the 80's and I wish I would have gotten one earlier. Full repair manual available from BAMA or some other source for some models.

Today: Still works perfectly. Lets you do a lot of basic measurements and observations.

I'll see if I can come up with more and add some links later.

2009-10-31

An experiment in toner transfer

Just Because, I decided to walk through the toner transfer process with my current things at hand. The biggest variable, that I was hoping to be the only one, was the paper. I started with the plain copy paper that I use for printing.

I drew up a small breakout board. SOIC-8 to be exact, quite useless. The results looked good on paper so I cleaned a piece of very thin two-sided board I have a big sheet of and ironed the design on until it shows through. In hindsight, the taping needs more thought because the glue gets around and masks a part of the backside of the board with a sticky mess.

I decided to solder on a chip I took out of something while trying out a small butane torch. SMD desoldering works out pretty nicely with that. Destroying the board may or may not happen with through-hole components, though.

After some inspection I decided pins 1-2 were shorted because of ragged copper, maybe under-etching, and a solder bridge that I can't get out without clearing the whole board. Funnily enough that's the output and negative in on LF353, so I have half of it permanently wired as a buffer.

Not a total loss, so I decided to try it out. I put -+ voltages on the chip, attached the scope to the outputs, wired both sides as voltage followers and fed some kHz sine in.

The result: it works. I took out the feedback on the left and the sine remained. There must be a short. Disconnecting the right side had (un)predictable results, so that probably works fine.

On a whim, I also fiddled with the supplies a bit. The positive clips normally as does the negative until you get to a certain point where JFET opamps do something funny: The negative clipping comes out as positive max.

So, I'm going to need to find some other type of paper and try not to get anything on the backside. Or use single sided board instead. And it wasn't a complete waste, I have a spare extra wide DIL package LF353 dual opamp now. :)