Date: Thu, 18 Dec 2003 22:42:36 +0100
From: Haakon Riiser <haakon.riiser@fys.uio.no>
To: sensors@Stimpy.netroedge.com
Subject: lm_sensors 2.8.2 / DESTDIR / root
The reason for this email is that I always try to avoid running
Makefiles as root, even during 'make install'. Therefore, I
always use the DESTDIR feature, when it's available. Until today,
I always built i2c and lm_sensors by doing
$ make
$ make -i install DESTDIR=/foo
$ cd /foo && su root && fix permissions/ownership && install
The -i flag to make install is a kludge to avoid having to be root
while installing to the DESTDIR, and it's only required because
the files are installed with "-o root -g root". Using the -i
flag is of course not a good idea, since more fatal errors can
easily fly by undetected.
Today, I upgraded to Linux 2.6.0, and tried a similar install
procedure for lm_sensors, except that the make target is now "user"
and the install target is "user_install". I now noticed that the
DESTDIR variable is not used everywhere in "user_install", so I
couldn't use the -i kludge anymore. Instead, I wrote a patch that
removes the "-o root -g root" arguments to install everywhere, and
I also tried to add DESTDIR to all files/directories installed.
(The patch only applies to lm_sensors, not i2c, since only
lm_sensors is required in Linux 2.6.0.)
There's really no reason to say -o root -g root anyway, since if you
do install directly with make install, you have to be logged in as
root, and then the files will get the right ownership by default.
Much of the point of installing to a temporary DESTDIR is that you
don't have to be root, and that you can prepare the installation
by hand. Fixing the ownership is trivial:
chown -R root.root $DESTDIR
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2189 7894878c-1315-0410-8ee3-d5d059ff63e0
makefile. This prevents ever picking up headers from /usr/include
for module builds. Headers must be located in
/lib/modules/`uname -r`/build
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1746 7894878c-1315-0410-8ee3-d5d059ff63e0
Christian Hammers <ch@laathspell.de> wrote:
> Hello
>
> I always got the following error when compiling lm_sensors-2.7.0:
>
>
>> gcc -DMODVERSIONS -include /lib/modules/2.4.20-bigvideo-1/build/include/linux/modversions.h -D__KERNEL__ -DMODULE -DEXPORT_SYMTAB -fomit-frame-pointer -I. -Ikernel/include -I/usr/local/include -I/lib/modules/2.4.20-bigvideo-1/build/include -O2 -c kernel/busses/i2c-amd8111.c -o kernel/busses/i2c-amd8111.o
>
>
>
>>> kernel/busses/i2c-amd8111.c:26:2: #error Your i2c is too old - i2c-2.7.0 or greater required!
>
>
>
> This is a compile problem as the include files of 2.7.0 are in
> /usr/local/include/linux/. gcc-3.2.3 just puts /usr/local/include at the
> end of the list although it is first on the command line and the info
> page says the list is scanned left to right.
>
>> GNU CPP version 3.2.3 20030316 (Debian prerelease) (cpplib)
>> (i386 Linux/ELF)
>> GNU C version 3.2.3 20030316 (Debian prerelease) (i386-linux)
>> compiled by GNU C version 3.2.3 20030316 (Debian prerelease).
>> ignoring nonexistent directory "/usr/i386-linux/include"
>> ignoring duplicate directory "/usr/local/include"
>> as it is a non-system directory that duplicates a system directory
>> #include "..." search starts here:
>> #include <...> search starts here:
>> .
>> kernel/include
>> /usr/local/include
>> /usr/lib/gcc-lib/i386-linux/3.2.3/include
>> /usr/include
>> /lib/modules/2.4.20-bigvideo-1/build/include
>
>
>
> As a fix I suggest:
>
> # diff -u Makefile.orig Makefile
> --- Makefile.orig 2003-03-19 18:20:38.000000000 +0100
> +++ Makefile 2003-03-19 18:21:08.000000000 +0100
> @@ -178,7 +178,7 @@
> # PROGCPPFLAGS/PROGCFLAGS is to create non-kernel object files (which are linked into executables).
> # ARCPPFLAGS/ARCFLAGS are used to create archive object files (static libraries).
> # LIBCPPFLAGS/LIBCFLAGS are for shared library objects.
> -ALL_CPPFLAGS := -I. -Ikernel/include -I$(I2C_HEADERS) -I$(LINUX_HEADERS)
> +ALL_CPPFLAGS := -I. -Ikernel/include -I$(I2C_HEADERS) -idirafter $(LINUX_HEADERS)
> ALL_CFLAGS := -O2
> ifeq ($(DEBUG),1)
>
>
>
> bye,
>
> -christian-
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1735 7894878c-1315-0410-8ee3-d5d059ff63e0
Set DESTDIR if you want to install at some other place then where you
will run everything from.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@675 7894878c-1315-0410-8ee3-d5d059ff63e0
default. Now uses libsensors. Ripped the display formatting code from
sensors (with some modification) but needless to say I've only tested
a single chip. Doesn't support alarms yet. With a bit of work, could
share the display formatting code with sensors so just one source needs
updating. Compiles on my machine.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@661 7894878c-1315-0410-8ee3-d5d059ff63e0
The Makefile now examine $(LINUX)/.config to see what modules need to be
compiled. It compiles only those modules which were either not configured
in at all, or were built as modules (ie. drivers which are built-in in the
kernel are not built, as they can not be overruled).
The above is still potentially dangerous, if we break the interface of
our modules. Still, it is much better than it was.
C
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@575 7894878c-1315-0410-8ee3-d5d059ff63e0
the kernel.
* <kernel/init.h> is now included for all modules
* Initialization-time only functions and variables are marked with __init
* EXPORT_SYMBOL or EXPORT_NO_SYMBOLS declarations added
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@513 7894878c-1315-0410-8ee3-d5d059ff63e0
* The i2c package can no longer be compiled as part of the lm_sensors tree
* The archive of the i2c package is removed
* smbus, i2c-dev and i2c-proc modules and headers have been removed; they
are now completely integrated into the i2c package
* The fake i2c.h header has been removed; this also allowed us to remove
the ugly LM_SENSORS and TBD defines.
* A new variable I2C_HEADERS is introduced in the Makefile. This allows
us to install the i2c headers in, for example, /usr/local/include/linux.
* All files now include <linux/i2c.h> instead of "i2c.h" and "smbus.h"
Status: 'make dep' works, all the right include files are found. 'make all'
does not yet work.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@496 7894878c-1315-0410-8ee3-d5d059ff63e0