On Tue, 2014-04-01 at 17:09 +0800, Kai Kang wrote:
> From: "yanjun.zhu" <[email protected]>
>
> __NR_setns is not defined in linux kernel 2.6.x. To linux kernel 3.0,
> this variable is defined. It has been shown that no native tools use
> this syscall, so it is safe to make this substitution
>
> Signed-off-by: yanjun.zhu <[email protected]>
> Signed-off-by: Robert Yang <[email protected]>
> Signed-off-by: Kai Kang <[email protected]>
> ---
> meta/recipes-core/util-linux/util-linux.inc | 6 ++++++
> 1 file changed, 6 insertions(+)
This is horrible. Firstly "no native tools use this syscall" - how did
you check that? I suspect you perhaps mean "no native tools in OE-Core
at this time"? How would we know when one is added?
Secondly, this should not be done as a sed, it should be a patch with a
description. This means when we upgrade util-linux, it doesn't silently
stop working or do something unintended.
Cheers,
Richard
> diff --git a/meta/recipes-core/util-linux/util-linux.inc
> b/meta/recipes-core/util-linux/util-linux.inc
> index ad7aac7..0f065b4 100644
> --- a/meta/recipes-core/util-linux/util-linux.inc
> +++ b/meta/recipes-core/util-linux/util-linux.inc
> @@ -112,6 +112,12 @@ RPROVIDES_${PN}-dev = "util-linux-libblkid-dev
> util-linux-libmount-dev util-linu
> SYSTEMD_PACKAGES = "${PN}-uuidd"
> SYSTEMD_SERVICE_${PN}-uuidd = "uuidd.service"
>
> +do_compile_prepend_class-native() {
> + if [ `uname -r | grep "2.6."` ]; then
> + sed -i 's:return syscall(SYS_setns:fprintf(stderr,"Kernel does
> not support setns");\n\treturn 1;\n//return syscall(:g'
> ${S}/include/namespace.h
> + fi
> +}
> +
> do_compile () {
> set -e
> install ${WORKDIR}/MCONFIG ${S}/MCONFIG
> --
> 1.8.1.2
>
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core