* [kbuild regression, post-rc1] Remote installation over read-only NFS broken
@ 2010-06-07 9:10 Rafael J. Wysocki
2010-06-07 11:28 ` Michal Marek
2010-06-07 14:41 ` Linus Torvalds
0 siblings, 2 replies; 7+ messages in thread
From: Rafael J. Wysocki @ 2010-06-07 9:10 UTC (permalink / raw)
To: Michal Marek; +Cc: LKML, Linus Torvalds, Andrew Morton
Hi Michal,
Unfortunately, your commit 73d1393eb8507ed5fd7f8e696f6b1ecc18035ebe
(kbuild: Generate modules.builtin in make modules_install) broke my testing
environment that had always worked before.
Namely, I build kernels on a central machine and export the build directory
along with the kernel sources over read-only NFS to test boxes. Then, on the
test boxes I run "make modules_install", copy the kernel to /boot, run mkinitrd
and so on. Now, after your commit above the "make modules_install" command on
the test boxes doesn't work any more, because it tries to write to the build
directory, which is mounted read-only.
Please fix or revert.
Rafael
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [kbuild regression, post-rc1] Remote installation over read-only NFS broken
2010-06-07 9:10 [kbuild regression, post-rc1] Remote installation over read-only NFS broken Rafael J. Wysocki
@ 2010-06-07 11:28 ` Michal Marek
2010-06-07 14:41 ` Linus Torvalds
1 sibling, 0 replies; 7+ messages in thread
From: Michal Marek @ 2010-06-07 11:28 UTC (permalink / raw)
To: Rafael J. Wysocki; +Cc: LKML, Linus Torvalds, Andrew Morton
On 7.6.2010 11:10, Rafael J. Wysocki wrote:
> Hi Michal,
>
> Unfortunately, your commit 73d1393eb8507ed5fd7f8e696f6b1ecc18035ebe
> (kbuild: Generate modules.builtin in make modules_install) broke my testing
> environment that had always worked before.
>
> Namely, I build kernels on a central machine and export the build directory
> along with the kernel sources over read-only NFS to test boxes. Then, on the
> test boxes I run "make modules_install", copy the kernel to /boot, run mkinitrd
> and so on. Now, after your commit above the "make modules_install" command on
> the test boxes doesn't work any more, because it tries to write to the build
> directory, which is mounted read-only.
I'll have a look, thanks for the report.
Michal
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [kbuild regression, post-rc1] Remote installation over read-only NFS broken
2010-06-07 9:10 [kbuild regression, post-rc1] Remote installation over read-only NFS broken Rafael J. Wysocki
2010-06-07 11:28 ` Michal Marek
@ 2010-06-07 14:41 ` Linus Torvalds
2010-06-07 21:16 ` Michal Marek
1 sibling, 1 reply; 7+ messages in thread
From: Linus Torvalds @ 2010-06-07 14:41 UTC (permalink / raw)
To: Rafael J. Wysocki; +Cc: Michal Marek, LKML, Andrew Morton
On Mon, 7 Jun 2010, Rafael J. Wysocki wrote:
>
> Namely, I build kernels on a central machine and export the build directory
> along with the kernel sources over read-only NFS to test boxes. Then, on the
> test boxes I run "make modules_install", copy the kernel to /boot, run mkinitrd
> and so on. Now, after your commit above the "make modules_install" command on
> the test boxes doesn't work any more, because it tries to write to the build
> directory, which is mounted read-only.
>
> Please fix or revert.
Ahh. It's broken for another reason too. Even if it's a writable
filesystem, it means that there's a lot of files that get written by root
(since you have to be root to do the install). Which is very
uncomfortable, and we've tried very hard to avoid that.
So it _should_ be possible to do a build as a normal user, and then do the
install as root, and afterwards
find . -user root
should return the empty set (which in practice ends up being basically the
same thing as Rafaels requirement that it work on a read-only build).
Linus
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [kbuild regression, post-rc1] Remote installation over read-only NFS broken
2010-06-07 14:41 ` Linus Torvalds
@ 2010-06-07 21:16 ` Michal Marek
2010-06-07 22:06 ` Rafael J. Wysocki
2010-06-10 1:11 ` Stephen Rothwell
0 siblings, 2 replies; 7+ messages in thread
From: Michal Marek @ 2010-06-07 21:16 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Rafael J. Wysocki, LKML, Andrew Morton, Eric Miao
On Mon, Jun 07, 2010 at 07:41:42AM -0700, Linus Torvalds wrote:
>
>
> On Mon, 7 Jun 2010, Rafael J. Wysocki wrote:
> >
> > Namely, I build kernels on a central machine and export the build directory
> > along with the kernel sources over read-only NFS to test boxes. Then, on the
> > test boxes I run "make modules_install", copy the kernel to /boot, run mkinitrd
> > and so on. Now, after your commit above the "make modules_install" command on
> > the test boxes doesn't work any more, because it tries to write to the build
> > directory, which is mounted read-only.
> >
> > Please fix or revert.
>
> Ahh. It's broken for another reason too. Even if it's a writable
> filesystem, it means that there's a lot of files that get written by root
> (since you have to be root to do the install). Which is very
> uncomfortable, and we've tried very hard to avoid that.
I can fix both issues by the below patch, but then it reintroduces the
issue Eric reported to me with the original approach:
| And indeed it's strange - while scripts/Makefile.build doesn't fail
| since
| there seems to be a script that generates some Makefiles in between
| the build process, I'll get this figured out to see what is the root
| cause.
(the whole thread is at http://lkml.org/lkml/2010/1/6/16). Eric, does
the above still hold, i.e. if you apply the below patch, does
scripts/Makefile.modbuiltin fail again? If so, is it possible to fix the
driver build process instead?
Here is the patch:
Subject: [PATCH] kbuild: Generate modules.builtin in make modules
Generating the file in make modules_install was broken as well, because
it didn't work in a readonly filesystem and otherwise it generated a
root-owned file which is not wanted.
Reported-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Michal Marek <mmarek@suse.cz>
diff --git a/Makefile b/Makefile
index efdc3d0..2735465 100644
--- a/Makefile
+++ b/Makefile
@@ -1095,7 +1095,7 @@ all: modules
# using awk while concatenating to the final file.
PHONY += modules
-modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux)
+modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin
$(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.order) > $(objtree)/modules.order
@$(kecho) ' Building modules, stage 2.';
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
@@ -1117,7 +1117,7 @@ PHONY += modules_install
modules_install: _modinst_ _modinst_post
PHONY += _modinst_
-_modinst_: modules.builtin
+_modinst_:
@if [ -z "`$(DEPMOD) -V 2>/dev/null | grep module-init-tools`" ]; then \
echo "Warning: you may need to install module-init-tools"; \
echo "See http://www.codemonkey.org.uk/docs/post-halloween-2.6.txt";\
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [kbuild regression, post-rc1] Remote installation over read-only NFS broken
2010-06-07 21:16 ` Michal Marek
@ 2010-06-07 22:06 ` Rafael J. Wysocki
2010-06-10 1:11 ` Stephen Rothwell
1 sibling, 0 replies; 7+ messages in thread
From: Rafael J. Wysocki @ 2010-06-07 22:06 UTC (permalink / raw)
To: Michal Marek; +Cc: Linus Torvalds, LKML, Andrew Morton, Eric Miao
On Monday 07 June 2010, Michal Marek wrote:
> On Mon, Jun 07, 2010 at 07:41:42AM -0700, Linus Torvalds wrote:
> >
> >
> > On Mon, 7 Jun 2010, Rafael J. Wysocki wrote:
> > >
> > > Namely, I build kernels on a central machine and export the build directory
> > > along with the kernel sources over read-only NFS to test boxes. Then, on the
> > > test boxes I run "make modules_install", copy the kernel to /boot, run mkinitrd
> > > and so on. Now, after your commit above the "make modules_install" command on
> > > the test boxes doesn't work any more, because it tries to write to the build
> > > directory, which is mounted read-only.
> > >
> > > Please fix or revert.
> >
> > Ahh. It's broken for another reason too. Even if it's a writable
> > filesystem, it means that there's a lot of files that get written by root
> > (since you have to be root to do the install). Which is very
> > uncomfortable, and we've tried very hard to avoid that.
>
> I can fix both issues by the below patch, but then it reintroduces the
> issue Eric reported to me with the original approach:
>
> | And indeed it's strange - while scripts/Makefile.build doesn't fail
> | since
> | there seems to be a script that generates some Makefiles in between
> | the build process, I'll get this figured out to see what is the root
> | cause.
>
> (the whole thread is at http://lkml.org/lkml/2010/1/6/16). Eric, does
> the above still hold, i.e. if you apply the below patch, does
> scripts/Makefile.modbuiltin fail again? If so, is it possible to fix the
> driver build process instead?
>
> Here is the patch:
>
> Subject: [PATCH] kbuild: Generate modules.builtin in make modules
>
> Generating the file in make modules_install was broken as well, because
> it didn't work in a readonly filesystem and otherwise it generated a
> root-owned file which is not wanted.
>
> Reported-by: Rafael J. Wysocki <rjw@sisk.pl>
> Signed-off-by: Michal Marek <mmarek@suse.cz>
The patch works for me, thanks.
> diff --git a/Makefile b/Makefile
> index efdc3d0..2735465 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1095,7 +1095,7 @@ all: modules
> # using awk while concatenating to the final file.
>
> PHONY += modules
> -modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux)
> +modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin
> $(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.order) > $(objtree)/modules.order
> @$(kecho) ' Building modules, stage 2.';
> $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
> @@ -1117,7 +1117,7 @@ PHONY += modules_install
> modules_install: _modinst_ _modinst_post
>
> PHONY += _modinst_
> -_modinst_: modules.builtin
> +_modinst_:
> @if [ -z "`$(DEPMOD) -V 2>/dev/null | grep module-init-tools`" ]; then \
> echo "Warning: you may need to install module-init-tools"; \
> echo "See http://www.codemonkey.org.uk/docs/post-halloween-2.6.txt";\
> --
Rafael
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [kbuild regression, post-rc1] Remote installation over read-only NFS broken
2010-06-07 21:16 ` Michal Marek
2010-06-07 22:06 ` Rafael J. Wysocki
@ 2010-06-10 1:11 ` Stephen Rothwell
2010-06-10 10:25 ` Michal Marek
1 sibling, 1 reply; 7+ messages in thread
From: Stephen Rothwell @ 2010-06-10 1:11 UTC (permalink / raw)
To: Michal Marek
Cc: Linus Torvalds, Rafael J. Wysocki, LKML, Andrew Morton, Eric Miao
[-- Attachment #1: Type: text/plain, Size: 1123 bytes --]
Hi Michal,
On Mon, 7 Jun 2010 23:16:30 +0200 Michal Marek <mmarek@suse.cz> wrote:
>
> I can fix both issues by the below patch, but then it reintroduces the
> issue Eric reported to me with the original approach:
>
> | And indeed it's strange - while scripts/Makefile.build doesn't fail
> | since
> | there seems to be a script that generates some Makefiles in between
> | the build process, I'll get this figured out to see what is the root
> | cause.
>
> (the whole thread is at http://lkml.org/lkml/2010/1/6/16). Eric, does
> the above still hold, i.e. if you apply the below patch, does
> scripts/Makefile.modbuiltin fail again? If so, is it possible to fix the
> driver build process instead?
>
> Here is the patch:
>
> Subject: [PATCH] kbuild: Generate modules.builtin in make modules
This patch breaks (at least) a powerpc ppc64_defconfig build with
separate object directory (that starts completely empty).
/bin/sh: line 1: init/modules.builtin: No such file or directory
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [kbuild regression, post-rc1] Remote installation over read-only NFS broken
2010-06-10 1:11 ` Stephen Rothwell
@ 2010-06-10 10:25 ` Michal Marek
0 siblings, 0 replies; 7+ messages in thread
From: Michal Marek @ 2010-06-10 10:25 UTC (permalink / raw)
To: Stephen Rothwell
Cc: Linus Torvalds, Rafael J. Wysocki, LKML, Andrew Morton, Eric Miao
On Thu, Jun 10, 2010 at 11:11:35AM +1000, Stephen Rothwell wrote:
> Hi Michal,
>
> On Mon, 7 Jun 2010 23:16:30 +0200 Michal Marek <mmarek@suse.cz> wrote:
> >
> > I can fix both issues by the below patch, but then it reintroduces the
> > issue Eric reported to me with the original approach:
> >
> > | And indeed it's strange - while scripts/Makefile.build doesn't fail
> > | since
> > | there seems to be a script that generates some Makefiles in between
> > | the build process, I'll get this figured out to see what is the root
> > | cause.
> >
> > (the whole thread is at http://lkml.org/lkml/2010/1/6/16). Eric, does
> > the above still hold, i.e. if you apply the below patch, does
> > scripts/Makefile.modbuiltin fail again? If so, is it possible to fix the
> > driver build process instead?
> >
> > Here is the patch:
> >
> > Subject: [PATCH] kbuild: Generate modules.builtin in make modules
>
> This patch breaks (at least) a powerpc ppc64_defconfig build with
> separate object directory (that starts completely empty).
>
> /bin/sh: line 1: init/modules.builtin: No such file or directory
Oops, this uncovered a bug in scripts/Makefile.modbuiltin. Following
patch should fix that, I'll run a few randconfigs before pushing it
though.
Michal
Subject: [PATCH] kbuild: Create output directory in Makefile.modbuiltin
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Michal Marek <mmarek@suse.cz>
diff --git a/scripts/Makefile.modbuiltin b/scripts/Makefile.modbuiltin
index 102a276..1adb974 100644
--- a/scripts/Makefile.modbuiltin
+++ b/scripts/Makefile.modbuiltin
@@ -14,6 +14,11 @@ __modbuiltin:
include scripts/Kbuild.include
+ifneq ($(KBUILD_SRC),)
+# Create output directory if not already present
+_dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj))
+endif
+
# The filename Kbuild has precedence over Makefile
kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))
kbuild-file := $(if $(wildcard $(kbuild-dir)/Kbuild),$(kbuild-dir)/Kbuild,$(kbuild-dir)/Makefile)
^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2010-06-10 10:25 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-07 9:10 [kbuild regression, post-rc1] Remote installation over read-only NFS broken Rafael J. Wysocki
2010-06-07 11:28 ` Michal Marek
2010-06-07 14:41 ` Linus Torvalds
2010-06-07 21:16 ` Michal Marek
2010-06-07 22:06 ` Rafael J. Wysocki
2010-06-10 1:11 ` Stephen Rothwell
2010-06-10 10:25 ` Michal Marek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox