base-files: - add sysupgrade support for keepfile hints * introduces /lib/upgrade/keep.d/ for per-package keepfile lists * introduces /etc/sysupgrade.conf for user defined keepfile hints - prime /lib/upgrade/keep.d/base-files-essential to keep sysupgrade usable for images without opkg - change sysupgrade to build the keepfile list from /lib/upgrade/keep.d/, /etc/sysupgrade.conf and opkg list-changed-conffiles

SVN-Revision: 23258
This commit is contained in:
Jo-Philipp Wich 2010-10-05 19:24:12 +00:00
parent f3a5085903
commit d80f82d7a4
4 changed files with 21 additions and 3 deletions

View File

@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=base-files
PKG_RELEASE:=58
PKG_RELEASE:=59
PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
PKG_BUILD_DEPENDS:=opkg/host
@ -54,6 +54,8 @@ define Package/base-files/conffiles
/etc/shells
/etc/sysctl.conf
/etc/rc.local
/etc/config/
/etc/dropbear/
$(call $(TARGET)/conffiles)
endef

View File

@ -0,0 +1,5 @@
## This file contains files and directories that should
## be preserved during an upgrade.
# /etc/example.conf
# /etc/openvpn/

View File

@ -0,0 +1,10 @@
# Essential files that will be always kept
/etc/banner
/etc/hosts
/etc/inittab
/etc/group
/etc/passwd
/etc/profile
/etc/shells
/etc/sysctl.conf
/etc/rc.local

View File

@ -55,8 +55,9 @@ EOF
add_uci_conffiles() {
local file="$1"
( find /etc/config /etc/passwd /etc/group /etc/dropbear \
/etc/firewall.user /etc/rc.local -type f;
( find $(sed -ne '/^[[:space:]]*$/d; /^#/d; p' \
/etc/sysupgrade.conf /lib/upgrade/keep.d/* 2>/dev/null) \
-type f 2>/dev/null;
opkg list-changed-conffiles ) | sort -u > "$file"
return 0
}