Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 106338 - Patchset needed to add mips support to genkernel for SGI LiveCDs purposes
Summary: Patchset needed to add mips support to genkernel for SGI LiveCDs purposes
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: MIPS Linux
: High normal (vote)
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords:
: 106292 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-09-17 22:23 UTC by Joshua Kinard
Modified: 2005-11-05 09:38 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch for initial sgimips support in generic/linuxrc (genkernel-sgimips-linuxrc.patch,1.21 KB, patch)
2005-09-17 22:27 UTC, Joshua Kinard
Details | Diff
Patch for initial sgimips support in generic/initrd.scripts (genkernel-sgimips-initrd_scripts.patch,493 bytes, patch)
2005-09-17 22:28 UTC, Joshua Kinard
Details | Diff
Patch for initial sgimips support in generic/linuxrc (genkernel-sgimips-linuxrc.patch,2.08 KB, patch)
2005-09-22 10:35 UTC, Joshua Kinard
Details | Diff
[1/7] Patch to Add Initial Support to genkernel for mips (genkernel-sgimips-initial-support.patch,133.02 KB, patch)
2005-10-03 22:00 UTC, Joshua Kinard
Details | Diff
[2/7] Patch to Allow mips systems to be detected properly by genkernel (genkernel-sgimips-arch-overrides.patch,314 bytes, patch)
2005-10-03 22:02 UTC, Joshua Kinard
Details | Diff
[3/7] Patch to allow genkernel to generate initrd correctly for mips (genkernel-sgimips-initrd_initramfs-bits.patch,4.05 KB, patch)
2005-10-03 22:05 UTC, Joshua Kinard
Details | Diff
[4/7] Patch to allow building of a static kernel (no modules) (genkernel-static-kernel-kludge.patch,9.63 KB, patch)
2005-10-03 22:10 UTC, Joshua Kinard
Details | Diff
[5/7] Patch for mips support in generic/linuxrc (genkernel-sgimips-linuxrc.patch,2.08 KB, patch)
2005-10-03 22:12 UTC, Joshua Kinard
Details | Diff
[6/7] Patch for mips support in generic/initrd.scripts (genkernel-sgimips-initrd_scripts.patch,493 bytes, patch)
2005-10-03 22:13 UTC, Joshua Kinard
Details | Diff
[7/7] Patch for comestic tweaking in unionfs bits (genkernel-misc-unionfs-tweak.patch,545 bytes, patch)
2005-10-03 22:15 UTC, Joshua Kinard
Details | Diff
Patch for genkernel-3.3.6 ebuild to add sys-boot/getdvhoff to DEPEND (genkernel-3.3.6-mips-getdvhoff.patch,400 bytes, patch)
2005-10-03 22:19 UTC, Joshua Kinard
Details | Diff
Patch to skip kerncache until after initrd build (genkernel-sgimips-skip-kerncache.patch,825 bytes, patch)
2005-11-04 13:08 UTC, Joshua Kinard
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joshua Kinard gentoo-dev 2005-09-17 22:23:13 UTC
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.
Comment 1 Joshua Kinard gentoo-dev 2005-09-17 22:27:35 UTC
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.
Comment 2 Joshua Kinard gentoo-dev 2005-09-17 22:28:26 UTC
Created attachment 68709 [details, diff]
Patch for initial sgimips support in generic/initrd.scripts
Comment 3 Joshua Kinard gentoo-dev 2005-09-22 10:35:39 UTC
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.
Comment 4 Joshua Kinard gentoo-dev 2005-10-03 22:00:35 UTC
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
Comment 5 Joshua Kinard gentoo-dev 2005-10-03 22:02:31 UTC
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
Comment 6 Joshua Kinard gentoo-dev 2005-10-03 22:05:44 UTC
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).
Comment 7 Joshua Kinard gentoo-dev 2005-10-03 22:09:12 UTC
*** Bug 106292 has been marked as a duplicate of this bug. ***
Comment 8 Joshua Kinard gentoo-dev 2005-10-03 22:10:43 UTC
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.
Comment 9 Joshua Kinard gentoo-dev 2005-10-03 22:12:38 UTC
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.
Comment 10 Joshua Kinard gentoo-dev 2005-10-03 22:13:21 UTC
Created attachment 69834 [details, diff]
[6/7] Patch for mips support in generic/initrd.scripts

ditto
Comment 11 Joshua Kinard gentoo-dev 2005-10-03 22:15:09 UTC
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.
Comment 12 Joshua Kinard gentoo-dev 2005-10-03 22:19:00 UTC
Created attachment 69836 [details, diff]
Patch for genkernel-3.3.6 ebuild to add sys-boot/getdvhoff to DEPEND
Comment 13 Joshua Kinard gentoo-dev 2005-10-03 22:25:36 UTC
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.
Comment 14 Chris Gianelloni (RETIRED) gentoo-dev 2005-10-04 07:15:29 UTC
(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.

Comment 15 Joshua Kinard gentoo-dev 2005-10-04 20:34:03 UTC
(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?
Comment 16 Chris Gianelloni (RETIRED) gentoo-dev 2005-10-28 12:21:29 UTC
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?
Comment 17 Joshua Kinard gentoo-dev 2005-10-29 14:33:56 UTC
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.
Comment 18 Joshua Kinard gentoo-dev 2005-11-04 13:08:54 UTC
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.
Comment 19 Chris Gianelloni (RETIRED) gentoo-dev 2005-11-04 13:54:56 UTC
#4 skipped and #7 wouldn't apply (saying it was reversing a previously applied
patch)...
Comment 20 Joshua Kinard gentoo-dev 2005-11-05 09:38:03 UTC
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.