mdadm: Fix config generation
The init script generated something like "DEVICE=/dev/sda" when it should have been generating "DEVICE /dev/sda". mdadm errors on this. Patch by jow. Also changed the default sendmail path to /usr/sbin/sendmail. No package in LEDE provides /sbin/sendmail. msmtp provides /usr/sbin/sendmail so use that. Also add a patch to fix file paths for mdadm runtime files. mdadm currently errors on them since /run is missing. Once /run is added to stock LEDE, this patch can be removed. Signed-off-by: Rosen Penev <rosenp@gmail.com> [rewrap commit message] Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
		 Rosen Penev
					Rosen Penev
				
			
				
					committed by
					
						 Jo-Philipp Wich
						Jo-Philipp Wich
					
				
			
			
				
	
			
			
			 Jo-Philipp Wich
						Jo-Philipp Wich
					
				
			
						parent
						
							378e1a4858
						
					
				
				
					commit
					8eadec40bd
				
			| @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk | |||||||
|  |  | ||||||
| PKG_NAME:=mdadm | PKG_NAME:=mdadm | ||||||
| PKG_VERSION:=4.0 | PKG_VERSION:=4.0 | ||||||
| PKG_RELEASE:=2 | PKG_RELEASE:=3 | ||||||
|  |  | ||||||
| PKG_SOURCE_URL:=@KERNEL/linux/utils/raid/mdadm | PKG_SOURCE_URL:=@KERNEL/linux/utils/raid/mdadm | ||||||
| PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz | PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz | ||||||
| @@ -38,11 +38,10 @@ define Package/mdadm/description | |||||||
| endef | endef | ||||||
|  |  | ||||||
| define Package/mdadm/conffiles | define Package/mdadm/conffiles | ||||||
| /etc/mdadm.conf |  | ||||||
| /etc/config/mdadm | /etc/config/mdadm | ||||||
| endef | endef | ||||||
|  |  | ||||||
| TARGET_CFLAGS += -ffunction-sections -fdata-sections -DNO_COROSYNC -DNO_DLM -DUSE_PTHREADS | TARGET_CFLAGS += -ffunction-sections -fdata-sections -DNO_COROSYNC -DNO_DLM -DUSE_PTHREADS -DCONFFILE="/var/etc/mdadm.conf" -DMAP_DIR="/var/run/mdadm" -DMDMON_DIR="/var/run/mdadm" -DFAILED_SLOTS_DIR="/var/run/mdadm/failed-slots" | ||||||
| TARGET_LDFLAGS += -Wl,--gc-sections | TARGET_LDFLAGS += -Wl,--gc-sections | ||||||
|  |  | ||||||
| define Build/Compile | define Build/Compile | ||||||
|   | |||||||
| @@ -34,14 +34,13 @@ mdadm_common() { | |||||||
| 	local cfg="$1" | 	local cfg="$1" | ||||||
| 	local email devices | 	local email devices | ||||||
|  |  | ||||||
| 	if [ -x /sbin/sendmail ]; then | 	if [ -x /usr/sbin/sendmail ]; then | ||||||
| 		append_option email "$cfg" email "MAILADDR" | 		config_get email "$cfg" email | ||||||
|  | 		[ -n "$email" ] && printf "MAILADDR %s\n" "$email" >> $CONF | ||||||
| 	fi | 	fi | ||||||
|  |  | ||||||
| 	append_option devices "$cfg" devices DEVICE " " | 	config_list_foreach "$cfg" devices append_list_item devices " " | ||||||
|  | 	[ -n "$devices" ] && printf "DEVICE %s\n" "$devices" >> $CONF | ||||||
| 	printf "%s\n%s\n" "$email" "$devices" >> $CONF |  | ||||||
| } | } | ||||||
|  |  | ||||||
| mdadm_array() { | mdadm_array() { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user