asterisk-13.x: change some default file locations

- Set data dir to /usr/share/asterisk and use default locations for
  everything else.
- This is more in line with FHS. Database files are now written to tmpfs
  (/var is mounted there). This prevents the rootfs from filling up. It
  also prevents the flash to degrade during constant database rewriting.
- As the data dir changes, so does the location of the sound files. This
  commit also takes care of that.

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
This commit is contained in:
Sebastian Kemper 2018-01-16 20:03:16 +01:00
parent 9cc45ac007
commit a430a3a59b
2 changed files with 8 additions and 12 deletions

View file

@ -46,8 +46,8 @@ define Package/asterisk13/install/sbin
endef
define Package/asterisk13/install/sounds
$(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/sounds/en/$(2) $(1)/usr/lib/asterisk/sounds/
$(INSTALL_DIR) $(1)/usr/share/asterisk/sounds/
$(CP) $(PKG_INSTALL_DIR)/usr/share/asterisk/sounds/en/$(2) $(1)/usr/share/asterisk/sounds/
endef
define BuildAsterisk13Module
@ -145,7 +145,7 @@ $(call Package/asterisk13/install/sbin,$(1),safe_asterisk)
$(call Package/asterisk13/install/sbin,$(1),astgenkey)
$(foreach m,$(AST_CFG_FILES),$(call Package/asterisk13/install/conffile,$(1),$(m));)
$(foreach m,$(AST_EMB_MODULES),$(call Package/asterisk13/install/module,$(1),$(m));)
$(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds/
$(INSTALL_DIR) $(1)/usr/share/asterisk/sounds/
$(INSTALL_DIR) $(1)/etc/default
$(INSTALL_DATA) ./files/asterisk.default $(1)/etc/default/asterisk
$(INSTALL_DIR) $(1)/etc/init.d
@ -163,9 +163,9 @@ This package provides the sound-files for Asterisk-13.
endef
define Package/asterisk13-sounds/install
$(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/sounds/en/* $(1)/usr/lib/asterisk/sounds/
rm -f $(1)/usr/lib/asterisk/sounds/vm-*
$(INSTALL_DIR) $(1)/usr/share/asterisk/sounds/
$(CP) $(PKG_INSTALL_DIR)/usr/share/asterisk/sounds/en/* $(1)/usr/share/asterisk/sounds/
rm -f $(1)/usr/share/asterisk/sounds/vm-*
endef
ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk13-chan-dahdi),)
@ -263,10 +263,7 @@ define Build/Compile
ASTCFLAGS="$(EXTRA_CFLAGS) -DLOW_MEMORY"
ASTLDFLAGS="$(EXTRA_LDFLAGS)"
$(MAKE) -C "$(PKG_BUILD_DIR)" \
ASTVARLIBDIR="/usr/lib/asterisk" \
ASTDATADIR="/usr/lib/asterisk" \
ASTKEYDIR="/usr/lib/asterisk" \
ASTDBDIR="/usr/lib/asterisk" \
ASTDATADIR="/usr/share/asterisk" \
NOISY_BUILD="yes" \
DEBUG="" \
OPTIMIZE="" \

View file

@ -14,8 +14,7 @@ start() {
[ -d $DEST/var/run/asterisk ] || mkdir -p $DEST/var/run/asterisk
[ -d $DEST/var/log/asterisk ] || mkdir -p $DEST/var/log/asterisk
[ -d $DEST/var/spool/asterisk ] || mkdir -p $DEST/var/spool/asterisk
[ -d $DEST/var/lib ] || mkdir -p $DEST/var/lib
[ -h $DEST/var/lib/asterisk ] || ln -s /usr/lib/asterisk /var/lib/asterisk
[ -d $DEST/var/lib/asterisk ] || mkdir -p $DEST/var/lib/asterisk
[ -d $DEST/var/lib/asterisk/keys ] || mkdir -p $DEST/var/lib/asterisk/keys
[ -d $DEST/var/log/asterisk/cdr-csv ] || mkdir -p $DEST/var/log/asterisk/cdr-csv