Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

miredo: Initial import of the package #4201

Closed
wants to merge 1 commit into from
Closed

Conversation

ppetr
Copy link

@ppetr ppetr commented Mar 26, 2017

Maintainer: me
Compile tested: OpenWrt-SDK-15.05.1-brcm47xx-mips74k_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64
Run tested: ASUS RT-N66U (brcm47xx-mips74k) running Chaos Calmer (15.05.1, r48532); works and provides IPv6 connectivity behind NAT as expected out of the box.

Description:
Miredo is an open-source Teredo IPv6 tunneling software, for Linux and the BSD operating systems. It includes functional implementations of all components of the Teredo specification (client, relay and server). It is meant to provide IPv6 connectivity even from behind NAT devices.

Copy link
Contributor

@diizzyy diizzyy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please review these suggestions

@@ -0,0 +1,65 @@
#
# Copyright (C) 2006-2017 OpenWrt.org
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not assign copyright to OpenWrt unless you affiliated.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I probably misunderstood

An up-to-date copyright notice. Use OpenWrt if no other present or supply your own.

in the Contribution Guidelines. I don't really care for copyright, so I'm happy to have none, but I can put there whatever is preferred, or create my own.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be clear, you're free to add your own however :-)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added my own, pro forma :)

PKG_VERSION:=1.2.6
PKG_RELEASE:=1

PKG_BUILD_DIR:=$(BUILD_DIR)/miredo-$(PKG_VERSION)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

PKG_BUILD_DIR:=$(BUILD_DIR)/miredo-$(PKG_VERSION)
PKG_SOURCE:=miredo-1.2.6.tar.xz
PKG_SOURCE_URL:=https://www.remlab.net/files/miredo/
PKG_SHA256SUM:=fa26d2f4a405415833669e2e2e22677b225d8f83600844645d5683535ea43149
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be PKG_HASH

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

PKG_SOURCE:=miredo-1.2.6.tar.xz
PKG_SOURCE_URL:=https://www.remlab.net/files/miredo/
PKG_SHA256SUM:=fa26d2f4a405415833669e2e2e22677b225d8f83600844645d5683535ea43149
PKG_CAT:=xzcat
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.


CONFIGURE_VARS += CFLAGS="$(TARGET_CFLAGS) -std=gnu99"

define Build/Configure
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CONFIGURE_ARGS doesn't work?
Also, we most likely do not want a static binary rather a shared one.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works, thank you.

I was struggling a bit with shared libraries as libtool creates wrappers instead of the actual programs. But pulling the original ones from its helper directories like src/.libs/miredo works, I updated the patch to do this. (Maybe there's a better way, I'll keep looking.) However, when using shared libraries, the package is actually larger than when using static builds. In that case, is it still worth using shared, considering that it's very unlikely another program will ever use the libraries?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please disregard the comment about libtool, this is properly fixed by copying files created by make install. Still I'm curious if a smaller, static version won't be more efficient.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CONFIGURE_ARGS work and now I'm using shared libraries.

IPv6 connectivity even from behind NAT devices.
endef

CONFIGURE_VARS += CFLAGS="$(TARGET_CFLAGS) -std=gnu99"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You probably want PKG_FIXUP:=autoreconf and TARGET_CFLAGS like here:
https:/openwrt/packages/blob/master/libs/libx264/Makefile#L27

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TARGET_CFLAGS works nicely, but autoreconf doesn't. The problem is that I need to patch configure to omit some test that fails to build in the build environment (see patches/100-cross-compile.patch), but I couldn't find a way of doing this after running autoreconf.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In particular, I'm fixing configure to prevent the error below, I didn't find a better solution.

configure: checking required libraries...
checking for /proc/self/maps... configure: error: cannot check for file existence when cross compiling

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just omit it?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Omited autoreconf, kept TARGET_CFLAGS, this works now.

@ppetr ppetr force-pushed the add-miredo branch 2 times, most recently from 28a037c to cccb636 Compare March 26, 2017 16:24
@ppetr
Copy link
Author

ppetr commented Mar 28, 2017

PTAL?

include $(INCLUDE_DIR)/package.mk

CONFIGURE_ARGS+=--with-pic --without-libiconv-prefix --without-libintl-prefix --without-Judy
TARGET_CFLAGS+=-std=gnu99 -O3 -ffast-math
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is -O3 and -ffast-math needed here? If it is a performance optimization please add some numbers to the comments or explain why this is good.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed. I copied it from some other package when creating this one, probably not needed at all.

procd_set_param file $CONFFILE
procd_set_param stdout 1 # forward stdout of the command to logd
procd_set_param stderr 1 # same for stderr
#procd_set_param user nobody # run service as user nobody
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this useless commented line.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.


# Linux iproute2 path:
-IP="/sbin/ip"
+IP="/usr/sbin/ip"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you make it use ip without an absolute path here or does the application does not have the PATH when executing this?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked, but absolute path is required here.
(Using a relative one would probably be a potential security issue anyway.)

@ppetr
Copy link
Author

ppetr commented Jan 6, 2018

PTAL?
(Sorry for the long delay.)

@Baozisoftware
Copy link

This package on openwrt 18.06 can't be compiled in musl, but it can be compiled with glibc or uclibc(use
DEPENDS:=+libpthread +librt +ip +kmod-ipv6 +kmod-tun +libcap
CONFIGURE_ARGS+=--with-pic --without-libiconv-prefix --without-libintl-prefix --without-Judy --enable-shared --disable-binreloc
TARGET_CFLAGS+=-**std=gnu99 -O3 -ffast-math -Wno-error=format-security

patches are redundant!
). But it only allows the router itself to access IPv6. Other devices can't.

@diizzyy
Copy link
Contributor

diizzyy commented Dec 30, 2018

@thess @hnyman
Close due to submitter timeout?

@thess
Copy link
Member

thess commented Jan 1, 2019

Old PR being closed for lack of interest.

@thess thess closed this Jan 1, 2019
@ppetr
Copy link
Author

ppetr commented Jan 1, 2019

My apologies to everyone involved, I haven't had any time to work on this. Should this improve, I'll fix the problems above and reopen. Thank you!

@Ykidia
Copy link

Ykidia commented Feb 9, 2020

Hello! What about continuing? I tried to build miredo (with all modifications from here plus replaced gettext.h with newer one) against musl, but with no success. Can you help me? Thanks!

@wosk
Copy link

wosk commented Mar 15, 2020

@Ykidia See following pull request

@Ykidia
Copy link

Ykidia commented Mar 15, 2020

Thank you, but I already adopted miredo package for actual (latest in OpenWrt) gettext, modified all *.m4 (recompiling aclocal.m4), applied https:/ppetr/openwrt-miredo/pull/4 and it is compiling and working now very good. Fixing errors like in #11467 ("pass PKG_CHECK_FORMAT_SECURITY:=0") is not the way I like (and many others).
If you want, I can send full source *.tar.gz (with my changes) for you to consider to make another PR without mentioned hack.
Thank you for revival!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants