Skip to contentSkip to conversation

Clean up some do_image_wic redundant code

PATCH In review [email protected] 2 participants 10 messages Aug 1, 2017 – Aug 2, 2017

lore
Share & tools
lore
#0 lore raw

cover Clean up some do_image_wic redundant code

From: Ming Liu <[email protected]>

Ming Liu (4):
wic-image-minimal: drop WKS_FILE_DEPENDS definition image_types_wic.bbclass: deal with dependencies only with
WKS_FILE_DEPENDS_DEFAULT
qemux86.conf: drop do_image_wic task dependencies qemux86-64.conf: drop do_image_wic task dependencies

 meta-selftest/recipes-test/images/wic-image-minimal.bb | 2 --
 meta/classes/image_types_wic.bbclass                   | 3 +--
 meta/conf/machine/qemux86-64.conf                      | 1 -
 meta/conf/machine/qemux86.conf                         | 1 -
 4 files changed, 1 insertion(+), 6 deletions(-)
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/4 wic-image-minimal: drop WKS_FILE_DEPENDS definition

From: Ming Liu <[email protected]>

It's being set in image_types_wic.bbclass, not need to double set it here, furthermore, the dependencies are incomplete by missing e2fsprogs-native.

---
 meta-selftest/recipes-test/images/wic-image-minimal.bb | 2 --
 1 file changed, 2 deletions(-)
meta-selftest/recipes-test/images/wic-image-minimal.bb +0 -2
index e1da203..af40d96 100644
@@ -6,8 +6,6 @@ IMAGE_INSTALL = "packagegroup-core-boot"
 
 IMAGE_FSTYPES = "wic"
 
-WKS_FILE_DEPENDS = "syslinux syslinux-native dosfstools-native mtools-native gptfdisk-native"
-
 LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
 
 IMAGE_ROOTFS_EXTRA_SPACE = "2000"
Signature · 1 line
2.7.4
#2 lore raw

Re: [PATCH 1/4] wic-image-minimal: drop WKS_FILE_DEPENDS definition

Quoted 16 lines · On Tue, Aug 01, 2017 at 07:13:47PM +0200, [email protected] wrote:

From: Ming Liu <[email protected]>

It's being set in image_types_wic.bbclass, not need to double set it here, furthermore, the dependencies are incomplete by missing e2fsprogs-native.

---
 meta-selftest/recipes-test/images/wic-image-minimal.bb | 2 --
 1 file changed, 2 deletions(-)
meta-selftest/recipes-test/images/wic-image-minimal.bb +0 -0
index e1da203..af40d96 100644

meta-selftest/recipes-test/images/wic-image-minimal.bb IMAGE_INSTALL = "packagegroup-core-boot" · line 11

Quoted 8 lines
meta-selftest/recipes-test/images/wic-image-minimal.bb +0 -2
@@ -6,8 +6,6 @@ IMAGE_INSTALL = "packagegroup-core-boot"
 
 IMAGE_FSTYPES = "wic"
 
-WKS_FILE_DEPENDS = "syslinux syslinux-native dosfstools-native mtools-native gptfdisk-native"
-
 LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
 
 IMAGE_ROOTFS_EXTRA_SPACE = "2000"

Please, consider adding e2fsprogs-native to the list instead of building extra packages that are not going to be used.

--
Regards,
Ed

#3 lore raw

PATCH 2/4 image_types_wic.bbclass: deal with dependencies only with WKS_FILE_DEPENDS_DEFAULT

In reply to [email protected]

From: Ming Liu <[email protected]>

Drop do_image_wic depends varflags, move the dependencies to WKS_FILE_DEPENDS_DEFAULT. I can not see the need to maintain them in two different ways, besides that it's out of USING_WIC control.

---
 meta/classes/image_types_wic.bbclass | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
meta/classes/image_types_wic.bbclass +1 -2
index b825b47..7b0a1c7 100644
@@ -39,9 +39,8 @@ IMAGE_CMD_wic[vardepsexclude] = "WKS_FULL_PATH WKS_FILES"
 USING_WIC = "${@bb.utils.contains_any('IMAGE_FSTYPES', 'wic ' + ' '.join('wic.%s' % c for c in '${CONVERSIONTYPES}'.split()), '1', '', d)}"
 WKS_FILE_CHECKSUM = "${@'${WKS_FULL_PATH}:%s' % os.path.exists('${WKS_FULL_PATH}') if '${USING_WIC}' else ''}"
 do_image_wic[file-checksums] += "${WKS_FILE_CHECKSUM}"
-do_image_wic[depends] += "${@' '.join('%s-native:do_populate_sysroot' % r for r in ('parted', 'gptfdisk', 'dosfstools', 'mtools'))}"
 
-WKS_FILE_DEPENDS_DEFAULT = "syslinux-native bmap-tools-native cdrtools-native btrfs-tools-native squashfs-tools-native e2fsprogs-native"
+WKS_FILE_DEPENDS_DEFAULT = "parted-native gptfdisk-native dosfstools-native mtools-native syslinux-native bmap-tools-native cdrtools-native btrfs-tools-native squashfs-tools-native e2fsprogs-native"
 WKS_FILE_DEPENDS_BOOTLOADERS = ""
 WKS_FILE_DEPENDS_BOOTLOADERS_x86 = "syslinux grub-efi systemd-boot"
 WKS_FILE_DEPENDS_BOOTLOADERS_x86-64 = "syslinux grub-efi systemd-boot"
Signature · 1 line
2.7.4
#4 lore raw

Re: [PATCH 2/4] image_types_wic.bbclass: deal with dependencies only with WKS_FILE_DEPENDS_DEFAULT

Quoted 16 lines · On Tue, Aug 01, 2017 at 07:13:48PM +0200, [email protected] wrote:

From: Ming Liu <[email protected]>

Drop do_image_wic depends varflags, move the dependencies to WKS_FILE_DEPENDS_DEFAULT. I can not see the need to maintain them in two different ways, besides that it's out of USING_WIC control.

---
 meta/classes/image_types_wic.bbclass | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
meta/classes/image_types_wic.bbclass +0 -0
index b825b47..7b0a1c7 100644

meta/classes/image_types_wic.bbclass IMAGE_CMD_wic[vardepsexclude] = "WKS_FULL_PATH WKS_FILES" · line 46

Quoted 10 lines
meta/classes/image_types_wic.bbclass +1 -2
@@ -39,9 +39,8 @@ IMAGE_CMD_wic[vardepsexclude] = "WKS_FULL_PATH WKS_FILES"
 USING_WIC = "${@bb.utils.contains_any('IMAGE_FSTYPES', 'wic ' + ' '.join('wic.%s' % c for c in '${CONVERSIONTYPES}'.split()), '1', '', d)}"
 WKS_FILE_CHECKSUM = "${@'${WKS_FULL_PATH}:%s' % os.path.exists('${WKS_FULL_PATH}') if '${USING_WIC}' else ''}"
 do_image_wic[file-checksums] += "${WKS_FILE_CHECKSUM}"
-do_image_wic[depends] += "${@' '.join('%s-native:do_populate_sysroot' % r for r in ('parted', 'gptfdisk', 'dosfstools', 'mtools'))}"
 
-WKS_FILE_DEPENDS_DEFAULT = "syslinux-native bmap-tools-native cdrtools-native btrfs-tools-native squashfs-tools-native e2fsprogs-native"
+WKS_FILE_DEPENDS_DEFAULT = "parted-native gptfdisk-native dosfstools-native mtools-native syslinux-native bmap-tools-native cdrtools-native btrfs-tools-native squashfs-tools-native e2fsprogs-native"
 WKS_FILE_DEPENDS_BOOTLOADERS = ""
 WKS_FILE_DEPENDS_BOOTLOADERS_x86 = "syslinux grub-efi systemd-boot"
 WKS_FILE_DEPENDS_BOOTLOADERS_x86-64 = "syslinux grub-efi systemd-boot"

This breakes wic build on qemux86-64 target on my machine with the
error: "ERROR: A native program parted required to build the image was not found (see details above)."

--
Regards,
Ed

author
#5 lore raw

Re: [PATCH 2/4] image_types_wic.bbclass: deal with dependencies only with WKS_FILE_DEPENDS_DEFAULT

Hi, Ed:

Thanks for testing it, I will investigate the cause and get back to you.

the best,
thank you

2017-08-02 10:26 GMT+02:00 Ed Bartosh <[email protected]>:

Quoted 44 lines · On Tue, Aug 01, 2017 at 07:13:48PM +0200, [email protected] wrote:
Quoted 6 lines

From: Ming Liu <[email protected]>

Drop do_image_wic depends varflags, move the dependencies to WKS_FILE_DEPENDS_DEFAULT. I can not see the need to maintain them in two different ways, besides that it's out of USING_WIC control.

Review

Quoted 6 lines
---
 meta/classes/image_types_wic.bbclass | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
(quoted diff) +0 -0

b/meta/classes/image_types_wic.bbclass

meta/classes/image_types_wic.bbclass IMAGE_CMD_wic[vardepsexclude] = "WKS_FULL_PATH

Quoted 4 lines

index b825b47..7b0a1c7 100644

meta/classes/image_types_wic.bbclass +0 -0
@@ -39,9 +39,8 @@ IMAGE_CMD_wic[vardepsexclude] = "WKS_FULL_PATH

WKS_FILES"

meta/classes/image_types_wic.bbclass IMAGE_CMD_wic[vardepsexclude] = "WKS_FULL_PATH · line 39

Quoted 1 line
meta/classes/image_types_wic.bbclass +0 -0
 USING_WIC = "${@bb.utils.contains_any('IMAGE_FSTYPES', 'wic ' + '

'.join('wic.%s' % c for c in '${CONVERSIONTYPES}'.split()), '1', '', d)}"

meta/classes/image_types_wic.bbclass IMAGE_CMD_wic[vardepsexclude] = "WKS_FULL_PATH · line 40

Quoted 1 line
meta/classes/image_types_wic.bbclass +0 -0
 WKS_FILE_CHECKSUM = "${@'${WKS_FULL_PATH}:%s' %

os.path.exists('${WKS_FULL_PATH}') if '${USING_WIC}' else ''}"

meta/classes/image_types_wic.bbclass IMAGE_CMD_wic[vardepsexclude] = "WKS_FULL_PATH · line 42

Quoted 2 lines
meta/classes/image_types_wic.bbclass +0 -1
 do_image_wic[file-checksums] += "${WKS_FILE_CHECKSUM}"
-do_image_wic[depends] += "${@' '.join('%s-native:do_populate_sysroot'

% r for r in ('parted', 'gptfdisk', 'dosfstools', 'mtools'))}"

meta/classes/image_types_wic.bbclass IMAGE_CMD_wic[vardepsexclude] = "WKS_FULL_PATH · line 43

Quoted 2 lines
meta/classes/image_types_wic.bbclass +0 -1
-WKS_FILE_DEPENDS_DEFAULT = "syslinux-native bmap-tools-native

cdrtools-native btrfs-tools-native squashfs-tools-native e2fsprogs-native"

meta/classes/image_types_wic.bbclass IMAGE_CMD_wic[vardepsexclude] = "WKS_FULL_PATH · line 42

Quoted 1 line
meta/classes/image_types_wic.bbclass +1 -0
+WKS_FILE_DEPENDS_DEFAULT = "parted-native gptfdisk-native

dosfstools-native mtools-native syslinux-native bmap-tools-native cdrtools-native btrfs-tools-native squashfs-tools-native e2fsprogs-native"

meta/classes/image_types_wic.bbclass IMAGE_CMD_wic[vardepsexclude] = "WKS_FULL_PATH WKS_FILES" · line 46

Quoted 3 lines
meta/classes/image_types_wic.bbclass +0 -0
 WKS_FILE_DEPENDS_BOOTLOADERS = ""
 WKS_FILE_DEPENDS_BOOTLOADERS_x86 = "syslinux grub-efi systemd-boot"
 WKS_FILE_DEPENDS_BOOTLOADERS_x86-64 = "syslinux grub-efi systemd-boot"

This breakes wic build on qemux86-64 target on my machine with the
error: "ERROR: A native program parted required to build the image was not found (see details above)."

--
Regards,
Ed

#6 lore raw

PATCH 3/4 qemux86.conf: drop do_image_wic task dependencies

In reply to [email protected]

From: Ming Liu <[email protected]>

They are being controlled by WKS_FILE_DEPENDS_DEFAULT, the code here is redundant and incomplete as well.

---
 meta/conf/machine/qemux86.conf | 1 -
 1 file changed, 1 deletion(-)
meta/conf/machine/qemux86.conf +0 -1
index c26dda2..f0bebbf 100644
@@ -29,4 +29,3 @@ MACHINE_FEATURES += "x86"
 MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "v86d"
 
 WKS_FILE ?= "directdisk.wks"
-do_image_wic[depends] += "syslinux:do_populate_sysroot syslinux-native:do_populate_sysroot mtools-native:do_populate_sysroot dosfstools-native:do_populate_sysroot"
Signature · 1 line
2.7.4
#7 lore raw

Re: [PATCH 3/4] qemux86.conf: drop do_image_wic task dependencies

Quoted 15 lines · On Tue, Aug 01, 2017 at 07:13:49PM +0200, [email protected] wrote:

From: Ming Liu <[email protected]>

They are being controlled by WKS_FILE_DEPENDS_DEFAULT, the code here is redundant and incomplete as well.

---
 meta/conf/machine/qemux86.conf | 1 -
 1 file changed, 1 deletion(-)
meta/conf/machine/qemux86.conf +0 -0
index c26dda2..f0bebbf 100644

meta/conf/machine/qemux86.conf MACHINE_FEATURES += "x86" · line 32

Quoted 4 lines
meta/conf/machine/qemux86.conf +0 -1
@@ -29,4 +29,3 @@ MACHINE_FEATURES += "x86"
 MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "v86d"
 
 WKS_FILE ?= "directdisk.wks"
-do_image_wic[depends] += "syslinux:do_populate_sysroot syslinux-native:do_populate_sysroot mtools-native:do_populate_sysroot dosfstools-native:do_populate_sysroot"

-1

WKS_FILE_DEPENDS_DEFAULT is a termporary setting aimed to easy transition from using wic-tools to using WKS_FILE_DEPENDS. It contains the whole set of packages that is not usually needed.

Please, consider setting WKS_FILE_DEPENDS with the minimum set of packages required by directdisk.wks. This will faster the build as unneeded packages will not be built.

You may want to look at "image_types_wic: set default WKS_FILE_DEPENDS" commit for further details.

--
Regards,
Ed

author
#8 lore raw

Re: [PATCH 3/4] qemux86.conf: drop do_image_wic task dependencies

Hi, Ed:

OK, understood. So the intention is to let WKS_FILE_DEPENDS contain the packages needed by a specific WKS file only, while my purpose was to remove the 'do_image_wic[depends]' way of maintaining the dependencies, use WKS_FILE_DEPENDS
instead. Will send a V2.

//Ming Liu

2017-08-02 10:35 GMT+02:00 Ed Bartosh <[email protected]>:

Quoted 41 lines · On Tue, Aug 01, 2017 at 07:13:49PM +0200, [email protected] wrote:

meta/conf/machine/qemux86.

Quoted 11 lines

From: Ming Liu <[email protected]>

They are being controlled by WKS_FILE_DEPENDS_DEFAULT, the code here is redundant and incomplete as well.

---
 meta/conf/machine/qemux86.conf | 1 -
 1 file changed, 1 deletion(-)
meta/conf/machine/qemux86. renamed from meta/conf/machine/qemux86.conf +0 -0

conf

meta/conf/machine/qemux86.conf MACHINE_FEATURES += "x86" · line 32

Quoted 8 lines

index c26dda2..f0bebbf 100644

meta/conf/machine/qemux86.conf +0 -1
@@ -29,4 +29,3 @@ MACHINE_FEATURES += "x86"
 MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "v86d"
 
 WKS_FILE ?= "directdisk.wks"
-do_image_wic[depends] += "syslinux:do_populate_sysroot

syslinux-native:do_populate_sysroot mtools-native:do_populate_sysroot dosfstools-native:do_populate_sysroot"

-1

WKS_FILE_DEPENDS_DEFAULT is a termporary setting aimed to easy transition from using wic-tools to using WKS_FILE_DEPENDS. It contains the whole set of packages that is not usually needed.

Please, consider setting WKS_FILE_DEPENDS with the minimum set of packages required by directdisk.wks. This will faster the build as unneeded packages will not be built.

You may want to look at "image_types_wic: set default WKS_FILE_DEPENDS" commit for further details.

--
Regards,
Ed

#9 lore raw

PATCH 4/4 qemux86-64.conf: drop do_image_wic task dependencies

In reply to [email protected]

From: Ming Liu <[email protected]>

They are being controlled by WKS_FILE_DEPENDS_DEFAULT, the code here is redundant and incomplete as well.

---
 meta/conf/machine/qemux86-64.conf | 1 -
 1 file changed, 1 deletion(-)
meta/conf/machine/qemux86-64.conf +0 -1
index 10189cb..9f55aaa 100644
@@ -30,4 +30,3 @@ MACHINE_FEATURES += "x86"
 MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "v86d"
 
 WKS_FILE ?= "directdisk.wks"
-do_image_wic[depends] += "syslinux:do_populate_sysroot syslinux-native:do_populate_sysroot mtools-native:do_populate_sysroot dosfstools-native:do_populate_sysroot"
Signature · 1 line
2.7.4