diff options
author | akuster <akuster808@gmail.com> | 2020-09-01 08:22:35 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-09-02 16:00:46 +0100 |
commit | d8f211edf5320136767da87506009a700abe183d (patch) | |
tree | 066b52606ff3457244853bd128672d939d86943f /meta/recipes-connectivity/bind/bind-9.16.5/init.d-add-support-for-read-only-rootfs.patch | |
parent | 8d7db36ecb19cb775ecc8d0522ded3e55b53c820 (diff) | |
download | poky-d8f211edf5320136767da87506009a700abe183d.tar.gz |
bind: Add 9.16.x
Removed obsolete packageconfig options
License change to MPL-2.0
https://gitlab.isc.org/isc-projects/bind9/blob/master/LICENSE
Refreshed:
bind-ensure-searching-for-json-headers-searches-sysr.patch
0001-named-lwresd-V-and-start-log-hide-build-options.patch
bind-ensure-searching-for-json-headers-searches-sysr.patch
Drop obsolete patch: 0001-configure.in-remove-useless-L-use_openssl-lib.patch
RP: Dropped the multilib scripts handling as those scripts are no longer present
in this version.
(From OE-Core rev: d7cc84de47fad1dfbae68c32bb2165c708bec66b)
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-connectivity/bind/bind-9.16.5/init.d-add-support-for-read-only-rootfs.patch')
-rw-r--r-- | meta/recipes-connectivity/bind/bind-9.16.5/init.d-add-support-for-read-only-rootfs.patch | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/bind/bind-9.16.5/init.d-add-support-for-read-only-rootfs.patch b/meta/recipes-connectivity/bind/bind-9.16.5/init.d-add-support-for-read-only-rootfs.patch new file mode 100644 index 0000000000..11db95ede1 --- /dev/null +++ b/meta/recipes-connectivity/bind/bind-9.16.5/init.d-add-support-for-read-only-rootfs.patch | |||
@@ -0,0 +1,65 @@ | |||
1 | Subject: init.d: add support for read-only rootfs | ||
2 | |||
3 | Upstream-Status: Inappropriate [oe specific] | ||
4 | |||
5 | Signed-off-by: Chen Qi <Qi.Chen@windriver.com> | ||
6 | --- | ||
7 | init.d | 40 ++++++++++++++++++++++++++++++++++++++++ | ||
8 | 1 file changed, 40 insertions(+) | ||
9 | |||
10 | diff --git a/init.d b/init.d | ||
11 | index 0111ed4..24677c8 100644 | ||
12 | --- a/init.d | ||
13 | +++ b/init.d | ||
14 | @@ -6,8 +6,48 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin | ||
15 | # Don't modify this line, change or create /etc/default/bind9. | ||
16 | OPTIONS="" | ||
17 | |||
18 | +test -f /etc/default/rcS && . /etc/default/rcS | ||
19 | test -f /etc/default/bind9 && . /etc/default/bind9 | ||
20 | |||
21 | +# This function is here because it's possible that /var and / are on different partitions. | ||
22 | +is_on_read_only_partition () { | ||
23 | + DIRECTORY=$1 | ||
24 | + dir=`readlink -f $DIRECTORY` | ||
25 | + while true; do | ||
26 | + if [ ! -d "$dir" ]; then | ||
27 | + echo "ERROR: $dir is not a directory" | ||
28 | + exit 1 | ||
29 | + else | ||
30 | + for flag in `awk -v dir=$dir '{ if ($2 == dir) { print "FOUND"; split($4,FLAGS,",") } }; \ | ||
31 | + END { for (f in FLAGS) print FLAGS[f] }' < /proc/mounts`; do | ||
32 | + [ "$flag" = "FOUND" ] && partition="read-write" | ||
33 | + [ "$flag" = "ro" ] && { partition="read-only"; break; } | ||
34 | + done | ||
35 | + if [ "$dir" = "/" -o -n "$partition" ]; then | ||
36 | + break | ||
37 | + else | ||
38 | + dir=`dirname $dir` | ||
39 | + fi | ||
40 | + fi | ||
41 | + done | ||
42 | + [ "$partition" = "read-only" ] && echo "yes" || echo "no" | ||
43 | +} | ||
44 | + | ||
45 | +bind_mount () { | ||
46 | + olddir=$1 | ||
47 | + newdir=$2 | ||
48 | + mkdir -p $olddir | ||
49 | + cp -a $newdir/* $olddir | ||
50 | + mount --bind $olddir $newdir | ||
51 | +} | ||
52 | + | ||
53 | +# Deal with read-only rootfs | ||
54 | +if [ "$ROOTFS_READ_ONLY" = "yes" ]; then | ||
55 | + [ "$VERBOSE" != "no" ] && echo "WARN: start bind service in read-only rootfs" | ||
56 | + [ `is_on_read_only_partition /etc/bind` = "yes" ] && bind_mount /var/volatile/bind/etc /etc/bind | ||
57 | + [ `is_on_read_only_partition /var/named` = "yes" ] && bind_mount /var/volatile/bind/named /var/named | ||
58 | +fi | ||
59 | + | ||
60 | test -x /usr/sbin/rndc || exit 0 | ||
61 | |||
62 | case "$1" in | ||
63 | -- | ||
64 | 1.7.9.5 | ||
65 | |||