aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorImran Khan <gururug@gmail.com>2020-11-27 06:19:02 +0000
committerDaniel Golle <daniel@makrotopia.org>2020-11-27 09:59:14 +0000
commit9c2eceef90b3ca924b8cd836e904ddc480514031 (patch)
treefd907535916ace889b3498143940b0e151938789
parentdfa357a3def512c13f22371d24138b6e8093be18 (diff)
downloadupstream-9c2eceef90b3ca924b8cd836e904ddc480514031.tar.gz
upstream-9c2eceef90b3ca924b8cd836e904ddc480514031.tar.bz2
upstream-9c2eceef90b3ca924b8cd836e904ddc480514031.zip
base-files: merge /etc/passwd on rw-rootfs
Support installations without root-overlayfs (and hence without /rom) when migrating user accounts. Signed-off-by: Imran Khan <gururug@gmail.com> Signed-off-by: Daniel Golle <daniel@makrotopia.org> [simplified patch, bumped PKG_RELEASE, cleaned message]
-rw-r--r--package/base-files/Makefile2
-rw-r--r--package/base-files/files/lib/preinit/80_mount_root8
2 files changed, 6 insertions, 4 deletions
diff --git a/package/base-files/Makefile b/package/base-files/Makefile
index e13578860f..c06b534bea 100644
--- a/package/base-files/Makefile
+++ b/package/base-files/Makefile
@@ -12,7 +12,7 @@ include $(INCLUDE_DIR)/version.mk
include $(INCLUDE_DIR)/feeds.mk
PKG_NAME:=base-files
-PKG_RELEASE:=237
+PKG_RELEASE:=238
PKG_FLAGS:=nonshared
PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
diff --git a/package/base-files/files/lib/preinit/80_mount_root b/package/base-files/files/lib/preinit/80_mount_root
index 56d3fa3797..a15c972220 100644
--- a/package/base-files/files/lib/preinit/80_mount_root
+++ b/package/base-files/files/lib/preinit/80_mount_root
@@ -20,11 +20,13 @@ do_mount_root() {
boot_run_hook preinit_mount_root
[ -f /sysupgrade.tgz ] && {
echo "- config restore -"
+ cp /etc/passwd /etc/group /etc/shadow /tmp
cd /
tar xzf /sysupgrade.tgz
- missing_lines /rom/etc/passwd /etc/passwd >> /etc/passwd
- missing_lines /rom/etc/group /etc/group >> /etc/group
- missing_lines /rom/etc/shadow /etc/shadow >> /etc/shadow
+ missing_lines /tmp/passwd /etc/passwd >> /etc/passwd
+ missing_lines /tmp/group /etc/group >> /etc/group
+ missing_lines /tmp/shadow /etc/shadow >> /etc/shadow
+ rm /tmp/passwd /tmp/group /tmp/shadow
# Prevent configuration corruption on a power loss
sync
}