Unable to pass Ignition configuration through qemu

333 views
Skip to first unread message

Michael Zedeler

unread,
May 15, 2017, 2:30:09 PM5/15/17
to CoreOS User
I've followed the extremely easy (thanks!) guide to running CoreOS with Qemu here:


But now I'm stuck while trying to pass a configuration to Ignition during boot.

I use ct without any platform flags to transform my YAML file to ignition format:

ct < ignition.yml > config.ign

And then:

./coreos_production_qemu.sh -i config.ign

(Yes - I have validated the configuration with the online validator.)

After the machine has started, I do this to see if it has picked up my configuration:

ssh core@localhost -p2222 journalctl --identifier=ignition --all

Which produces this output:

May 15 14:43:33 localhost ignition[436]: Ignition v0.13.0
May 15 14:43:33 localhost ignition[436]: parsed url from cmdline: ""
May 15 14:43:33 localhost ignition[436]: no config URL provided
May 15 14:43:33 localhost ignition[436]: op(1): [started]  loading QEMU firmware config module
May 15 14:43:33 localhost ignition[436]: op(1): executing: "modprobe" "qemu_fw_cfg"
May 15 14:43:33 localhost ignition[436]: op(1): [finished] loading QEMU firmware config module
May 15 14:43:33 localhost ignition[436]: QEMU firmware config was not found. Ignoring...
May 15 14:43:33 localhost ignition[436]: parsing config:
May 15 14:43:33 localhost ignition[436]: failed to fetch config: not a config (empty)
May 15 14:43:33 localhost ignition[436]: not a config (empty): ignoring user-provided config
May 15 14:43:34 localhost ignition[505]: Ignition v0.13.0
May 15 14:43:34 localhost ignition[505]: parsed url from cmdline: ""
May 15 14:43:34 localhost ignition[505]: no config URL provided
May 15 14:43:34 localhost ignition[505]: op(1): [started]  loading QEMU firmware config module
May 15 14:43:34 localhost ignition[505]: op(1): executing: "modprobe" "qemu_fw_cfg"
May 15 14:43:34 localhost ignition[505]: op(1): [finished] loading QEMU firmware config module
May 15 14:43:34 localhost ignition[505]: QEMU firmware config was not found. Ignoring...
May 15 14:43:34 localhost ignition[505]: parsing config:
May 15 14:43:34 localhost ignition[505]: failed to fetch config: not a config (empty)
May 15 14:43:34 localhost ignition[505]: not a config (empty): ignoring user-provided config

As far as I can see, the firmware config hasn't been set as it should.

I'm currently running Qemu with this version string:

QEMU emulator version 2.5.0 (Debian 1:2.5+dfsg-5ubuntu10.11), Copyright (c) 2003-2008 Fabrice Bellard

I suspect that I may need to upgrade to version 2.9 (it seems that some things regarding the fw_cfg has changed there), but I'd like to know if it is really necessary or if there is anything else I can do.

I'm running Mint 18 and the system is fully up to date.

Any help would be greatly appreciated!

Regards,

Michael.

Alex Crawford

unread,
May 15, 2017, 3:06:52 PM5/15/17
to Michael Zedeler, CoreOS User
On 05/15, Michael Zedeler wrote:
> I suspect that I may need to upgrade to version 2.9 (it seems that some
> things regarding the fw_cfg has changed there), but I'd like to know if it
> is really necessary or if there is anything else I can do.

The version you are using should be fine. You'll want to make sure that
the coreos_production_qemu.sh script you are using has support for
Ignition (does it show up in the help text) and that the firmware device
shows up in the running system (does /sys/firmware/qemu_fw_cfg/ exist).

-Alex
signature.asc

Michael Zedeler

unread,
May 15, 2017, 3:56:42 PM5/15/17
to CoreOS User, michael...@gmail.com
Thanks for your fast reply :-)

I've just verified that the script is up to date (it does mention the -i flag - I just downloaded it today, btw) and checked whether /sys/firmware/qemu_fw_cfg/ exists in the guest OS. This is not the case. There is no such directory.

It seems that I have to enable (recompile the kernel) with this feature on:

https://cateee.net/lkddb/web-lkddb/FW_CFG_SYSFS.html

Is there any easy way to do this? (I used to compile my own kernels some 10 years ago and would really like to not do that again.)

Regards,

Michael.

Alex Crawford

unread,
May 15, 2017, 4:04:27 PM5/15/17
to Michael Zedeler, CoreOS User
That's already enabled:

$ zgrep CONFIG_FW_CFG_SYSFS /proc/config.gz
CONFIG_FW_CFG_SYSFS=m

Which version of Container Linux are you using? I can download that and
try again.

-Alex
signature.asc

Michael Zedeler

unread,
May 15, 2017, 5:20:14 PM5/15/17
to CoreOS User, michael...@gmail.com
Well... it *should* be, but it doesn't seem that it is:
 
/proc/config.gz doesn't exist, but

$ grep CONFIG_FW_CFG_SYSFS  /boot/config-$(uname -r)

Gives me empty output (and it seems to contain lots of configuration options).

My kernel is 4.4 and it seems that the flag is available from 4.6 and onwards.

$ uname -a
Linux laptop 4.4.0-21-generic #37-Ubuntu SMP Mon Apr 18 18:33:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

I've started downloading a newer kernel and will try to install it now.

Thanks again for the fast reply.

Regards,

Michael.

Michael Zedeler

unread,
May 15, 2017, 5:38:28 PM5/15/17
to CoreOS User, michael...@gmail.com
As written before - it seems that the 4.4 kernel doesn't support fw_cfg, so I've upgraded and it seems to be enabled:

$ grep CONFIG_FW_CFG /boot/config-$(uname -r)
CONFIG_FW_CFG_SYSFS=m
# CONFIG_FW_CFG_SYSFS_CMDLINE is not set

So far so good, but it still doesn't work?!

Here is the ignition file:

{
  "ignition": { "version": "2.0.0" },
  "systemd": {
    "units": [{
      "name": "example.service",
      "enable": true,
      "contents": "[Service]\nType=oneshot\nExecStart=/usr/bin/echo Hello World\n\n[Install]\nWantedBy=multi-user.target"
    }]
  }
}

(I had to remove the spaces to get the validator to accept it.)

A strange thing is that I get this on the guest:

$ ls /sys/firmware/
acpi  dmi  memmap

But then:
$ sudo modprobe qemu_fw_cfg
$ ls /sys/firmware/qemu_fw_cfg/
$

The qemu firmware directory shows up, but is empty.

I'm still kind of lost. It is strange because the OS installation is pretty straightforward. I haven't been playing around with custom kernels, drivers or such.

Regards,

Michael.

Alex Crawford

unread,
May 15, 2017, 5:41:30 PM5/15/17
to Michael Zedeler, CoreOS User
On 05/15, Michael Zedeler wrote:
> As written before - it seems that the 4.4 kernel doesn't support fw_cfg, so
> I've upgraded and it seems to be enabled:

Container Linux uses the 4.11.0 kernel. You shouldn't have to worry
about messing with the kernel at all.

Which version of Container Linux are you downloading?

-Alex
signature.asc

Michael Zedeler

unread,
May 16, 2017, 7:19:13 AM5/16/17
to CoreOS User, michael...@gmail.com
I'm using 1353.7.0 which seems to be the latest stable version.

Regards,

Michael.
 

Alex Crawford

unread,
May 16, 2017, 1:14:17 PM5/16/17
to Michael Zedeler, CoreOS User
On 05/16, Michael Zedeler wrote:
> I'm using 1353.7.0 which seems to be the latest stable version.

I don't know what's going on here. I just downloaded that version from
https://stable.release.core-os.net/amd64-usr/current/ and it worked just
fine on my system:

NixOS 17.03.1123.4a7a03913d (Gorilla)
qemu-x86_64 2.8.0

I seem to recall this requiring at least QEMU 2.7, but I cannot find
where I originally got that idea. Can you try upgrading to 2.7?

-Alex
signature.asc

Michael Zedeler

unread,
May 22, 2017, 11:43:37 AM5/22/17
to CoreOS User, michael...@gmail.com
I have upgraded to Ubuntu 17.04 and it is just working out of the box. My version of QEMU is 2.8 now.

I feel pretty sure that it is the upgrade from 2.5 to 2.8 that did the trick.

Regards,

Michael.
Reply all
Reply to author
Forward
0 new messages