From c4f0ca9670d709dd62f4deb2bc8c307c67379509 Mon Sep 17 00:00:00 2001 From: Shibby Date: Sat, 8 Oct 2011 11:16:25 +0200 Subject: [PATCH] define TCONFIG_HFS --- release/src/Makefile | 6 +++++- release/src/router/Makefile | 4 ++-- release/src/router/config/config.in | 4 ++++ release/src/router/config_base | 1 + release/src/router/httpd/tomato.c | 3 ++- release/src/router/nvram/defaults.c | 3 ++- release/src/router/rc/usb.c | 9 ++++++--- release/src/router/www/Makefile | 7 +++++++ release/src/router/www/about.asp | 3 +++ release/src/router/www/nas-usb.asp | 18 +++++++++++------- 10 files changed, 43 insertions(+), 15 deletions(-) diff --git a/release/src/Makefile b/release/src/Makefile index 05106ae0e9..78d733bf72 100644 --- a/release/src/Makefile +++ b/release/src/Makefile @@ -222,7 +222,7 @@ what: # JFFSv1 | NO_JFFS # NO_CIFS, NO_SSH, NO_ZEBRA, NO_SAMBA, NO_HTTPS, NO_XXTP, NO_LIBOPT # SAMBA3, OPENVPN, IPV6SUPP, EBTABLES, NTFS, MEDIASRV, BBEXTRAS, USBEXTRAS, BCM57, SLIM, NOCAT -# NFS BTCLIENT BTGUI TR_EXTRAS SNMP SDHC +# NFS BTCLIENT BTGUI TR_EXTRAS SNMP SDHC HFS define RouterOptions @( \ @@ -353,6 +353,10 @@ define RouterOptions sed -i "/TCONFIG_SDHC/d" $(1); \ echo "TCONFIG_SDHC=y" >>$(1); \ fi; \ + if [ "$(HFS)" = "y" ]; then \ + sed -i "/TCONFIG_HFS/d" $(1); \ + echo "TCONFIG_HFS=y" >>$(1); \ + fi; \ ) endef diff --git a/release/src/router/Makefile b/release/src/router/Makefile index 01fc2945f5..d8365a977a 100644 --- a/release/src/router/Makefile +++ b/release/src/router/Makefile @@ -423,8 +423,8 @@ endif $(if $(TCONFIG_USB),@cp -f,$(if $(TCONFIG_SDHC),@cp -f,@mv)) $(TARGETDIR)/lib/modules/*/kernel/fs/vfat.*o $(PLATFORMDIR)/extras/ || true $(if $(TCONFIG_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/msdos.*o $(PLATFORMDIR)/extras/ || true $(if $(TCONFIG_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/fuse.*o $(PLATFORMDIR)/extras/ || true - $(if $(TCONFIG_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/hfs.*o $(PLATFORMDIR)/extras/ || true - $(if $(TCONFIG_USB),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/hfsplus.*o $(PLATFORMDIR)/extras/ || true + $(if $(TCONFIG_HFS),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/hfs.*o $(PLATFORMDIR)/extras/ || true + $(if $(TCONFIG_HFS),@cp -f,@mv) $(TARGETDIR)/lib/modules/*/kernel/fs/hfsplus.*o $(PLATFORMDIR)/extras/ || true ifneq ($(TCONFIG_USB),y) @rm -rf $(TARGETDIR)/lib/modules/*/kernel/drivers/usb || true diff --git a/release/src/router/config/config.in b/release/src/router/config/config.in index b50b79f84b..dafd5c8554 100644 --- a/release/src/router/config/config.in +++ b/release/src/router/config/config.in @@ -139,3 +139,7 @@ config TCONFIG_SNMP config TCONFIG_SDHC bool " SDHC/MMC mod for WRT54G/GL" default n + +config TCONFIG_HFS + bool " HFS/HFS+ filesystem support " + default n diff --git a/release/src/router/config_base b/release/src/router/config_base index 815f0be055..52554fd740 100644 --- a/release/src/router/config_base +++ b/release/src/router/config_base @@ -34,3 +34,4 @@ TCONFIG_SAMBASRV=y # TCONFIG_NOCAT is not set # TCONFIG_SNMP is not set # TCONFIG_SDHC is not set +# TCONFIG_HFS is not set diff --git a/release/src/router/httpd/tomato.c b/release/src/router/httpd/tomato.c index e50d1e2ad6..860849c669 100644 --- a/release/src/router/httpd/tomato.c +++ b/release/src/router/httpd/tomato.c @@ -1010,8 +1010,9 @@ static const nvset_t nvset_list[] = { #ifdef TCONFIG_NTFS { "usb_fs_ntfs", V_01 }, #endif +#ifdef TCONFIG_HFS { "usb_fs_hfs", V_01 }, //!Victek - { "usb_fs_hfsplus", V_01 }, //!Victek +#endif { "usb_automount", V_01 }, { "script_usbhotplug", V_TEXT(0, 2048) }, { "script_usbmount", V_TEXT(0, 2048) }, diff --git a/release/src/router/nvram/defaults.c b/release/src/router/nvram/defaults.c index fd17d3087e..576636b6ca 100644 --- a/release/src/router/nvram/defaults.c +++ b/release/src/router/nvram/defaults.c @@ -664,8 +664,9 @@ const defaults_t defaults[] = { #ifdef TCONFIG_NTFS { "usb_fs_ntfs", "1" }, #endif +#ifdef TCONFIG_HFS { "usb_fs_hfs", "0" }, //!Victek - { "usb_fs_hfsplus", "0" }, //!Victek +#endif { "usb_automount", "1" }, #if 0 { "usb_bdflush", "30 500 0 0 100 100 60 0 0" }, diff --git a/release/src/router/rc/usb.c b/release/src/router/rc/usb.c index ffe19c50eb..33d001b294 100644 --- a/release/src/router/rc/usb.c +++ b/release/src/router/rc/usb.c @@ -126,13 +126,12 @@ void start_usb(void) modprobe("fat"); modprobe("vfat"); } +#ifdef TCONFIG_HFS if (nvram_get_int("usb_fs_hfs")) { modprobe("hfs"); - } - - if (nvram_get_int("usb_fs_hfsplus")) { modprobe("hfsplus"); } +#endif } /* if enabled, force USB2 before USB1.1 */ @@ -196,8 +195,10 @@ void stop_usb(void) modprobe_r("vfat"); modprobe_r("fat"); modprobe_r("fuse"); +#ifdef TCONFIG_SAMBASRV modprobe_r("hfs"); modprobe_r("hfsplus"); +#endif sleep(1); #ifdef TCONFIG_SAMBASRV modprobe_r("nls_cp437"); @@ -351,6 +352,7 @@ int mount_r(char *mnt_dev, char *mnt_dir, char *type) ret = eval("ntfs-3g", "-o", options, mnt_dev, mnt_dir); } +#ifdef TCONFIG_HFS if (ret != 0 && strncmp(type, "hfs", "") == 0) { ret = eval("mount", "-o", "noatime,nodev", mnt_dev, mnt_dir); } @@ -358,6 +360,7 @@ int mount_r(char *mnt_dev, char *mnt_dir, char *type) if (ret != 0 && strncmp(type, "hfsplus", "") == 0) { ret = eval("mount", "-o", "noatime,nodev", mnt_dev, mnt_dir); } +#endif if (ret != 0) /* give it another try - guess fs */ ret = eval("mount", "-o", "noatime,nodev", mnt_dev, mnt_dir); diff --git a/release/src/router/www/Makefile b/release/src/router/www/Makefile index 3d3a54a704..106f99f15a 100644 --- a/release/src/router/www/Makefile +++ b/release/src/router/www/Makefile @@ -109,6 +109,12 @@ ifneq ($(TCONFIG_NOCAT),y) sed -i $(INSTALLDIR)/www/about.asp -e "/NOCAT-BEGIN/,/NOCAT-END/d" endif +# Only include HFS/HFS+ option and pages when configured. +ifneq ($(TCONFIG_HFS),y) + sed -i $(INSTALLDIR)/www/nas-usb.asp -e "/HFS-BEGIN/,/HFS-END/d" + sed -i $(INSTALLDIR)/www/about.asp -e "/HFS-BEGIN/,/HFS-END/d" +endif + # Only include IPv6 options if IPv6 is configured in. ifneq ($(TCONFIG_IPV6),y) cd $(INSTALLDIR)/www && \ @@ -221,6 +227,7 @@ endif -e "/NOCAT-BEGIN/d" -e "/NOCAT-END/d"\ -e "/SNMP-BEGIN/d" -e "/SNMP-END/d"\ -e "/SDHC-BEGIN/d" -e "/SDHC-END/d"\ + -e "/HFS-BEGIN/d" -e "/HFS-END/d"\ || true; \ done diff --git a/release/src/router/www/about.asp b/release/src/router/www/about.asp index 6fdd99c44f..43a23f6c5a 100644 --- a/release/src/router/www/about.asp +++ b/release/src/router/www/about.asp @@ -141,6 +141,9 @@ Copyright (C) 2011 MichaƂ Rupental
- Captive Portal. (Based in NocatSplash)
+ +- HFS / HFS+ filesystem integration
+ Copyright (C) 2007-2011 Ofer Chen & Vicente Soriano
http://victek.is-a-geek.com

diff --git a/release/src/router/www/nas-usb.asp b/release/src/router/www/nas-usb.asp index c6803bf099..777ad091ef 100644 --- a/release/src/router/www/nas-usb.asp +++ b/release/src/router/www/nas-usb.asp @@ -47,7 +47,7 @@ textarea {