summaryrefslogtreecommitdiffstats
path: root/package/base-files/files/lib/preinit/41_merge_overlay_hooks
blob: df39db15f5a4fa437242e3d90c2fff958e56812f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/sh
# Copyright (C) 2010 OpenWrt.org

merge_overlay_hooks() {
	jffs2_not_mounted || [ ! -d /tmp/overlay/lib/preinit ] || {
		echo "- merge overlay components -"

		mkdir -p /tmp/preinit-hook-merge
		ln -sf /lib/preinit/* /tmp/overlay/lib/preinit/* /tmp/preinit-hook-merge/

		boot_hook_splice_start

		local pipart
		for pipart in /tmp/preinit-hook-merge/*; do
			. $pipart
		done

		boot_hook_splice_finish

		rm -rf /tmp/preinit-hook-merge
	}
}

boot_hook_add preinit_mount_root merge_overlay_hooks
#!/bin/sh
# Copyright (C) 2010 OpenWrt.org

merge_overlay_hooks() {
	jffs2_not_mounted || [ ! -d /tmp/overlay/lib/preinit ] || {
		echo "- merge overlay components -"

		mkdir -p /tmp/preinit-hook-merge
		ln -sf /lib/preinit/* /tmp/overlay/lib/preinit/* /tmp/preinit-hook-merge/

		boot_hook_splice_start

		local pipart
		for pipart in /tmp/preinit-hook-merge/*; do
			. $pipart
		done

		boot_hook_splice_finish

		rm -rf /tmp/preinit-hook-merge
	}
}

boot_hook_add preinit_mount_root merge_overlay_hooks