aboutsummaryrefslogtreecommitdiffstats
path: root/layout/rootfs/etc/s6-rc/source-base/init-clock/up
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2019-05-04 00:10:26 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2019-05-04 00:10:26 +0000
commit7bb2006007c1996f33758e41db070252d4d3607f (patch)
tree3dc03d4f6a8867742961a3dea9ecc96c52d00a10 /layout/rootfs/etc/s6-rc/source-base/init-clock/up
parent1202c964c4e91083a3c60b41b9c11e220bfa759d (diff)
downloadlh-bootstrap-7bb2006007c1996f33758e41db070252d4d3607f.tar.gz
Make a lean and mean version, as a basis for filling an initramfs
Diffstat (limited to 'layout/rootfs/etc/s6-rc/source-base/init-clock/up')
-rw-r--r--layout/rootfs/etc/s6-rc/source-base/init-clock/up71
1 files changed, 0 insertions, 71 deletions
diff --git a/layout/rootfs/etc/s6-rc/source-base/init-clock/up b/layout/rootfs/etc/s6-rc/source-base/init-clock/up
deleted file mode 100644
index 1c7f02c..0000000
--- a/layout/rootfs/etc/s6-rc/source-base/init-clock/up
+++ /dev/null
@@ -1,71 +0,0 @@
-#!/command/execlineb -P
-
-# Get the local country code as well as a few other codes
-# for countries all around the world.
-
-pipeline
-{
- s6-setuidgid nobody
- foreground
- {
- s6-envdir /etc/s6-linux-init/env-stage2
- importas -u COUNTRY_CODE COUNTRY_CODE
- s6-echo ${COUNTRY_CODE}
- }
- forx CODE { uk de ru cn kr jp us ca br au il za }
- importas -u CODE CODE
- s6-echo ${CODE}
-}
-
-
-# Suppress duplicates (e.g. if the local country code is in the list).
-
-pipeline
-{
- s6-setuidgid nobody
- s6-sort -u
-}
-
-
-# Get the IP addresses for some NTP servers in those countries.
-# Limit the DNS queries to 30 seconds: if the DNS is slower than
-# that, chances are the server isn't good for us anyway.
-# All the queries are parallelized, so it's fast.
-
-pipeline
-{
- s6-setuidgid nobody
- forstdin -p -d"\n" CODE
- importas -u CODE CODE
- forx -p I { 0 1 }
- importas -u I I
- redirfd -w 2 /dev/null
- s6-dnsip4 -t 30000 -- ${I}.${CODE}.pool.ntp.org
-}
-
-
-# Ask for a NTP exchange with the servers we get. Accept anything.
-# If the exchange can't be completed in 5 seconds, kill it.
-# All the queries are parallelized.
-
-pipeline
-{
- s6-setuidgid ntp
- forstdin -p -d"\n" NTPSERVERIP
- importas -u NTPSERVERIP NTPSERVERIP
- redirfd -w 2 /dev/null
- s6-sntpclock -f -T 5000 ${NTPSERVERIP}
-}
-
-
-# Take the first answer we get.
-
-pipeline
-{
- s6-setuidgid nobody
- s6-head -Sc 12
-}
-
-# Update the system clock. Accept anything.
-
-s6-clockadd -f