next up previous
次へ: kernelのコンパイル 上へ: LIDSのインストール 戻る: kernelにパッチをあてる

lidstoolsのコンパイル

カーネルオプションを検討する前に、lidstoolsをコンパイルしてインストールしておきます。lids-1.1.2rc5-2.4.20に移動して、configure, makeをし、suでrootになってmake installします。
[omok@localhost lids]$ cd /home/omok/work/lids/lids-1.1.2rc5-2.4.20
[omok@localhost lids-1.1.2rc5-2.4.20]$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets ${MAKE}... yes
checking for gcc... gcc
checking for C compiler default output... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of gcc... none
checking how to run the C preprocessor... gcc -E
checking for /usr/src/linux/include/linux/kernel.h... yes
checking for /usr/src/linux/kernel/fork.c... yes
checking for /usr/src/linux/include/linux/version.h... yes
checking for /usr/src/linux/include/asm/ptrace.h... yes
Checking for kernel sources version being 2.4.20... ok
checking for /usr/src/linux/include/linux/lids.h... yes
checking for /usr/src/linux/include/linux/lidsif.h... yes
Checking for LIDS patch version being 1.1.2rc5... ok
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking whether sys/types.h defines makedev... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking sys/file.h usability... yes
checking sys/file.h presence... yes
checking for sys/file.h... yes
checking termio.h usability... yes
checking termio.h presence... yes
checking for termio.h... yes
checking for unistd.h... (cached) yes
checking for gcc option to accept ANSI C... none needed
checking for an ANSI C-conforming const... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking for stdlib.h... (cached) yes
checking for working malloc... yes
checking whether time.h and sys/time.h may both be included... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking for alarm... yes
checking for working mktime... yes
checking return type of signal handlers... void
checking whether lstat dereferences a symlink specified with a trailing slash...
 yes
checking whether stat accepts an empty string... no
checking for memset... yes
checking for realpath... yes
checking for strchr... yes
checking for /etc/lids/lids.conf... yes
checking for /etc/lids/lids.cap... yes
checking for /etc/lids/lids.net... yes
checking for /etc/lids/lids.pw... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating lidstools/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
ここで、makeをすると
[omok@localhost lids-1.1.2rc5-2.4.20]$ make
make  all-recursive
make[1]: Entering directory `/home/omok/work/lids.temp/lids-1.1.2rc5-2.4.20'
Making all in lidstools
make[2]: Entering directory `/home/omok/work/lids.temp/lids-1.1.2rc5-2.4.20/lids
tools'
source='lidsadm.c' object='lidsadm.o' libtool=no \
depfile='.deps/lidsadm.Po' tmpdepfile='.deps/lidsadm.TPo' \
depmode=none /bin/sh ../depcomp \
gcc -DHAVE_CONFIG_H -I. -I. -I..     -I/usr/src/linux/include -DCONFIG_LIDS -c `
test -f 'lidsadm.c' || echo './'`lidsadm.c
../depcomp: ../depcomp: No such file or directory
make[2]: *** [lidsadm.o] Error 127
make[2]: Leaving directory `/home/omok/work/lids.temp/lids-1.1.2rc5-2.4.20/lidst
ools'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/omok/work/lids.temp/lids-1.1.2rc5-2.4.20'
make: *** [all] Error 2
[omok@localhost lids-1.1.2rc5-2.4.20]$
のように、エラーになります。エラーメッセージを見てみると、depcompが無いようですので、
RedHat9.0
/usr/share/automake-1.6/depcomp
Debian(Woody)
/usr/share/automake/depcomp
からlids-1.1.2rc5-2.4.20内にコピーして、再度makeします。
[omok@localhost lids-1.1.2rc5-2.4.20]$ cp /usr/share/automake/depcomp ./
[omok@localhost lids-1.1.2rc5-2.4.20]$ make
make  all-recursive
make[1]: Entering directory `/home/omok/work/lids/lids-1.1.2rc5-2.4.20'
Making all in lidstools
make[2]: Entering directory `/home/omok/work/lids/lids-1.1.2rc5-2.4.20/lidstools
'
source='lidsadm.c' object='lidsadm.o' libtool=no \
depfile='.deps/lidsadm.Po' tmpdepfile='.deps/lidsadm.TPo' \
depmode=none /bin/sh ../depcomp \
gcc -DHAVE_CONFIG_H -I. -I. -I..     -I/usr/src/linux/include -DCONFIG_LIDS -c `
test -f 'lidsadm.c' || echo './'`lidsadm.c
source='read_pw.c' object='read_pw.o' libtool=no \
depfile='.deps/read_pw.Po' tmpdepfile='.deps/read_pw.TPo' \
depmode=none /bin/sh ../depcomp \
gcc -DHAVE_CONFIG_H -I. -I. -I..     -I/usr/src/linux/include -DCONFIG_LIDS -c `
test -f 'read_pw.c' || echo './'`read_pw.c
source='rmd160.c' object='rmd160.o' libtool=no \
depfile='.deps/rmd160.Po' tmpdepfile='.deps/rmd160.TPo' \
depmode=none /bin/sh ../depcomp \
gcc -DHAVE_CONFIG_H -I. -I. -I..     -I/usr/src/linux/include -DCONFIG_LIDS -c `
test -f 'rmd160.c' || echo './'`rmd160.c
source='sig_rmd160.c' object='sig_rmd160.o' libtool=no \
depfile='.deps/sig_rmd160.Po' tmpdepfile='.deps/sig_rmd160.TPo' \
depmode=none /bin/sh ../depcomp \
gcc -DHAVE_CONFIG_H -I. -I. -I..     -I/usr/src/linux/include -DCONFIG_LIDS -c `
test -f 'sig_rmd160.c' || echo './'`sig_rmd160.c
source='time.c' object='time.o' libtool=no \
depfile='.deps/time.Po' tmpdepfile='.deps/time.TPo' \
depmode=none /bin/sh ../depcomp \
gcc -DHAVE_CONFIG_H -I. -I. -I..     -I/usr/src/linux/include -DCONFIG_LIDS -c `
test -f 'time.c' || echo './'`time.c
source='lids_capflag.c' object='lids_capflag.o' libtool=no \
depfile='.deps/lids_capflag.Po' tmpdepfile='.deps/lids_capflag.TPo' \
depmode=none /bin/sh ../depcomp \
gcc -DHAVE_CONFIG_H -I. -I. -I..     -I/usr/src/linux/include -DCONFIG_LIDS -c `
test -f 'lids_capflag.c' || echo './'`lids_capflag.c
gcc  -I/usr/src/linux/include -DCONFIG_LIDS   -o lidsadm -static lidsadm.o read_
pw.o rmd160.o sig_rmd160.o time.o lids_capflag.o
source='lidsconf.c' object='lidsconf.o' libtool=no \
depfile='.deps/lidsconf.Po' tmpdepfile='.deps/lidsconf.TPo' \
depmode=none /bin/sh ../depcomp \
gcc -DHAVE_CONFIG_H -I. -I. -I..     -I/usr/src/linux/include -DCONFIG_LIDS -c `
test -f 'lidsconf.c' || echo './'`lidsconf.c
gcc  -I/usr/src/linux/include -DCONFIG_LIDS   -o lidsconf  lidsconf.o read_pw.o
rmd160.o sig_rmd160.o time.o lids_capflag.o
make[2]: Leaving directory `/home/omok/work/lids/lids-1.1.2rc5-2.4.20/lidstools'
make[2]: Entering directory `/home/omok/work/lids/lids-1.1.2rc5-2.4.20'
make[2]: *** No rule to make target `example/lids.conf', needed by `all-am'.  St
op.
make[2]: Leaving directory `/home/omok/work/lids/lids-1.1.2rc5-2.4.20'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/omok/work/lids/lids-1.1.2rc5-2.4.20'
make: *** [all] Error 2
[omok@localhost lids-1.1.2rc5-2.4.20]$
となり、再度エラーになります。もう一度エラーメッセージを見てみると、 example/***ファイルを希望しているのに、ディレクトリはexample/example/***となっています。 example/exampleの下のファイル全てを、一つ上にコピーして、もう一度makeをします。
[omok@localhost lids-1.1.2rc5-2.4.20]$ cd example/
[omok@localhost lids-1.1.2rc5-2.4.20]$ ls
example
[omok@localhost lids-1.1.2rc5-2.4.20]$ cd example/
[omok@localhost lids-1.1.2rc5-2.4.20]$ ls
README  lids.cap  lids.cap~  lids.conf  lids.conf~  lids.net  lids.pw  up.pl
[omok@localhost lids-1.1.2rc5-2.4.20]$ cp * ..
[omok@localhost lids-1.1.2rc5-2.4.20]$ cd ../..
[omok@localhost lids-1.1.2rc5-2.4.20]$ make
make  all-recursive
make[1]: Entering directory `/home/omok/work/lids/lids-1.1.2rc5-2.4.20'
Making all in lidstools
make[2]: Entering directory `/home/omok/work/lids/lids-1.1.2rc5-2.4.20/lidstools
'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/omok/work/lids/lids-1.1.2rc5-2.4.20/lidstools'
make[2]: Entering directory `/home/omok/work/lids/lids-1.1.2rc5-2.4.20'
make[2]: Nothing to be done for `all-am'.
make[2]: Leaving directory `/home/omok/work/lids/lids-1.1.2rc5-2.4.20'
make[1]: Leaving directory `/home/omok/work/lids/lids-1.1.2rc5-2.4.20'
[omok@localhost lids-1.1.2rc5-2.4.20]$
と、無事にmakeできますので、suでrootになって、make installします。
[omok@localhost lids-1.1.2rc5-2.4.20]$ su
Password:
[root@localhost lids-1.1.2rc5-2.4.20]# make install
Making install in lidstools
make[1]: Entering directory `/home/omok/work/lids/lids-1.1.2rc5-2.4.20/lidstools
'
make[2]: Entering directory `/home/omok/work/lids/lids-1.1.2rc5-2.4.20/lidstools
'
/bin/sh ../mkinstalldirs /sbin
  /usr/bin/install -c lidsadm /sbin/lidsadm
  /usr/bin/install -c lidsconf /sbin/lidsconf
/bin/sh ../mkinstalldirs /usr/local/man/man8
mkdir /usr/local/man/man8
 /usr/bin/install -c -m 644 ./lidsadm.8.gz /usr/local/man/man8/lidsadm.8.8
 /usr/bin/install -c -m 644 ./lidsconf.8.gz /usr/local/man/man8/lidsconf.8.8
make[2]: Leaving directory `/home/omok/work/lids/lids-1.1.2rc5-2.4.20/lidstools'
make[1]: Leaving directory `/home/omok/work/lids/lids-1.1.2rc5-2.4.20/lidstools'
make[1]: Entering directory `/home/omok/work/lids/lids-1.1.2rc5-2.4.20'
make[2]: Entering directory `/home/omok/work/lids/lids-1.1.2rc5-2.4.20'
make[2]: Nothing to be done for `install-exec-am'.
/bin/sh ./mkinstalldirs /etc/lids
mkdir /etc/lids
 /usr/bin/install -c -m 644 example/lids.conf /etc/lids/lids.conf
 /usr/bin/install -c -m 644 example/lids.cap /etc/lids/lids.cap
 /usr/bin/install -c -m 644 example/lids.net /etc/lids/lids.net
 /usr/bin/install -c -m 644 example/lids.pw /etc/lids/lids.pw
make  install-data-hook
make[3]: Entering directory `/home/omok/work/lids/lids-1.1.2rc5-2.4.20'
( [ 1 -eq 1 ] && /sbin/lidsconf -U ; true)
UPDATE
object file /sbin was (3:2 inode 80483) instead of (3:3 341377). corrected.
object file /bin was (3:2 inode 80481) instead of (3:3 487682). corrected.
object file /boot was (3:2 inode 112673) instead of (3:1 2). corrected.
object file /lib was (3:2 inode 16098) instead of (3:3 162561). corrected.
object file /usr was (3:2 inode 32194) instead of (3:3 308865). corrected.
object file /etc was (3:2 inode 48289) instead of (3:3 357633). corrected.
object file /etc/lids was (8:2 inode 17382) instead of (3:3 619007). corrected.
object file /etc/shadow was (3:2 inode 52620) instead of (3:3 359955). corrected
.
object file /var/log was (3:5 inode 38153) instead of (3:3 32515). corrected.
object file /var/log/wtmp was (3:5 inode 38172) instead of (3:3 32532). correcte
d.
subject file /bin/login was (3:2 inode 84684) instead of (3:3 487703). corrected
.
object file /etc/shadow was (3:2 inode 52620) instead of (3:3 359955). corrected
.
subject file /bin/su was (3:2 inode 81032) instead of (3:3 487704). corrected.
object file /etc/shadow was (3:2 inode 52620) instead of (3:3 359955). corrected
.
subject file /bin/login was (3:2 inode 84684) instead of (3:3 487703). corrected
.
object file /var/log/lastlog was (3:5 inode 38154) instead of (3:3 32533). corre
cted.
/etc/rc.d/rc doesn't exist anymore. not removed.
/etc/rc.d/rc doesn't exist anymore. not removed.
/etc/rc.d/rc doesn't exist anymore. not removed.
/etc/rc.d/init.d/halt doesn't exist anymore. not removed.
/etc/rc.d/init.d/halt doesn't exist anymore. not removed.
/etc/rc.d/init.d/halt doesn't exist anymore. not removed.
/etc/rc.d/init.d/halt doesn't exist anymore. not removed.
subject file /usr/sbin/sshd was (3:2 inode 132291) instead of (3:3 422932). corr
ected.
object file /etc/shadow was (3:2 inode 52620) instead of (3:3 359955). corrected
.
object file /root was (3:2 inode 64389) instead of (3:3 65025). corrected.
subject file /usr/sbin/sshd was (3:2 inode 132291) instead of (3:3 422932). corr
ected.
subject file /usr/sbin/sshd was (3:2 inode 132291) instead of (3:3 422932). corr
ected.
/usr/X11R6/bin/XF86_SVGA doesn't exist anymore. not removed.
subject file /usr/bin/ssh was (3:2 inode 149782) instead of (3:3 325715). correc
ted.
( [ 1 -eq 1 ] && /sbin/lidsconf -P ; true)
MAKE PASSWD
enter new password:
ここで、lidstools用の管理パスワードを聞かれますので、好きな物をいれます。
reenter new password:
再度管理パスワードを聞かれますので、入力します。
wrote password to /etc/lids/lids.pw
make[3]: Leaving directory `/home/omok/work/lids/lids-1.1.2rc5-2.4.20'
make[2]: Leaving directory `/home/omok/work/lids/lids-1.1.2rc5-2.4.20'
make[1]: Leaving directory `/home/omok/work/lids/lids-1.1.2rc5-2.4.20'
[root@localhost lids-1.1.2rc5-2.4.20]#
これで、lidstoolsのインストールは完了です。

Kazuki Omo 平成15年5月16日