Wednesday 10 February 2010

Running Fedora ARM on Nokia N900

When I’ve got mine N900, I thought, pity that it doesn’t have Fedora in it. But now, I’ve managed to run Fedora ARM port on it.

Steps were the following:
  1. Rebuild kernel with FRAMEBUFFER_CONSOLE=y enabled to see console output and flash it. It is well described on Maemo Kernel Guide and Jebba’s notes
  2. Setup bootmenu
  3. Unpack prebuilt rootfs to partition on an SD card
  4. Copy kernel modules to /lib/modules and firmware to /lib/firmware inside new system

Hardware support

Watchdog

To prevent hardware reset by watchdog chip it needs to have chars regularly written to correspondent device. On N900’s board this is /dev/watchdog and /dev/twl4030_wdt. I’ve made simple rpm with config for watchdog daemon and startup script.

Wifi

Wifi is working “out-of-the-box”. Only script to startup it like this one should be prepared and put to PATH, as there is no way to type anything except english letters from console.

Touchscreen

tslib could provide touchscreen support, but to be available in X it needs xf86-input-tslib driver.

Battery

To have battery charging it needs to run bme proprietary daemon.


But it is more useful to run Fedora system in chroot from Maemo to have familiar userspace instead of cripple busybox.

Wednesday 14 October 2009

Making an evil initrd with febootstrap

Иногда, мне приходится админить известную ОС Вселенского Зла. И чтобы производить разные автоматические действия, типа разбиения диска, я сделал специальный initrd который может загрузиться по сети и сделать свою работу. Это просто благодаря утилитке febootstrap. Хотя, мне пришлось пропатчить её чтобы она работала из-под рута — патч в баге 528687.

Скрипт для создания злобного initrd, который сотрёт все разделы на диске, создаст два и отформатирует первый в NTFS в конце заметки. Не запускайте его на своей машинке >:)

----

Sometimes, I have a need to admin an well-known World Evil OS (Windows, yeah). And to do some unattended operations like custom disk partitioning, I've made special initrd that could be booted over network, and do the work. This was simple thanks to febootstrap util. Though, I had to patch it to flawlessly run under root, see bug 528687.

Script that makes an evil initrd that erases all partitions, creates two and formats first to NTFS at the end of post. Be careful not to run it on your machine >:)

----

LANG=C i386 febootstrap fedora-11 fedora-parted file:///home/alex/tmp/repo -i coreutils -i parted -i ntfsprogs -i upstart

MAKEDEV -d fedora-parted/dev -x sd{a,b,c,d}{,1,2,3,4,5,6,7,8}

febootstrap-minimize fedora-parted

cat > fedora-parted/init <<EOF
#!/bin/sh

/sbin/parted -s /dev/sda mklabel msdos mkpart primary ntfs 0 50% mkpart primary ext2 50% 100% set 1 boot on
/sbin/partprobe /dev/sda
/sbin/mkfs.ntfs /dev/sda1
/sbin/reboot -f
EOF
chmod +x fedora-parted/init

febootstrap-to-initramfs fedora-parted > initrd-parted.img

Monday 21 September 2009

Mounting raw and qcow2 VM disk images

Mounting a partition from raw image is pretty simple:
losetup /dev/loop0 image.img
kpartx -a /dev/loop0
mount /dev/mapper/loop0p1 /mnt/image

If kernel parameter (as loop in compiled into Fedora’s kernel) like loop.max_part=63 added it is even simplier:
losetup /dev/loop0 image.img
mount /dev/loop0p1 /mnt/image

Alternative way is to specify direct offset to partition:
mount image.img /mnt/image -o loop,offset=32256


To mount qcow2 images there is (at least in F-11 qemu) very useful qemu-nbd util. It shares image through kernel network block device protocol and this allows to mount it:
modprobe nbd max_part=63
qemu-nbd -c /dev/nbd0 image.img
mount /dev/nbd0p1 /mnt/image


If LVM is present on image it could be initialized with:
vgscan
vgchange -ay
mount /dev/VolGroupName/LogVolName /mnt/image


Finishing is done with (depending on how it was initalized):
umount /mnt/image
vgchange -an VolGroupName
killall qemu-nbd
kpartx -d /dev/loop0
losetup -d /dev/loop0

Tuesday 14 July 2009

Tasks properties widget

On last week I had to spend some days on my postgraduate application. Good news here that it is ended now and I hopefully will have more time to work.

Also I've committed the tasks properties widget code but it does not work properly yet. Going to fix it this week.

Tuesday 7 July 2009

No progress :/

Last week was a busy for me - I had to do some bureaucratic things to receive my diploma and apply for postgraduate course. So, was tired and did almost nothing. Anyway, I’m going to some progress on client part next week. And also, I’ve find that we deviate from original plan long time ago (tasks properties were not part of it at all), so it should be rehashed, I guess.

Tuesday 30 June 2009

Adding coverage tests

I've created unit test for my new tasks property code last week. It was useful as it helped to find one problem in code with uninitialised variable. Also, I've started some code to create tasks properties widget in Ember (but didn't commit it yet).

The list of things to do is left unchanged: parameters filtering on server side; Eris changes and widget on client side. I want to do some client stuff on this week.

Tuesday 23 June 2009

Task properties are doing something

On last week, Al helped me to fix the “bug” with python script which turned to be not a bug but simple error.

Also I’ve make a new world initialization script (define_world_empty.py) that creates an empty script. It helps to monitor with cycmd without being spammed with all kind of different event from entities and NPCs from default world. While it is possible create empty world with calling some functions from main define_world.py, I think that having separate script to create empty world, is useful by itself, to serve as a template.

Next, Al made a prototype for some core class that would allow to change task property and I added some logic to it. So now, operation for change of task properties is successfully processed, property changed and exposed back to client.

Next things to do on server side, is to implement filtering to let change only allowed properties, and on client side to make changes in Eris and create widget to select task parameters.