1 # Copyright (C) 2006 OpenWrt.org
2 # Copyright (C) 2010 Vertical Communications
12 grep -q "^$1:" "$file2" || echo "$*"
17 # Rootfs mount options can be passed by declaring in the kernel
18 # cmdline as much options as needed prefixed with "rootfs_mount_options."
21 # rootfs_mount_options.compress_algorithm=zstd rootfs_mount_options.noinline_data
23 compose_rootfs_mount_options() {
27 for cmdlinevar in $(cat /proc/cmdline); do
28 if [ "$cmdlinevar" != "${cmdlinevar#rootfs_mount_options\.}" ]; then
29 append mount_options "${cmdlinevar#rootfs_mount_options\.}"
37 mount_root start "$(compose_rootfs_mount_options)"
38 boot_run_hook preinit_mount_root
39 [ -f /sysupgrade.tgz -o -f /tmp/sysupgrade.tar ] && {
40 echo "- config restore -"
41 cp /etc/passwd /etc/group /etc/shadow /tmp
43 [ -f /sysupgrade.tgz ] && tar xzf /sysupgrade.tgz
44 [ -f /tmp/sysupgrade.tar ] && tar xf /tmp/sysupgrade.tar
45 missing_lines /tmp/passwd /etc/passwd >> /etc/passwd
46 missing_lines /tmp/group /etc/group >> /etc/group
47 missing_lines /tmp/shadow /etc/shadow >> /etc/shadow
48 rm /tmp/passwd /tmp/group /tmp/shadow
49 # Prevent configuration corruption on a power loss
54 [ "$INITRAMFS" = "1" ] || boot_hook_add preinit_main do_mount_root