summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/image.mk2
-rw-r--r--include/rootfs.mk2
-rw-r--r--package/Makefile5
3 files changed, 7 insertions, 2 deletions
diff --git a/include/image.mk b/include/image.mk
index b963735..d48b1f6 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -297,7 +297,7 @@ opkg_target = \
target-dir-%: FORCE
rm -rf $(mkfs_cur_target_dir) $(mkfs_cur_target_dir).opkg
- $(CP) $(TARGET_DIR) $(mkfs_cur_target_dir)
+ $(CP) $(TARGET_DIR_ORIG) $(mkfs_cur_target_dir)
-mv $(mkfs_cur_target_dir)/etc/opkg $(mkfs_cur_target_dir).opkg
echo 'src default file://$(PACKAGE_DIR_ALL)' > $(mkfs_cur_target_dir).conf
$(if $(call opkg_package_files,$(mkfs_packages_add)), \
diff --git a/include/rootfs.mk b/include/rootfs.mk
index 6ca7c9c..6a66100 100644
--- a/include/rootfs.mk
+++ b/include/rootfs.mk
@@ -52,6 +52,8 @@ opkg_package_files = $(wildcard \
$(foreach dir,$(PACKAGE_SUBDIRS), \
$(foreach pkg,$(1), $(dir)/$(pkg)_*.ipk)))
+TARGET_DIR_ORIG := $(TARGET_ROOTFS_DIR)/root.orig-$(BOARD)
+
define prepare_rootfs
@if [ -d $(TOPDIR)/files ]; then \
$(call file_copy,$(TOPDIR)/files/.,$(1)); \
diff --git a/package/Makefile b/package/Makefile
index 9f39395..8726e2e 100644
--- a/package/Makefile
+++ b/package/Makefile
@@ -54,7 +54,7 @@ $(curdir)/merge-index: $(curdir)/merge
$(curdir)/install: $(TMP_DIR)/.build $(curdir)/system/opkg/host/install $(curdir)/merge $(if $(CONFIG_TARGET_PER_DEVICE_ROOTFS),$(curdir)/merge-index)
- find $(STAGING_DIR_ROOT) -type d | $(XARGS) chmod 0755
- rm -rf $(TARGET_DIR)
+ rm -rf $(TARGET_DIR) $(TARGET_DIR_ORIG)
[ -d $(TARGET_DIR)/tmp ] || mkdir -p $(TARGET_DIR)/tmp
$(call opkg,$(TARGET_DIR)) install \
$(call opkg_package_files,$(shell cat $(PACKAGE_INSTALL_FILES) 2>/dev/null))
@@ -65,6 +65,9 @@ $(curdir)/install: $(TMP_DIR)/.build $(curdir)/system/opkg/host/install $(curdir
done; \
done || true
@-$(MAKE) package/preconfig
+
+ $(CP) $(TARGET_DIR) $(TARGET_DIR_ORIG)
+
$(call prepare_rootfs,$(TARGET_DIR))
PASSOPT=""