+define Package/kdump/install
+ $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d $(1)/etc/config $(1)/etc/uci-defaults
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/vmcore-dmesg $(1)/usr/sbin
+ $(INSTALL_BIN) ./files/kdump.init $(1)/etc/init.d/kdump
+ $(INSTALL_BIN) ./files/kdump.defaults $(1)/etc/uci-defaults/kdump
+ $(INSTALL_CONF) ./files/kdump.config $(1)/etc/config/kdump
+endef
+
+define Package/kdump/prerm
+#!/bin/sh
+
+case $$(uname -m) in
+ i?86|x86_64)
+ if grep -q " crashkernel=" /boot/grub/grub.cfg; then
+ mount /boot -o remount,rw
+ sed -i 's/ crashkernel=[^ ]*//' /boot/grub/grub.cfg
+ mount /boot -o remount,ro
+ fi
+ ;;
+esac
+endef
+