mirror of
https://github.com/openwrt/openwrt.git
synced 2025-02-02 01:08:05 +00:00
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] Signed-off-by: maurerr <mariusd84@gmail.com>
This commit is contained in:
parent
74cafb9233
commit
dde2d21182
@ -12,7 +12,7 @@ include $(INCLUDE_DIR)/version.mk
|
|||||||
include $(INCLUDE_DIR)/feeds.mk
|
include $(INCLUDE_DIR)/feeds.mk
|
||||||
|
|
||||||
PKG_NAME:=base-files
|
PKG_NAME:=base-files
|
||||||
PKG_RELEASE:=237
|
PKG_RELEASE:=238
|
||||||
PKG_FLAGS:=nonshared
|
PKG_FLAGS:=nonshared
|
||||||
|
|
||||||
PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
|
PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
|
||||||
|
@ -20,11 +20,13 @@ do_mount_root() {
|
|||||||
boot_run_hook preinit_mount_root
|
boot_run_hook preinit_mount_root
|
||||||
[ -f /sysupgrade.tgz ] && {
|
[ -f /sysupgrade.tgz ] && {
|
||||||
echo "- config restore -"
|
echo "- config restore -"
|
||||||
|
cp /etc/passwd /etc/group /etc/shadow /tmp
|
||||||
cd /
|
cd /
|
||||||
tar xzf /sysupgrade.tgz
|
tar xzf /sysupgrade.tgz
|
||||||
missing_lines /rom/etc/passwd /etc/passwd >> /etc/passwd
|
missing_lines /tmp/passwd /etc/passwd >> /etc/passwd
|
||||||
missing_lines /rom/etc/group /etc/group >> /etc/group
|
missing_lines /tmp/group /etc/group >> /etc/group
|
||||||
missing_lines /rom/etc/shadow /etc/shadow >> /etc/shadow
|
missing_lines /tmp/shadow /etc/shadow >> /etc/shadow
|
||||||
|
rm /tmp/passwd /tmp/group /tmp/shadow
|
||||||
# Prevent configuration corruption on a power loss
|
# Prevent configuration corruption on a power loss
|
||||||
sync
|
sync
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user