From 9c2eceef90b3ca924b8cd836e904ddc480514031 Mon Sep 17 00:00:00 2001 From: Imran Khan Date: Fri, 27 Nov 2020 06:19:02 +0000 Subject: 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 Signed-off-by: Daniel Golle [simplified patch, bumped PKG_RELEASE, cleaned message] --- package/base-files/files/lib/preinit/80_mount_root | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'package/base-files/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 } -- cgit v1.2.3