{"id":783,"date":"2016-03-21T18:17:40","date_gmt":"2016-03-21T17:17:40","guid":{"rendered":"http:\/\/hobbykeller.spdns.de\/?p=783"},"modified":"2019-08-22T12:48:40","modified_gmt":"2019-08-22T10:48:40","slug":"davfs2-installation-bug-in-openwrt-chaos-calmer","status":"publish","type":"post","link":"https:\/\/hobbykeller.spdns.de\/?p=783","title":{"rendered":"davfs2 installation bug in OpenWRT Chaos Calmer"},"content":{"rendered":"<pre class=\"\">Nature:              Bug fix \/ Workaround\r\nApplies to:          Chaos Calmer 15.05\r\nReplaces info from:  http:\/\/hobbykeller.spdns.de\/?p=561<\/pre>\n<p>The davfs2 package which ships with OpenWRT&#8217;s Chaos Calmer (15.05) version may not compile correctly when building the oWRT binaries. It is typical of the bug that the compilation process is interrupted with a message as follows:<\/p>\n<p><!--more--><\/p>\n<pre class=\"lang:default decode:true\" title=\"davfs2 compile error output\">webdav.c: In function 'dav_conv_from_utf_8':\r\nwebdav.c:587:9: error: 'from_utf_8' undeclared (first use in this function)\r\n     if (from_utf_8)\r\n         ^\r\nwebdav.c:587:9: note: each undeclared identifier is reported only once for each function it appears in\r\nwebdav.c:588:9: warning: implicit declaration of function 'convert' [-Wimplicit-function-declaration]\r\n         convert(&amp;new, from_utf_8);\r\n         ^\r\nwebdav.c: In function 'dav_conv_to_utf_8':\r\nwebdav.c:599:9: error: 'to_utf_8' undeclared (first use in this function)\r\n     if (to_utf_8)\r\n         ^\r\nwebdav.c: In function 'dav_conv_from_server_enc':\r\nwebdav.c:611:9: error: 'from_server_enc' undeclared (first use in this function)\r\n     if (from_server_enc)\r\n         ^\r\nwebdav.c: In function 'dav_conv_to_server_enc':\r\nwebdav.c:623:9: error: 'to_server_enc' undeclared (first use in this function)\r\n     if (to_server_enc)\r\n         ^\r\nwebdav.c: At top level:\r\nwebdav.c:1273:19: error: unknown type name 'iconv_t'\r\n convert(char **s, iconv_t conv)\r\n                   ^\r\nwebdav.c: In function 'prop_result':\r\nwebdav.c:1896:13: error: 'from_server_enc' undeclared (first use in this function)\r\n         if (from_server_enc)\r\n             ^\r\nIn file included from webdav.c:22:0:\r\nwebdav.c: At top level:\r\ncompat.h:51:15: warning: 'canonicalize_file_name' defined but not used [-Wunused-function]\r\n static char * canonicalize_file_name(const char *path)\r\n               ^\r\nwebdav.c:1544:1: warning: 'log_writer' defined but not used [-Wunused-function]\r\n log_writer(void *cookie, const char *buffer, size_t size)\r\n ^\r\nmake[6]: *** [webdav.o] Error 1\r\nmake[6]: Leaving directory `\/home\/ilek\/codelab\/openwrt\/build_dir\/target-powerpc_8540_musl-1.1.14\/davfs2-1.5.2\/src'\r\nmake[5]: *** [all-recursive] Error 1\r\nmake[5]: Leaving directory `\/home\/ilek\/codelab\/openwrt\/build_dir\/target-powerpc_8540_musl-1.1.14\/davfs2-1.5.2'\r\nmake[4]: *** [all] Error 2\r\nmake[4]: Leaving directory `\/home\/ilek\/codelab\/openwrt\/build_dir\/target-powerpc_8540_musl-1.1.14\/davfs2-1.5.2'\r\nmake[3]: *** [\/home\/ilek\/codelab\/openwrt\/build_dir\/target-powerpc_8540_musl-1.1.14\/davfs2-1.5.2\/.built] Error 2\r\nmake[3]: Leaving directory `\/home\/ilek\/codelab\/openwrt\/feeds\/packages\/net\/davfs2'\r\nmake[2]: *** [package\/feeds\/packages\/davfs2\/compile] Error 2\r\nmake[2]: Leaving directory `\/home\/ilek\/codelab\/openwrt'\r\nmake[1]: *** [\/home\/ilek\/codelab\/openwrt\/staging_dir\/target-powerpc_8540_musl-1.1.14\/stamp\/.package_compile] Error 2\r\nmake[1]: Leaving directory `\/home\/ilek\/codelab\/openwrt'\r\nmake: *** [world] Error 2\r\n<\/pre>\n<p>There is a discussion on GitHub under the title &#8220;<a href=\"https:\/\/github.com\/openwrt\/packages\/issues\/1327\" target=\"_blank\" rel=\"noopener noreferrer\">davfs2 &#8211; can use full language support &#8211; error build<\/a>&#8221; which references another bug report titled &#8220;<a href=\"https:\/\/github.com\/openwrt\/packages\/pull\/2149\" target=\"_blank\" rel=\"noopener noreferrer\">davfs2: fix inconsistency with HAVE_ICONV and HAVE_ICONV_H<\/a>&#8221; which finally contains a <a href=\"https:\/\/github.com\/openwrt\/packages\/pull\/2149\/files\" target=\"_blank\" rel=\"noopener noreferrer\">bug fix<\/a>.<\/p>\n<h1>Bug fix<\/h1>\n<p>To fix the bug, change <code>feeds\/packages\/net\/davfs\/Makefile<\/code> as shown in the following patch:<\/p>\n<pre class=\"lang:default decode:true\" title=\"Patch for davfs2 Makefile\">--- a\/Makefile\r\n+++ b\/Makefile\r\n@@ -9,7 +9,7 @@\r\n \r\n PKG_NAME:=davfs2\r\n PKG_VERSION:=1.5.2\r\n-PKG_RELEASE:=3\r\n+PKG_RELEASE:=4\r\n \r\n PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz\r\n PKG_SOURCE_URL:=http:\/\/download.savannah.gnu.org\/releases\/davfs2\/\r\n@@ -23,7 +23,7 @@\r\n   SECTION:=net\r\n   CATEGORY:=Network\r\n   SUBMENU:=Filesystem\r\n-  DEPENDS=+libneon +kmod-fuse +libfuse\r\n+  DEPENDS=+libneon +kmod-fuse +libfuse $(ICONV_DEPENDS)\r\n   TITLE:=Mount a WebDAV resource as a regular file system.\r\n   URL:=http:\/\/savannah.nongnu.org\/projects\/davfs2\/\r\n   MAINTAINER:=Federico Di Marco &lt;fededim@gmail.com&gt;<\/pre>\n<p>Furthermore, another patch file must be added to the <code>patches<\/code> subdirectory and saved as <code>patches\/001-replace-have-iconv-h-with-have-iconv.patch <\/code>:<\/p>\n<pre class=\"lang:default decode:true\" title=\"davfs2 HAVE_ICONV patch\">--- a\/src\/webdav.c\r\n+++ b\/src\/webdav.c\r\n+@@ -25,7 +25,7 @@\r\n+ #ifdef HAVE_FCNTL_H\r\n+ #include &lt;fcntl.h&gt;\r\n+ #endif\r\n+-#ifdef HAVE_ICONV_H\r\n++#ifdef HAVE_ICONV\r\n+ #include &lt;iconv.h&gt;\r\n+ #endif\r\n+ #ifdef HAVE_LANGINFO_H\r\n+@@ -231,7 +231,7 @@ static int initialized;\r\n+    Needed by  ssl_verify() which may be called at any time. *\/\r\n+ static int have_terminal;\r\n+ \r\n+-#ifdef HAVE_ICONV_H\r\n++#ifdef HAVE_ICONV\r\n+ \/* Handle to convert character encoding from utf-8 to LC_CTYPE.\r\n+    If NULL no conversion is done. *\/\r\n+ static iconv_t from_utf_8;\r\n+@@ -264,7 +264,7 @@ static char **cookie_list;\r\n+ \/* Private function prototypes and inline functions *\/\r\n+ \/*==================================================*\/\r\n+ \r\n+-#ifdef HAVE_ICONV_H\r\n++#ifdef HAVE_ICONV\r\n+ static void\r\n+ convert(char **s, iconv_t conv);\r\n+ #endif\r\n+@@ -337,7 +337,7 @@ dav_init_webdav(const dav_args *args)\r\n+     if (args-&gt;neon_debug &amp; ~NE_DBG_HTTPPLAIN)\r\n+         syslog(LOG_MAKEPRI(LOG_DAEMON, LOG_DEBUG), \"Initializing webdav\");\r\n+ \r\n+-#ifdef HAVE_ICONV_H\r\n++#ifdef HAVE_ICONV\r\n+     char *lc_charset = nl_langinfo(CODESET);\r\n+     if (lc_charset &amp;&amp; strcasecmp(lc_charset, \"UTF-8\") != 0) {\r\n+         from_utf_8 = iconv_open(lc_charset, \"UTF-8\");<\/pre>\n<h1>davfs2 update to version 1.5.4<\/h1>\n<p>While the basic patching procedure still applies for version 1.5.4, the patch file has to be slightly modified. You can download an updated version here.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Nature: Bug fix \/ Workaround Applies to: Chaos Calmer 15.05 Replaces info from: http:\/\/hobbykeller.spdns.de\/?p=561 The davfs2 package which ships with OpenWRT&#8217;s Chaos Calmer (15.05) version may not compile correctly when<span class=\"more-button\"><a href=\"https:\/\/hobbykeller.spdns.de\/?p=783\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\">davfs2 installation bug in OpenWRT Chaos Calmer<\/span><\/a><\/span><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[64,16],"tags":[152,150,82,151,17],"class_list":["post-783","post","type-post","status-publish","format-standard","hentry","category-linux","category-openwrt","tag-from_utf_8-undeclared","tag-chaos-calmer","tag-davfs2","tag-nls","tag-openwrt"],"_links":{"self":[{"href":"https:\/\/hobbykeller.spdns.de\/index.php?rest_route=\/wp\/v2\/posts\/783","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hobbykeller.spdns.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hobbykeller.spdns.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hobbykeller.spdns.de\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hobbykeller.spdns.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=783"}],"version-history":[{"count":7,"href":"https:\/\/hobbykeller.spdns.de\/index.php?rest_route=\/wp\/v2\/posts\/783\/revisions"}],"predecessor-version":[{"id":1256,"href":"https:\/\/hobbykeller.spdns.de\/index.php?rest_route=\/wp\/v2\/posts\/783\/revisions\/1256"}],"wp:attachment":[{"href":"https:\/\/hobbykeller.spdns.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=783"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hobbykeller.spdns.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=783"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hobbykeller.spdns.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=783"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}