V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
OpenWrt 是一个专门面向嵌入式设备的 Linux 发行版。你可以将 OpenWrt 支持的型号的嵌入式设备,比如各种路由器上的系统,换成一个有更多可能性可以折腾的 Linux 系统。
OpenWrt 官方网站
debiansid
V2EX  ›  OpenWrt

deadwood on openwrt 打包 ipk 求助

  •  
  •   debiansid · 2015-01-29 15:09:01 +08:00 · 1348 次点击
    这是一个创建于 3589 天前的主题,其中的信息可能已经有所发展或是发生改变。
    @aa65535 我参考了你的chinadns以及maradns的Makefile写法,但是deadwood始终无法编译;错误如下
    cd /home/admin/openwrt/build_dir/target-mips_34kc_eglibc-2.19/deadwood-3.2.06/src; make all -C /home/admin/openwrt/build_dir/target-mips_34kc_eglibc-2.19/deadwood-3.2.06 CFLAGS="-Os -pipe -mno-branch-likely -mips32r2 -mtune=34kc -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float -mips16 -minterlink-mips16" FLAGS="-Os -pipe -mno-branch-likely -mips32r2 -mtune=34kc -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float -mips16 -minterlink-mips16" CC="mips-openwrt-linux-gnu-gcc" HOSTCC="gcc" V=
    make[4]: Entering directory `/home/admin/openwrt/build_dir/target-mips_34kc_eglibc-2.19/deadwood-3.2.06'
    make[4]: *** No rule to make target `all'. Stop.
    make[4]: Leaving directory `/home/admin/openwrt/build_dir/target-mips_34kc_eglibc-2.19/deadwood-3.2.06'
    make[3]: *** [/home/admin/openwrt/build_dir/target-mips_34kc_eglibc-2.19/deadwood-3.2.06/.built] Error 2
    make[3]: Leaving directory `/home/admin/openwrt/package/openwrt-deadwood'
    make[2]: *** [package/openwrt-deadwood/compile] Error 2
    make[2]: Leaving directory `/home/admin/openwrt'
    make[1]: *** [/home/admin/openwrt/staging_dir/target-mips_34kc_eglibc-2.19/stamp/.package_compile] Error 2
    make[1]: Leaving directory `/home/admin/openwrt'

    src里面有Makefile,用toolchain可以make all成功,我想弄成ipk形式。
    不知道从哪里下手。

    谢谢
    第 1 条附言  ·  2015-01-29 17:02:13 +08:00
    deadwood_3.2.06-1_ar71xx.ipk
    生成了,要点是
    1.修改源代码Makefile
    2.修改ipk Makefile,分别编译Deadwood, duende

    等换eglibc再测试效果
    15 条回复    2015-02-02 23:39:26 +08:00
    aa65535
        1
    aa65535  
       2015-01-29 16:35:31 +08:00
    这种错误一般是 PKG_BUILD_DIR 路径没写对,检查一下对应的 tar.gz 文件里的目录名称。
    目录 /home/admin/openwrt/build_dir/target-mips_34kc_eglibc-2.19/deadwood-3.2.06 是对的么?

    另外,问这种最好把 Makefile 贴出来,不然我只能猜了。
    debiansid
        2
    debiansid  
    OP
       2015-01-29 17:03:04 +08:00
    @aa65535 -C 要指定到源码在的位置,src以及tools
    debiansid
        4
    debiansid  
    OP
       2015-01-29 18:12:56 +08:00
    @LazyZhu @aa65535
    make -C /home/admin/openwrt/build_dir/target-mips_34kc_eglibc-2.19/deadwood-3.2.06/src CFLAGS="-Os -pipe -mno-branch-likely -mips32r2 -mtune=34kc -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float -mips16 -minterlink-mips16" FLAGS="-Os -pipe -mno-branch-likely -mips32r2 -mtune=34kc -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float -mips16 -minterlink-mips16" CC="mips-openwrt-linux-gnu-gcc" HOSTCC="gcc" V=
    make[4]: Entering directory `/home/admin/openwrt/build_dir/target-mips_34kc_eglibc-2.19/deadwood-3.2.06/src'
    mips-openwrt-linux-gnu-gcc -Os -pipe -mno-branch-likely -mips32r2 -mtune=34kc -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float -mips16 -minterlink-mips16 -Wall -c -o DwHash.o DwHash.c
    DwHash.c: In function 'dwh_hash_compress':
    DwHash.c:155:24: error: 'MUL_CONSTANT' undeclared (first use in this function)
    out *= MUL_CONSTANT;
    ^
    DwHash.c:155:24: note: each undeclared identifier is reported only once for each function it appears in
    make[4]: *** [DwHash.o] Error 1
    make[4]: Leaving directory `/home/admin/openwrt/build_dir/target-mips_34kc_eglibc-2.19/deadwood-3.2.06/src'
    make[3]: *** [/home/admin/openwrt/build_dir/target-mips_34kc_eglibc-2.19/deadwood-3.2.06/.built] Error 2
    make[3]: Leaving directory `/home/admin/openwrt/package/openwrt-deadwood'
    make[2]: *** [package/openwrt-deadwood/compile] Error 2
    make[2]: Leaving directory `/home/admin/openwrt'
    make[1]: *** [/home/admin/openwrt/staging_dir/target-mips_34kc_eglibc-2.19/stamp/.package_compile] Error 2
    make[1]: Leaving directory `/home/admin/openwrt'
    make: *** [world] Error 2

    编译不是每次都可以成功。指点下?
    debiansid
        5
    debiansid  
    OP
       2015-01-29 18:14:51 +08:00
    @aa65535 @LazyZhu
    我的Makefile
    #
    # Copyright (C) 2006-2009 OpenWrt.org
    #
    # This is free software, licensed under the GNU General Public License v2.
    # See /LICENSE for more information.
    #

    include $(TOPDIR)/rules.mk

    PKG_NAME:=deadwood
    PKG_VERSION:=3.2.06
    PKG_RELEASE:=1

    PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
    PKG_SOURCE_URL:=http://maradns.samiam.org/deadwood/stable/$(PKG_VERSION)
    #PKG_MD5SUM:=1d221438fb4d9317263555262b9c652c

    include $(INCLUDE_DIR)/package.mk

    define Package/deadwood
    SECTION:=net
    CATEGORY:=Network
    DEPENDS:=+libpthread
    TITLE:=Small and secure DNS Server
    URL:=http://www.maradns.org/
    SUBMENU:=IP Addresses and Names
    endef

    define Package/deadwood/description
    maradns is a DNS server written with security, simplicity, and
    performance in mind.
    endef

    define Package/deadwood/conffiles
    /etc/maradns/dwood3rc
    endef

    #define Build/Configure
    # it's not GNU autoconf stuff
    # (cd $(PKG_BUILD_DIR)/src; \
    #$(TARGET_CONFIGURE_OPTS) \
    # ./configure \
    );
    #endef

    # cd $(PKG_BUILD_DIR)/src; \

    define Build/Compile
    $(MAKE) -C $(PKG_BUILD_DIR)/src \
    CFLAGS="$(TARGET_CFLAGS)" \
    FLAGS="$(TARGET_CFLAGS)" \
    CC="$(TARGET_CC)" \
    HOSTCC="$(HOSTCC)" \
    V=
    #mkdir -p $(PKG_INSTALL_DIR)/usr/{bin,sbin}
    #mkdir -p $(PKG_INSTALL_DIR)/usr/man/man{1,5,8}
    $(MAKE) -C $(PKG_BUILD_DIR)/tools \
    CFLAGS="$(TARGET_CFLAGS)" \
    FLAGS="$(TARGET_CFLAGS)" \
    CC="$(TARGET_CC)" \
    #PREFIX="$(PKG_INSTALL_DIR)/usr" \
    #RPM_BUILD_ROOT="$(PKG_INSTALL_DIR)" \
    V=
    #install
    endef

    define Package/deadwood/install
    $(INSTALL_DIR) $(1)/etc/maradns
    $(INSTALL_DATA) ./files/dwood3rc $(1)/etc/maradns/dwood3rc
    $(INSTALL_DIR) $(1)/etc/init.d
    $(INSTALL_BIN) ./files/deadwood.init $(1)/etc/init.d/deadwood
    $(INSTALL_DIR) $(1)/usr/bin
    $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/Deadwood $(1)/usr/bin/
    $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/duende $(1)/usr/bin/
    endef

    $(eval $(call BuildPackage,deadwood))
    LazyZhu
        6
    LazyZhu  
       2015-01-29 18:28:02 +08:00
    @debiansid
    PKG_USE_MIPS16:=0
    试试添加这条后编译,
    另外deadwood依赖librt, 参考我的Makefile
    debiansid
        7
    debiansid  
    OP
       2015-01-29 19:02:29 +08:00
    @LazyZhu duende-ng 的Makefile 给一个吧,我的是eglibc,不能直接用ipk。谢谢
    LazyZhu
        8
    LazyZhu  
       2015-01-29 19:15:23 +08:00
    @debiansid 好了
    debiansid
        9
    debiansid  
    OP
       2015-01-29 19:30:50 +08:00 via iPhone
    @LazyZhu 感谢… 还有我想在4300跑powerdns 的recursor 作者说uclibc 不支持*context 只能换eglibc 才能编译。现在主流都是uclibc 换了软件都要自己编译,有啥方案不?
    LazyZhu
        10
    LazyZhu  
       2015-01-29 19:43:28 +08:00
    不知道powerdns要啥context, 搜索"uClibc context patch", openwrt 工具链自己打补丁哦
    debiansid
        11
    debiansid  
    OP
       2015-01-29 21:19:08 +08:00
    @LazyZhu root@YesRouter:/etc/maradns# *** Error in `Deadwood': double free or corruption (out): 0x004cf1f0 ***
    eglibc 下不稳定貌似。你的ublibc下面正常不
    debiansid
        12
    debiansid  
    OP
       2015-01-29 21:23:38 +08:00
    debiansid
        13
    debiansid  
    OP
       2015-01-30 11:48:20 +08:00
    @LazyZhu http://git.uclibc.org/uClibc/commit/?id=a8dc90eaaa5e6474beac828558d969b1aafee4af
    我找到了这个包,不知道怎么在buildroot里面替换原来的uclibc
    debiansid
        14
    debiansid  
    OP
       2015-01-30 12:50:50 +08:00
    替换bz2,编译失败,现在想打补丁,不知道应该在哪个阶段打
    debiansid
        15
    debiansid  
    OP
       2015-02-02 23:39:26 +08:00 via iPhone
    @LazyZhu 折腾两天搞好了 ipk
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   5824 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 03:23 · PVG 11:23 · LAX 19:23 · JFK 22:23
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.