The only catch is that I tested the ebuilds on a Gentoo from late 2006, so some of them (mostly just the kernel) are out of date. but this catch is actually the main virtue of my ebuilds: because of the way one installs Gentoo and the loose way portage glues itself together, compared to other abandonware XBox distros, it's much easier to start with my abandoned ebuilds and make a working, up-to-date system.
emerge cromwell
rather than undocumented, untested,
un-stable-release-tagged sources sitting on a CVS server which are
still two years behind, or binary-only GPL-violating
versions from ShaLLaX that have his name stamped all over them
which you can't get rid of because he won't give you source.
gimp files/backdrop.xcf.bz2
, then ebuild
cromwell-20050612.ebuild digest
, then emerge
cromwell
)
just use my cromwell distribution, and don't ever look back.
xbox-sources
kernel, but
theirs is missing the genpatches, so it can't boot Gentoo's on
LiveCD's. Mine has genpatches, and has some other fixes:
ohci: wakeup
messages on
the console, which makes dmesg
useless
ide-cd.ko
can be built as a module without
panicing at boot
append real_root=/dev/nfs
and DHCP. This is kind of a big deal.
nodev
option.
dd
image of the
filesystem as it was when you booted, before mounting read-write, and
before running e2fsck more aggressively and possibly losing data.
real_root=shell
is process
1, so you can exec chroot /newroot /sbin/init
from
this shell.
snd_intel8x0
still needs the
option xbox=1
at load time. I think the alsa-driver in
the kernel above is also patched, but I tested with this one. I think
it's better to use the ebuild because of the lousy politics of Linux
kernel committers who often NIH over the people doing the bulk of
actual work.
/usr/local/portage/sys-boot/cromwell/files/backdrop.xcf.bz2
, and then ebuild /usr/local/portage/sys-boot/cromwell/cromwell-20050612.ebuild digest
.
CROMWELL_BANNER_HOSTNAME
in /etc/make.conf
to change the hostname displayed in the upper right corner.
emerge sys-boot/cromwell
and find your Cromwells in /usr/mdec/cromwell
.
emerge sys-kernel/xbox-sources sys-kernel/genkernel sys-boot/raincoat sys-apps/xbox-tools
. Cromwell, xbox-sources, xbox-tools, and raincoat are no
problem, but note that my genkernel will overwrite your existing
genkernel, so if you don't like this, you'll have to emerge regular
genkernel when you're done.
cd /usr/src/linux-2.6.15.1
# build /lib/modules/
mkdir /cd; mount -t iso9660 -o ro,loop=/dev/loop0 install-x86-minimal-2006.1.iso /cd
# get a read-write copy of the CD
cd / && pax -rwpe cd ~
cd
umount /cd; rmdir /cd
Now you have the InstallCD in ~/cd
. We'll make some
changes, then burn our version onto a physical CD-ROM that we can boot
in the XBox.
Mount the squashfs inside, and copy some things into it:
mkdir /squashcd; mount -t squashfs -o loop=/dev/loop0 image.squashfs /squashcd
# get a read-write copy of the squashfs
cd / && pax -rwpe squashcd ~
cd
umount /squashcd; rmdir /squashcd
#copy xbox-tools and raincoat into the squashfs
cat /var/db/pkg/sys-boot/raincoat-0.11/CONTENTS /var/db/pkg/sys-apps/xbox-tools-20050725/CONTENTS |
awk '{ if ( $1 == "obj" ) { print gensub("^/", "", 1, $2) } }' | \
( cd / && pax -w ) | ( cd ~/squashcd && pax -rvpe )
#copy kernel modules into the squashfs
(cd /lib/modules && tar cf - 2.6.15.1-xbox ) | (cd ~/squashcd/lib/modules && tar xpf -)
#make new squashfs
emerge =sys-fs/squashfs-tools-2.2_p2
rm cd/image.squashfs; mksquashfs squashcd/ cd/image.squashfs -check_data
chmod 555 cd/image.squashfs
mkdir ~/cd/boot
cp /var/tmp/genkernel/initramfs-2.6.15.1-xbox ~/cd/boot/xboxirfs
cp /var/tmp/genkernel/kernel-genkernel-x86-2.6.15.1-xbox ~/cd/boot/xboxkern
ln -s xboxkern ~/cd/boot/kernel-genkernel-x86-2.6.15.1-xbox
ln -s xboxirfs ~/cd/boot/initramfs-2.6.15.1-xbox
# help yourself out later
cp /usr/src/linux-2.6.15.1/.config ~/cd/boot/dot.config-2.6.15.1-xbox
cp /usr/src/linux-2.6.15.1/System.map ~/cd/boot/System.map-genkernel-x86-2.6.15.1-xbox
cat > ~/cd/linuxboo.cfg << EOF
title Linux
kernel /boot/xboxkern
initrd /boot/xboxirfs
append cdroot looptype=squashfs loop=/image.squashfs doload=squashfs,isofs,loop,nls_iso8859_15
EOF
As you can see from the config file's format, Cromwell is definitely not the same as Grub. Its philosophy is similar because it contains Grub's filesystem-reading code, but the config-file-parsing and device-enumerating code is Cromwell's own. There is no ``Stage 2'' with Cromwell---the Grub filesystem code is burned right into the FLASH.
cd
mkisofs -o install-x86-minimal-2006.0-xbox.iso -J -r -publisher "Ivy Ministries" -V gentoo-xbox -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table cd/
# optional. only works with LiteON writers.
# This made the difference whether my Samsung SDG-605B drive would read the DVD+R or not.
# sorta. it still seems to give read errors. Use a CD-RW, or replace the drive with normal IDE DVD-ROM.
dvd+rw-booktype -dvd-rom-spec -unit+r /dev/hdb
growisofs -dvd-compat -Z /dev/hdb=install-x86-minimal-2006.0-xbox.iso
Also, if you turn off ``DOS compatibility'' and ``change display/entry units to sectors'' in fdisk like I did, don't put any filesystems in the fourth sector (LBA 3), because the MS ROM will scribble there if you ever accidentally let it boot.
Gentoo initramfs's grab modules from /lib/modules/<version>/kernel/...
and put them into the initramfs based on a list in
/usr/share/genkernel/x86/modules_load
. The modules are
split into categories like SCSI
, FIREWIRE
,
ATARAID
, DMRAID
, LVM2
,
EVMS2
, PCMCIA
, USB
,
SATA
, FS
, IDE
, NFS
.
Most of the modules assigned to categories by
Genkernel's modules_load
file are implicitly disabled
because they are disabled in my kernel config file and never
built---these will be left out of the initramfs and not loaded without
causing any error. Some categories are off by default, as controlled
by MY_HWOPTS
in /usr/share/genkernel/generic/initrd.defaults
. You change the defaults by editing the append
line in /linuxboot.cfg
. You can
turn whole categories on or off by adding dosata
or
nosata
to the kernel command line, or you can turn
individual modules on or off with noload=usb-storage
or
doload=ext3,isofs,squashfs,loop
. Sometimes the initramfs will load a module
you didn't explicitly or implicitly mention because it's needed for a
feature, like unionfs or NFS, and you've asked it for that feature. Sometimes it's too dumb to do that.
For disk booting, I use:
title Linux
kernel /boot/kernel-genkernel-x86-2.6.15.1-xbox
initrd /boot/initramfs-2.6.15.1-xbox
append real_root=/dev/hda4 nodmraid noload=usb-storage nofs doload=ext3
you can put other title
's in there if you want. Cromwell
will give you a vertical text menu as a second step after you select
the hard disk from the horizontal icon menu. To see the vertical
menu, you have to select the hard disk rather than waiting for the
timeout.
For NFS booting, I use:
append real_root=/dev/nfs nofs noide nodmraid noload=usb-storage doload=forcedeth
The path to the NFS root filesystem is specified in DHCP, for example
by options root-path "10.100.100.140:/export/nbnfs/armitage";
in ISC dhcpd.conf.
If you boot over NFS, you'll need to make a couple other changes. First, remove net.eth0 entirely. Just let the initramfs set up the network card.
Second, change:
--- etc/init.d/functions.sh.orig 2007-03-04 22:41:43.000000000 -0800
+++ etc/init.d/functions.sh 2007-03-04 18:35:57.889644087 -0800
@@ -607,7 +607,7 @@
# Network filesystems list for common use in rc-scripts.
# This variable is used in is_net_fs and other places such as
# localmount.
-NET_FS_LIST="afs cifs coda davfs gfs ncpfs nfs nfs4 shfs smbfs"
+[ "X$NET_FS_LIST" = X ] && NET_FS_LIST="afs cifs coda davfs gfs ncpfs nfs nfs4 shfs smbfs"
# bool is_net_fs(path)
#
and put a line in /etc/conf.d/rc that says: NET_FS_LIST="afs cifs coda davfs gfs ncpfs shfs smbfs"
This will keep the rc scripts from unmounting the root filesystem too early during shutdown. It'll also make them mount other NFS filesystems earlier during startup, which is no problem since the initramfs has already brought up networking.
Third, add amd74xx
and ide-cd
to
/etc/modules.autoload.d/kernel-2.6
because the append
line I gave you above will not load the IDE drivers from the
initramfs, so your CD-ROM won't work.
RC_USE_FSTAB="yes"
Then, put lines like this in /etc/fstab:
# <fs> <mountpoint> <type> <opts> <dump/pass>
udev /dev tmpfs remount,rw,exec,nosuid,mode=0755 0 0
/dev/hda4 / ext3 rw,nodev 1 1
# cat > /etc/modules.d/alsa-xbox
options snd_intel8x0 xbox=1
^D
# modules-update
# modprobe -r snd_intel8x0
# modprobe snd_intel8x0
/etc/asound.conf
.
/etc/X11/xorg.conf
which is working with ``X Window System Version 6.8.2 / Release Date: 9 February 2005''.
xbox-blink oooo
to
/etc/conf.d/local.start
which will stop the eject LED
from blinking distractingly.
emerge joymouse
. Here is how the XBox controller presents itself as a Linux joystick:
so, the following joymouse command makes a reasonable mouse from a right-handed joystick: joymouse -v -i /dev/input/js0 -t joystick -Mx -t joystick -My -t joystick -M- -t joystick -Mx -t joystick -My -B0 -B2 -B- -B2 -B1 -B- -B- -B- -B- -B- -B1 -B0 -By- -Bx+ -By+ -Bx-
I added that to /etc/conf.d/local.start. For some reason the right
and left sticks are opposite each other in the vertical axis. And it
moves too fast. And if you unplug the joystick, joymouse won't find
it again---that only works for mice and keyboards. Isn't it great how
they waited until they had a good replacement to rototill the joystick
mouse emulation out of the stable kernel? Anyway, add this to
/etc/X11/xorg.conf
, and start joymouse before starting
X11.
Section "InputDevice"
Identifier "Joystick"
Driver "mouse"
Option "Protocol" "ExplorerPS/2"
Option "Device" "/dev/joymouse"
Option "SendCoreEvents" "true"
Option "ZAxisMapping" "4 5 6 7"
EndSection
And buy a mouse.
To start with, of course there are the different revisions of XBox, a complete disaster. Then there is the problem of nonstandard DVD-ROM drives: the replacement XBox drives must be bought from shady unprofessional vendors and are expensive or unobtainable, and the original drive wears out over time and is not nearly as good at reading scratched movies as a typical drive. With a regular PeeCee I could buy a standard DVD-ROM instead of having to dremmel/hack/patch/solder one in. And we have the churn of Gentoo itself, and Linux itself---it seems neither me nor the xbox-linux.org people want to keep up with that pain in the ass, as both of us have XBox patches for a very old kernel, and Gentoo has churned ``squashfs'' so my old kernel cannot boot modern LiveCD's. Finally there is the churn of the video formats one downloads on the Internet, particularly from hacker groups like the CCC which obnoxiously jump on the latest experimental codec to shave off a few bits, and deliver movie files that not only are unsupported without the latest ebuilds, but that a 700MHz i386 will never be able to play.
The greatest accomplishment of this work was the ability to NFS-boot. This provides an incredible rescue system, because you can back up your entire working system onto NFS and use a Cromwell menu to toggle between Disk/NFS. That way, you can try new ebuilds on one system. If, suddenly, DVD's start playing skippy and jerky for no comprehensible reason, like happened to me, you can toggle back to the known-good system. Without this type of backup to let one roll back changes, I think Gentoo would be impractical. It's doubly inpractical if you end up with a house full of people wanting to watch movies who can't do so for half a year while you get around to hammering through some rototilled Linux mess.
The second greatest accomplishment was actually getting source for everything, and next documenting how you build/use it. In theory we are using a so-called ``open source'' operating system, and the GPL guarantees I should get a packet containing source code along with every binary thing I get. In practice that doesn't happen. Cromwells are by far the worst offender and warranted a separate rant, but in general it seems like everyone who writes a page like this writes the top-level ordered list only, meaning the part where I say ``cheat and use mine,'' then stops. Shame on you guys for that. Second, the documentation is ``post to my web forum,'' or ``join my irc channel,'' rather than web pages and mailing lists like normal Linux. Delving into these ADHD-wridden gamerz rats' nests full of signon hoops, clumsy PHP, incomplete sentences, and rampant unappologetic censorship is not my favorite thing to do.
I'm really sick of the XBox and hope I can finish the DVD-skipping problem and then don't have to look at it for a long time.