mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-18 21:11:08 +02:00
fix(coreos-base/oem-vagrant): Add coreos-setup-environment
In vagrant /etc/environment is set up by cloudinit but other services still depend on the coreos-setup-environment.service unit as a signal that /etc/environment is valid. Also the OEM needs to provide this script in order to block the likely to be broken defaults from being written. This just provides a dumb script that blocks. Use system-cloudinit@.service because it does not depend on coreos-setup-environment.service. Otherwise we would dead lock on a circular dependency.
This commit is contained in:
parent
72829fedf7
commit
4649f7fa12
@ -7,7 +7,7 @@ coreos:
|
||||
content: |
|
||||
[Path]
|
||||
PathExists=/var/lib/coreos-vagrant/user-data
|
||||
Unit=user-cloudinit@var-lib-coreos\x2dvagrant-user\x2ddata.service
|
||||
Unit=system-cloudinit@var-lib-coreos\x2dvagrant-user\x2ddata.service
|
||||
oem:
|
||||
id: vagrant
|
||||
name: Vagrant
|
||||
|
13
sdk_container/src/third_party/coreos-overlay/coreos-base/oem-vagrant/files/coreos-setup-environment
vendored
Executable file
13
sdk_container/src/third_party/coreos-overlay/coreos-base/oem-vagrant/files/coreos-setup-environment
vendored
Executable file
@ -0,0 +1,13 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
ENV="$1"
|
||||
|
||||
if [ -z "$ENV" ]; then
|
||||
echo usage: $0 /etc/environment
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# just block until cloudinit updates environment
|
||||
while ! grep -qs ^COREOS_PUBLIC_IPV4 "$ENV"; do
|
||||
sleep 0.1
|
||||
done
|
@ -19,4 +19,7 @@ src_install() {
|
||||
insinto "/usr/share/oem"
|
||||
doins "${FILESDIR}/authorized_keys"
|
||||
doins "${FILESDIR}/cloud-config.yml"
|
||||
|
||||
into "/usr/share/oem"
|
||||
dobin ${FILESDIR}/coreos-setup-environment
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user