Commit Graph

12 Commits

Author SHA1 Message Date
James Slagle
8d910d10f8 Wait for tgtd socket to be available
tgtd returns execution control and backgrounds itself almost immediately
and before it has made it's listening socket available. This can cause a
race condition as the tgtd socket is not available when tgtadm is run,
resulting in an error:

failed to send request hdr to tgt daemon

Add a function to check if the socket is available before moving on to
calling tgtadm, and a wait_for helper function we can use.  We'll
check for the socket every 0.5 seconds, for up to 5 seconds.

I'm seeing this issue on almost every deploy using a ramdisk built from
Fedora 20. I'm not sure if something has changed in tgtd, but this
behavior is documented since Fedora 18 at least. In the systemd script
for tgtd, there is actually "sleep 5" to work around the problem.

See Also: https://bugzilla.redhat.com/show_bug.cgi?id=848942

Change-Id: Iffa9fc63393309ca653d592dff17316ecbea3e09
2014-01-14 12:53:03 -05:00
James Slagle
6b220a044f Default name for ramdisks to image.
If you build a ramdisk with ramdisk-image-create and forget to specify
-o, you end up with a .kernel and .initramfs file as the image outputs.
This commit defaults the $IMAGE_NAME value to image so you'd end up
with image.kernel and image.initramfs

Change-Id: I10f3ac9ad178c32119523e4da930070e3ade4f73
2013-12-04 15:31:46 -05:00
Chris Jones
09eb230ea3 Detect udevd version and behave accordingly.
We can no longer rely on the name of the udevd binary as a hint for its
version, so instead we query the binary and behave accordingly.

Change-Id: Id4c869dfeeca5ed970169343b6b5f0f2c4499ca3
2013-11-20 11:13:06 +00:00
Chris Jones
f093d4d38d Fix troubleshooting override.
We can now actually override the $TROUBLESHOOT environment variable in
ramdisks, by not declaring it as readonly. Yay for insufficient
end-to-end testing.

Change-Id: I026c9dbdd411bf3eb945d5b18188eb1eedf3850a
2013-11-19 11:25:58 +00:00
Chris Jones
a19d8ceee7 Document ramdisk troubleshooting.
We now document how to trigger a troubleshooting shell when booting a
di-b ramdisk.

Change-Id: Ief44347893fa81a7f2669143e1746a5ee99599af
2013-11-18 19:45:59 +00:00
Jenkins
45a0082fa7 Merge "Add troubleshooting override to deploy ramdisk." 2013-11-18 19:08:45 +00:00
Chris Jones
1f328087d9 Add troubleshooting override to deploy ramdisk.
We now allow operators to drop into a troubleshooting shell while
booting a deploy ramdisk, without having to have pre-configured their
desire to do so ahead of time, by means of a 10 second pause for them to
press a key.

Change-Id: I05ffa1ebaa95c83dee7bd2a2f52ba4c08928bb10
2013-11-18 17:22:26 +00:00
Jenkins
6f7eae51b2 Merge "Split network bringup out of base ramdisk init." 2013-11-18 11:38:43 +00:00
Victor Lowther
43b70ce224 /bin/bash all the things.
Since we are using bash syntax in some of the element fragments,
we should make sure we use bash for all of them, so that things don't
break on systems where /bin/sh != /bin/bash.

Change-Id: If2f043c57aa4e1492b7f9839213ef6123f683612
2013-11-17 16:59:31 -06:00
Chris Jones
c9f432d45b Split network bringup out of base ramdisk init.
We now run the network bringup portion of the ramdisk init from an
init.d script, thus allowing image builders to inject code into the init
script before that point (e.g. configure network hardware).
The environment variables used by the network bringup code are retained
in the base init script so they can be overridden by init.d fragments.

Change-Id: I1ef0bb21e7f26c0ff3f02266f853ce5402bcb94d
Closes-Bug: #1252023
2013-11-17 20:37:26 +00:00
Jan Provaznik
f6f4e808d1 Remove BUSYBOX variable from ramdisk-defaults
ramdisk-defaults file is sourced before chroot to an image being created
is executed. Busybox path should be set inside chroot instead.

Change-Id: Ic0e1d3093ca9d489dd96b14157e93b336cf0baee
2013-11-11 14:36:15 +01:00
Chris Jones
8d1ce9c0c3 Build ramdisks in an image chroot.
Ramdisks are now built inside a chroot which is built by the normal
image build process. Doing so improves our independence of the
precise state of the build host.

This fixes bug 1194055.

Change-Id: Ibc254fbb9e7b404b5f38c1b35bcde8a4136e8e28
2013-07-12 11:09:35 +01:00