So MythTV crashed again on my XBox frontend. Dad said he had enough of the constant crashing and I agreed. I switched the front TV back to a direct hookup to the satelite box and moved the XBox into my room. I decided to sit down and see what I could do to fix or at least reduce MythTV’s crashes.
So I tried upgrading Xebian’s kernel from 2.4 to 2.6.
Whoops. Apparently I’ve forgotten some of Xebian’s internals and I rendered my XBox’s Linux install unbootable. Even the emergency linux is broken, as it won’t even get past the bootloader. Xebian simply gives me a kernel panic, so I likely screwed up the linuxboot.cfg or the initrd/linuxrc. If none of this makes sense, I’ll explain later. At the moment I’m downloading the Xebian disk iso from sourceforge and following my instructions. Good thing I wrote it down. My wireless connection is slow for such a large file, so I’ve got time to fill.
Did I loose you somewhere near ‘bootloader’? You’re still a good person. How about ‘linuxrc’? Thats fine too. I’ll try and explain this fancypants terminology I’ve learned since I first installed Linux.
If you followed my softmod procedure for installing Linux, you might be wondering what this exploit is exactly. I myself don’t know exactly how it works, but I’ve got a theory. Please excuse me while I explain my theory as though it were fact. First, the installer modifies the dashboard executable to perform a calculated jump to some stuff tacked onto the end of the file. The added on code replaces the Xbox Live item with ‘Linux’ by replacing where it jumps to call the function that loads the interface and then replaces the text string to display. When the Linux item is selected, it jumps back into some trojan code attached to the dashboard’s executable which uses the power of kernel-space’s lack of protection to load the bootloader.
We now return to your regularly scheduled facts
The bootloader is a custom piece of software designed to be executed from start to finish (no ELF headers or any other pesky standards in the way). It reads linuxboot.cfg which has a syntax very similar to that of LiLo’s.
If you know what this file is, you can safely stop reading. For those new to linux, the initrd stands for the “Initial Ram Disk”. It is the first root that the newly-booted kernel sees. The file is decompressed and mounted as normal as /. Inside the initrd, there exists an exectable (usually a script) named linuxrc. Together, they load all the required drivers to make the system bootable. This usually includes loading special device drivers like SATA, or networking (in case of a network boot (I use this in my Stateless Linux project)). The final step in the linuxrc is to mount the root filesystem and pivot into it. This is performed via the pivot_root program which mounts the first argument as / and then moves the previous / into the second argument. Thus, ‘pivoting’ the root.