DebConf9

I'm going to DebConf, and will be giving what I think is the first talk I've ever done about debhelper there. Incidentially, debhelper in experimental has some nice new features.

I have no idea how I'm getting from the Madrid airport to Cáceres, and would rather spend time working on my talk than trying to book tickets internationally, so I hope buying train tickets at the station is not a foolish plan..

Posted
Socialstructing

This and this are very interesting. It gives me a framework for thinking about:

  • How I lived, rent-free, for years on land I didn't own.
  • Why I don't think about asking for money when I fix someone's computer or help them get something working or host something for them on the web.
  • Why I've not bought land to put my yurt on, and keep being unsure it's a good idea.
  • How contributing to free software isn't just throwing my time away for no return.
  • Why I get to travel to interesting places so frequently and inexpensively.
  • Why I'm housesitting this week.
  • How I get fresh eggs, plant sets for the garden, summer produce.
  • Why I have email in my mailbox offering to buy me a train ticket in Spain.
Posted
palm pre

Pre

I got a Palm Pre because I want a Linux smartphone that is not locked down (like the G1), on which I can play with Debian and even my own kernel. But I also want one that seems likely to be widely viable going forward, and there I have my doubts about OpenMoko, sadly.

(Or, I got a Palm Pre because I dreamt last night that I got one, and decided my subconcious must have made a decision after dithering for years. And because Madduck rules.)

Debian chroot on Palm Pre

This is a quick installation of a Debian chroot on the Palm Pre phone. Similar methods are explained at the Pre Dev Wiki. But they have you download a prebuilt Debian image and modify the Palm webOS system to install ssh; I preferred to use debootstrap and keep webOS changes to a minimum.

Also, since the Pre uses LVM, its media partition can be resized on the fly. That allows for a larger Debian filesystem, and I think is a nicer method than the loopback filesystem approach documented elsewhere, but do read the warnings about Palm, LVM, and upgrades here.

On the Pre:

  1. Enable dev mode by opening the Pre's Launcher and typing the following into it: upupdowndownleftrightleftrightbastart
  2. Plug the Pre into your laptop, tell it to charge via USB, while doing the following on the laptop.

On a Linux laptop:

  1. Run debootstrap to build an armel chroot: sudo debootstrap --foreign --arch=armel sid /tmp/debian
  2. Download novacom, cd to it, and build it: sudo apt-get install libusb-dev; make
  3. Transfer the armel chroot from the laptop to the Pre: (cd /tmp; sudo tar czv debian) | sudo ./novacom put file:///tmp/debian.tar.gz
  4. Run sudo ./novacom to get root shell on the Pre.
  5. In that shell, use LVM to resize the existing /media/internal volume down to 1 GB, and create a new 6 GB one for Debian:
     cp -a /media/internal /opt
     umount /media/internal
     lvresize -L 1G /dev/mapper/store-media
     mkdosfs -F 32 /dev/mapper/store-media
     mount /media/internal
     mv /opt/internal/ /opt/internal/. /media/internal
     rmdir /opt/internal
     lvcreate -l 100%FREE -n debian store
     mkfs.ext3 /dev/store/debian
     mkdir /media/debian
     echo "/dev/mapper/store-debian /media/debian auto noatime 0 0" >> /etc/fstab
     mount /media/debian
  6. Then in the Pre's root shell, you can unpack Debian, set up some bind mounts to allow accessing the Pre's filesystems from inside Debian, and chroot in to finish debootstrap:
     cd /media
     tar zxvf /tmp/debian.tar.gz
     mkdir /media/debian/media/pre-root /media/debian/media/internal
     echo "/ /media/debian/media/pre-root bind defaults,bind 0 0" >> /etc/fstab
     echo "/var /media/debian/media/pre-root/var bind defaults,bind 0 0" >> /etc/fstab
     echo "/var/log /media/debian/media/pre-root/var/log bind defaults,bind 0 0" >> /etc/fstab
     echo "/tmp /media/debian/tmp bind defaults,bind 0 0" >> /etc/fstab
     echo "/proc /media/debian/proc bind defaults,bind 0 0" >> /etc/fstab
     echo "/dev /media/debian/dev bind defaults,bind 0 0" >> /etc/fstab
     echo "/dev/pts /media/debian/dev/pts bind defaults,bind 0 0" >> /etc/fstab
     echo "/sys /media/debian/sys bind defaults,bind 0 0" >> /etc/fstab
     echo "/media/internal /media/debian/media/internal bind defaults,bind 0 0" >> /etc/fstab
     mount -a
     chroot debian
     /debootstrap/debootstrap --second-stage
     ln -sf /proc/mounts /etc/mtab
     ln -sf /media/pre-root/etc/resolv.conf /etc/resolv.conf
     apt-get clean
  7. Now customise the Debian chroot as usual.

How this could be made easier:

  • Make a debian package of novacom.
  • Installation script? debcoexist? d-i?

TODO:

  • Install openssh in Debian and configure it to start at boot.
  • Set up VNC, install VNC app in webOS to allow accessing a Debian desktop.
ssh to debian chroot on palm pre

Following setting up a Debian chroot on the Pre, I wanted to be able to ssh into the chroot. This sets that up, including starting Debian's ssh on boot.

Actually, I went a step further and hooked Debian's rc3.d init scripts into the Pre's webOS boot process, so all services installed in Debian will start on boot. So as a bonus, cron, at, etc will also work.

Since the Pre's EVDO IP address changes all the time, dynamic DNS is needed if you want to ssh in over EVDO. I used ez-ipupdate to handle that. (If you didn't want to ssh via EVDO, you could omit that part, and add "-i eth0" to both the firewall rules below.)

  1. Use novacom and the cable to get a root shell, and chroot /media/debian
  2. Install ssh: apt-get install openssh-server openssh-client
  3. Hook Debian init scripts into webOS startup:
     cat > /media/pre-root/etc/event.d/debian_start <<EOF
     # start Debian services after webOS boot is complete to avoid delaying that
     start on stopped finish
     script
         echo "Starting Debian services..."
         chroot /media/debian /etc/init.d/rc 2
     end script
     EOF
  4. Edit /etc/rc.local and add these commands to it:
     # Add firewall rule to allow SSH access on port 22,
     # both wifi and EVDO.
     iptables -D INPUT -p tcp --dport 22 -j ACCEPT || true
     iptables -I INPUT -p tcp --dport 22 -j ACCEPT
  5. If you want to easily be able to determine the phone's address while it's on wifi, you can use mDNS (hostname.local): apt-get install avahi-daemon
  6. Install ez-ipupdate: apt-get ez-ipupdate
  7. Follow the prompts to configure ez-ipupdate to use dyndns or your preferred dyanmic DNS service. When it asks if ppp is used, say yes.
  8. Edit /etc/ez-ipupdate/default.conf and make sure the interface is set to 'ppp0' (See Debian bug #536512 for why you need to do this currently.)
  9. Hook ez-ipupdate into webOS's ip-up script, so it is run whenever the address changes:
     HOOK=/media/pre-root/etc/ppp/ip-up.d/09ez-ipupdate-debian
     echo '#!/bin/sh' > $HOOK
     echo '/usr/sbin/chroot /media/debian /etc/ppp/ip-up.d/ez-ipupdate >/dev/null 2>&1 || true' >> $HOOK
     chmod a+x $HOOK
  10. Reboot the Pre. Now is a good time to learn that Orange+Sym+R on the keypad is equivilant to ctrl-alt-del. :-) The ssh daemon should be started automatically.

TODO:

  • Enable avahi for mdns for wifi.
  • Cleanly stop Debian services on shutdown. Problem with doing this is that I can't just run '/etc/init.d/rc 0', because that will kill every process in webOS too, and hang the phone. It'd need a very custom runlevel to be set up in Debian.
debian desktop via vnc on the palm pre

On my Palm Pre, I'm running a PalmOS emulator, with a VNC client in it, connecting to a VNC server on the same phone, in order to get to an xterm. About the most roundabout way to get a prompt on a phone one can imagine, and also very wasteful of screen space because of that PalmOS emulator. I hope better methods become available.

  1. Install Classic. (This will only work for a week w/o being bought, BTW.)
  2. Login as root to Debian chroot on the Pre.
  3. Download PalmVNC: cd /media/internal/ClassicApps; wget http://palmvnc2.free.fr/stable/PalmVNC.prc
  4. apt-get install tightvncserver
  5. su to your non-root account on the Pre.
  6. Create a VNC password file containing an empty password by running: mkdir -p ~/.vnc; echo | vncpasswd -f > ~/.vnc/passwd; chmod 600 ~/.vnc/passwd
  7. Run tightvncserver -interface 127.0.0.1 -geometry 320x320
    (It only listens to localhost, so the empty password is ok (ish). The geometry is all that is visible on the Pre without scrolling.)
  8. Start Classic (or restart it).
  9. In Classic, select PalmVNC and tell it to connect to localhost, and change the display from 0 to 1. It will prompt for a password, just hit Ok for a blank one.
  10. Optionally, make VNC auto-start on boot, add to rc.local something like this: su joey -c 'cd; tightvncserver -interface 127.0.0.1 -geometry 320x320'

TODO:

  • Need way to send arrow keys!
  • xmonad configuration

Update: Here's another screenshot, of FBReader on the Pre. One of the missing apps on the Pre is a good offline e-book reader with no vendor lock-in. FBReader is what I use on my laptop, so it's great to have it on my phone. Especially since I have room for my entire e-book library on the Pre's generous flash drive.


Previously: Palm Pre, ssh to Debian chroot on Palm Pre

life, day 12145

If you're sitting on the futon getting someone's spiffy podcasting audio mixer working with linux and you find yourself using 2 laptops and speaking into 2 mics at once, and wearing headphones adorned with a sock, and someone mentions the IT Crowd, the best thing to do is probably to ham it up.

(I'd rather be Roy, but who am I kidding.. PS, The sock was not my idea!)


Also, I've taken some updated pictures of the yurt since it's been up for over a year.


More

Posted
xmonad.hs for the Palm Pre

I've developed an xmonad configuration file for using this window manager with the Palm Pre smart phone. (I described how I run X on the Pre in VNC here.)

The tricky part is that the Pre has absolutely no keys or key combinations that can be stolen by xmonad and used as the mod key.

So at first I looked at using xmonad's support for gestures. That would be a perfect fit with the Pre. But, if taps are bound to gestures with no mod key, xmonad eats them all. Applications receive no taps! Not good.

I also tried using a submap. But, the key that triggers a submap never gets sent through to the application, even if none of the actions in the submap are triggered. Xmonad could handle these things better..

Instead, I had to use PalmVNC's support for sending special keys via a menu. So the mod "key" consists of tapping the Menu icon in the emulator (on the left hand side) and then pressing "a".

Thus, to start a new terminal, use "Menu a x"; to close a window use "Menu a c"; to change layout, use "Menu a space"; and you can read the rest of the bindings in the config file.

Posted
experiencing more of Spain

I'm in Spain for DebConf, and gave a talk on Sunday which seemed well received.

On Monday there was a trip by bus to Valle del Jerte, a few hours away. In the nature reserve there, we hiked up to Los Pilones, a great series of pools, carved out of the rock and connected by little falls and natural water slides. The water was clear and each pool had its own character, some with little grottos, which I had a lot of fun exploring.

I'd have happily stayed longer, but we left to rejoin the group who hadn't taken the hike, in Jerte. There was an outdoor pool there, and I took another dip, just to wash off after the hike. I'd barely gotten in though, when I hurt my toe on something in the rocky bottom of the pool.

It wasn't until I got out that I realized I'd cut two toes and was bleeding impressively. Lots of Debian people took over then, and got the bleeding stopped and an ambulance called. In the end, it wasn't too serious, just 4 stiches needed.

So I also got to experience part of Spain I'd not been expecting to, and can compare healthcare systems firsthand now. And they got me out of there in time to get picked up by the last bus, so it's all good, I guess.

Posted
home at last

So, DebConf's over, I'm back from Spain. It was a long trip. Maybe I'll try to blog something about it, but now I'm excited about being home. Especially about the garden, which has exploded while I was away. I have thai basil by the bushel now, not the leaf; not enough tomatoes but as many as can be expected from my tiny planting, a freezer full of blackberries and even some still on the vine, new sorts of squashes, lots more coming on (onions, green beans, cabbage). So glad to be back in the humid, sticky, cool(?!) of the appalachian summer.

mr co is busily moving all the bits I don't cross national borders with back onto my personal area network; music is playing without headphones for a change; the office is full of soaked laundry from my checked baggage (courtesy of Delta, thanks guys); the cat is happy; my toes don't hurt much; and all is right with the world.

Posted