···11+# This file is part of systemd.
22+#
33+# systemd is free software; you can redistribute it and/or modify it under the
44+# terms of the GNU Lesser General Public License as published by the Free
55+# Software Foundation; either version 2.1 of the License, or (at your option)
66+# any later version.
77+#
88+# Entries in this file show the compile time defaults. Local configuration
99+# should be created by either modifying this file (or a copy of it placed in
1010+# /etc/ if the original file is shipped in /usr/), or by creating "drop-ins" in
1111+# the /etc/systemd/resolved.conf.d/ directory. The latter is generally
1212+# recommended. Defaults can be restored by simply deleting the main
1313+# configuration file and all drop-ins located in /etc/.
1414+#
1515+# Use 'systemd-analyze cat-config systemd/resolved.conf' to display the full config.
1616+#
1717+# See resolved.conf(5) for details.
1818+1919+[Resolve]
2020+# Some examples of DNS servers which may be used for DNS= and FallbackDNS=:
2121+# Cloudflare: 1.1.1.1#cloudflare-dns.com 1.0.0.1#cloudflare-dns.com 2606:4700:4700::1111#cloudflare-dns.com 2606:4700:4700::1001#cloudflare-dns.com
2222+# Google: 8.8.8.8#dns.google 8.8.4.4#dns.google 2001:4860:4860::8888#dns.google 2001:4860:4860::8844#dns.google
2323+# Quad9: 9.9.9.9#dns.quad9.net 149.112.112.112#dns.quad9.net 2620:fe::fe#dns.quad9.net 2620:fe::9#dns.quad9.net
2424+#DNS=
2525+#FallbackDNS=
2626+DNS=1.1.1.1 8.8.8.8 8.8.4.4 172.16.0.1
2727+FallbackDNS=100.100.100.100
2828+#Domains=
2929+#DNSSEC=no
3030+#DNSOverTLS=no
3131+#MulticastDNS=no
3232+#LLMNR=no
3333+#Cache=no-negative
3434+#CacheFromLocalhost=no
3535+DNSStubListener=no
3636+#DNSStubListenerExtra=
3737+#ReadEtcHosts=yes
3838+#ResolveUnicastSingleLabel=no
3939+#StaleRetentionSec=0
···11+#!/bin/sh
22+# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
33+#
44+# Licensed under the Apache License, Version 2.0 (the "License"). You may
55+# not use this file except in compliance with the License. A copy of the
66+# License is located at
77+#
88+# http://aws.amazon.com/apache2.0/
99+#
1010+# or in the "license" file accompanying this file. This file is distributed
1111+# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
1212+# express or implied. See the License for the specific language governing
1313+# permissions and limitations under the License.
1414+1515+# Parameters:
1616+# 1. rw_root -- path where the read/write root is mounted
1717+# 2. work_dir -- path to the overlay workdir (must be on same filesystem as rw_root)
1818+# Overlay will be set up on /mnt, original root on /mnt/rom
1919+pivot() {
2020+ local rw_root work_dir
2121+ rw_root="$1"
2222+ work_dir="$2"
2323+ /bin/mount \
2424+ -o noatime,lowerdir=/,upperdir=${rw_root},workdir=${work_dir} \
2525+ -t overlay "overlayfs:${rw_root}" /mnt
2626+ pivot_root /mnt /mnt/rom
2727+}
2828+2929+# Overlay is configured under /overlay
3030+# Global variable $overlay_root is expected to be set to either:
3131+# "ram", which configures a tmpfs as the rw overlay layer (this is
3232+# the default, if the variable is unset)
3333+# - or -
3434+# A block device name, relative to /dev, in which case it is assumed
3535+# to contain an ext4 filesystem suitable for use as a rw overlay
3636+# layer. e.g. "vdb"
3737+do_overlay() {
3838+ local overlay_dir="/overlay"
3939+ if [ "$overlay_root" = ram ] ||
4040+ [ -z "$overlay_root" ]; then
4141+ /bin/mount -t tmpfs -o noatime,mode=0755 tmpfs /overlay
4242+ else
4343+ /bin/mount -t ext4 "/dev/$overlay_root" /overlay
4444+ fi
4545+ mkdir -p /overlay/root /overlay/work
4646+ pivot /overlay/root /overlay/work
4747+}
4848+4949+# If we're given an overlay, ensure that it really exists. Panic if not.
5050+if [ -n "$overlay_root" ] &&
5151+ [ "$overlay_root" != ram ] &&
5252+ [ ! -b "/dev/$overlay_root" ]; then
5353+ echo -n "FATAL: "
5454+ echo "Overlay root given as $overlay_root but /dev/$overlay_root does not exist"
5555+ exit 1
5656+fi
5757+5858+do_overlay
5959+6060+# invoke the actual system init program and proceed with the boot
6161+# process.
6262+exec /sbin/init $@