如何通过源码安装nfs,求指点

编译打包和其他
kerrysu
帖子: 25
注册时间: 2016-03-29 9:56
系统: ubuntu

如何通过源码安装nfs,求指点

#1

帖子 kerrysu » 2016-08-02 14:44

如何通过源码安装nfs,求具体教程,谢谢!
头像
vickycq
帖子: 4507
注册时间: 2011-03-20 13:12
系统: Debian
来自: 山东省寿光县
联系:

Re: 如何通过源码安装nfs,求指点

#2

帖子 vickycq » 2016-08-02 15:21

kerrysu 写了:通过源码安装nfs!求具体教程!
从源码编译 nfs-utils
参考 http://git.linux-nfs.org/?p=steved/nfs- ... e9;hb=HEAD

设定 nfs 服务/客户端
参考 https://help.ubuntu.com/community/SettingUpNFSHowTo
https://help.ubuntu.com/lts/serverguide ... ystem.html
https://www.digitalocean.com/community/ ... untu-14-04
https://www.howtoforge.com/how-to-confi ... untu-14.04
kerrysu 写了:通过源码安装nfs!
通过哪里的源码安装 nfs?
可直接说明最终目的

nfs 分为若干部分
1. 内核支持
2. nfs-utils
3. 其它相关部分

1.
检查内核相关支持情况

代码: 全选

grep -Ri 'config_nfs' /boot
2.
nfs-utils 1.3.3 源码下载地址 https://sourceforge.net/projects/nfs/files/nfs-utils/
nfs-utils 上游代码仓库地址 http://git.linux-nfs.org/?p=steved/nfs- ... ;a=summary

3.
参考
http://linux-nfs.org/wiki/index.php/Main_Page
http://nfs.sourceforge.net/
Debian 中文论坛 - forums.debiancn.org
欢迎所有 Debian GNU/Linux 用户
kerrysu
帖子: 25
注册时间: 2016-03-29 9:56
系统: ubuntu

Re: 如何通过源码安装nfs,求指点

#3

帖子 kerrysu » 2016-08-02 17:05

你好,我主要想表达的是在不用apt-get的情况下如何自己下载组件安装NFS,求指导!谢谢
头像
vickycq
帖子: 4507
注册时间: 2011-03-20 13:12
系统: Debian
来自: 山东省寿光县
联系:

Re: 如何通过源码安装nfs,求指点

#4

帖子 vickycq » 2016-08-02 17:22

kerrysu 写了:在不用apt-get的情况下如何自己下载组件安装NFS
为何不使用 apt-get?

根据所使用的 Ubuntu 版本从 http://packages.ubuntu.com/ 下载 nfs-common nfs-kernel-server 及其依赖手动安装

不用 apt-get 的情况下为 Ubuntu 16.04(xenial) 下载组件安装 nfs-utils
下载以下文件
http://packages.ubuntu.com/xenial/nfs-kernel-server
http://packages.ubuntu.com/xenial/nfs-common
对于 amd64 架构为
nfs-kernel-server_1.2.8-9ubuntu12_amd64.deb
nfs-common_1.2.8-9ubuntu12_amd64.deb
下载后用 dpkg -i 安装

附1 如何从 http://packages.ubuntu.com/xenial/nfs-kernel-server 下载 deb 文件
滚动到页面底部,点击表格第一列 "Architecture" 下方对应的架构。例如 amd64 架构点击 'amd64'
进入下载页面后任意选择镜像即可。例如选择韩国镜像 kr.archive.ubuntu.com/ubuntu

附2 如何满足依赖
用 dpkg -i 安装 nfs-common nfs-kernel-server 时,凡是提示依赖不满足的,按上文叙述的方法手工下载安装
Debian 中文论坛 - forums.debiancn.org
欢迎所有 Debian GNU/Linux 用户
头像
vickycq
帖子: 4507
注册时间: 2011-03-20 13:12
系统: Debian
来自: 山东省寿光县
联系:

Re: 如何通过源码安装nfs,求指点

#5

帖子 vickycq » 2016-08-03 9:30

kerrysu 写了:最近在搭建NFS,但是在装NFS的时候老师让我自己尝试用源码安装,配置文件,到现在一头雾水,以前从来没有用源码安装过,能不能详细的给我介绍一下,怎么用源码编译安装
参考 http://git.linux-nfs.org/?p=steved/nfs- ... e9;hb=HEAD

1. 从 sourceforge 项目主页下载 1.3.3 源代码 解压
2. ./configure; make
3. sudo make install


1) 以上第2步需先安装必要的工具 如 build-essectial
2) 以上第2步需先安装必要的依赖。具体参考上文参考链接 "PROJECT RESOURCES" 一节,以及 http://archive.ubuntu.com/ubuntu/pool/m ... untu12.dsc 中 "Build-Depends" 一节中的描述安装必要的依赖。或根据 configure 的输出有针对性地安装缺失依赖;
3) 以上第3步安装完成后,需注意到用此法安装的 nfs-utils 不包含可靠的启动脚本。可根据上文参考链接 "DAEMON STARTUP ORDER" 一节自行撰写,或直接借用 Ubuntu 对应软件包中提供的 systemd 服务/init 脚本,如 nfs-kernel-server 中的 /lib/systemd/system/*.service,/etc/init.d/nfs-kernel-server
Debian 中文论坛 - forums.debiancn.org
欢迎所有 Debian GNU/Linux 用户
kerrysu
帖子: 25
注册时间: 2016-03-29 9:56
系统: ubuntu

Re: 如何通过源码安装nfs,求指点

#6

帖子 kerrysu » 2016-08-03 14:28

root@ubuntu:/home/ks/share/nfs-utils-1.3.3# ./configure
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
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 gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
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 minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for TIRPC... yes
checking for authgss_free_private_data in -ltirpc... yes
checking for prctl... yes
checking for cap_get_proc in -lcap... yes
checking sys/capability.h usability... yes
checking sys/capability.h presence... yes
checking for sys/capability.h... yes
checking for libwrap... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking how to run the C preprocessor... gcc -E
checking whether ln -s works... yes
checking whether make sets $(MAKE)... (cached) yes
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for ar... (cached) ar
checking for ld... /usr/bin/ld -m elf_x86_64
checking for ANSI C header files... (cached) yes
checking for GNU libc2... yes
checking for BSD signal semantics... no
checking for gethostbyname... yes
checking for connect... yes
checking for getaddrinfo... yes
checking for getservbyname... yes
checking for crypt in -lcrypt... yes
checking for dlclose in -ldl... yes
checking for event_dispatch in -levent... yes
checking event.h usability... yes
checking event.h presence... yes
checking for event.h... yes
checking for nfs4_init_name_mapping in -lnfsidmap... yes
checking nfsidmap.h usability... yes
checking nfsidmap.h presence... yes
checking for nfsidmap.h... yes
checking for nfs4_set_debug in -lnfsidmap... yes
checking for nfs4_owner_to_uid in -lnfsidmap... yes
checking for keyctl_instantiate in -lkeyutils... yes
checking keyutils.h usability... yes
checking keyutils.h presence... yes
checking for keyutils.h... yes
checking for find_key_by_type_and_desc in -lkeyutils... yes
checking sqlite3.h usability... yes
checking sqlite3.h presence... yes
checking for sqlite3.h... yes
checking for sqlite3_libversion_number in -lsqlite3... yes
checking for suitable sqlite3 version... yes
checking libgen.h usability... yes
checking libgen.h presence... yes
checking for libgen.h... yes
checking sys/inotify.h usability... yes
checking sys/inotify.h presence... yes
checking for sys/inotify.h... yes
checking for dm_task_create in -ldevmapper... yes
checking libdevmapper.h usability... yes
checking libdevmapper.h presence... yes
checking for libdevmapper.h... yes
checking for sys/inotify.h... (cached) yes
checking for blkid_get_library_version in -lblkid... yes
checking blkid/blkid.h usability... yes
checking blkid/blkid.h presence... yes
checking for blkid/blkid.h... yes
checking for suitable libblkid version... yes
checking for getnameinfo... yes
checking for event_dispatch in -levent... (cached) yes
checking for event.h... (cached) yes
checking for nfs4_init_name_mapping in -lnfsidmap... (cached) yes
checking for nfsidmap.h... (cached) yes
checking for nfs4_set_debug in -lnfsidmap... (cached) yes
checking for nfs4_owner_to_uid in -lnfsidmap... (cached) yes
checking for Kerberos v5... configure: error: Kerberos v5 with GSS support not found: consider --disable-gss or --with-krb5=

那个错误怎么解决?
头像
vickycq
帖子: 4507
注册时间: 2011-03-20 13:12
系统: Debian
来自: 山东省寿光县
联系:

Re: 如何通过源码安装nfs,求指点

#7

帖子 vickycq » 2016-08-03 14:33

kerrysu 写了:root@ubuntu:/home/ks/share/nfs-utils-1.3.3# ./configure
执行 configure; make 无需使用 root/sudo
kerrysu 写了:checking for Kerberos v5... configure: error: Kerberos v5 with GSS support not found: consider --disable-gss or --with-krb5=
具体参考上文参考链接 "PROJECT RESOURCES" 一节
如需要 'gss' 支持,安装 kerberos-5 头文件。对于 Ubuntu 安装 libkrb5-dev
如无需 'gss' 支持,configure 时添加参数 --disable-gss
Debian 中文论坛 - forums.debiancn.org
欢迎所有 Debian GNU/Linux 用户
kerrysu
帖子: 25
注册时间: 2016-03-29 9:56
系统: ubuntu

Re: 如何通过源码安装nfs,求指点

#8

帖子 kerrysu » 2016-08-05 17:12

你好,那个libwrap的源码tcp_wrappers怎么安装?
头像
vickycq
帖子: 4507
注册时间: 2011-03-20 13:12
系统: Debian
来自: 山东省寿光县
联系:

Re: 如何通过源码安装nfs,求指点

#9

帖子 vickycq » 2016-08-05 17:48

kerrysu 写了:那个libwrap的源码tcp_wrappers怎么安装?
sudo apt install libwrap0 libwrap0-dev

若需自行编译 参考 http://www.linuxfromscratch.org/blfs/vi ... ppers.html
上次由 vickycq 在 2016-08-05 21:51,总共编辑 1 次。
Debian 中文论坛 - forums.debiancn.org
欢迎所有 Debian GNU/Linux 用户
kerrysu
帖子: 25
注册时间: 2016-03-29 9:56
系统: ubuntu

Re: 如何通过源码安装nfs,求指点

#10

帖子 kerrysu » 2016-08-05 21:21

一直在看这一行代码,不懂:$ patch -Np1 -i ../tcp_wrappers-7.6-shared_lib_plus_plus-1.patch
求指教
头像
vickycq
帖子: 4507
注册时间: 2011-03-20 13:12
系统: Debian
来自: 山东省寿光县
联系:

Re: 如何通过源码安装nfs,求指点

#11

帖子 vickycq » 2016-08-05 22:41

全部流程

代码: 全选

wget ftp://ftp.porcupine.org/pub/security/tcp_wrappers_7.6.tar.gz
wget http://www.linuxfromscratch.org/patches/blfs/6.3/tcp_wrappers-7.6-shared_lib_plus_plus-1.patch
tar xf tcp_wrappers_7.6.tar.gz
cd tcp_wrappers_7.6
chmod 744 ./*
patch -Np1 -i ../tcp_wrappers-7.6-shared_lib_plus_plus-1.patch
sed -i -e "s,^extern char \*malloc();,/* & */," scaffold.c
make REAL_DAEMON_DIR=/usr/sbin STYLE=-DPROCESS_OPTIONS linux
kerrysu 写了:一直在看这一行代码,不懂:$ patch -Np1 -i ../tcp_wrappers-7.6-shared_lib_plus_plus-1.patch
tcp wrappers 最后一版发布于 1997 年,需通过以上命令打一些补丁。此命令在解压后的目录(tcp_wrappers_7.6)中操作。
由于补丁文件中的路径均为以下形式 tcp_wrappers_7.6/options.c
故使用参数 -p1 将以上粗体部分去除,以便在解压后的目录中操作。
仿此原理,亦可在上一级目录中操作,使用 -p0
参考 http://linux.die.net/man/1/patch

对于此类软件,通过实践熟悉编译流程即可。实际使用时 一般建议直接使用软件源中的版本。即 apt install libwrap0 libwrap0-dev
指导思想是尽量不脱离软件包管理器的体系,以方便管理。有特殊需要时才考虑自行打包或编译。
Debian 中文论坛 - forums.debiancn.org
欢迎所有 Debian GNU/Linux 用户
kerrysu
帖子: 25
注册时间: 2016-03-29 9:56
系统: ubuntu

Re: 如何通过源码安装nfs,求指点

#12

帖子 kerrysu » 2016-08-06 14:48

make的时候出现:
#make
collect2: error: ld returned 1 exit status
make[1]: *** [tcpd] Error 1
make[1]: Leaving directory `/home/xiongwen/tcp_wrappers_7.6'
make: *** [linux] Error 2

在make install的时候:

# make install
install -o root -g root -m 0755 shared/libwrap.so.0.7.6 /usr/lib/
ln -sf libwrap.so.0.7.6 /usr/lib/libwrap.so.0
ln -sf libwrap.so.0 /usr/lib/libwrap.so
install -o root -g root -m 0755 tcpd /usr/sbin/
install: cannot stat ‘tcpd’: No such file or directory
make: *** [install-bin] Error 1
头像
vickycq
帖子: 4507
注册时间: 2011-03-20 13:12
系统: Debian
来自: 山东省寿光县
联系:

Re: 如何通过源码安装nfs,求指点

#13

帖子 vickycq » 2016-08-06 15:36

kerrysu 写了:#make
1. make 时无需使用 root 账户
2. 确保严格按照 11 楼流程操作
3. 出现问题时,建议将输出全部复制贴上来。不要节选,以免遗漏重要信息。

根据测试,对于 11 楼的流程,遗漏倒数第三行(patch -Np1 ...)或倒数第二行(sed -i ...)都无法编译通过,报错各有不同。由于您提供的信息不完整,无法确定问题性质。
kerrysu 写了:install: cannot stat ‘tcpd’: No such file or directory
由于 make 未成功,自然无法 make install
对于此类软件,通过实践熟悉编译流程即可。实际使用时一般建议直接使用软件源中的版本。即 apt install libwrap0 libwrap0-dev
指导思想是尽量不脱离软件包管理器的体系,以方便管理。有特殊需要时才考虑自行打包或编译。
Debian 中文论坛 - forums.debiancn.org
欢迎所有 Debian GNU/Linux 用户
kerrysu
帖子: 25
注册时间: 2016-03-29 9:56
系统: ubuntu

Re: 如何通过源码安装nfs,求指点

#14

帖子 kerrysu » 2016-08-06 15:56

xiongwen@ubuntu:~/tcp_wrappers_7.6$ make REAL_DAEMON_DIR=/usr/sbin STYLE=-DPROCESS_OPTIONS linux
make[1]: Entering directory `/home/xiongwen/tcp_wrappers_7.6'
gcc -O2 -DFACILITY=LOG_DAEMON -DHOSTS_ACCESS -DNETGROUP -DDAEMON_UMASK=022 -DREAL_DAEMON_DIR=\"/usr/sbin\" -DPROCESS_OPTIONS -DKILL_IP_OPTIONS -DSEVERITY=LOG_INFO -DRFC931_TIMEOUT=10 -DHOSTS_DENY=\"/etc/hosts.deny\" -DHOSTS_ALLOW=\"/etc/hosts.allow\" -DSYS_ERRLIST_DEFINED -DHAVE_WEAKSYMS -D_REENTRANT -o tcpd.o -c tcpd.c
gcc -O2 -DFACILITY=LOG_DAEMON -DHOSTS_ACCESS -DNETGROUP -DDAEMON_UMASK=022 -DREAL_DAEMON_DIR=\"/usr/sbin\" -DPROCESS_OPTIONS -DKILL_IP_OPTIONS -DSEVERITY=LOG_INFO -DRFC931_TIMEOUT=10 -DHOSTS_DENY=\"/etc/hosts.deny\" -DHOSTS_ALLOW=\"/etc/hosts.allow\" -DSYS_ERRLIST_DEFINED -DHAVE_WEAKSYMS -D_REENTRANT -fPIC -shared -D_REENTRANT -c hosts_access.c -o shared/hosts_access.o
gcc -O2 -DFACILITY=LOG_DAEMON -DHOSTS_ACCESS -DNETGROUP -DDAEMON_UMASK=022 -DREAL_DAEMON_DIR=\"/usr/sbin\" -DPROCESS_OPTIONS -DKILL_IP_OPTIONS -DSEVERITY=LOG_INFO -DRFC931_TIMEOUT=10 -DHOSTS_DENY=\"/etc/hosts.deny\" -DHOSTS_ALLOW=\"/etc/hosts.allow\" -DSYS_ERRLIST_DEFINED -DHAVE_WEAKSYMS -D_REENTRANT -fPIC -shared -D_REENTRANT -c options.c -o shared/options.o
options.c: In function ‘twist_option’:
options.c:394:13: warning: incompatible implicit declaration of built-in function ‘execl’ [enabled by default]
(void) execl("/bin/sh", "sh", "-c", value, (char *) 0);
^
gcc -O2 -DFACILITY=LOG_DAEMON -DHOSTS_ACCESS -DNETGROUP -DDAEMON_UMASK=022 -DREAL_DAEMON_DIR=\"/usr/sbin\" -DPROCESS_OPTIONS -DKILL_IP_OPTIONS -DSEVERITY=LOG_INFO -DRFC931_TIMEOUT=10 -DHOSTS_DENY=\"/etc/hosts.deny\" -DHOSTS_ALLOW=\"/etc/hosts.allow\" -DSYS_ERRLIST_DEFINED -DHAVE_WEAKSYMS -D_REENTRANT -fPIC -shared -D_REENTRANT -c shell_cmd.c -o shared/shell_cmd.o
shell_cmd.c: In function ‘do_child’:
shell_cmd.c:84:9: warning: incompatible implicit declaration of built-in function ‘execl’ [enabled by default]
(void) execl("/bin/sh", "sh", "-c", command, (char *) 0);
^
shell_cmd.c:91:5: warning: incompatible implicit declaration of built-in function ‘_exit’ [enabled by default]
_exit(0);
^
gcc -O2 -DFACILITY=LOG_DAEMON -DHOSTS_ACCESS -DNETGROUP -DDAEMON_UMASK=022 -DREAL_DAEMON_DIR=\"/usr/sbin\" -DPROCESS_OPTIONS -DKILL_IP_OPTIONS -DSEVERITY=LOG_INFO -DRFC931_TIMEOUT=10 -DHOSTS_DENY=\"/etc/hosts.deny\" -DHOSTS_ALLOW=\"/etc/hosts.allow\" -DSYS_ERRLIST_DEFINED -DHAVE_WEAKSYMS -D_REENTRANT -fPIC -shared -D_REENTRANT -c rfc931.c -o shared/rfc931.o
gcc -O2 -DFACILITY=LOG_DAEMON -DHOSTS_ACCESS -DNETGROUP -DDAEMON_UMASK=022 -DREAL_DAEMON_DIR=\"/usr/sbin\" -DPROCESS_OPTIONS -DKILL_IP_OPTIONS -DSEVERITY=LOG_INFO -DRFC931_TIMEOUT=10 -DHOSTS_DENY=\"/etc/hosts.deny\" -DHOSTS_ALLOW=\"/etc/hosts.allow\" -DSYS_ERRLIST_DEFINED -DHAVE_WEAKSYMS -D_REENTRANT -fPIC -shared -D_REENTRANT -c eval.c -o shared/eval.o
gcc -O2 -DFACILITY=LOG_DAEMON -DHOSTS_ACCESS -DNETGROUP -DDAEMON_UMASK=022 -DREAL_DAEMON_DIR=\"/usr/sbin\" -DPROCESS_OPTIONS -DKILL_IP_OPTIONS -DSEVERITY=LOG_INFO -DRFC931_TIMEOUT=10 -DHOSTS_DENY=\"/etc/hosts.deny\" -DHOSTS_ALLOW=\"/etc/hosts.allow\" -DSYS_ERRLIST_DEFINED -DHAVE_WEAKSYMS -D_REENTRANT -fPIC -shared -D_REENTRANT -c hosts_ctl.c -o shared/hosts_ctl.o
gcc -O2 -DFACILITY=LOG_DAEMON -DHOSTS_ACCESS -DNETGROUP -DDAEMON_UMASK=022 -DREAL_DAEMON_DIR=\"/usr/sbin\" -DPROCESS_OPTIONS -DKILL_IP_OPTIONS -DSEVERITY=LOG_INFO -DRFC931_TIMEOUT=10 -DHOSTS_DENY=\"/etc/hosts.deny\" -DHOSTS_ALLOW=\"/etc/hosts.allow\" -DSYS_ERRLIST_DEFINED -DHAVE_WEAKSYMS -D_REENTRANT -fPIC -shared -D_REENTRANT -c refuse.c -o shared/refuse.o
gcc -O2 -DFACILITY=LOG_DAEMON -DHOSTS_ACCESS -DNETGROUP -DDAEMON_UMASK=022 -DREAL_DAEMON_DIR=\"/usr/sbin\" -DPROCESS_OPTIONS -DKILL_IP_OPTIONS -DSEVERITY=LOG_INFO -DRFC931_TIMEOUT=10 -DHOSTS_DENY=\"/etc/hosts.deny\" -DHOSTS_ALLOW=\"/etc/hosts.allow\" -DSYS_ERRLIST_DEFINED -DHAVE_WEAKSYMS -D_REENTRANT -fPIC -shared -D_REENTRANT -c percent_x.c -o shared/percent_x.o
gcc -O2 -DFACILITY=LOG_DAEMON -DHOSTS_ACCESS -DNETGROUP -DDAEMON_UMASK=022 -DREAL_DAEMON_DIR=\"/usr/sbin\" -DPROCESS_OPTIONS -DKILL_IP_OPTIONS -DSEVERITY=LOG_INFO -DRFC931_TIMEOUT=10 -DHOSTS_DENY=\"/etc/hosts.deny\" -DHOSTS_ALLOW=\"/etc/hosts.allow\" -DSYS_ERRLIST_DEFINED -DHAVE_WEAKSYMS -D_REENTRANT -fPIC -shared -D_REENTRANT -c clean_exit.c -o shared/clean_exit.o
gcc -O2 -DFACILITY=LOG_DAEMON -DHOSTS_ACCESS -DNETGROUP -DDAEMON_UMASK=022 -DREAL_DAEMON_DIR=\"/usr/sbin\" -DPROCESS_OPTIONS -DKILL_IP_OPTIONS -DSEVERITY=LOG_INFO -DRFC931_TIMEOUT=10 -DHOSTS_DENY=\"/etc/hosts.deny\" -DHOSTS_ALLOW=\"/etc/hosts.allow\" -DSYS_ERRLIST_DEFINED -DHAVE_WEAKSYMS -D_REENTRANT -fPIC -shared -D_REENTRANT -c weak_symbols.c -o shared/weak_symbols.o
gcc -O2 -DFACILITY=LOG_DAEMON -DHOSTS_ACCESS -DNETGROUP -DDAEMON_UMASK=022 -DREAL_DAEMON_DIR=\"/usr/sbin\" -DPROCESS_OPTIONS -DKILL_IP_OPTIONS -DSEVERITY=LOG_INFO -DRFC931_TIMEOUT=10 -DHOSTS_DENY=\"/etc/hosts.deny\" -DHOSTS_ALLOW=\"/etc/hosts.allow\" -DSYS_ERRLIST_DEFINED -DHAVE_WEAKSYMS -D_REENTRANT -fPIC -shared -D_REENTRANT -c fromhost.c -o shared/fromhost.o
gcc -O2 -DFACILITY=LOG_DAEMON -DHOSTS_ACCESS -DNETGROUP -DDAEMON_UMASK=022 -DREAL_DAEMON_DIR=\"/usr/sbin\" -DPROCESS_OPTIONS -DKILL_IP_OPTIONS -DSEVERITY=LOG_INFO -DRFC931_TIMEOUT=10 -DHOSTS_DENY=\"/etc/hosts.deny\" -DHOSTS_ALLOW=\"/etc/hosts.allow\" -DSYS_ERRLIST_DEFINED -DHAVE_WEAKSYMS -D_REENTRANT -fPIC -shared -D_REENTRANT -c fix_options.c -o shared/fix_options.o
gcc -O2 -DFACILITY=LOG_DAEMON -DHOSTS_ACCESS -DNETGROUP -DDAEMON_UMASK=022 -DREAL_DAEMON_DIR=\"/usr/sbin\" -DPROCESS_OPTIONS -DKILL_IP_OPTIONS -DSEVERITY=LOG_INFO -DRFC931_TIMEOUT=10 -DHOSTS_DENY=\"/etc/hosts.deny\" -DHOSTS_ALLOW=\"/etc/hosts.allow\" -DSYS_ERRLIST_DEFINED -DHAVE_WEAKSYMS -D_REENTRANT -fPIC -shared -D_REENTRANT -c socket.c -o shared/socket.o
gcc -O2 -DFACILITY=LOG_DAEMON -DHOSTS_ACCESS -DNETGROUP -DDAEMON_UMASK=022 -DREAL_DAEMON_DIR=\"/usr/sbin\" -DPROCESS_OPTIONS -DKILL_IP_OPTIONS -DSEVERITY=LOG_INFO -DRFC931_TIMEOUT=10 -DHOSTS_DENY=\"/etc/hosts.deny\" -DHOSTS_ALLOW=\"/etc/hosts.allow\" -DSYS_ERRLIST_DEFINED -DHAVE_WEAKSYMS -D_REENTRANT -fPIC -shared -D_REENTRANT -c tli.c -o shared/tli.o
gcc -O2 -DFACILITY=LOG_DAEMON -DHOSTS_ACCESS -DNETGROUP -DDAEMON_UMASK=022 -DREAL_DAEMON_DIR=\"/usr/sbin\" -DPROCESS_OPTIONS -DKILL_IP_OPTIONS -DSEVERITY=LOG_INFO -DRFC931_TIMEOUT=10 -DHOSTS_DENY=\"/etc/hosts.deny\" -DHOSTS_ALLOW=\"/etc/hosts.allow\" -DSYS_ERRLIST_DEFINED -DHAVE_WEAKSYMS -D_REENTRANT -fPIC -shared -D_REENTRANT -c workarounds.c -o shared/workarounds.o
gcc -O2 -DFACILITY=LOG_DAEMON -DHOSTS_ACCESS -DNETGROUP -DDAEMON_UMASK=022 -DREAL_DAEMON_DIR=\"/usr/sbin\" -DPROCESS_OPTIONS -DKILL_IP_OPTIONS -DSEVERITY=LOG_INFO -DRFC931_TIMEOUT=10 -DHOSTS_DENY=\"/etc/hosts.deny\" -DHOSTS_ALLOW=\"/etc/hosts.allow\" -DSYS_ERRLIST_DEFINED -DHAVE_WEAKSYMS -D_REENTRANT -fPIC -shared -D_REENTRANT -c update.c -o shared/update.o
gcc -O2 -DFACILITY=LOG_DAEMON -DHOSTS_ACCESS -DNETGROUP -DDAEMON_UMASK=022 -DREAL_DAEMON_DIR=\"/usr/sbin\" -DPROCESS_OPTIONS -DKILL_IP_OPTIONS -DSEVERITY=LOG_INFO -DRFC931_TIMEOUT=10 -DHOSTS_DENY=\"/etc/hosts.deny\" -DHOSTS_ALLOW=\"/etc/hosts.allow\" -DSYS_ERRLIST_DEFINED -DHAVE_WEAKSYMS -D_REENTRANT -fPIC -shared -D_REENTRANT -c misc.c -o shared/misc.o
gcc -O2 -DFACILITY=LOG_DAEMON -DHOSTS_ACCESS -DNETGROUP -DDAEMON_UMASK=022 -DREAL_DAEMON_DIR=\"/usr/sbin\" -DPROCESS_OPTIONS -DKILL_IP_OPTIONS -DSEVERITY=LOG_INFO -DRFC931_TIMEOUT=10 -DHOSTS_DENY=\"/etc/hosts.deny\" -DHOSTS_ALLOW=\"/etc/hosts.allow\" -DSYS_ERRLIST_DEFINED -DHAVE_WEAKSYMS -D_REENTRANT -fPIC -shared -D_REENTRANT -c diag.c -o shared/diag.o
gcc -O2 -DFACILITY=LOG_DAEMON -DHOSTS_ACCESS -DNETGROUP -DDAEMON_UMASK=022 -DREAL_DAEMON_DIR=\"/usr/sbin\" -DPROCESS_OPTIONS -DKILL_IP_OPTIONS -DSEVERITY=LOG_INFO -DRFC931_TIMEOUT=10 -DHOSTS_DENY=\"/etc/hosts.deny\" -DHOSTS_ALLOW=\"/etc/hosts.allow\" -DSYS_ERRLIST_DEFINED -DHAVE_WEAKSYMS -D_REENTRANT -fPIC -shared -D_REENTRANT -c percent_m.c -o shared/percent_m.o
gcc -O2 -DFACILITY=LOG_DAEMON -DHOSTS_ACCESS -DNETGROUP -DDAEMON_UMASK=022 -DREAL_DAEMON_DIR=\"/usr/sbin\" -DPROCESS_OPTIONS -DKILL_IP_OPTIONS -DSEVERITY=LOG_INFO -DRFC931_TIMEOUT=10 -DHOSTS_DENY=\"/etc/hosts.deny\" -DHOSTS_ALLOW=\"/etc/hosts.allow\" -DSYS_ERRLIST_DEFINED -DHAVE_WEAKSYMS -D_REENTRANT -fPIC -shared -D_REENTRANT -c myvsyslog.c -o shared/myvsyslog.o
rm -f shared/libwrap.so.0.7.6
gcc -o shared/libwrap.so.0.7.6 -shared -Xlinker -soname -Xlinker libwrap.so.0 -lc -lnsl shared/hosts_access.o shared/options.o shared/shell_cmd.o shared/rfc931.o shared/eval.o shared/hosts_ctl.o shared/refuse.o shared/percent_x.o shared/clean_exit.o shared/weak_symbols.o shared/fromhost.o shared/fix_options.o shared/socket.o shared/tli.o shared/workarounds.o shared/update.o shared/misc.o shared/diag.o shared/percent_m.o shared/myvsyslog.o;
shared/percent_m.o: In function `percent_m':
percent_m.c:(.text+0x4a): warning: `sys_nerr' is deprecated; use `strerror' or `strerror_r' instead
percent_m.c:(.text+0x5a): warning: `sys_errlist' is deprecated; use `strerror' or `strerror_r' instead
ln -s libwrap.so.0.7.6 shared/libwrap.so.0
ln -s libwrap.so.0 shared/libwrap.so
gcc -O2 -DFACILITY=LOG_DAEMON -DHOSTS_ACCESS -DNETGROUP -DDAEMON_UMASK=022 -DREAL_DAEMON_DIR=\"/usr/sbin\" -DPROCESS_OPTIONS -DKILL_IP_OPTIONS -DSEVERITY=LOG_INFO -DRFC931_TIMEOUT=10 -DHOSTS_DENY=\"/etc/hosts.deny\" -DHOSTS_ALLOW=\"/etc/hosts.allow\" -DSYS_ERRLIST_DEFINED -DHAVE_WEAKSYMS -D_REENTRANT -o tcpd tcpd.o -Lshared -lwrap
shared/libwrap.so: undefined reference to `yp_get_default_domain'
collect2: error: ld returned 1 exit status
make[1]: *** [tcpd] Error 1
make[1]: Leaving directory `/home/xiongwen/tcp_wrappers_7.6'
make: *** [linux] Error 2

注:patch和sed是运行过的
头像
vickycq
帖子: 4507
注册时间: 2011-03-20 13:12
系统: Debian
来自: 山东省寿光县
联系:

Re: 如何通过源码安装nfs,求指点

#15

帖子 vickycq » 2016-08-06 16:56

kerrysu 写了:注:patch和sed是运行过的
猜测 虽然运行过了,但未正确运行。
kerrysu 写了:shared/libwrap.so: undefined reference to `yp_get_default_domain'
问题在于 patch -Np1 ... 一行命令未成功运行。或产生了错误输出但未引起您的注意。

"yp_get_default_domain" 存在于 libnsl 中。原版 Makefile 中 "linux" 一节不包含 -lnsl,因此无法编译通过。
tcp_wrappers-7.6-shared_lib_plus_plus-1.patch 的第 50 行 正修正了此错误。

建议另起炉灶,严格按 11 楼的流程执行。若对任何一步的输出产生疑问,将其全部复制贴上来。
Debian 中文论坛 - forums.debiancn.org
欢迎所有 Debian GNU/Linux 用户
回复