Talk:Initramfs

From Gentoo Linux Wiki

Jump to: navigation, search

Contents

[edit] netcat

According to http://www.manpagez.com/man/1/nc/ using the -l option is not allowed to gether with -p or -s, plus -w is ignored :P

The lower example of starting telnet with netcat might just not work at all.

Those switches work fine with net-analyzer/netcat, the man page you linked seems to be for a different implementation of netcat (there are quite a few different ones floating about). It's actually the -i switch that won't work because it requires an argument. I've updated the article to reflect that.

[edit] device nodes

I added the device node section yesterday because I noticed that some stuff does not work without basic device nodes being present. Now it seems to be getting a bit out of hands with three different approaches to device nodes 1) copy them 2) mdev 3) devtmpfs. Should we leave it like that or settle on one method? Just wondering if it confuses people. On the other hand, it gives them a choice... AndreasKlauer 14:47, 3 May 2010 (GMT)

Just tried devtmpfs for the first time myself, it's really nice and seems to be a better solution than mdev. I guess I'll change the page to reflect that by mentioning devtmpfs before mdev. AndreasKlauer 23:07, 12 May 2010 (GMT)

[edit] Applications

When I get dumped to the rescue shell, I am unable to use nano. I only get: "Error opening terminal: linux" Is this happening to anyone else? Anyone know why this might be happening? Thanks. Luckally busybox has vi built in and I like it better anyway.

+nano is not a busybox module, is it? the real nano is rather picky about terminals, it has similar issue with exotic terminal emulators (such as rxvt-unicode). Similar issue is described here http://en.gentoo-wiki.com/wiki/Rxvt-Unicode#Error_opening_terminal:_rxvt-unicode. Not sure if a terminfo file can be included in initramfs to make it acceptable for nano. An alternative workaround is to set the terminal variable to something else that nano will accept... although I'm not sure that will work in initramfs either since there are no terminfo files by default there AndreasKlauer 01:23, 28 August 2010 (GMT)

[edit] clean up

Several snippets add stuff to the initramfs that also requires cleaning up later (additional mounts etc). However the cleanup phase is currently not mentioned, apart from the 'basics' version that umounts /proc and /sys. Not cleaning up properly can cause a lot of problems later on though (for example messing with /dev/pts can cause xterm/urxvt to not work, had this issue earlier during testing). Should I add cleanup instructions to each snippet individually or should I just mention the issue in the troubleshooting section? AndreasKlauer 14:50, 3 May 2010 (GMT)

[edit] multiple initramfs

this is in the basic section, I think it's too advanced / not useful to a lot of people, and I'd like to keep the basics as basic as possible. wondering whether to include this at all (functionality section then maybe) or just leave it out, haven't seen this used ever. For it to be useful you'd have to invent some split init script structure that executes all scripts it finds in a subdir in a specific order somehow - none of this is explained anywhere in this guide and that's something a binary distro would be more likely to use (add functionality to initramfs as binary packages are emerged). AndreasKlauer 23:19, 12 May 2010 (GMT)

I personally use this a lot. I manage a number of machines and have a single generic initramfs which I deploy on all machines, I then override certain config files with an extra machine specific initramfs. It's a lot easier than remaking a ton of different initramfs when I only want to make single global change. I think it's also useful to understand that multiple initramfs override each other, especially if you accidentally embed one in the kernel as well as specifying an external one, I've seen that problem catch a few people out. I agree that it shouldn't be in the basic section though, it's definitely an advanced topic. Malone 08:46, 13 May 2010 (GMT)
Hmmm, okay. I'll put it in the functionality section then. AndreasKlauer 11:53, 13 May 2010 (GMT)

It is possible to specify multiple initramfs to be extracted during boot. This can be useful if you want to create a generic initramfs and then add modifications in separate files. You can specify multiple initramfs archives in your grub config by using multiple initrd lines.

File: /boot/grub/grub.conf
title=Gentoo Linux 2.6.27-r8 with initramfs (hd0,0)
root (hd0,0)
kernel /boot/kernel-2.6.27-gentoo-r8
initrd /boot/first-initramfs.cpio.gz
initrd /boot/second-initramfs.cpio.gz
initrd /boot/third-initramfs.cpio.gz

The kernel will extract these files in the order they are specified. The files will all be extracted into the same place, this means files from later archives will overwrite former ones if they have the same filename. Also note that it is possible to have an initramfs archive embedded in the kernel as well as extra ones specified in the grub config. The archive in the kernel will be extracted first, followed by the ones in the grub config.

[edit] UUID/LABEL root mounting

Initramfs#UUID.2FLABEL_Root_Mounting currently does three separate things at once: 1) it parses kernel parameters, 2) it finds device by uuid/label, 3) it mounts the device. Should I leave it like that or would it make more sense to split it up into separate functionality sections, one that does kernel parameters (may be useful for things other than just root=), one that finds devices by uuid/label/..., and leave out the mounting part since that's done in the basics already? AndreasKlauer 12:10, 13 May 2010 (GMT)

Nobody commented; since I have to work with network and kernel parameters on a server next week, I guess I'll just go ahead and do this, along with a rudimentary networking section (which is currently somewhat done in Remote Rescue Shell). AndreasKlauer 13:46, 20 May 2010 (GMT)
Started work on a networking section, will add an nfs mount example and move the Remote Rescue Shell down there later. The other stuff will follow later AndreasKlauer 12:31, 26 May 2010 (GMT)
Another idea is to have a "Parser" heading and then the UUID/Label stuff as a heading under that. The reason I didn't write that section so is because there wasn't anything else in the article that really needed it, so everything got thrown in as one. Ni1s 11:40, 31 May 2010 (GMT)

[edit] nfs

I added the network section recently, but didn't have time since, so it's only half finished. Also it recently came to my attention that the kernel can mount NFS root partitions without the help of initramfs, depending on how the network is set up. Currently the initramfs wiki page suggests that initramfs is necessary for network filesystems. This should be rephrased, and I'll do that when I find the time, but for now I only added a note AndreasKlauer 06:53, 25 June 2010 (GMT)

Personal tools