diff options
author | Waldemar Brodkorb <wbx@openadk.org> | 2013-10-18 11:37:40 +0200 |
---|---|---|
committer | Waldemar Brodkorb <wbx@openadk.org> | 2013-10-18 11:37:40 +0200 |
commit | 207248e837badc05ba0d1e6fb0f3fb77b4fd8a34 (patch) | |
tree | 890ede82bb7ad22c79ccbbd690b03f84fe8b0b58 /package | |
parent | d579cd4a819aa5e0e6fa9dccd4e2ea6104a57815 (diff) | |
parent | 94e55c5b6cb493d9467686088a7b159322eeda5f (diff) |
Merge branch 'master' of git+ssh://openadk.org/git/openadk
Diffstat (limited to 'package')
-rw-r--r-- | package/base-files/Makefile | 2 | ||||
-rw-r--r-- | package/base-files/src/etc/init.d/mount | 2 | ||||
-rw-r--r-- | package/cfgfs/src/defs.h | 2 | ||||
-rw-r--r-- | package/cfgfs/src/wraps.c | 8 | ||||
-rw-r--r-- | package/mpd/Makefile | 3 | ||||
-rw-r--r-- | package/mpd/files/mpd.conf | 2 | ||||
-rw-r--r-- | package/mpd/files/mpd.init | 4 | ||||
-rw-r--r-- | package/mpd/patches/patch-src_db_simple_db_plugin_c | 84 |
8 files changed, 99 insertions, 8 deletions
diff --git a/package/base-files/Makefile b/package/base-files/Makefile index 77500a403..da70549a0 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/mk/rootfs.mk PKG_NAME:= base-files PKG_VERSION:= 1.0 -PKG_RELEASE:= 60 +PKG_RELEASE:= 61 PKG_SECTION:= base PKG_DESCR:= basic files and scripts diff --git a/package/base-files/src/etc/init.d/mount b/package/base-files/src/etc/init.d/mount index f0df597e5..6c59d7bab 100644 --- a/package/base-files/src/etc/init.d/mount +++ b/package/base-files/src/etc/init.d/mount @@ -1,5 +1,5 @@ #!/bin/sh -#INIT 99 +#INIT 60 [[ $1 = autostart ]] || exit 0 # any lvm volumes to activate? diff --git a/package/cfgfs/src/defs.h b/package/cfgfs/src/defs.h index c099ffb5a..5a70d8c14 100644 --- a/package/cfgfs/src/defs.h +++ b/package/cfgfs/src/defs.h @@ -10,7 +10,7 @@ #define DEFS_H #define DEF_FLASHBLOCK 65536 /* size of a flash block */ -#define DEF_FLASHPART 4194304 /* max size of the partition */ +#define DEF_FLASHPART 16777215 /* max size of the partition */ #define FWCF_VER 0x01 /* major version of spec used */ diff --git a/package/cfgfs/src/wraps.c b/package/cfgfs/src/wraps.c index 288f6dbab..0364c7b71 100644 --- a/package/cfgfs/src/wraps.c +++ b/package/cfgfs/src/wraps.c @@ -77,6 +77,14 @@ fwcf_pack(char *odata, size_t i, int algo, size_t *dstsz) /* 12 bytes header, padding to 4-byte boundary, 4 bytes trailer */ k = ((j + 19) / 4) * 4; + +#if DEF_FLASHPART > 0xFFFFFF +# error DEF_FLASHPART too large +#endif + if (k > DEF_FLASHPART) + errx(1, "%lu bytes too large for flash partition of %lu KiB", + (u_long)k, DEF_FLASHPART / 1024UL); + /* padded to size of flash block */ #if (DEF_FLASHBLOCK & 3) # error DEF_FLASHBLOCK must be dword-aligned diff --git a/package/mpd/Makefile b/package/mpd/Makefile index c14529ab5..2d97f9f0b 100644 --- a/package/mpd/Makefile +++ b/package/mpd/Makefile @@ -5,7 +5,7 @@ include ${TOPDIR}/rules.mk PKG_NAME:= mpd PKG_VERSION:= 0.17.6 -PKG_RELEASE:= 1 +PKG_RELEASE:= 2 PKG_MD5SUM:= d0da6a6a1d9cf1e8710b6082f6ef7849 PKG_DESCR:= A music player daemon PKG_SECTION:= multimedia @@ -120,6 +120,7 @@ CONFIGURE_ARGS+= --disable-httpd-output \ --disable-sqlite \ --disable-mpg123 \ --disable-soundcloud \ + --enable-inotify \ --with-zeroconf=no ifneq (${ADK_PACKAGE_MPD_WITH_ALSA},) diff --git a/package/mpd/files/mpd.conf b/package/mpd/files/mpd.conf index ee3565c15..cb5bc4c90 100644 --- a/package/mpd/files/mpd.conf +++ b/package/mpd/files/mpd.conf @@ -5,7 +5,7 @@ music_directory "/music" playlist_directory "/etc/mpd/playlists" state_file "/etc/mpd/state" db_file "/etc/mpd/database" -pid_file "/var/run/mpd.pid" +pid_file "/var/run/mpd/mpd.pid" log_file "syslog" filesystem_charset "UTF-8" id3v1_encoding "UTF-8" diff --git a/package/mpd/files/mpd.init b/package/mpd/files/mpd.init index 8ff050b73..5c474eb13 100644 --- a/package/mpd/files/mpd.init +++ b/package/mpd/files/mpd.init @@ -21,6 +21,10 @@ start) mkdir -p /etc/mpd/playlists chown -R mpd:mpd /etc/mpd fi + if [ ! -d /var/run/mpd ];then + mkdir -p /var/run/mpd + chown -R mpd:mpd /var/run/mpd + fi mpd ;; stop) diff --git a/package/mpd/patches/patch-src_db_simple_db_plugin_c b/package/mpd/patches/patch-src_db_simple_db_plugin_c index 4158c5b8e..55ebba670 100644 --- a/package/mpd/patches/patch-src_db_simple_db_plugin_c +++ b/package/mpd/patches/patch-src_db_simple_db_plugin_c @@ -1,9 +1,87 @@ ---- mpd-0.17.5.orig/src/db/simple_db_plugin.c 2013-08-01 09:15:41.000000000 +0200 -+++ mpd-0.17.5/src/db/simple_db_plugin.c 2013-10-08 15:28:10.000000000 +0200 -@@ -338,6 +338,8 @@ simple_db_save(struct db *_db, GError ** +--- mpd-0.17.6.orig/src/db/simple_db_plugin.c 2013-08-01 09:15:41.000000000 +0200 ++++ mpd-0.17.6/src/db/simple_db_plugin.c 2013-10-17 17:51:34.000000000 +0200 +@@ -28,6 +28,9 @@ + #include "conf.h" + #include "directory.h" + ++#include <sys/mount.h> ++#include <mntent.h> ++#include <string.h> + #include <sys/types.h> + #include <sys/stat.h> + #include <unistd.h> +@@ -128,8 +131,8 @@ simple_db_check(struct simple_db *db, GE + return false; + } + +- /* Check if we can write to the directory */ +- if (access(dirPath, X_OK | W_OK)) { ++ /* Check if we can change into the directory */ ++ if (access(dirPath, X_OK)) { + g_set_error(error_r, simple_db_quark(), errno, + "Can't create db file in \"%s\": %s", + dirPath, g_strerror(errno)); +@@ -159,9 +162,9 @@ simple_db_check(struct simple_db *db, GE + } + + /* And check that we can write to it */ +- if (access(db->path, R_OK | W_OK)) { ++ if (access(db->path, R_OK)) { + g_set_error(error_r, simple_db_quark(), errno, +- "Can't open db file \"%s\" for reading/writing: %s", ++ "Can't open db file \"%s\" for reading: %s", + db->path, g_strerror(errno)); + return false; + } +@@ -305,6 +308,9 @@ simple_db_save(struct db *_db, GError ** + { + struct simple_db *db = (struct simple_db *)_db; + struct directory *music_root = db->root; ++ struct mntent *mnt; ++ int remount; ++ FILE *f; + + db_lock(); + +@@ -317,6 +323,26 @@ simple_db_save(struct db *_db, GError ** + db_unlock(); + + g_debug("writing DB"); ++ ++ remount = 0; ++ /* check if /data is mounted read-only */ ++ if ((f = setmntent("/proc/mounts", "r")) == NULL) ++ g_message("Checking /proc/mounts failed"); ++ ++ while ((mnt = getmntent(f)) != NULL) { ++ if (strcmp(mnt->mnt_dir, "/data") == 0 && ++ hasmntopt(mnt, MNTOPT_RO) != NULL) { ++ remount = 1; ++ } ++ } ++ endmntent(f); ++ ++ if (remount) { ++ if (mount("","/data",0,MS_REMOUNT,0)<0) { ++ g_error("Remounting /data rw failed"); ++ } ++ g_message("Mounted /data successfully in read-write mode"); ++ } + + FILE *fp = fopen(db->path, "w"); + if (!fp) { +@@ -338,6 +364,16 @@ simple_db_save(struct db *_db, GError ** fclose(fp); ++ if (remount) { ++ sync(); ++ if (mount("","/data",0,MS_REMOUNT|MS_RDONLY,0)<0) { ++ g_error("Remounting /data ro failed"); ++ } ++ g_message("Mounted /data successfully in read-only mode"); ++ } ++ + g_message("Successfully written database to file: %s", db->path); + struct stat st; |