diff --git a/utils/uvol/Makefile b/utils/uvol/Makefile index f929ba515..e988d5168 100644 --- a/utils/uvol/Makefile +++ b/utils/uvol/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=uvol -PKG_VERSION:=0.3 +PKG_VERSION:=0.4 PKG_RELEASE:=$(AUTORELEASE) PKG_MAINTAINER:=Daniel Golle @@ -64,12 +64,13 @@ define Package/autopart/install endef define Package/uvol/install - $(INSTALL_DIR) $(1)/etc/init.d $(1)/usr/libexec/uvol $(1)/usr/sbin $(1)/lib/functions + $(INSTALL_DIR) $(1)/etc/init.d $(1)/usr/libexec/uvol $(1)/usr/sbin $(1)/lib/functions $(1)/etc/uci-defaults $(INSTALL_BIN) ./files/uvol.init $(1)/etc/init.d/uvol $(INSTALL_BIN) ./files/common.sh $(1)/lib/functions/uvol.sh $(INSTALL_BIN) ./files/ubi.sh $(1)/usr/libexec/uvol/20-ubi.sh $(INSTALL_BIN) ./files/lvm.sh $(1)/usr/libexec/uvol/50-lvm.sh $(INSTALL_BIN) ./files/uvol $(1)/usr/sbin + $(INSTALL_BIN) ./files/uvol.defaults $(1)/etc/uci-defaults/90-uvol-restore-uci endef $(eval $(call BuildPackage,autopart)) diff --git a/utils/uvol/files/common.sh b/utils/uvol/files/common.sh index 0eee6d432..e3b554e18 100644 --- a/utils/uvol/files/common.sh +++ b/utils/uvol/files/common.sh @@ -11,15 +11,27 @@ uvol_uci_add() { local volname="$1" local devname="$2" local mode="$3" - local autofs uuid uciname + local autofs=0 + local target="/var/run/uvol/$volname" + local uuid uciname - uciname=${volname//-/_} + [ "$mode" = "ro" ] && autofs=1 + uciname="${volname//[-.]/_}" + uciname="${uciname//[!([:alnum:]_)]}" uuid="$(/sbin/block info | grep "^$2" | xargs -n 1 echo | grep "^UUID=.*")" [ "$uuid" ] || return 22 - _uvol_init_spooldir uuid="${uuid:5}" - autofs=0 - [ "$mode" = "ro" ] && autofs=1 + + case "$uciname" in + "_uxc") + target="/var/state/uxc" + ;; + "_"*) + return 1 + ;; + esac + + _uvol_init_spooldir if [ -e "${UCI_SPOOLDIR}/remove-$1" ]; then rm "${UCI_SPOOLDIR}/remove-$1" fi @@ -27,11 +39,10 @@ uvol_uci_add() { cat >"${UCI_SPOOLDIR}/add-$1" <"${UCI_SPOOLDIR}/remove-$1" </dev/null || uvol detect || true