Skip to content
Snippets Groups Projects
0016-procd-remove-procd-nand-package.patch 24.63 KiB
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Fri, 21 Apr 2017 20:37:58 +0200
Subject: procd: remove procd-nand package

We always want to support staged upgrades now, so it's better to include
upgraded into the main package. /lib/upgrade/nand.sh is moved to
base-files.

The procd-nand-firstboot package is removed for now, it may return later
as a separate package.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>

diff --git a/package/base-files/Makefile b/package/base-files/Makefile
index 305d0bfd333fd17f0f7c57ee2298dbfd4b97fe29..fe4430d59092dae9ba2ffbea61f58ac7b4b41dc6 100644
--- a/package/base-files/Makefile
+++ b/package/base-files/Makefile
@@ -19,7 +19,9 @@ PKG_BUILD_DEPENDS:=usign/host
 PKG_LICENSE:=GPL-2.0
 
 # Extend depends from version.mk
-PKG_CONFIG_DEPENDS += CONFIG_SIGNED_PACKAGES CONFIG_TARGET_INIT_PATH CONFIG_TARGET_PREINIT_DISABLE_FAILSAFE
+PKG_CONFIG_DEPENDS += \
+	CONFIG_SIGNED_PACKAGES CONFIG_TARGET_INIT_PATH CONFIG_TARGET_PREINIT_DISABLE_FAILSAFE \
+	CONFIG_NAND_SUPPORT
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -31,7 +33,7 @@ endif
 define Package/base-files
   SECTION:=base
   CATEGORY:=Base system
-  DEPENDS:=+netifd +libc +procd +jsonfilter +SIGNED_PACKAGES:usign +SIGNED_PACKAGES:lede-keyring +fstools +fwtool
+  DEPENDS:=+netifd +libc +procd +jsonfilter +SIGNED_PACKAGES:usign +SIGNED_PACKAGES:lede-keyring +NAND_SUPPORT:ubi-utils +fstools +fwtool
   TITLE:=Base filesystem for Lede
   URL:=http://openwrt.org/
   VERSION:=$(PKG_RELEASE)-$(REVISION)
@@ -106,9 +108,16 @@ ifdef CONFIG_SIGNED_PACKAGES
   endef
 endif
 
+ifeq ($(CONFIG_NAND_SUPPORT),)
+  define Package/base-files/nand-support
+	rm -f $(1)/lib/upgrade/nand.sh
+  endef
+endif
+
 define Package/base-files/install
 	$(CP) ./files/* $(1)/
 	$(Package/base-files/install-key)
+	$(Package/base-files/nand-support)
 	if [ -d $(GENERIC_PLATFORM_DIR)/base-files/. ]; then \
 		$(CP) $(GENERIC_PLATFORM_DIR)/base-files/* $(1)/; \
 	fi
diff --git a/package/base-files/files/lib/upgrade/nand.sh b/package/base-files/files/lib/upgrade/nand.sh
new file mode 100644
index 0000000000000000000000000000000000000000..6bd2005344c081df20e5a330a69e49e37225c39f
--- /dev/null
+++ b/package/base-files/files/lib/upgrade/nand.sh
@@ -0,0 +1,376 @@
+#!/bin/sh
+# Copyright (C) 2014 OpenWrt.org
+#
+
+. /lib/functions.sh
+
+# 'kernel' partition on NAND contains the kernel
+CI_KERNPART="kernel"
+
+# 'ubi' partition on NAND contains UBI