Patchwork [09/20] image.bbclass, kernel.bbclass: Use kmod-native instead of module-init-tools-cross

login
register
mail settings
Submitter Khem Raj
Date Feb. 6, 2012, 6:40 a.m.
Message ID <71993993e48a2abeb09b5c6c86a1d8d2ebec7c25.1328510188.git.raj.khem@gmail.com>
Download mbox | patch
Permalink /patch/20739/
State New
Headers show

Comments

Khem Raj - Feb. 6, 2012, 6:40 a.m.
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/classes/image.bbclass  |    2 +-
 meta/classes/kernel.bbclass |    9 ++++-----
 2 files changed, 5 insertions(+), 6 deletions(-)
Darren Hart - May 3, 2012, 9:09 p.m.
Some comments regarding implementation are needed here. For example, why
is HOST_PREFIX no longer necessary?

On 02/05/2012 10:40 PM, Khem Raj wrote:
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
>  meta/classes/image.bbclass  |    2 +-
>  meta/classes/kernel.bbclass |    9 ++++-----
>  2 files changed, 5 insertions(+), 6 deletions(-)
> 
> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
> index 3034725..adb9b39 100644
> --- a/meta/classes/image.bbclass
> +++ b/meta/classes/image.bbclass
> @@ -173,7 +173,7 @@ fakeroot do_rootfs () {
>  		KERNEL_VERSION=`cat ${STAGING_KERNEL_DIR}/kernel-abiversion`
>  
>  		mkdir -p ${IMAGE_ROOTFS}/lib/modules/$KERNEL_VERSION
> -		${TARGET_PREFIX}depmod -a -b ${IMAGE_ROOTFS} -F ${STAGING_KERNEL_DIR}/System.map-$KERNEL_VERSION $KERNEL_VERSION
> +		depmod -a -b ${IMAGE_ROOTFS} -F ${STAGING_KERNEL_DIR}/System.map-$KERNEL_VERSION $KERNEL_VERSION
>  	fi
>  
>  	${IMAGE_PREPROCESS_COMMAND}
> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
> index ec5d65e..be54f8e 100644
> --- a/meta/classes/kernel.bbclass
> +++ b/meta/classes/kernel.bbclass
> @@ -1,7 +1,7 @@
>  inherit linux-kernel-base module_strip
>  
>  PROVIDES += "virtual/kernel"
> -DEPENDS += "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}depmod virtual/${TARGET_PREFIX}gcc${KERNEL_CCSUFFIX} update-modules"
> +DEPENDS += "virtual/${TARGET_PREFIX}gcc kmod-native virtual/${TARGET_PREFIX}gcc${KERNEL_CCSUFFIX} update-modules"
>  
>  # we include gcc above, we dont need virtual/libc
>  INHIBIT_DEFAULT_DEPS = "1"
> @@ -259,7 +259,7 @@ if [ ! -e "$D/lib/modules/${KERNEL_VERSION}" ]; then
>  	mkdir -p $D/lib/modules/${KERNEL_VERSION}
>  fi
>  if [ -n "$D" ]; then
> -	${HOST_PREFIX}depmod -A -b $D -F ${STAGING_KERNEL_DIR}/System.map-${KERNEL_VERSION} ${KERNEL_VERSION}
> +	depmod -a -b $D -F ${STAGING_KERNEL_DIR}/System.map-${KERNEL_VERSION} ${KERNEL_VERSION}
>  else
>  	depmod -a
>  fi
> @@ -267,7 +267,7 @@ fi
>  
>  pkg_postinst_modules () {
>  if [ -n "$D" ]; then
> -	${HOST_PREFIX}depmod -A -b $D -F ${STAGING_KERNEL_DIR}/System.map-${KERNEL_VERSION} ${KERNEL_VERSION}
> +	depmod -a -b $D -F ${STAGING_KERNEL_DIR}/System.map-${KERNEL_VERSION} ${KERNEL_VERSION}
>  else
>  	depmod -a
>  	update-modules || true
> @@ -339,9 +339,8 @@ python populate_packages_prepend () {
>  		if m:
>  			kernelver_stripped = m.group(1)
>  		path = d.getVar("PATH", 1)
> -		host_prefix = d.getVar("HOST_PREFIX", 1) or ""
>  
> -		cmd = "PATH=\"%s\" %sdepmod -n -a -r -b %s -F %s/boot/System.map-%s %s" % (path, host_prefix, dvar, dvar, kernelver, kernelver_stripped)
> +		cmd = "PATH=\"%s\" depmod -n -a -b %s -F %s/boot/System.map-%s %s" % (path, dvar, dvar, kernelver, kernelver_stripped)
>  		f = os.popen(cmd, 'r')
>  
>  		deps = {}
Khem Raj - May 3, 2012, 9:48 p.m.
On Thu, May 3, 2012 at 2:09 PM, Darren Hart <dvhart@linux.intel.com> wrote:
> Some comments regarding implementation are needed here. For example, why
> is HOST_PREFIX no longer necessary?

Its no longer treated like a cross-tool like we did before. so depmod is really
treated as a host tool since it does not do anything target specific

>
> On 02/05/2012 10:40 PM, Khem Raj wrote:
>> Signed-off-by: Khem Raj <raj.khem@gmail.com>
>> ---
>>  meta/classes/image.bbclass  |    2 +-
>>  meta/classes/kernel.bbclass |    9 ++++-----
>>  2 files changed, 5 insertions(+), 6 deletions(-)
>>
>> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
>> index 3034725..adb9b39 100644
>> --- a/meta/classes/image.bbclass
>> +++ b/meta/classes/image.bbclass
>> @@ -173,7 +173,7 @@ fakeroot do_rootfs () {
>>               KERNEL_VERSION=`cat ${STAGING_KERNEL_DIR}/kernel-abiversion`
>>
>>               mkdir -p ${IMAGE_ROOTFS}/lib/modules/$KERNEL_VERSION
>> -             ${TARGET_PREFIX}depmod -a -b ${IMAGE_ROOTFS} -F ${STAGING_KERNEL_DIR}/System.map-$KERNEL_VERSION $KERNEL_VERSION
>> +             depmod -a -b ${IMAGE_ROOTFS} -F ${STAGING_KERNEL_DIR}/System.map-$KERNEL_VERSION $KERNEL_VERSION
>>       fi
>>
>>       ${IMAGE_PREPROCESS_COMMAND}
>> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
>> index ec5d65e..be54f8e 100644
>> --- a/meta/classes/kernel.bbclass
>> +++ b/meta/classes/kernel.bbclass
>> @@ -1,7 +1,7 @@
>>  inherit linux-kernel-base module_strip
>>
>>  PROVIDES += "virtual/kernel"
>> -DEPENDS += "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}depmod virtual/${TARGET_PREFIX}gcc${KERNEL_CCSUFFIX} update-modules"
>> +DEPENDS += "virtual/${TARGET_PREFIX}gcc kmod-native virtual/${TARGET_PREFIX}gcc${KERNEL_CCSUFFIX} update-modules"
>>
>>  # we include gcc above, we dont need virtual/libc
>>  INHIBIT_DEFAULT_DEPS = "1"
>> @@ -259,7 +259,7 @@ if [ ! -e "$D/lib/modules/${KERNEL_VERSION}" ]; then
>>       mkdir -p $D/lib/modules/${KERNEL_VERSION}
>>  fi
>>  if [ -n "$D" ]; then
>> -     ${HOST_PREFIX}depmod -A -b $D -F ${STAGING_KERNEL_DIR}/System.map-${KERNEL_VERSION} ${KERNEL_VERSION}
>> +     depmod -a -b $D -F ${STAGING_KERNEL_DIR}/System.map-${KERNEL_VERSION} ${KERNEL_VERSION}
>>  else
>>       depmod -a
>>  fi
>> @@ -267,7 +267,7 @@ fi
>>
>>  pkg_postinst_modules () {
>>  if [ -n "$D" ]; then
>> -     ${HOST_PREFIX}depmod -A -b $D -F ${STAGING_KERNEL_DIR}/System.map-${KERNEL_VERSION} ${KERNEL_VERSION}
>> +     depmod -a -b $D -F ${STAGING_KERNEL_DIR}/System.map-${KERNEL_VERSION} ${KERNEL_VERSION}
>>  else
>>       depmod -a
>>       update-modules || true
>> @@ -339,9 +339,8 @@ python populate_packages_prepend () {
>>               if m:
>>                       kernelver_stripped = m.group(1)
>>               path = d.getVar("PATH", 1)
>> -             host_prefix = d.getVar("HOST_PREFIX", 1) or ""
>>
>> -             cmd = "PATH=\"%s\" %sdepmod -n -a -r -b %s -F %s/boot/System.map-%s %s" % (path, host_prefix, dvar, dvar, kernelver, kernelver_stripped)
>> +             cmd = "PATH=\"%s\" depmod -n -a -b %s -F %s/boot/System.map-%s %s" % (path, dvar, dvar, kernelver, kernelver_stripped)
>>               f = os.popen(cmd, 'r')
>>
>>               deps = {}
>
> --
> Darren Hart
> Intel Open Source Technology Center
> Yocto Project - Linux Kernel

Patch

diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 3034725..adb9b39 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -173,7 +173,7 @@  fakeroot do_rootfs () {
 		KERNEL_VERSION=`cat ${STAGING_KERNEL_DIR}/kernel-abiversion`
 
 		mkdir -p ${IMAGE_ROOTFS}/lib/modules/$KERNEL_VERSION
-		${TARGET_PREFIX}depmod -a -b ${IMAGE_ROOTFS} -F ${STAGING_KERNEL_DIR}/System.map-$KERNEL_VERSION $KERNEL_VERSION
+		depmod -a -b ${IMAGE_ROOTFS} -F ${STAGING_KERNEL_DIR}/System.map-$KERNEL_VERSION $KERNEL_VERSION
 	fi
 
 	${IMAGE_PREPROCESS_COMMAND}
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index ec5d65e..be54f8e 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -1,7 +1,7 @@ 
 inherit linux-kernel-base module_strip
 
 PROVIDES += "virtual/kernel"
-DEPENDS += "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}depmod virtual/${TARGET_PREFIX}gcc${KERNEL_CCSUFFIX} update-modules"
+DEPENDS += "virtual/${TARGET_PREFIX}gcc kmod-native virtual/${TARGET_PREFIX}gcc${KERNEL_CCSUFFIX} update-modules"
 
 # we include gcc above, we dont need virtual/libc
 INHIBIT_DEFAULT_DEPS = "1"
@@ -259,7 +259,7 @@  if [ ! -e "$D/lib/modules/${KERNEL_VERSION}" ]; then
 	mkdir -p $D/lib/modules/${KERNEL_VERSION}
 fi
 if [ -n "$D" ]; then
-	${HOST_PREFIX}depmod -A -b $D -F ${STAGING_KERNEL_DIR}/System.map-${KERNEL_VERSION} ${KERNEL_VERSION}
+	depmod -a -b $D -F ${STAGING_KERNEL_DIR}/System.map-${KERNEL_VERSION} ${KERNEL_VERSION}
 else
 	depmod -a
 fi
@@ -267,7 +267,7 @@  fi
 
 pkg_postinst_modules () {
 if [ -n "$D" ]; then
-	${HOST_PREFIX}depmod -A -b $D -F ${STAGING_KERNEL_DIR}/System.map-${KERNEL_VERSION} ${KERNEL_VERSION}
+	depmod -a -b $D -F ${STAGING_KERNEL_DIR}/System.map-${KERNEL_VERSION} ${KERNEL_VERSION}
 else
 	depmod -a
 	update-modules || true
@@ -339,9 +339,8 @@  python populate_packages_prepend () {
 		if m:
 			kernelver_stripped = m.group(1)
 		path = d.getVar("PATH", 1)
-		host_prefix = d.getVar("HOST_PREFIX", 1) or ""
 
-		cmd = "PATH=\"%s\" %sdepmod -n -a -r -b %s -F %s/boot/System.map-%s %s" % (path, host_prefix, dvar, dvar, kernelver, kernelver_stripped)
+		cmd = "PATH=\"%s\" depmod -n -a -b %s -F %s/boot/System.map-%s %s" % (path, dvar, dvar, kernelver, kernelver_stripped)
 		f = os.popen(cmd, 'r')
 
 		deps = {}