* [PATCH 1/3] isoimage-isohybrid: Fix creating initrd.cpio
@ 2018-08-27 14:31 Alexandru Vasiu
2018-08-27 14:31 ` [PATCH 2/3] isoimage-isohybrid: Fix variable names Alexandru Vasiu
2018-08-27 14:31 ` [PATCH 3/3] image_types_wic: Add variable WIC_EXTENSION Alexandru Vasiu
0 siblings, 2 replies; 5+ messages in thread
From: Alexandru Vasiu @ 2018-08-27 14:31 UTC (permalink / raw)
To: openembedded-core
Only bsdcpio works with numbers for option -R to specify user:group,
while GNU cpio doesn't. Debian use GNU cpio so without this change,
you cannot create ISO images without installing bsdcpio.
Signed-off-by: Alexandru Vasiu <alexandru.vasiu@ni.com>
---
scripts/lib/wic/plugins/source/isoimage-isohybrid.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
index 0d4f50d1f7..4a0a57ef9e 100644
--- a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
+++ b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
@@ -191,7 +191,7 @@ class IsoImagePlugin(SourcePlugin):
else:
raise WicError("Couldn't find or build initrd, exiting.")
- exec_cmd("cd %s && find . | cpio -o -H newc -R +0:+0 >./initrd.cpio " \
+ exec_cmd("cd %s && find . | cpio -o -H newc -R root:root >./initrd.cpio " \
% initrd_dir, as_shell=True)
exec_cmd("gzip -f -9 -c %s/initrd.cpio > %s" \
% (cr_workdir, initrd), as_shell=True)
--
2.18.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/3] isoimage-isohybrid: Fix variable names
2018-08-27 14:31 [PATCH 1/3] isoimage-isohybrid: Fix creating initrd.cpio Alexandru Vasiu
@ 2018-08-27 14:31 ` Alexandru Vasiu
2018-08-27 14:31 ` [PATCH 3/3] image_types_wic: Add variable WIC_EXTENSION Alexandru Vasiu
1 sibling, 0 replies; 5+ messages in thread
From: Alexandru Vasiu @ 2018-08-27 14:31 UTC (permalink / raw)
To: openembedded-core
initrd.cpio is created in initrd_dir, not in cr_workdir. Gzip will
let initrd.cpio uncompressed if the path is not found.
Also, grub_image variable doesn't exist, grub_src_image should
be used instead.
Signed-off-by: Alexandru Vasiu <alexandru.vasiu@ni.com>
---
scripts/lib/wic/plugins/source/isoimage-isohybrid.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
index 4a0a57ef9e..25a695da17 100644
--- a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
+++ b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
@@ -194,7 +194,7 @@ class IsoImagePlugin(SourcePlugin):
exec_cmd("cd %s && find . | cpio -o -H newc -R root:root >./initrd.cpio " \
% initrd_dir, as_shell=True)
exec_cmd("gzip -f -9 -c %s/initrd.cpio > %s" \
- % (cr_workdir, initrd), as_shell=True)
+ % (initrd_dir, initrd), as_shell=True)
shutil.rmtree(initrd_dir)
return initrd
@@ -317,7 +317,7 @@ class IsoImagePlugin(SourcePlugin):
grub_src = os.path.join(deploy_dir, grub_src_image)
if not os.path.exists(grub_src):
raise WicError("Grub loader %s is not found in %s. "
- "Please build grub-efi first" % (grub_image, deploy_dir))
+ "Please build grub-efi first" % (grub_src_image, deploy_dir))
shutil.copy(grub_src, grub_target)
if not os.path.isfile(os.path.join(target_dir, "boot.cfg")):
--
2.18.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/3] image_types_wic: Add variable WIC_EXTENSION
2018-08-27 14:31 [PATCH 1/3] isoimage-isohybrid: Fix creating initrd.cpio Alexandru Vasiu
2018-08-27 14:31 ` [PATCH 2/3] isoimage-isohybrid: Fix variable names Alexandru Vasiu
@ 2018-08-27 14:31 ` Alexandru Vasiu
2018-08-27 23:00 ` Richard Purdie
1 sibling, 1 reply; 5+ messages in thread
From: Alexandru Vasiu @ 2018-08-27 14:31 UTC (permalink / raw)
To: openembedded-core
Used to specify what extention will have the image file which
is created using wic. The default value is wic. For creating an
ISO image, WIC_EXTENSION will be iso.
Signed-off-by: Alexandru Vasiu <alexandru.vasiu@ni.com>
---
meta/classes/image.bbclass | 2 ++
meta/classes/image_types_wic.bbclass | 3 ++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 024d2d4c96..c6833a6770 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -607,6 +607,8 @@ python create_symlinks() {
if not link_name:
return
for type in subimages:
+ if type == 'wic':
+ type = d.getVar('WIC_EXTENSION')
dst = os.path.join(deploy_dir, link_name + "." + type)
src = img_name + imgsuffix + type
if os.path.exists(os.path.join(deploy_dir, src)):
diff --git a/meta/classes/image_types_wic.bbclass b/meta/classes/image_types_wic.bbclass
index 5b40a9e919..77cde5763c 100644
--- a/meta/classes/image_types_wic.bbclass
+++ b/meta/classes/image_types_wic.bbclass
@@ -9,6 +9,7 @@ WKS_FILE ??= "${IMAGE_BASENAME}.${MACHINE}.wks"
WKS_FILES ?= "${WKS_FILE} ${IMAGE_BASENAME}.wks"
WKS_SEARCH_PATH ?= "${THISDIR}:${@':'.join('%s/wic' % p for p in '${BBPATH}'.split(':'))}:${@':'.join('%s/scripts/lib/wic/canned-wks' % l for l in '${BBPATH}:${COREBASE}'.split(':'))}"
WKS_FULL_PATH = "${@wks_search(d.getVar('WKS_FILES').split(), d.getVar('WKS_SEARCH_PATH')) or ''}"
+WIC_EXTENSION ??= "wic"
def wks_search(files, search_path):
for f in files:
@@ -30,7 +31,7 @@ IMAGE_CMD_wic () {
fi
BUILDDIR="${TOPDIR}" wic create "$wks" --vars "${STAGING_DIR}/${MACHINE}/imgdata/" -e "${IMAGE_BASENAME}" -o "$out/" ${WIC_CREATE_EXTRA_ARGS}
- mv "$out/$(basename "${wks%.wks}")"*.direct "$out${IMAGE_NAME_SUFFIX}.wic"
+ mv "$out/$(basename "${wks%.wks}")"*.direct "$out${IMAGE_NAME_SUFFIX}.${WIC_EXTENSION}"
rm -rf "$out/"
}
IMAGE_CMD_wic[vardepsexclude] = "WKS_FULL_PATH WKS_FILES TOPDIR"
--
2.18.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 3/3] image_types_wic: Add variable WIC_EXTENSION
2018-08-27 14:31 ` [PATCH 3/3] image_types_wic: Add variable WIC_EXTENSION Alexandru Vasiu
@ 2018-08-27 23:00 ` Richard Purdie
2018-08-28 9:17 ` Ioan-Adrian Ratiu
0 siblings, 1 reply; 5+ messages in thread
From: Richard Purdie @ 2018-08-27 23:00 UTC (permalink / raw)
To: Alexandru Vasiu, openembedded-core
On Mon, 2018-08-27 at 17:31 +0300, Alexandru Vasiu wrote:
> Used to specify what extention will have the image file which
> is created using wic. The default value is wic. For creating an
> ISO image, WIC_EXTENSION will be iso.
>
> Signed-off-by: Alexandru Vasiu <alexandru.vasiu@ni.com>
> ---
> meta/classes/image.bbclass | 2 ++
> meta/classes/image_types_wic.bbclass | 3 ++-
> 2 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
> index 024d2d4c96..c6833a6770 100644
> --- a/meta/classes/image.bbclass
> +++ b/meta/classes/image.bbclass
> @@ -607,6 +607,8 @@ python create_symlinks() {
> if not link_name:
> return
> for type in subimages:
> + if type == 'wic':
> + type = d.getVar('WIC_EXTENSION')
> dst = os.path.join(deploy_dir, link_name + "." + type)
> src = img_name + imgsuffix + type
> if os.path.exists(os.path.join(deploy_dir, src)):
This is hardcoding an image type specific issue into common code. I
really want to avoid doing that.
In the past I started the process of trying to untangle the spaghetti
we had in image.bbclass and abstract it into common building blocks.
The hope was to eventually have proper APIs around this.
I never really got back to do further rounds of cleanup/improvement to
get to that goal but the more image type specific pieces we add back
in, the harder it will make those goals and the less maintainable the
coed will become.
So is there some other way we can handle this. It looks like we don't
even use this iso mode in OE-Core which is bad from a testing
perspective too? I don't see WIC_EXTENSION being set to iso anywhere?
Cheers,
Richard
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 3/3] image_types_wic: Add variable WIC_EXTENSION
2018-08-27 23:00 ` Richard Purdie
@ 2018-08-28 9:17 ` Ioan-Adrian Ratiu
0 siblings, 0 replies; 5+ messages in thread
From: Ioan-Adrian Ratiu @ 2018-08-28 9:17 UTC (permalink / raw)
To: Richard Purdie, Alexandru Vasiu, openembedded-core
On Tue, 28 Aug 2018, Richard Purdie <richard.purdie@linuxfoundation.org> wrote:
> On Mon, 2018-08-27 at 17:31 +0300, Alexandru Vasiu wrote:
>> Used to specify what extention will have the image file which
>> is created using wic. The default value is wic. For creating an
>> ISO image, WIC_EXTENSION will be iso.
>>
>> Signed-off-by: Alexandru Vasiu <alexandru.vasiu@ni.com>
>> ---
>> meta/classes/image.bbclass | 2 ++
>> meta/classes/image_types_wic.bbclass | 3 ++-
>> 2 files changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
>> index 024d2d4c96..c6833a6770 100644
>> --- a/meta/classes/image.bbclass
>> +++ b/meta/classes/image.bbclass
>> @@ -607,6 +607,8 @@ python create_symlinks() {
>> if not link_name:
>> return
>> for type in subimages:
>> + if type == 'wic':
>> + type = d.getVar('WIC_EXTENSION')
>> dst = os.path.join(deploy_dir, link_name + "." + type)
>> src = img_name + imgsuffix + type
>> if os.path.exists(os.path.join(deploy_dir, src)):
>
> This is hardcoding an image type specific issue into common code. I
> really want to avoid doing that.
>
> In the past I started the process of trying to untangle the spaghetti
> we had in image.bbclass and abstract it into common building blocks.
> The hope was to eventually have proper APIs around this.
>
> I never really got back to do further rounds of cleanup/improvement to
> get to that goal but the more image type specific pieces we add back
> in, the harder it will make those goals and the less maintainable the
> coed will become.
>
> So is there some other way we can handle this. It looks like we don't
> even use this iso mode in OE-Core which is bad from a testing
> perspective too? I don't see WIC_EXTENSION being set to iso anywhere?
Our problem is this: all WIC images built & symlinked under
${DEPLOY_DIR_IMAGE} have the extension .wic, including the iso's.
We want our build pipeline to output an iso directly after issuing
"bitbake <image>" by adding IMAGE_FSTYPES += "wic" and having an
<image>.<machine>.wks which speficfies the isoimage-isohybrid plugin.
I agree this solution is hacky. An alternative would be to just rename
the image .wic extension to .iso in our piepline outside bitbake and be
done with it.
How about adding an IMAGE_FSTYPES += "iso" and creating the associated
logic/bbclasses? Is that amount of code justified to have .iso
extensions to wic-built images or are we better of just renaming .wic
to .iso?
>
> Cheers,
>
> Richard
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.openembedded.org_mailman_listinfo_openembedded-2Dcore&d=DwICAg&c=I_0YwoKy7z5LMTVdyO6YCiE2uzI1jjZZuIPelcSjixA&r=fzwh7IUt7VYYiD6094geII0kSDP3DkEnN0B8zB62AxE&m=TX1s2gOuF5JVPXLJ60USSIym1ujQ2VDP00KcC-1c-_c&s=pYCCOX_mHEmd8jE8DN3zmrnoYuL35Wz_sA2MuuYDNrw&e=
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-08-28 9:16 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-27 14:31 [PATCH 1/3] isoimage-isohybrid: Fix creating initrd.cpio Alexandru Vasiu
2018-08-27 14:31 ` [PATCH 2/3] isoimage-isohybrid: Fix variable names Alexandru Vasiu
2018-08-27 14:31 ` [PATCH 3/3] image_types_wic: Add variable WIC_EXTENSION Alexandru Vasiu
2018-08-27 23:00 ` Richard Purdie
2018-08-28 9:17 ` Ioan-Adrian Ratiu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox