* [PATCH] runqemu: avoid overridden user input for bootparams
@ 2017-02-21 15:18 Dmitry Rozhkov
2017-02-28 10:52 ` Patrick Ohly
0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Rozhkov @ 2017-02-21 15:18 UTC (permalink / raw)
To: openembedded-core
Currently runqemu hardcodes the "ip=" kernel boot parameter
when configuring QEMU to use tap or slirp networking. This makes
the guest system to have a network interface pre-configured
by kernel and causes systemd to fail renaming the interface
to whatever pleases it:
Feb 21 10:10:20 intel-corei7-64 systemd-udevd[201]: Error changing
net interface name 'eth0' to 'enp0s3': Device or resource busy,
Always append user input for kernel boot params after the ones
added by the script. This way user input has priority over runqemu's
default params.
Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
---
scripts/runqemu | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/scripts/runqemu b/scripts/runqemu
index d74f252..8899cbb 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -180,6 +180,7 @@ class BaseConfig(object):
self.kernel = ''
self.kernel_cmdline = ''
self.kernel_cmdline_script = ''
+ self.bootparams = ''
self.dtb = ''
self.fstype = ''
self.kvm_enabled = False
@@ -400,7 +401,7 @@ class BaseConfig(object):
elif arg.startswith('qemuparams='):
self.qemu_opt_script += ' %s' % arg[len('qemuparams='):]
elif arg.startswith('bootparams='):
- self.kernel_cmdline_script += ' %s' % arg[len('bootparams='):]
+ self.bootparams = arg[len('bootparams='):]
elif os.path.exists(arg) or (re.search(':', arg) and re.search('/', arg)):
self.check_arg_path(os.path.abspath(arg))
elif re.search('-image-', arg):
@@ -1040,7 +1041,9 @@ class BaseConfig(object):
def start_qemu(self):
if self.kernel:
- kernel_opts = "-kernel %s -append '%s %s %s'" % (self.kernel, self.kernel_cmdline, self.kernel_cmdline_script, self.get('QB_KERNEL_CMDLINE_APPEND'))
+ kernel_opts = "-kernel %s -append '%s %s %s %s'" % (self.kernel, self.kernel_cmdline,
+ self.kernel_cmdline_script, self.get('QB_KERNEL_CMDLINE_APPEND'),
+ self.bootparams)
if self.dtb:
kernel_opts += " -dtb %s" % self.dtb
else:
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] runqemu: avoid overridden user input for bootparams
2017-02-21 15:18 [PATCH] runqemu: avoid overridden user input for bootparams Dmitry Rozhkov
@ 2017-02-28 10:52 ` Patrick Ohly
2017-02-28 11:44 ` Dmitry Rozhkov
0 siblings, 1 reply; 3+ messages in thread
From: Patrick Ohly @ 2017-02-28 10:52 UTC (permalink / raw)
To: Dmitry Rozhkov; +Cc: openembedded-core
On Tue, 2017-02-21 at 17:18 +0200, Dmitry Rozhkov wrote:
> Currently runqemu hardcodes the "ip=" kernel boot parameter
> when configuring QEMU to use tap or slirp networking. This makes
> the guest system to have a network interface pre-configured
> by kernel and causes systemd to fail renaming the interface
> to whatever pleases it:
>
> Feb 21 10:10:20 intel-corei7-64 systemd-udevd[201]: Error changing
> net interface name 'eth0' to 'enp0s3': Device or resource busy,
>
> Always append user input for kernel boot params after the ones
> added by the script. This way user input has priority over runqemu's
> default params.
Presumably the user's bootparams then would include "ip="?
Either way, the change looks good to me. I did something similar for the
qemu parameters in "runqemu: let command line parameters override
defaults".
--
Best Regards, Patrick Ohly
The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] runqemu: avoid overridden user input for bootparams
2017-02-28 10:52 ` Patrick Ohly
@ 2017-02-28 11:44 ` Dmitry Rozhkov
0 siblings, 0 replies; 3+ messages in thread
From: Dmitry Rozhkov @ 2017-02-28 11:44 UTC (permalink / raw)
To: Patrick Ohly; +Cc: openembedded-core
On Tue, 2017-02-28 at 11:52 +0100, Patrick Ohly wrote:
> On Tue, 2017-02-21 at 17:18 +0200, Dmitry Rozhkov wrote:
> >
> > Currently runqemu hardcodes the "ip=" kernel boot parameter
> > when configuring QEMU to use tap or slirp networking. This makes
> > the guest system to have a network interface pre-configured
> > by kernel and causes systemd to fail renaming the interface
> > to whatever pleases it:
> >
> > Feb 21 10:10:20 intel-corei7-64 systemd-udevd[201]: Error
> > changing
> > net interface name 'eth0' to 'enp0s3': Device or resource
> > busy,
> >
> > Always append user input for kernel boot params after the ones
> > added by the script. This way user input has priority over
> > runqemu's
> > default params.
>
> Presumably the user's bootparams then would include "ip="?
Yes, exactly that. "ip=" in the user's bootparams is the input that
shouldn't be ignored.
> Either way, the change looks good to me. I did something similar for
> the
> qemu parameters in "runqemu: let command line parameters override
> defaults".
>
BR,
Dmitry
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-02-28 11:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-21 15:18 [PATCH] runqemu: avoid overridden user input for bootparams Dmitry Rozhkov
2017-02-28 10:52 ` Patrick Ohly
2017-02-28 11:44 ` Dmitry Rozhkov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox