分享

lfs上安装net

 dwlinux_gs 2016-06-14
在lfs上安装net-tools,步骤:
下载net-tools-1.60.tar.bz2,解压后
make config --对每项进行配置
make --这里如果是默认的1.60版本,会出现报错,提示如下错误:
inet_sr.c: In function 'INET_setroute':
inet_sr.c:108: error: label at end of compound statement
make[1]: *** [inet_sr.o] Error 1
make[1]: Leaving directory `/root/sources/net-tools-1.60/lib'
make: *** [subdirs] Error 2
解决的办法是对这个问题打一个patch,patch内容如下:
--- net-tools-1.60/hostname.c 2001-04-08 19:04:23.000000000 +0200
+++ net-tools-1.60-fixed/hostname.c 2004-05-29 20:29:50.526423387 +0200
@@ -98,6 +98,7 @@
    fprintf(stderr, _("%s: name too long\n"), program_name);
    break;
default:
+      ;
}
exit(1);
     };
@@ -117,6 +118,7 @@
    fprintf(stderr, _("%s: name too long\n"), program_name);
    break;
default:
+      ;
}
exit(1);
     };
@@ -174,6 +176,7 @@
printf("%s\n", hp->h_name);
break;
     default:
+  ;
     }
}

diff -Nur net-tools-1.60/lib/inet_sr.c net-tools-1.60-fixed/lib/inet_sr.c
--- net-tools-1.60/lib/inet_sr.c 2000-02-20 22:46:45.000000000 +0100
+++ net-tools-1.60-fixed/lib/inet_sr.c 2004-05-29 20:29:42.490447616 +0200
@@ -105,6 +105,7 @@
     case 2:
        isnet = 0; break;
     default:
+       ;
     }

     /* Fill in the other fields. */
将以上内容保存为hostname.patch,复制到net-tools的源代码目录下,执行:
patch -Np1 -i hostname.patch
即可修改该问题。
然后make -n install ; make install。
完成安装。
以上patch的原文链接:
http://distro./pub/linux/distributions/sourcemage/grimoire/codex/test/net/net-tools/gcc-3.4.patch

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多