The included patches are the initial attempts at getting genkernel's initrd to replace the customized "miniroot" I wrote for our experimental livecds. This is one of the stages to getting catalyst to fully support mips for LiveCD generation. With these two patches, a kernel can boot and load the CD and kick off init. The only noted failures are a failure to unmount the initramfs /dev folder, which appears to be a non-fatal issue. The second flaw is outlined in Bug #82556, which is a blocker for this bug, as I have also run into the referenced problem.
Created attachment 68708 [details, diff] Patch for initial sgimips support in generic/linuxrc An SGI LiveCD needs to skip certain checks in the boot process. We're not like other arch LiveCDs in which we have to mount an isofs filesystem first to find the loopback file containing the real root FS. We have a simple utility, sys-boot/getdvhoff, which will calculate the exact offset in bytes of the partition on the CD (yes, this CD has disk partitions on it) containing the ext2 filesystem to mount. This byte offset is passed to losetup which configures /dev/loop0, and then mounts /dev/loop0 onto the new root.
Created attachment 68709 [details, diff] Patch for initial sgimips support in generic/initrd.scripts
Created attachment 69019 [details, diff] Patch for initial sgimips support in generic/linuxrc Updated to better load a SGI LiveCD root. Still clashes with 82556 apparently.
Created attachment 69829 [details, diff] [1/7] Patch to Add Initial Support to genkernel for mips For genkernel-3.3.6; this patch creates the mips/ directory and populates it with 2.6.x kernel configs for IP22 (Indy/Indigo2 r4k, r5k), IP27 (Origin, r10k+), IP28 (Indigo2, r10k), IP30 (Octane, r10k+), and IP32 (O2, r5k). Also creates the pkg/mips folder with a .keep file present, as well as busybox config and genkernel config.sh. First patch in the series
Created attachment 69830 [details, diff] [2/7] Patch to Allow mips systems to be detected properly by genkernel Tweaks gen_arch.sh to detect mips/mips64 systems correctly
Created attachment 69831 [details, diff] [3/7] Patch to allow genkernel to generate initrd correctly for mips Rigs genkernel to properly build a suitable initrd for mips by creating the initrd/initramfs before doing the actual kernel compile. Afterwards, copies the initrd/initramfs to the kernel build dir, then builds the kernel. Also copies getdvhoff into the initrd for the LiveCDs (getdvhoff is a DEPEND of genkernel now on mips).
*** Bug 106292 has been marked as a duplicate of this bug. ***
Created attachment 69832 [details, diff] [4/7] Patch to allow building of a static kernel (no modules) Allows one to create a define in ${ARCH}/config.sh to enable/disable module builds. Covers functions for both module-init-tools and modutils, although a 2.4 mips kernel will likely be generated using genkernel.
Created attachment 69833 [details, diff] [5/7] Patch for mips support in generic/linuxrc Final (hopefully) update of generic/linuxrc patch for mips. Minor fixes somewheres, can't remember where in relation to last patch.
Created attachment 69834 [details, diff] [6/7] Patch for mips support in generic/initrd.scripts ditto
Created attachment 69835 [details, diff] [7/7] Patch for comestic tweaking in unionfs bits While not direly important for mips support, I fixed this while I was at it. Removes a redundant 'if' statement check for a unionfs feature and lumps it in with the previous if statement that also happened to be for unionfs.
Created attachment 69836 [details, diff] Patch for genkernel-3.3.6 ebuild to add sys-boot/getdvhoff to DEPEND
Hopefully, this is the final patchset to get mips LiveCD support into genkernel. It's only for 2.6 kernels really, though it will build 2.4 kernels as well, but the LiveCD test failed on it, so anyone's guess there. It relies heavily on a lot of new features, features which have not been tested against other archs, but it's my belief that I didn't break anything too horribly... Next up, Catalyst.
(In reply to comment #6) > the initrd/initramfs to the kernel build dir, then builds the kernel. Also > copies getdvhoff into the initrd for the LiveCDs (getdvhoff is a DEPEND of > genkernel now on mips). We really need to add getdvhoff to genkernel's mess of tarballs it ships with, as Genkernel is supposed to be "Gentoo-agnostic". Basically, it needs to be able to work with just a /usr/src/linux and bash. At least, I think I would prefer it if it shipped with its own.
(In reply to comment #14) > We really need to add getdvhoff to genkernel's mess of tarballs it ships with, > as Genkernel is supposed to be "Gentoo-agnostic". Basically, it needs to be > able to work with just a /usr/src/linux and bash. At least, I think I would > prefer it if it shipped with its own. This is doable. getdvhoff is just a single C file shipped with the sgibootcd utility, and likely will only ever have a single version unless bugs are found. It should'nt inflate genkernel at all. The only catch is, I rigged the getdvhoff ebuild to build via klibc, as the end result is a whopping 8KB binary (compared to 79KB for a uclibc one). The udev shipped with genkernel has klibc built in. I'm not entirely sure how to handle this in for getdvhoff, though -- perhaps ship klibc with it as well?
So I'd need to apply all 7 of the numbered patches, correct? Any luck on the getdvhoff thing? And is it only required for building the CD, or is it also required to be *on* the CD anywhere?
Apply all but #4; Plasmaroo suggested re-writing #4 to support a --static commandline that will bypass the calls to compile_modules and other associated functions. I just haven't gotten around to writing this in yet. I also believe I have an 8th patch I forgot to attach to this bug...I'll dig it up and attach it later on.
Created attachment 72134 [details, diff] Patch to skip kerncache until after initrd build Skips creation of the kerncache until after the initrd is built, followed then by the kernel.
#4 skipped and #7 wouldn't apply (saying it was reversing a previously applied patch)...
Comment on attachment 69835 [details, diff] [7/7] Patch for comestic tweaking in unionfs bits oh yeah, I forgot on #7, one of my patches included it by accident. Completely forgot about that.