* [PATCH] wic: Fix non-existing initrd case
@ 2022-10-16 11:22 Jan Kiszka
2022-10-17 7:49 ` Henning Schild
2022-10-24 10:39 ` Anton Mikanovich
0 siblings, 2 replies; 6+ messages in thread
From: Jan Kiszka @ 2022-10-16 11:22 UTC (permalink / raw)
To: isar-users; +Cc: Henning Schild
From: Jan Kiszka <jan.kiszka@siemens.com>
An initrd is optional, and most callers of isar_get_filenames are taking
this into acount already. Adjust the last one and stop bailing out from
the helper if there is no initrd file.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
meta/scripts/lib/wic/plugins/isarpluginbase.py | 2 +-
.../scripts/lib/wic/plugins/source/bootimg-pcbios-isar.py | 8 +++++---
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/meta/scripts/lib/wic/plugins/isarpluginbase.py b/meta/scripts/lib/wic/plugins/isarpluginbase.py
index 68af2208..99e552e0 100644
--- a/meta/scripts/lib/wic/plugins/isarpluginbase.py
+++ b/meta/scripts/lib/wic/plugins/isarpluginbase.py
@@ -36,6 +36,6 @@ def isar_get_filenames(rootfs_dir):
if not os.path.isfile(os.path.join(rootfs_dir, "boot", kernel)):
raise WicError("kernel %s not found" % (os.path.join(rootfs_dir, "boot", kernel)))
if not os.path.isfile(os.path.join(rootfs_dir, "boot", initrd)):
- raise WicError("initrd %s not found" % (os.path.join(rootfs_dir, "boot", initrd)))
+ initrd = None
return kernel, initrd
diff --git a/meta/scripts/lib/wic/plugins/source/bootimg-pcbios-isar.py b/meta/scripts/lib/wic/plugins/source/bootimg-pcbios-isar.py
index 7fb0f2a8..43f4bec4 100644
--- a/meta/scripts/lib/wic/plugins/source/bootimg-pcbios-isar.py
+++ b/meta/scripts/lib/wic/plugins/source/bootimg-pcbios-isar.py
@@ -141,9 +141,11 @@ class BootimgPcbiosIsarPlugin(SourcePlugin):
syslinux_conf += "APPEND label=boot root=%s %s\n" % \
(creator.rootdev, bootloader.append)
- # we are using an initrd, smuggle it in
- syslinux_conf = syslinux_conf.replace(" root=%s " % (creator.rootdev),
- " root=%s initrd=%s " % (creator.rootdev, initrd))
+ # if we are using an initrd, smuggle it in
+ if initrd:
+ syslinux_conf = syslinux_conf.replace(
+ " root=%s " % (creator.rootdev),
+ " root=%s initrd=%s " % (creator.rootdev, initrd))
logger.debug("Writing syslinux config %s/hdd/boot/syslinux.cfg",
cr_workdir)
--
2.35.3
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] wic: Fix non-existing initrd case
2022-10-16 11:22 [PATCH] wic: Fix non-existing initrd case Jan Kiszka
@ 2022-10-17 7:49 ` Henning Schild
2022-10-17 7:55 ` Jan Kiszka
2022-10-24 10:39 ` Anton Mikanovich
1 sibling, 1 reply; 6+ messages in thread
From: Henning Schild @ 2022-10-17 7:49 UTC (permalink / raw)
To: Jan Kiszka; +Cc: isar-users
Am Sun, 16 Oct 2022 13:22:52 +0200
schrieb Jan Kiszka <jan.kiszka@siemens.com>:
> From: Jan Kiszka <jan.kiszka@siemens.com>
>
> An initrd is optional, and most callers of isar_get_filenames are
> taking this into acount already. Adjust the last one and stop bailing
> out from the helper if there is no initrd file.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
> meta/scripts/lib/wic/plugins/isarpluginbase.py | 2 +-
> .../scripts/lib/wic/plugins/source/bootimg-pcbios-isar.py | 8
> +++++--- 2 files changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/meta/scripts/lib/wic/plugins/isarpluginbase.py
> b/meta/scripts/lib/wic/plugins/isarpluginbase.py index
> 68af2208..99e552e0 100644 ---
> a/meta/scripts/lib/wic/plugins/isarpluginbase.py +++
> b/meta/scripts/lib/wic/plugins/isarpluginbase.py @@ -36,6 +36,6 @@
> def isar_get_filenames(rootfs_dir): if not
> os.path.isfile(os.path.join(rootfs_dir, "boot", kernel)): raise
> WicError("kernel %s not found" % (os.path.join(rootfs_dir, "boot",
> kernel))) if not os.path.isfile(os.path.join(rootfs_dir, "boot",
> initrd)):
> - raise WicError("initrd %s not found" %
> (os.path.join(rootfs_dir, "boot", initrd)))
> + initrd = None
>
> return kernel, initrd
> diff --git
> a/meta/scripts/lib/wic/plugins/source/bootimg-pcbios-isar.py
> b/meta/scripts/lib/wic/plugins/source/bootimg-pcbios-isar.py index
> 7fb0f2a8..43f4bec4 100644 ---
> a/meta/scripts/lib/wic/plugins/source/bootimg-pcbios-isar.py +++
> b/meta/scripts/lib/wic/plugins/source/bootimg-pcbios-isar.py @@
> -141,9 +141,11 @@ class BootimgPcbiosIsarPlugin(SourcePlugin):
> syslinux_conf += "APPEND label=boot root=%s %s\n" % \
> (creator.rootdev, bootloader.append)
> - # we are using an initrd, smuggle it in
> - syslinux_conf = syslinux_conf.replace(" root=%s " %
> (creator.rootdev),
> - " root=%s
> initrd=%s " % (creator.rootdev, initrd))
> + # if we are using an initrd, smuggle it in
> + if initrd:
> + syslinux_conf = syslinux_conf.replace(
> + " root=%s " % (creator.rootdev),
> + " root=%s initrd=%s " % (creator.rootdev,
> initrd))
I did not check but am pretty sure this is forking patch we should
rather get applied in OE first.
Henning
> logger.debug("Writing syslinux config
> %s/hdd/boot/syslinux.cfg", cr_workdir)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] wic: Fix non-existing initrd case
2022-10-17 7:49 ` Henning Schild
@ 2022-10-17 7:55 ` Jan Kiszka
2022-10-17 7:58 ` Jan Kiszka
2022-10-17 8:05 ` Henning Schild
0 siblings, 2 replies; 6+ messages in thread
From: Jan Kiszka @ 2022-10-17 7:55 UTC (permalink / raw)
To: Henning Schild; +Cc: isar-users
On 17.10.22 09:49, Henning Schild wrote:
> Am Sun, 16 Oct 2022 13:22:52 +0200
> schrieb Jan Kiszka <jan.kiszka@siemens.com>:
>
>> From: Jan Kiszka <jan.kiszka@siemens.com>
>>
>> An initrd is optional, and most callers of isar_get_filenames are
>> taking this into acount already. Adjust the last one and stop bailing
>> out from the helper if there is no initrd file.
>>
>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
>> ---
>> meta/scripts/lib/wic/plugins/isarpluginbase.py | 2 +-
>> .../scripts/lib/wic/plugins/source/bootimg-pcbios-isar.py | 8
>> +++++--- 2 files changed, 6 insertions(+), 4 deletions(-)
>>
>> diff --git a/meta/scripts/lib/wic/plugins/isarpluginbase.py
>> b/meta/scripts/lib/wic/plugins/isarpluginbase.py index
>> 68af2208..99e552e0 100644 ---
>> a/meta/scripts/lib/wic/plugins/isarpluginbase.py +++
>> b/meta/scripts/lib/wic/plugins/isarpluginbase.py @@ -36,6 +36,6 @@
>> def isar_get_filenames(rootfs_dir): if not
>> os.path.isfile(os.path.join(rootfs_dir, "boot", kernel)): raise
>> WicError("kernel %s not found" % (os.path.join(rootfs_dir, "boot",
>> kernel))) if not os.path.isfile(os.path.join(rootfs_dir, "boot",
>> initrd)):
>> - raise WicError("initrd %s not found" %
>> (os.path.join(rootfs_dir, "boot", initrd)))
>> + initrd = None
>>
>> return kernel, initrd
>> diff --git
>> a/meta/scripts/lib/wic/plugins/source/bootimg-pcbios-isar.py
>> b/meta/scripts/lib/wic/plugins/source/bootimg-pcbios-isar.py index
>> 7fb0f2a8..43f4bec4 100644 ---
>> a/meta/scripts/lib/wic/plugins/source/bootimg-pcbios-isar.py +++
>> b/meta/scripts/lib/wic/plugins/source/bootimg-pcbios-isar.py @@
>> -141,9 +141,11 @@ class BootimgPcbiosIsarPlugin(SourcePlugin):
>> syslinux_conf += "APPEND label=boot root=%s %s\n" % \
>> (creator.rootdev, bootloader.append)
>> - # we are using an initrd, smuggle it in
>> - syslinux_conf = syslinux_conf.replace(" root=%s " %
>> (creator.rootdev),
>> - " root=%s
>> initrd=%s " % (creator.rootdev, initrd))
>> + # if we are using an initrd, smuggle it in
>> + if initrd:
>> + syslinux_conf = syslinux_conf.replace(
>> + " root=%s " % (creator.rootdev),
>> + " root=%s initrd=%s " % (creator.rootdev,
>> initrd))
>
> I did not check but am pretty sure this is forking patch we should
> rather get applied in OE first.
>
Forking -isar in OE core??? Hard to believe ;)
Jan
--
Siemens AG, Technology
Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] wic: Fix non-existing initrd case
2022-10-17 7:55 ` Jan Kiszka
@ 2022-10-17 7:58 ` Jan Kiszka
2022-10-17 8:05 ` Henning Schild
1 sibling, 0 replies; 6+ messages in thread
From: Jan Kiszka @ 2022-10-17 7:58 UTC (permalink / raw)
To: Henning Schild; +Cc: isar-users
On 17.10.22 09:55, Jan Kiszka wrote:
> On 17.10.22 09:49, Henning Schild wrote:
>> Am Sun, 16 Oct 2022 13:22:52 +0200
>> schrieb Jan Kiszka <jan.kiszka@siemens.com>:
>>
>>> From: Jan Kiszka <jan.kiszka@siemens.com>
>>>
>>> An initrd is optional, and most callers of isar_get_filenames are
>>> taking this into acount already. Adjust the last one and stop bailing
>>> out from the helper if there is no initrd file.
>>>
>>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
>>> ---
>>> meta/scripts/lib/wic/plugins/isarpluginbase.py | 2 +-
>>> .../scripts/lib/wic/plugins/source/bootimg-pcbios-isar.py | 8
>>> +++++--- 2 files changed, 6 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/meta/scripts/lib/wic/plugins/isarpluginbase.py
>>> b/meta/scripts/lib/wic/plugins/isarpluginbase.py index
>>> 68af2208..99e552e0 100644 ---
>>> a/meta/scripts/lib/wic/plugins/isarpluginbase.py +++
>>> b/meta/scripts/lib/wic/plugins/isarpluginbase.py @@ -36,6 +36,6 @@
>>> def isar_get_filenames(rootfs_dir): if not
>>> os.path.isfile(os.path.join(rootfs_dir, "boot", kernel)): raise
>>> WicError("kernel %s not found" % (os.path.join(rootfs_dir, "boot",
>>> kernel))) if not os.path.isfile(os.path.join(rootfs_dir, "boot",
>>> initrd)):
>>> - raise WicError("initrd %s not found" %
>>> (os.path.join(rootfs_dir, "boot", initrd)))
>>> + initrd = None
>>>
>>> return kernel, initrd
>>> diff --git
>>> a/meta/scripts/lib/wic/plugins/source/bootimg-pcbios-isar.py
>>> b/meta/scripts/lib/wic/plugins/source/bootimg-pcbios-isar.py index
>>> 7fb0f2a8..43f4bec4 100644 ---
>>> a/meta/scripts/lib/wic/plugins/source/bootimg-pcbios-isar.py +++
>>> b/meta/scripts/lib/wic/plugins/source/bootimg-pcbios-isar.py @@
>>> -141,9 +141,11 @@ class BootimgPcbiosIsarPlugin(SourcePlugin):
>>> syslinux_conf += "APPEND label=boot root=%s %s\n" % \
>>> (creator.rootdev, bootloader.append)
>>> - # we are using an initrd, smuggle it in
>>> - syslinux_conf = syslinux_conf.replace(" root=%s " %
>>> (creator.rootdev),
>>> - " root=%s
>>> initrd=%s " % (creator.rootdev, initrd))
>>> + # if we are using an initrd, smuggle it in
>>> + if initrd:
>>> + syslinux_conf = syslinux_conf.replace(
>>> + " root=%s " % (creator.rootdev),
>>> + " root=%s initrd=%s " % (creator.rootdev,
>>> initrd))
>>
>> I did not check but am pretty sure this is forking patch we should
>> rather get applied in OE first.
>>
>
> Forking -isar in OE core??? Hard to believe ;)
>
And if your concern was
oe-core/scripts/lib/wic/plugins/source/bootimg-pcbios.py: It does not
have initrd support at all.
Jan
--
Siemens AG, Technology
Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] wic: Fix non-existing initrd case
2022-10-17 7:55 ` Jan Kiszka
2022-10-17 7:58 ` Jan Kiszka
@ 2022-10-17 8:05 ` Henning Schild
1 sibling, 0 replies; 6+ messages in thread
From: Henning Schild @ 2022-10-17 8:05 UTC (permalink / raw)
To: Jan Kiszka; +Cc: isar-users
Am Mon, 17 Oct 2022 09:55:36 +0200
schrieb Jan Kiszka <jan.kiszka@siemens.com>:
> On 17.10.22 09:49, Henning Schild wrote:
> > Am Sun, 16 Oct 2022 13:22:52 +0200
> > schrieb Jan Kiszka <jan.kiszka@siemens.com>:
> >
> >> From: Jan Kiszka <jan.kiszka@siemens.com>
> >>
> >> An initrd is optional, and most callers of isar_get_filenames are
> >> taking this into acount already. Adjust the last one and stop
> >> bailing out from the helper if there is no initrd file.
> >>
> >> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> >> ---
> >> meta/scripts/lib/wic/plugins/isarpluginbase.py | 2 +-
> >> .../scripts/lib/wic/plugins/source/bootimg-pcbios-isar.py | 8
> >> +++++--- 2 files changed, 6 insertions(+), 4 deletions(-)
> >>
> >> diff --git a/meta/scripts/lib/wic/plugins/isarpluginbase.py
> >> b/meta/scripts/lib/wic/plugins/isarpluginbase.py index
> >> 68af2208..99e552e0 100644 ---
> >> a/meta/scripts/lib/wic/plugins/isarpluginbase.py +++
> >> b/meta/scripts/lib/wic/plugins/isarpluginbase.py @@ -36,6 +36,6 @@
> >> def isar_get_filenames(rootfs_dir): if not
> >> os.path.isfile(os.path.join(rootfs_dir, "boot", kernel)): raise
> >> WicError("kernel %s not found" % (os.path.join(rootfs_dir, "boot",
> >> kernel))) if not os.path.isfile(os.path.join(rootfs_dir, "boot",
> >> initrd)):
> >> - raise WicError("initrd %s not found" %
> >> (os.path.join(rootfs_dir, "boot", initrd)))
> >> + initrd = None
> >>
> >> return kernel, initrd
> >> diff --git
> >> a/meta/scripts/lib/wic/plugins/source/bootimg-pcbios-isar.py
> >> b/meta/scripts/lib/wic/plugins/source/bootimg-pcbios-isar.py index
> >> 7fb0f2a8..43f4bec4 100644 ---
> >> a/meta/scripts/lib/wic/plugins/source/bootimg-pcbios-isar.py +++
> >> b/meta/scripts/lib/wic/plugins/source/bootimg-pcbios-isar.py @@
> >> -141,9 +141,11 @@ class BootimgPcbiosIsarPlugin(SourcePlugin):
> >> syslinux_conf += "APPEND label=boot root=%s %s\n" % \
> >> (creator.rootdev, bootloader.append)
> >> - # we are using an initrd, smuggle it in
> >> - syslinux_conf = syslinux_conf.replace(" root=%s " %
> >> (creator.rootdev),
> >> - " root=%s
> >> initrd=%s " % (creator.rootdev, initrd))
> >> + # if we are using an initrd, smuggle it in
> >> + if initrd:
> >> + syslinux_conf = syslinux_conf.replace(
> >> + " root=%s " % (creator.rootdev),
> >> + " root=%s initrd=%s " % (creator.rootdev,
> >> initrd))
> >
> > I did not check but am pretty sure this is forking patch we should
> > rather get applied in OE first.
> >
>
> Forking -isar in OE core??? Hard to believe ;)
The -isar files contain _minimal_ changes specific to Isar only. Every
change on them should be questioned carefully of whether it is
Isar-only.
The lines you touch are in fact Isar-only, so it is OK.
diff -Nru scripts/lib/wic/plugins/source/bootimg-pcbios.py
meta/scripts/lib/wic/plugins/source/bootimg-pcbios-isar.py
d7c435d27acb9
Henning
> Jan
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] wic: Fix non-existing initrd case
2022-10-16 11:22 [PATCH] wic: Fix non-existing initrd case Jan Kiszka
2022-10-17 7:49 ` Henning Schild
@ 2022-10-24 10:39 ` Anton Mikanovich
1 sibling, 0 replies; 6+ messages in thread
From: Anton Mikanovich @ 2022-10-24 10:39 UTC (permalink / raw)
To: Jan Kiszka, isar-users; +Cc: Henning Schild
16.10.2022 14:22, Jan Kiszka wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
>
> An initrd is optional, and most callers of isar_get_filenames are taking
> this into acount already. Adjust the last one and stop bailing out from
> the helper if there is no initrd file.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Applied to next, thanks.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-10-24 10:39 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-16 11:22 [PATCH] wic: Fix non-existing initrd case Jan Kiszka
2022-10-17 7:49 ` Henning Schild
2022-10-17 7:55 ` Jan Kiszka
2022-10-17 7:58 ` Jan Kiszka
2022-10-17 8:05 ` Henning Schild
2022-10-24 10:39 ` Anton Mikanovich
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox