1 |
On 3/28/2021 05:25, James Le Cuirot wrote:> On Sat, 27 Mar 2021 18:40:52 |
2 |
-0400 Joshua Kinard <kumba@g.o> |
3 |
> wrote: |
4 |
> |
5 |
>> On 3/27/2021 18:16, James Le Cuirot wrote: |
6 |
>>> On Sat, 27 Mar 2021 17:43:34 -0400 Joshua Kinard <kumba@g.o> |
7 |
>>> wrote: |
8 |
>>> |
9 |
>>>> I kinda wish the Linux kernel had an ability to partially boot, |
10 |
>>>> init the networking subsystem, then fetch an initramfs image over |
11 |
>>>> TFTP like it can do with NFS Root. That would solve the problem |
12 |
>>>> on my MIPS system(s) (and make install netboots better). I've dug |
13 |
>>>> around, but this does not seem to be a capability currently in the |
14 |
>>>> kernel, unless I have over looked something. |
15 |
>>>> |
16 |
>>>> Otherwise in the future, I may just have to setup an initramfs |
17 |
>>>> into an NFS Root and teach the SGI's to somehow deal with it. |
18 |
>>>> Which all still seems unnecessarily complicated because some other |
19 |
>>>> distro thinks it knows what's best for everyone else (but I |
20 |
>>>> digress...). |
21 |
>>>> |
22 |
>>> |
23 |
>>> NBD may be a slightly simpler alternative and a bit more like an |
24 |
>>> initramfs. nbdkit can do all sorts of weird things. I thought it |
25 |
>>> might have a plugin for cpio archives, allowing you to use a regular |
26 |
>>> initramfs generated by Dracut or similar directly. It doesn't |
27 |
>>> appear to but plugins are quite easy to write. Alternatively you |
28 |
>>> could just extract the initramfs and use nbdkit-linuxdisk-plugin. |
29 |
>> |
30 |
>> Can NBD be used like I described? Never played with it before. The |
31 |
>> MIPS machine has functioning local disk drives, and currently, it |
32 |
>> boots fine by just pulling a kernel off my TFTP server and booting from |
33 |
>> the local drive, no initramfs needed because I compiled everything into |
34 |
>> it. If we ever force sep-usr to end, then I'll need a way to teach it |
35 |
>> to mount /usr before dropping into /bin/init (and nothing else). |
36 |
> |
37 |
> Apologies, I went to experiment with this idea but I'd forgotten that |
38 |
> booting over NBD is not a built-in kernel feature and requires... an |
39 |
> initramfs. NFS looks like the only option with this general approach. |
40 |
|
41 |
I've kinda come to this conclusion myself. I could probably host an |
42 |
extracted, micro-initramfs on my NFS server that would be loaded by the |
43 |
kernel to jump to $REAL_ROOT. Not *too* much of an issue on the Octane, |
44 |
because I can store the kernel command line args in a PROM variable so that |
45 |
all I have to do is type "$foo" at the PROM prompt to load something. But, |
46 |
SGI did their best to be inconsistent, and IP27 systems cannot permanently |
47 |
save variables to NVRAM. Once you power cycle, all user-defined PROM vars |
48 |
are lost. And Linux's NFS Root command args are somewhat complicated from |
49 |
what I remember. Upshot is I boot the IP27 over serial console, so I can |
50 |
just save bootp() args in a text file on my desktop and paste it into the |
51 |
console for those instances. |
52 |
|
53 |
In any event, I kinda wish there was some way to just boot the kernel to a |
54 |
point, have it copy an initramfs image via TFTP, load it, run it, jump to |
55 |
$REAL_ROOT. If I had the time, maybe I could put something together like |
56 |
that myself, but time is not something I have much of right now. |
57 |
|
58 |
|
59 |
> Rich is right though, the initramfs can be tiny. Dracut images are heavy |
60 |
> because they are very flexible and pack a lot of features but none of |
61 |
> that is required. |
62 |
> |
63 |
> The kexec idea would be a nice bonus for you, if it works. Limiting what |
64 |
> kernel features you can enable must be frustrating. |
65 |
|
66 |
My primary kernel image for daily use on the Octane isn't terribly limited. |
67 |
The final vmlinux output is ~39MB, due to loading debugging symbols in. |
68 |
But the cutoff in size for Octane seems to be somewhere around 43-45MB, |
69 |
before the PROM errors out due to no available contiguous FreeMemory() areas |
70 |
(the mem region defined by the ARCS PROM where stuff can be loaded and |
71 |
executed). Netboot kernels for installs can creep up there if you go too |
72 |
crazy on kernel features and pack the netboot with supporting packages |
73 |
(mainly filesystem tools). This already impacts older systems, like SGI |
74 |
Indy, which cannot boot current MIPS netboot images because they have |
75 |
smaller FreeMemory() areas. |
76 |
|
77 |
I thought switching to musl would make the netboots smaller, but that oddly |
78 |
didn't work and musl netboots are about ~2MB larger than the older uclibc-ng |
79 |
versions. And all of my uclibc-ng stages have become unusable for some |
80 |
unknown reason. As soon as you rebuild ncurses in one, all binaries linked |
81 |
to it throws SIGSEGVs (which kills portage). glibc-based netboots are too |
82 |
big and will not load at all, even on the Octane. |
83 |
|
84 |
|
85 |
> It's also worth bearing in mind that you could just generate an image |
86 |
> with Dracut and extract it to a disk partition. That may seem a little |
87 |
> pointless if you're not using something like LVM or encryption but I |
88 |
> don't see the point in separate /usr either. ;) I'm guessing you don't |
89 |
> want to change your partition layout at this point though. |
90 |
|
91 |
No, no LUKS, encryption, btrfs, etc. Just mdraid w/ 0.90 metadata for |
92 |
auto-assemble. Which is why I hate having to use an initramfs for something |
93 |
so simple. Unnecessary complexity annoys me (unless you're working on a |
94 |
non-functional art piece). |
95 |
|
96 |
In any event, I've already rebuilt the system from a RAID5 down to a RAID1, |
97 |
so re-doing that to merge / and /usr would not be difficult when the time comes. |
98 |
|
99 |
-- |
100 |
Joshua Kinard |
101 |
Gentoo/MIPS |
102 |
kumba@g.o |
103 |
rsa6144/5C63F4E3F5C6C943 2015-04-27 |
104 |
177C 1972 1FB8 F254 BAD0 3E72 5C63 F4E3 F5C6 C943 |
105 |
|
106 |
"The past tempts us, the present confuses us, the future frightens us. And |
107 |
our lives slip away, moment by moment, lost in that vast, terrible in-between." |
108 |
|
109 |
--Emperor Turhan, Centauri Republic |