"Hier staunt der Laie und Fachmann wundert sich."

Mittwoch, September 26, 2007

Upgrading KnoppMyth R5A22 to R5B7

Prelude


If you are familiar with KnoppMyth R5A22 then you know that upgrading was not recommended for a long time due to some problems with this release. Since my box worked (almost) perfectly with R5A22 I did not care very much. But recently I start having problems. It started when I installed a second harddrive to add some storage space for my TV recordings.

First I thought the problem was the file system. I had chosen ReiserFS without doing any research on it, just remembering that it is a journaling file system, which always seems like a good idea. On my other partitions I had switched to XFS a long time ago since I found ext3 to be very (very!) slow on deletions of large files (which was one of my main occupations :-).

The problem that appeared were these: When watching a recently made recording (one that was freshly stored on the new partition) it simply stopped in the middle of it and then returned me to the menu, just as if it had reached the end of the recording. I used "mythfrontend" from an xterm to see if there were any erros (since "dmesg" did not show anything and the backend-log neither). Turns out, mythfrontend complains about some problem with some prebuffer timeout in connection with an mpeg4 error. I don't remember the exact wording but I figured that it could be the file system. So I switched the new partition to XFS, and the problem was gone.

Until today. It's acting up again. So this time I'll try an upgrade, since the KnoppMyth editor explicitly mentions in the forum that R5A22 users can upgrade to this new version.

Step 1


Backup current partition as described in an earlier post about upgrading to R5A22 using "dd". Then also use KnoppMyth's backup (found under the Extras menu). The automatic upgrade won't work without the latter.

Step 2


While downloading the iso image I read through this recommended post: (sorry, requires registration).

I then tried the auto-install (without doing anything that was mentioned above just to see what would happen: Lilo didn't work (showing "L 99 99 99 99" and so on on the screen). Oh well, it was worth a try :-)

Step 3


So now I reboot from the KnoppMyth install CD again. My system partition is updated so I switch to a console right away. Here, I mount /dev/hda1 (my system partition), and /proc and /dev, then chroot to it with


# This mounts my system partition
mount /dev/hda1 /mnt/hda1
# We also need /proc in the chroot environment
mount --bind /proc /mnt/hda1/proc
# We need /dev as well
mount --bind /dev /mnt/hda1/dev
# Now chroot
chroot /mnt/hda1
# and call lilo
lilo


Two problems may occur:

1) If lilo complains about not recognizing the "part:" token, then open your lilo.conf ("nano -w /etc/lilo.conf" -- withing the chroot environment!) and remove those lines starting with "part:".

2.) If lilo gives you "Fatal: open /dev/hda: Permission denied" then you probably forgot to mount /proc and /dev before chroot-ing.

OK. I rebooted now to see if this did the trick, and it did -- part of it anyway. Of course, it did not install my old lilo-configuration but the new one from RAB7. That's enough to try out how much is working though.

Step 4



X11 starts OK and KnoppMyth asks me for the root password, then the time zone settings, remote control type and so on. Since my wlan is not yet set up, I configure the eth0 interface to some sensible values.

At the end, the mythfrontend starts, but the backend seems not to work ("could not connect..."). This seems normal, since I did not confige mythtv using myth-setup yet. So I need to do this before I can restore my backup using the mythfrontend.

Step 5: Runnding mythtv-setup


In the general section I leave the IP settings alone. The second page asks for the storage dir for recordings. The default is "/mnt/store", which I do not remember to have before the update. No wonder the backend won't start. I'll set this to my old TV dir, which was /myth/tv and see what happens.

Checking my existing recordings (in the frontend) yields an empty page. After a complete reboot the recordings show up (that's strange). Phoo.

Step 6: Setting up WLAN



Todo

Step 7: Automatic shutdown and startup



I was using NVRAM and some scripts to handle the automatic shutdown and wakeup of my mythbox. NVRAM seems to be installed (apt-get install nvram-wakeup says so) and so I decide to simply copy the scripts from my backup.

Before trying it out, read http://knoppmythwiki.org/index.php?page=WakeupToRecord and remeber to

touch /var/log/mythtv/mythevent.date
touch /var/log/mythtv/mythpreshutdown.log
chmod 777 /var/log/mythtv/mythevent.date
chmod 777 /var/log/mythtv/mythpreshutdown.log


Following that I restore the /etc/nvram-wakeup.conf as well and run the nvram-wakeup command like this (if you'ver never used nvram: better read the docs first, because its different for different mainboards):
nvram-wakeup --configfile=/etc/nvram-wakeup.config --directisa


You also have to make sure that the mythtv can run the necessary commands (like nvram-wakeup, lilo, reboot). I simply restored my old /etc/sudoers from the backup.

-- Update --

Step 8: Setting up video


For some reason the ivtv firmware cannot be loaded on bootup. In the KnoppMyth wiki I found the following information, which helped me solve this (though I don't understand why):

* Edit your /etc/mythtv/modules/ivtv file and remove the "simple=1" option for msp3400.

* Edit your /etc/modules file and remove the line that says "ivtv" around line 45.

* Reboot the system.

* After it comes back up you will need to stop the backend, run mythtv-setup, clear your capture card settings, restablish them and the input connections, and finally exit mythtv-setup and restart the backend. Note that with the new driver you will see a different set of inputs for PVR-150 and PVR-500 cards.



Step 9: restoring lvm settings


I restored the content of /etc/lvm/ and added the init-script for lvm to my boot process by running (source: LVM howto)

update-rc.d lvm start 26 S . stop 82 1 .

(Note the two ".")

Step 10: setting up the remote control



I had to adjust /etc/lirc/hardware.conf to DEVICE=/dev/lirc and also I had to create the /dev/lirc device node (see lirc howto) by running

#First I had to delete the existing one, because it was incorrect
rm /dev/lirc
# Then create it correctly using
mknod /dev/lirc c 61 0


After restarting gdm (/etc/init.d/gdm restart) or rebooting the remote worked once again.

Note:
Send lircrc to knoppmyth@gmail.com