Skip to contentSkip to conversation

/dev/.initramfs copy state before switch_root

DISCUSSION Warren Togami 3 participants 5 messages Jun 8, 2009 – Jun 9, 2009 3 messages not in the archive

lore
Share & tools
lore
#0 lore raw

I have pushed the following changes.

* If netboot, copy /tmp/net.* to /dev/.initramfs/. Initscripts of your distribution or NetworkManager can read the files in this location to be aware of prior configured interfaces. A distribution may choose to do something with this information.

* If you specify kernel cmdline "rdcopystate", then all of /tmp/* is copied into /dev/.initramfs/. This could sometimes be useful for post-boot examination or debugging.

* net.<interface name>.lease is written containing the DHCP lease, because dcbw asked for this for NetworkManager. Your own tools could choose to do something with it or not.

TODO:

* We need something to write out a file like /dev/.initramfs/net.eth0.static in the case of a static IP during initrd. I have never used static IP with initrd before. Are there multiple syntaxes to configure static IP? Others have touched this part of the code.

Warren Togami
[email protected]
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 7 lines · Warren Togami

I have pushed the following changes.

* If netboot, copy /tmp/net.* to /dev/.initramfs/. Initscripts of your distribution or NetworkManager can read the files in this location to be aware of prior configured interfaces. A distribution may choose to do something with this information.

* If you specify kernel cmdline "rdcopystate", then all of /tmp/* is copied into /dev/.initramfs/. This could sometimes be useful for post-boot examination or debugging.

* net.<interface name>.lease is written containing the DHCP lease, because dcbw asked for this for NetworkManager. Your own tools could choose to do something with it or not.

That's great, thanks!

Quoted 3 lines

TODO:

* We need something to write out a file like /dev/.initramfs/net.eth0.static in the case of a static IP during initrd. I have never used static IP with initrd before. Are there multiple syntaxes to configure static IP? Others have touched this part of the code.

I don't know if this is really necessary. After all, it just a static conf and initscripts can just check if an interface is already up?

Anyway, the syntax to use on the commandline is ip=... See http://apps.sourceforge.net/trac/dracut/wiki/commandline for more information.

As for a file format, why not ask the NetworkManager people what they'd like to have?

Hope that helps
Philippe
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw
Quoted 2 lines · Seewer Philippe

I don't know if this is really necessary. After all, it just a static conf and initscripts can just check if an interface is already up?

NetworkManager or initscripts perhaps cannot differentiate between checking if it is already up immediately at boot-up or if it is run again sometime later. It is really better for dracut to inform the OS explicitly in a uniform manner similar to if dhcp were used.

Quoted 8 lines

Anyway, the syntax to use on the commandline is ip=... See
http://apps.sourceforge.net/trac/dracut/wiki/commandline for more information.

As for a file format, why not ask the NetworkManager people what they'd like to have?

Dan, what file format would you prefer?

Warren Togami
[email protected]
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

#6 lore raw
Quoted 8 lines · Warren Togami
Quoted 2 lines · Seewer Philippe

I don't know if this is really necessary. After all, it just a static conf and initscripts can just check if an interface is already up?

NetworkManager or initscripts perhaps cannot differentiate between checking if it is already up immediately at boot-up or if it is run again sometime later. It is really better for dracut to inform the OS explicitly in a uniform manner similar to if dhcp were used.

Hmm, but in both cases NetworkManager should just preserve this state. So if no dhcp was involved, reading the actual network state (interface and routes) and preserving them, should be preferred.

Quoted 10 lines
Quoted 9 lines

Anyway, the syntax to use on the commandline is ip=... See
http://apps.sourceforge.net/trac/dracut/wiki/commandline for more information.

As for a file format, why not ask the NetworkManager people what they'd like to have?

Quoted 8 lines

Dan, what file format would you prefer?

Warren Togami
[email protected]
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#7 lore raw
In reply to a message not in the archive

Warren Togami wrote:
[snip]

Quoted 1 line

* net.<interface name>.lease is written containing the DHCP lease, because dcbw asked for this for NetworkManager. Your own tools could choose to do something with it or not.

By the way, why not do this:
---

modules.d/40network/ifup +1 -1
index de459c3..8280b73 100755
@@ -70,7 +70,7 @@ do_dhcp() {
    # /sbin/dhclient-script will mark the netif up and generate the online
    # event for nfsroot
    # XXX add -V vendor class and option parsing per kernel
-    dhclient -1 -q -R ${reqs} -pf /tmp/dhclient.$netif.pid -lf /tmp/net.$netif.lease $netif
+    dhclient -1 -q -R ${reqs} -pf /tmp/dhclient.$netif.pid -lf /dev/.initramfs/net.$netif.lease $netif

}

ip_to_var() {

modules.d/99base/init +0 -0
index fb1a604..eab923e 100755
@@ -35,6 +35,7 @@ mknod /dev/null c 1 3

mknod /dev/ptmx c 5 2
mknod /dev/console c 5 1
mkdir /dev/pts
+mkdir /dev/.initramfs/
mount -t devpts -o gid=5,mode=620 /dev/pts /dev/pts >/dev/null 2>&1

# run scriptlets to parse the command line
@@ -139,7 +140,6 @@ for x in "$@"; do
done

# Copy state
-mkdir /dev/.initramfs/
if getarg rdcopystate; then

    cp /tmp/* /dev/.initramfs/ >/dev/null 2>&1

else
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html