From: Emil Dahl Juhl juhl.emildahl@gmail.com
[ Upstream commit 1375152bb02ab2a8435e87ea27034482dbc95f57 ]
Instead of preserving mode, timestamp, and owner, for the object files during installation, just preserve the mode and timestamp.
When installing as root, the installed files should be owned by root. When installing as user, --preserve=ownership doesn't work anyway. This makes --preserve=ownership rather pointless.
Signed-off-by: Emil Dahl Juhl juhl.emildahl@gmail.com Signed-off-by: Sascha Hauer s.hauer@pengutronix.de Acked-by: Daniel Lezcano daniel.lezcano@linaro.org Signed-off-by: Rafael J. Wysocki rafael.j.wysocki@intel.com Signed-off-by: Sasha Levin sashal@kernel.org ---
LLM Generated explanations, may be completely bogus:
YES - `tools/lib/thermal/Makefile:142` switches the install step from `cp -fpR` to `cp -fR --preserve=mode,timestamp`, deliberately dropping ownership preservation while still keeping permissions and mtimes. That resolves the longstanding issue where `sudo make install` leaves the deployed `libthermal` artifacts owned by the non-root builder, which is both a packaging nuisance and a security footgun for system directories. - The regression surface is tiny: it only alters a post-build copy command, introduces no source or ABI changes, and continues to require GNU `cp` (the build already depends on it for `-pR`). Non-root installs still behave the same—ownership was never retained successfully there, as noted in the commit message. - Stable-tree criteria are met: this is a clear bug fix with user- visible impact (incorrect ownership on installed files), it is self- contained to the tools build machinery, and it avoids any architectural churn or new features.
Natural next step: run `make -C tools/lib/thermal install prefix=/tmp/test DESTDIR=` before and after the backport to confirm the installed files now come out root-owned.
tools/lib/thermal/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/lib/thermal/Makefile b/tools/lib/thermal/Makefile index a1f5e388644d3..ac918e98cd033 100644 --- a/tools/lib/thermal/Makefile +++ b/tools/lib/thermal/Makefile @@ -134,7 +134,7 @@ endef install_lib: libs $(call QUIET_INSTALL, $(LIBTHERMAL_ALL)) \ $(call do_install_mkdir,$(libdir_SQ)); \ - cp -fpR $(LIBTHERMAL_ALL) $(DESTDIR)$(libdir_SQ) + cp -fR --preserve=mode,timestamp $(LIBTHERMAL_ALL) $(DESTDIR)$(libdir_SQ)
install_headers: $(call QUIET_INSTALL, headers) \