Merge pull request #701 from flatcar/krnowak/move-oem-mountpoint

/usr/share/oem -> /oem
This commit is contained in:
Krzesimir Nowak 2023-05-30 16:00:33 +02:00 committed by GitHub
commit b5dbef8d2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
89 changed files with 328 additions and 177 deletions

View File

@ -855,12 +855,21 @@ EOF
# container.
if [[ -n "${image_kernel}" ]]; then
local folder
# Everything except /boot and /usr because they are mountpoints and /lost+found because e2fsck expects it
for folder in "${root_fs_dir}/"*; do
if [ "${folder}" = "${root_fs_dir}/boot" ] || [ "${folder}" = "${root_fs_dir}/usr" ] || [ "${folder}" = "${root_fs_dir}/lost+found" ]; then
continue
fi
sudo rm --one-file-system -rf "${folder}"
case "${folder#"${root_fs_dir}"}" in
/boot|/usr|/oem)
# Keep those because they are mountpoints, so not really
# parts of the rootfs state.
:
;;
/lost+found)
# Keep lost+found because e2fsck expects it.
:
;;
*)
sudo rm --one-file-system -rf "${folder}"
;;
esac
done
else
# For the developer container we still need to remove the resolv.conf symlink to /run

View File

@ -53,7 +53,7 @@
"blocks":"262144",
"fs_type":"btrfs",
"fs_compression":"zlib",
"mount":"/usr/share/oem"
"mount":"/oem"
},
"7":{
"label":"OEM-CONFIG",

View File

@ -483,7 +483,7 @@ install_oem_package() {
--root="${oem_tmp}" --sysroot="${oem_tmp}" \
--root-deps=rdeps --usepkgonly ${getbinpkg} \
--verbose --jobs=2 "${oem_pkg}"
sudo rsync -a "${oem_tmp}/usr/share/oem/" "${VM_TMP_ROOT}/usr/share/oem/"
sudo rsync -a "${oem_tmp}/oem/" "${VM_TMP_ROOT}/oem/"
sudo rm -rf "${oem_tmp}"
}
@ -511,7 +511,7 @@ install_oem_aci() {
info "Installing ${oem_aci} OEM ACI"
sudo install -Dpm 0644 \
"${aci_path}" \
"${VM_TMP_ROOT}/usr/share/oem/flatcar-oem-${oem_aci}.aci" ||
"${VM_TMP_ROOT}/oem/flatcar-oem-${oem_aci}.aci" ||
die "Could not install ${oem_aci} OEM ACI"
# Remove aci_dir if building ACI and installing it succeeded
rm -rf "${aci_dir}"
@ -529,8 +529,8 @@ run_fs_hook() {
_run_box_fs_hook() {
# Copy basic Vagrant configs from OEM
mkdir -p "${VM_TMP_DIR}/box"
cp -R "${VM_TMP_ROOT}/usr/share/oem/box/." "${VM_TMP_DIR}/box"
sudo rm -fr "${VM_TMP_ROOT}/usr/share/oem/box"
cp -R "${VM_TMP_ROOT}/oem/box/." "${VM_TMP_DIR}/box"
sudo rm -fr "${VM_TMP_ROOT}/oem/box"
}
# Write the vm disk image to the target directory in the proper format

View File

@ -0,0 +1 @@
- Moved a mountpoint of the OEM partition from `/usr/share/oem` to `/oem`. `/usr/share/oem` became a symlink to `/oem` for backward compatibility. Despite the move, the initrd images providing files through `/usr/share/oem` should keep using `/usr/share/oem`. The move was done to enable activating the OEM sysext images that are placed in the OEM partition.

View File

@ -77,7 +77,7 @@ QEMU_UPDATE_PAYLOAD="tmp/flatcar_test_update.gz"
# and the binpackages from.
QEMU_DEVCONTAINER_URL="${QEMU_DEVCONTAINER_URL:-}"
QEMU_DEVCONTAINER_BINHOST_URL="${QEMU_DEVCONTAINER_BINHOST_URL:-}"
QEMU_DEVCONTAINER_FILE="${QEMU_DEVCONTAINER_FILE:-}"
# -- Equinix Metal --
EQUINIXMETAL_PARALLEL="${PARALLEL_TESTS:-4}"

View File

@ -46,6 +46,9 @@ declare -a devcontainer_opts
if [ -n "${QEMU_DEVCONTAINER_URL}" ] ; then
echo "++++ Using custom devcontainer URL '${QEMU_DEVCONTAINER_URL}'"
devcontainer_opts+=( "--devcontainer-url" "${QEMU_DEVCONTAINER_URL}" )
elif [ -n "${QEMU_DEVCONTAINER_FILE}" ]; then
echo "++++ Using custom devcontainer FILE '${QEMU_DEVCONTAINER_FILE}'"
devcontainer_opts+=( "--devcontainer-file" "${QEMU_DEVCONTAINER_FILE}" )
fi
if [ -n "${QEMU_DEVCONTAINER_BINHOST_URL}" ] ; then
echo "++++ Using custom devcontainer binhost '${QEMU_DEVCONTAINER_BINHOST_URL}'"

View File

@ -48,10 +48,10 @@ src_compile() {
}
src_install() {
into "/usr/share/oem"
into "/oem"
dobin bin/amazon-ssm-agent bin/ssm-cli bin/ssm-document-worker bin/ssm-session-logger bin/ssm-session-worker
# files used by ignition on a first run
insinto "/usr/share/oem/ssm"
insinto "/oem/ssm"
newins seelog_unix.xml seelog.xml.template
doins amazon-ssm-agent.json.template
}

View File

@ -50,13 +50,13 @@ override_vmw_check_lib() {
}
src_configure() {
local oemlib="/usr/share/oem/$(get_libdir)"
local oeminc="/usr/share/oem/include"
local oemlib="/oem/$(get_libdir)"
local oeminc="/oem/include"
# set rpath even if oem is in ld.so.conf
append-ldflags "-Wl,-rpath,${oemlib}"
# libdnet is installed to /usr/share/oem
# libdnet is installed to /oem
export CUSTOM_DNET_CPPFLAGS="-I=${oeminc}"
export CUSTOM_DNET_LIBS="-L=${oemlib}"
export CUSTOM_MSPACK_CPPFLAGS="-I=${oeminc}"
@ -71,7 +71,7 @@ src_configure() {
override_vmw_check_lib gthread-2.0 GTHREAD
local myeconfargs=(
--prefix=/usr/share/oem
--prefix=/oem
$(use_enable deploypkg)
$(use_enable salt-minion)
--disable-containerinfo
@ -99,7 +99,7 @@ src_configure() {
src_install() {
# Relocate event scripts, a symlink will be created by the systemd
# unit.
emake DESTDIR="${D}" confdir=/usr/share/oem/vmware-tools install
emake DESTDIR="${D}" confdir=/oem/vmware-tools install
rm "${D}"/etc/pam.d/vmtoolsd
# TODO: pamd_mimic_system vmtoolsd auth account

View File

@ -25,12 +25,12 @@ dev-python/distro-oem
S="${WORKDIR}/WALinuxAgent-${PV}"
src_install() {
into "/usr/share/oem"
into "/oem"
dobin "${S}/bin/waagent"
insinto "/usr/share/oem/python/$(get_libdir)/python${DEP_PYVER}/site-packages"
insinto "/oem/python/$(get_libdir)/python${DEP_PYVER}/site-packages"
doins -r "${S}/azurelinuxagent/"
insinto "/usr/share/oem"
insinto "/oem"
doins "${FILESDIR}/waagent.conf"
}

View File

@ -10,7 +10,7 @@ CROS_WORKON_REPO="https://github.com"
if [[ "${PV}" == 9999 ]]; then
KEYWORDS="~amd64 ~arm ~arm64 ~x86"
else
CROS_WORKON_COMMIT="17224c8d6f71b17676bbcf34919072fb67a6bf4c" # flatcar-master
CROS_WORKON_COMMIT="93b80ace22806bae4ab521f16fa9f4d1d3172e77" # flatcar-master
KEYWORDS="amd64 arm arm64 x86"
fi

View File

@ -27,9 +27,9 @@
-sed -i s,CLUSTER_NAME,$CLUSTER_NAME,g /var/lib/kubelet/kubeconfig
-sed -i s,MASTER_ENDPOINT,$APISERVER_ENDPOINT,g /var/lib/kubelet/kubeconfig
-sed -i s,AWS_REGION,$AWS_DEFAULT_REGION,g /var/lib/kubelet/kubeconfig
+sed -i s,CLUSTER_NAME,$CLUSTER_NAME,g /usr/share/oem/eks/kubelet-kubeconfig
+sed -i s,MASTER_ENDPOINT,$APISERVER_ENDPOINT,g /usr/share/oem/eks/kubelet-kubeconfig
+sed -i s,AWS_REGION,$AWS_DEFAULT_REGION,g /usr/share/oem/eks/kubelet-kubeconfig
+sed -i s,CLUSTER_NAME,$CLUSTER_NAME,g /oem/eks/kubelet-kubeconfig
+sed -i s,MASTER_ENDPOINT,$APISERVER_ENDPOINT,g /oem/eks/kubelet-kubeconfig
+sed -i s,AWS_REGION,$AWS_DEFAULT_REGION,g /oem/eks/kubelet-kubeconfig
### kubelet.service configuration
if [[ -z "${DNS_CLUSTER_IP}" ]]; then
@ -38,7 +38,7 @@
fi
-KUBELET_CONFIG=/etc/kubernetes/kubelet/kubelet-config.json
+KUBELET_CONFIG=/usr/share/oem/eks/kubelet-config.json
+KUBELET_CONFIG=/oem/eks/kubelet-config.json
echo "$(jq ".clusterDNS=[\"$DNS_CLUSTER_IP\"]" $KUBELET_CONFIG)" > $KUBELET_CONFIG
INTERNAL_IP=$(get_meta_data 'latest/meta-data/local-ipv4')
@ -47,7 +47,7 @@
#calculate the max number of pods per instance type
-MAX_PODS_FILE="/etc/eks/eni-max-pods.txt"
+MAX_PODS_FILE="/usr/share/oem/eks/eni-max-pods.txt"
+MAX_PODS_FILE="/oem/eks/eni-max-pods.txt"
set +o pipefail
MAX_PODS=$(cat $MAX_PODS_FILE | awk "/^${INSTANCE_TYPE:-unset}/"' { print $2 }')
set -o pipefail
@ -55,7 +55,7 @@
fi
fi
+cp /usr/share/oem/eks/kubelet.service /etc/systemd/system/
+cp /oem/eks/kubelet.service /etc/systemd/system/
+
mkdir -p /etc/systemd/system/kubelet.service.d
@ -71,8 +71,8 @@
echo "$DOCKER_CONFIG_JSON" > /etc/docker/daemon.json
systemctl restart docker
+else
+ # Copy the docker config shipped in /usr/share/oem
+ cp /usr/share/oem/eks/docker-daemon.json /etc/docker/daemon.json
+ # Copy the docker config shipped in /oem
+ cp /oem/eks/docker-daemon.json /etc/docker/daemon.json
+ systemctl restart docker
fi

View File

@ -7,12 +7,12 @@ After=docker.service iptables-restore.service
[Service]
EnvironmentFile=/run/metadata/flatcar
ExecStartPre=/usr/share/oem/eks/download-kubelet.sh
ExecStartPre=/oem/eks/download-kubelet.sh
ExecStartPre=/sbin/iptables -P FORWARD ACCEPT -w 5
ExecStart=/opt/eks/kubelet \
--cloud-provider aws \
--config /usr/share/oem/eks/kubelet-config.json \
--kubeconfig /usr/share/oem/eks/kubelet-kubeconfig \
--config /oem/eks/kubelet-config.json \
--kubeconfig /oem/eks/kubelet-kubeconfig \
--container-runtime docker \
--network-plugin cni \
--cni-bin-dir=/opt/cni/bin \

View File

@ -31,7 +31,7 @@ src_prepare() {
}
src_install() {
insinto /usr/share/oem/eks
insinto /oem/eks
doins "${WORKDIR}/bootstrap.sh"
# These files are based on the ones found on the amazon-eks-ami repository,
@ -53,5 +53,5 @@ src_install() {
# necessary files to run the kubelet on the node.
doins "${FILESDIR}/download-kubelet.sh"
chmod +x "${D}/usr/share/oem/eks/bootstrap.sh" "${D}/usr/share/oem/eks/download-kubelet.sh"
chmod +x "${D}/oem/eks/bootstrap.sh" "${D}/oem/eks/download-kubelet.sh"
}

View File

@ -13,6 +13,6 @@ KEYWORDS="amd64 x86"
IUSE=""
src_install() {
dodir /usr/share/oem/nova-agent
rsync -aq "${S}/" "${D}/usr/share/oem/nova-agent/" || die
dodir /oem/nova-agent
rsync -aq "${S}/" "${D}/oem/nova-agent/" || die
}

View File

@ -25,7 +25,7 @@ SLOT="0"
IUSE=""
src_install() {
into "/usr/share/oem"
into "/oem"
dobin ${S}/scripts/gentoo-to-networkd
dobin ${GOBIN}/nova-agent-watcher
}

View File

@ -7,9 +7,9 @@ After=network-online.target sshd-keygen.service
Type=simple
Restart=always
RestartSec=5s
Environment=PATH=/usr/share/oem/python/bin:/usr/share/oem/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
Environment=PATH=/oem/python/bin:/oem/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
Environment=PYTHONUNBUFFERED=x
ExecStart=/usr/share/oem/bin/waagent -daemon
ExecStart=/oem/bin/waagent -daemon
[Install]
WantedBy=multi-user.target

View File

@ -27,10 +27,10 @@ src_prepare() {
}
src_install() {
insinto "/usr/share/oem"
insinto "/oem"
doins "${FILESDIR}/grub.cfg"
doins "${T}/oem-release"
doins -r "${FILESDIR}/base"
doins -r "${FILESDIR}/units"
dosym "/usr/bin/true" "/usr/share/oem/bin/eject"
dosym "/usr/bin/true" "/oem/bin/eject"
}

View File

@ -21,7 +21,7 @@ src_prepare() {
}
src_install() {
insinto "/usr/share/oem"
insinto "/oem"
doins "${T}/cloud-config.yml"
doins "${FILESDIR}/grub.cfg"
}

View File

@ -12,7 +12,7 @@ coreos:
[Service]
Type=oneshot
StandardOutput=journal+console
ExecStart=/usr/share/oem/bin/cloudstack-ssh-key
ExecStart=/oem/bin/cloudstack-ssh-key
- name: cloudstack-cloudinit.service
command: restart
runtime: yes
@ -25,7 +25,7 @@ coreos:
[Service]
Type=oneshot
EnvironmentFile=/etc/environment
ExecStart=/usr/share/oem/bin/cloudstack-coreos-cloudinit
ExecStart=/oem/bin/cloudstack-coreos-cloudinit
oem:
id: cloudstack
name: CloudStack

View File

@ -1,6 +1,6 @@
#!/bin/bash
. /usr/share/oem/bin/cloudstack-dhcp
. /oem/bin/cloudstack-dhcp
DHCP_SERVER=$(get_dhcp_ip)
USERDATA_URL="http://${DHCP_SERVER}/latest/user-data"

View File

@ -1,6 +1,6 @@
#!/bin/bash
. /usr/share/oem/bin/cloudstack-dhcp
. /oem/bin/cloudstack-dhcp
DHCP_SERVER=$(get_dhcp_ip)
KEY_URL="http://${DHCP_SERVER}/latest/meta-data/public-keys"

View File

@ -18,7 +18,7 @@ sed -i -e '/^COREOS_PUBLIC_IPV4=/d' \
-e '/^COREOS_PRIVATE_IPV4=/d' \
"${ENV}"
. /usr/share/oem/bin/cloudstack-dhcp
. /oem/bin/cloudstack-dhcp
DHCP_SERVER=$(get_dhcp_ip)
METADATA_URL="http://${DHCP_SERVER}/latest/meta-data/"

View File

@ -26,13 +26,13 @@ src_prepare() {
}
src_install() {
into "/usr/share/oem"
into "/oem"
dobin "${FILESDIR}/cloudstack-dhcp"
dobin "${FILESDIR}/cloudstack-ssh-key"
dobin "${FILESDIR}/cloudstack-coreos-cloudinit"
dobin "${FILESDIR}/flatcar-setup-environment"
insinto "/usr/share/oem"
insinto "/oem"
doins "${T}/cloud-config.yml"
doins "${FILESDIR}/grub.cfg"
}

View File

@ -21,7 +21,7 @@ src_prepare() {
}
src_install() {
insinto "/usr/share/oem"
insinto "/oem"
doins "${FILESDIR}/grub.cfg"
doins "${T}/oem-release"
doins -r "${FILESDIR}/base"

View File

@ -11,7 +11,7 @@
{
"name": "amazon-ssm-agent.service",
"enabled": true,
"contents": "[Unit]\nDescription=amazon-ssm-agent\nAfter=network-online.target\n\n[Service]\nType=simple\nWorkingDirectory=/usr/share/oem\nExecStart=/usr/share/oem/bin/amazon-ssm-agent\nKillMode=process\nRestart=on-failure\nRestartForceExitStatus=SIGPIPE\nRestartSec=15min\n\n[Install]\nWantedBy=multi-user.target\n"
"contents": "[Unit]\nDescription=amazon-ssm-agent\nAfter=network-online.target\n\n[Service]\nType=simple\nWorkingDirectory=/oem\nExecStart=/oem/bin/amazon-ssm-agent\nKillMode=process\nRestart=on-failure\nRestartForceExitStatus=SIGPIPE\nRestartSec=15min\n\n[Install]\nWantedBy=multi-user.target\n"
},
{
"name": "nvidia.service",

View File

@ -48,7 +48,7 @@ src_prepare() {
}
src_install() {
insinto "/usr/share/oem"
insinto "/oem"
doins "${T}/oem-release"
if use ec2 ; then
newins "${FILESDIR}/grub-ec2.cfg" grub.cfg
@ -58,7 +58,7 @@ src_install() {
newins "${FILESDIR}/grub-brightbox.cfg" grub.cfg
fi
insinto "/usr/share/oem/base"
insinto "/oem/base"
doins "${FILESDIR}/base/README"
if use ec2 ; then
newins "${FILESDIR}/base/base-ec2.ign" base.ign

View File

@ -12,7 +12,7 @@ coreos:
[Service]
Type=oneshot
StandardOutput=journal+console
ExecStart=/usr/share/oem/bin/exoscale-ssh-key
ExecStart=/oem/bin/exoscale-ssh-key
- name: exoscale-cloudinit.service
command: restart
runtime: yes
@ -25,7 +25,7 @@ coreos:
[Service]
Type=oneshot
EnvironmentFile=/etc/environment
ExecStart=/usr/share/oem/bin/exoscale-coreos-cloudinit
ExecStart=/oem/bin/exoscale-coreos-cloudinit
oem:
id: exoscale
name: exoscale

View File

@ -1,6 +1,6 @@
#!/bin/bash
. /usr/share/oem/bin/exoscale-dhcp
. /oem/bin/exoscale-dhcp
DHCP_SERVER=$(get_dhcp_ip)
USERDATA_URL="http://${DHCP_SERVER}/latest/user-data"

View File

@ -1,6 +1,6 @@
#!/bin/bash
. /usr/share/oem/bin/exoscale-dhcp
. /oem/bin/exoscale-dhcp
DHCP_SERVER=$(get_dhcp_ip)
KEY_URL="http://${DHCP_SERVER}/latest/public-keys"

View File

@ -18,7 +18,7 @@ sed -i -e '/^COREOS_PUBLIC_IPV4=/d' \
-e '/^COREOS_PRIVATE_IPV4=/d' \
"${ENV}"
. /usr/share/oem/bin/exoscale-dhcp
. /oem/bin/exoscale-dhcp
DHCP_SERVER=$(get_dhcp_ip)
METADATA_URL="http://${DHCP_SERVER}/latest/"

View File

@ -26,13 +26,13 @@ src_prepare() {
}
src_install() {
into "/usr/share/oem"
into "/oem"
dobin "${FILESDIR}/exoscale-dhcp"
dobin "${FILESDIR}/exoscale-ssh-key"
dobin "${FILESDIR}/exoscale-coreos-cloudinit"
dobin "${FILESDIR}/flatcar-setup-environment"
insinto "/usr/share/oem"
insinto "/oem"
doins "${T}/cloud-config.yml"
doins "${FILESDIR}/grub.cfg"
}

View File

@ -9,7 +9,7 @@ Before=sshd.socket
[Service]
Type=oneshot
ExecStart=/usr/share/oem/bin/enable-oslogin
ExecStart=/oem/bin/enable-oslogin
[Install]
WantedBy=sysinit.target

View File

@ -19,7 +19,7 @@ ExecStartPre=/usr/bin/rm -rf /var/lib/flatcar-oem-gce
ExecStartPre=/usr/bin/mkdir -p /var/lib/flatcar-oem-gce
ExecStartPre=-/usr/bin/umount /var/lib/flatcar-oem-gce.img
ExecStartPre=/usr/bin/mount /var/lib/flatcar-oem-gce.img /var/lib/flatcar-oem-gce
ExecStartPre=/usr/bin/tar --directory=/var/lib/flatcar-oem-gce --extract --file=/usr/share/oem/flatcar-oem-gce.aci --strip-components=1 rootfs
ExecStartPre=/usr/bin/tar --directory=/var/lib/flatcar-oem-gce --extract --file=/oem/flatcar-oem-gce.aci --strip-components=1 rootfs
ExecStartPre=/usr/bin/umount /var/lib/flatcar-oem-gce.img
# the container expects to be able to optmize irq settings in /proc/irq and /sys/
Environment=SYSTEMD_NSPAWN_API_VFS_WRITABLE=1

View File

@ -22,12 +22,12 @@ src_prepare() {
}
src_install() {
insinto "/usr/share/oem"
insinto "/oem"
doins "${FILESDIR}/grub.cfg"
doins "${T}/oem-release"
doins -r "${FILESDIR}/base"
doins -r "${FILESDIR}/files"
doins -r "${FILESDIR}/units"
exeinto "/usr/share/oem/bin"
exeinto "/oem/bin"
doexe "${FILESDIR}/bin/enable-oslogin"
}

View File

@ -22,7 +22,7 @@ src_prepare() {
}
src_install() {
insinto "/usr/share/oem"
insinto "/oem"
doins "${FILESDIR}/grub.cfg"
doins "${T}/oem-release"
}

View File

@ -11,8 +11,8 @@ coreos:
ConditionVirtualization=vmware
[Service]
ExecStartPre=/usr/bin/ln -sfT /usr/share/oem/vmware-tools /etc/vmware-tools
ExecStart=/usr/share/oem/bin/vmtoolsd
ExecStartPre=/usr/bin/ln -sfT /oem/vmware-tools /etc/vmware-tools
ExecStart=/oem/bin/vmtoolsd
TimeoutStopSec=5
- name: cloudstack-ssh-key.service
command: restart
@ -27,7 +27,7 @@ coreos:
Type=oneshot
StandardOutput=journal+console
EnvironmentFile=/etc/environment
ExecStart=/usr/share/oem/bin/cloudstack-ssh-key
ExecStart=/oem/bin/cloudstack-ssh-key
- name: cloudstack-cloudinit.service
command: restart
runtime: yes
@ -40,7 +40,7 @@ coreos:
[Service]
Type=oneshot
EnvironmentFile=/etc/environment
ExecStart=/usr/share/oem/bin/cloudstack-coreos-cloudinit
ExecStart=/oem/bin/cloudstack-coreos-cloudinit
- name: cloudstack-set-guest-password.service
runtime: yes
content: |
@ -51,7 +51,7 @@ coreos:
[Service]
Type=oneshot
ExecStart=/usr/share/oem/bin/cloudstack-set-guest-password
ExecStart=/oem/bin/cloudstack-set-guest-password
EnvironmentFile=/etc/environment
oem:
id: interoute

View File

@ -31,13 +31,13 @@ src_prepare() {
}
src_install() {
into "/usr/share/oem"
into "/oem"
dobin "${FILESDIR}/cloudstack-set-guest-password"
dobin "${FILESDIR}/cloudstack-ssh-key"
dobin "${FILESDIR}/cloudstack-coreos-cloudinit"
dobin "${FILESDIR}/flatcar-setup-environment"
insinto "/usr/share/oem"
insinto "/oem"
doins "${T}/cloud-config.yml"
doins "${FILESDIR}/grub.cfg"
}

View File

@ -20,9 +20,9 @@ coreos:
ConditionVirtualization=vmware
[Service]
ExecStartPre=/usr/bin/ln -sfT /usr/share/oem/vmware-tools /etc/vmware-tools
ExecStart=/usr/share/oem/bin/vmtoolsd
ExecStartPost=/usr/share/oem/bin/vmware-toolbox-cmd timesync enable
ExecStartPre=/usr/bin/ln -sfT /oem/vmware-tools /etc/vmware-tools
ExecStart=/oem/bin/vmtoolsd
ExecStartPost=/oem/bin/vmware-toolbox-cmd timesync enable
TimeoutStopSec=5
- name: niftycloud-coreos-cloudinit.service
command: restart
@ -37,7 +37,7 @@ coreos:
[Service]
Type=oneshot
EnvironmentFile=/etc/environment
ExecStart=/usr/share/oem/bin/niftycloud-coreos-cloudinit
ExecStart=/oem/bin/niftycloud-coreos-cloudinit
- name: niftycloud-ssh-key.service
command: restart
runtime: yes
@ -47,7 +47,7 @@ coreos:
[Service]
Type=oneshot
StandardOutput=journal+console
ExecStart=/usr/share/oem/bin/niftycloud-ssh-key
ExecStart=/oem/bin/niftycloud-ssh-key
oem:
id: niftycloud

View File

@ -1,8 +1,8 @@
#!/bin/bash
VMTOOLSD=""
if [ -x /usr/share/oem/bin/vmtoolsd ]; then
VMTOOLSD="/usr/share/oem/bin/vmtoolsd"
if [ -x /oem/bin/vmtoolsd ]; then
VMTOOLSD="/oem/bin/vmtoolsd"
else
exit 1
fi

View File

@ -3,8 +3,8 @@
set -e
VMTOOLSD=""
if [ -x /usr/share/oem/bin/vmtoolsd ]; then
VMTOOLSD="/usr/share/oem/bin/vmtoolsd"
if [ -x /oem/bin/vmtoolsd ]; then
VMTOOLSD="/oem/bin/vmtoolsd"
else
exit 1
fi

View File

@ -27,12 +27,12 @@ src_prepare() {
}
src_install() {
into "/usr/share/oem"
into "/oem"
dobin "${FILESDIR}/niftycloud-ssh-key"
dobin "${FILESDIR}/niftycloud-coreos-cloudinit"
dobin "${FILESDIR}/flatcar-setup-environment"
insinto "/usr/share/oem"
insinto "/oem"
doins "${T}/cloud-config.yml"
doins "${FILESDIR}/grub.cfg"
}

View File

@ -21,7 +21,7 @@ src_prepare() {
}
src_install() {
insinto "/usr/share/oem"
insinto "/oem"
doins "${FILESDIR}/grub.cfg"
doins "${T}/oem-release"
doins -r "${FILESDIR}/base"

View File

@ -22,7 +22,7 @@ src_prepare() {
}
src_install() {
insinto "/usr/share/oem"
insinto "/oem"
doins "${FILESDIR}/grub.cfg"
doins "${T}/oem-release"
}

View File

@ -21,7 +21,7 @@ src_prepare() {
}
src_install() {
insinto "/usr/share/oem"
insinto "/oem"
doins "${T}/cloud-config.yml"
doins "${FILESDIR}/grub.cfg"
}

View File

@ -10,15 +10,15 @@ coreos:
After=dbus.service
[Service]
Environment=HOME=/root
ExecStartPre=/bin/mount -t proc none /usr/share/oem/nova-agent/proc
ExecStartPre=/bin/mount -t xenfs none /usr/share/oem/nova-agent/proc/xen
ExecStartPre=/bin/mount --bind /dev /usr/share/oem/nova-agent/dev
ExecStartPre=/bin/mount --bind /sys /usr/share/oem/nova-agent/sys
ExecStart=/usr/bin/chroot /usr/share/oem/nova-agent/ /usr/share/nova-agent/0.0.1.38/sbin/nova-agent -o - -n -l info /usr/share/nova-agent/nova-agent.py
ExecStopPost=/bin/umount -f /usr/share/oem/nova-agent/sys
ExecStopPost=/bin/umount -f /usr/share/oem/nova-agent/dev
ExecStopPost=/bin/umount -f /usr/share/oem/nova-agent/proc/xen
ExecStopPost=/bin/umount -f /usr/share/oem/nova-agent/proc
ExecStartPre=/bin/mount -t proc none /oem/nova-agent/proc
ExecStartPre=/bin/mount -t xenfs none /oem/nova-agent/proc/xen
ExecStartPre=/bin/mount --bind /dev /oem/nova-agent/dev
ExecStartPre=/bin/mount --bind /sys /oem/nova-agent/sys
ExecStart=/usr/bin/chroot /oem/nova-agent/ /usr/share/nova-agent/0.0.1.38/sbin/nova-agent -o - -n -l info /usr/share/nova-agent/nova-agent.py
ExecStopPost=/bin/umount -f /oem/nova-agent/sys
ExecStopPost=/bin/umount -f /oem/nova-agent/dev
ExecStopPost=/bin/umount -f /oem/nova-agent/proc/xen
ExecStopPost=/bin/umount -f /oem/nova-agent/proc
- name: nova-agent-watcher.service
command: restart
runtime: yes
@ -27,7 +27,7 @@ coreos:
After=dbus.service
[Service]
ExecStart=/usr/share/oem/bin/nova-agent-watcher -watch-dir=/usr/share/oem/nova-agent -scripts-dir=/usr/share/oem/bin/
ExecStart=/oem/bin/nova-agent-watcher -watch-dir=/oem/nova-agent -scripts-dir=/oem/bin/
oem:
id: rackspace

View File

@ -30,10 +30,10 @@ src_prepare() {
}
src_install() {
insinto "/usr/share/oem"
insinto "/oem"
doins "${T}/cloud-config.yml"
doins "${FILESDIR}/grub.cfg"
into "/usr/share/oem"
into "/oem"
dobin "${FILESDIR}/flatcar-setup-environment"
}

View File

@ -16,7 +16,7 @@ IUSE=""
S="${WORKDIR}"
src_install() {
insinto "/usr/share/oem"
insinto "/oem"
doins "${FILESDIR}/cloud-config.yml"
doins "${FILESDIR}/grub.cfg"
}

View File

@ -16,7 +16,7 @@ IUSE=""
S="${WORKDIR}"
src_install() {
insinto "/usr/share/oem"
insinto "/oem"
doins -r "${FILESDIR}/box"
doins "${FILESDIR}/grub.cfg"
}

View File

@ -22,11 +22,11 @@ src_prepare() {
}
src_install() {
insinto "/usr/share/oem"
insinto "/oem"
doins "${T}/cloud-config.yml"
doins -r "${FILESDIR}/box"
doins "${FILESDIR}/grub.cfg"
into "/usr/share/oem"
into "/oem"
dobin "${FILESDIR}/flatcar-setup-environment"
}

View File

@ -22,7 +22,7 @@ src_prepare() {
}
src_install() {
insinto "/usr/share/oem"
insinto "/oem"
doins "${FILESDIR}/grub.cfg"
doins "${T}/oem-release"
}

View File

@ -4,8 +4,8 @@ Documentation=https://github.com/vmware/open-vm-tools
ConditionVirtualization=vmware
[Service]
ExecStartPre=/usr/bin/ln -sfT /usr/share/oem/vmware-tools /etc/vmware-tools
ExecStart=/usr/share/oem/bin/vmtoolsd
ExecStartPre=/usr/bin/ln -sfT /oem/vmware-tools /etc/vmware-tools
ExecStart=/oem/bin/vmtoolsd
TimeoutStopSec=5
PrivateTmp=true

View File

@ -27,7 +27,7 @@ src_prepare() {
}
src_install() {
insinto "/usr/share/oem"
insinto "/oem"
doins "${FILESDIR}/grub.cfg"
doins "${T}/oem-release"
doins -r "${FILESDIR}/base"

View File

@ -15,8 +15,8 @@ Modifications made:
- We modify the configure flags:
- Add `--prefix=/usr/share/oem/python` as `/usr/share/oem` is where
the OEM partition is mounted.
- Add `--prefix=/oem/python` as `/oem` is where the OEM partition is
mounted.
- Add `--with-platlibdir="$(get_libdir)"`, this is to make sure that
consistent library directory gets picked. In our case for both

View File

@ -218,7 +218,7 @@ src_configure() {
ac_cv_header_stropts_h=no
# Flatcar: Use oem-specific prefix.
--prefix=/usr/share/oem/python
--prefix=/oem/python
# Flatcar: Make sure we put libs into a correct subdirectory.
--with-platlibdir="$(get_libdir)"
# Flatcar: No need for shared libs.
@ -428,7 +428,7 @@ src_test() {
# files to drop), adding symlinks and the EXTERNALLY-MANAGED file, and
# removing the /discard directory.
src_install() {
local prefix=/usr/share/oem/python
local prefix=/oem/python
local eprefix="${ED}${prefix}"
local libdir="${prefix}/$(get_libdir)"
local elibdir="${eprefix}/$(get_libdir)"

View File

@ -51,8 +51,8 @@ src_prepare() {
src_configure() {
# Install into OEM, don't bother with a sbin directory.
econf \
--prefix=/usr/share/oem \
--sbindir=/usr/share/oem/bin \
--prefix=/oem \
--sbindir=/oem/bin \
--disable-static \
--without-python
}

View File

@ -47,7 +47,7 @@ src_prepare() {
multilib_src_configure() {
ECONF_SOURCE="${S}" econf \
--prefix=/usr/share/oem \
--prefix=/oem \
$(use_enable debug) \
$(use_enable static-libs static)
}

View File

@ -32,7 +32,7 @@ src_compile() {
}
src_install() {
insinto "/usr/share/oem/python/$(get_libdir)/python${DEP_PYVER}/site-packages"
insinto "/oem/python/$(get_libdir)/python${DEP_PYVER}/site-packages"
local ssd="${S}/src/distro"
doins "${ssd}/distro.py"
doins "${ssd}/__init__.py"

View File

@ -9,7 +9,7 @@ CROS_WORKON_REPO="https://github.com"
if [[ "${PV}" == 9999 ]]; then
KEYWORDS="~amd64 ~arm ~arm64 ~x86"
else
CROS_WORKON_COMMIT="25680dba1b3a314d1024db000d307735f59b5cf1" # flatcar-master
CROS_WORKON_COMMIT="a482cb4b69ffa5cf92d9cd719409e7abd7f382a3" # flatcar-master
KEYWORDS="amd64 arm arm64 x86"
fi
@ -149,7 +149,7 @@ src_install() {
# This simplifies the configuration of OEMs with dynamic libs.
ldpaths=
for libdir in $(get_all_libdirs) ; do
ldpaths+=":/usr/share/oem/${libdir}"
ldpaths+=":/oem/${libdir}"
done
echo "LDPATH='${ldpaths#:}'" >> "${D}"/etc/env.d/80oem || die
@ -226,5 +226,10 @@ pkg_postinst() {
ln -sfT "../lib/${compat}" "${ROOT}/usr/${libdir}/${compat}"
done
done
# Create a compatibility symlink for OEM.
ln -sfT ../../oem "${ROOT}/usr/share/oem"
# Also create the directory to avoid having dangling
# symlinks.
mkdir -p "${ROOT}/oem"
fi
}

View File

@ -1,7 +1,7 @@
From c70e0d9e067a7428542aec57d12a50212abb7c00 Mon Sep 17 00:00:00 2001
From 750d5021772a4865f9389038d32be05e41bb5fb7 Mon Sep 17 00:00:00 2001
From: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
Date: Fri, 24 Feb 2023 09:08:13 +0100
Subject: [PATCH 01/18] *: sed `s/coreos/flatcar/`
Subject: [PATCH 01/21] *: sed `s/coreos/flatcar/`
Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
---
@ -6355,5 +6355,5 @@ index bec64866..ed027604 100644
var (
--
2.35.1
2.25.1

View File

@ -1,7 +1,7 @@
From 4e107fd4f2bad2b3926dadef7b1143a4b2b43e3f Mon Sep 17 00:00:00 2001
From 4395ad82b1c264dc05d67de5a739d1f65ef16f38 Mon Sep 17 00:00:00 2001
From: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
Date: Fri, 24 Feb 2023 09:13:33 +0100
Subject: [PATCH 02/18] mod: add flatcar/ignition@0.36.2
Subject: [PATCH 02/21] mod: add flatcar/ignition@0.36.2
it's required for Ignition conversion.
@ -41,5 +41,5 @@ index 85b3e34e..b109532e 100644
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/appengine v1.6.7 // indirect
--
2.35.1
2.25.1

View File

@ -1,7 +1,7 @@
From b8c235d5945df6f726c86386437cd787a30046c4 Mon Sep 17 00:00:00 2001
From 96693902d6107ad52069f6fd2282f22568aafd51 Mon Sep 17 00:00:00 2001
From: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
Date: Fri, 24 Feb 2023 09:14:03 +0100
Subject: [PATCH 03/18] sum: go mod tidy
Subject: [PATCH 03/21] sum: go mod tidy
Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
---
@ -119,5 +119,5 @@ index 087ef0ad..bb95e1fe 100644
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
--
2.35.1
2.25.1

View File

@ -1,7 +1,7 @@
From e80a5d4a028931ad82376896b87a1b3afe64422f Mon Sep 17 00:00:00 2001
From 807d6a9724d1155526d42ed47a2bfb2fc8fb6ca3 Mon Sep 17 00:00:00 2001
From: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
Date: Fri, 24 Feb 2023 09:14:24 +0100
Subject: [PATCH 04/18] vendor: go mod vendor
Subject: [PATCH 04/21] vendor: go mod vendor
Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
---
@ -17091,5 +17091,5 @@ index 9b01b083..1e050725 100644
## explicit; go 1.17
golang.org/x/net/context
--
2.35.1
2.25.1

View File

@ -1,7 +1,7 @@
From 54fa31c31ed431678adc89b6dfa450022d2f96fa Mon Sep 17 00:00:00 2001
From beac2bed3719b9e9f1eded4abf1730c8dd7d50a0 Mon Sep 17 00:00:00 2001
From: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
Date: Mon, 26 Sep 2022 12:12:04 +0200
Subject: [PATCH 05/18] config: add ignition translation
Subject: [PATCH 05/21] config: add ignition translation
it's a merge from flatcar/ign-converter
@ -2621,5 +2621,5 @@ index 00000000..e81f6bed
+ }
+}
--
2.35.1
2.25.1

View File

@ -1,7 +1,7 @@
From b33b28b0c5373c40b3cd9480be5519fe579612cf Mon Sep 17 00:00:00 2001
From a6b10520d45bf2083c6e6f184370aedd98d14168 Mon Sep 17 00:00:00 2001
From: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
Date: Wed, 25 May 2022 10:20:09 +0200
Subject: [PATCH 06/18] config/v3_5: convert ignition 2.x to 3.x
Subject: [PATCH 06/21] config/v3_5: convert ignition 2.x to 3.x
if the version of ignition is 2.x we convert it to 3.x using
ign-converter.
@ -72,5 +72,5 @@ index f0d4bb84..dccc5c4c 100644
return Parse(raw)
}
--
2.35.1
2.25.1

View File

@ -1,7 +1,7 @@
From b2f30b420740fc48611fe28d39c1e87a7efe9dc9 Mon Sep 17 00:00:00 2001
From 5c0764d31cf5a565dcd76a6c9508762e0928ef6f Mon Sep 17 00:00:00 2001
From: Mathieu Tortuyaux <mathieu@kinvolk.io>
Date: Fri, 30 Jul 2021 14:21:31 +0200
Subject: [PATCH 07/18] internal/prv/cmdline: backport flatcar patch
Subject: [PATCH 07/21] internal/prv/cmdline: backport flatcar patch
this patch provides backward compatibility for various config
key
@ -36,5 +36,5 @@ index f09e6fcb..b6de99d5 100644
}
--
2.35.1
2.25.1

View File

@ -1,7 +1,7 @@
From 3f6a1a26812dc29fbb97ced24959a991bcc85a83 Mon Sep 17 00:00:00 2001
From 88ac3872fa8cf315e24fd38b05dd2fb32d6de1ce Mon Sep 17 00:00:00 2001
From: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
Date: Fri, 24 Feb 2023 09:40:01 +0100
Subject: [PATCH 08/18] provider/qemu: apply fw_cfg patch
Subject: [PATCH 08/21] provider/qemu: apply fw_cfg patch
we support both CoreOS and Flatcar fw_cfg path to ensure compatiblity
@ -159,5 +159,5 @@ index f8bf820e..89515187 100644
+ return types.Config{}, report.Report{}, iErrors.ErrEmpty
}
--
2.35.1
2.25.1

View File

@ -1,7 +1,7 @@
From 240e3e2b8ba5a19cdef6f6cd9856435337283510 Mon Sep 17 00:00:00 2001
From 5839131cf64ac3ef23b5b076bd7ff289d295ceee Mon Sep 17 00:00:00 2001
From: Mathieu Tortuyaux <mathieu@kinvolk.io>
Date: Thu, 2 Sep 2021 11:03:17 +0200
Subject: [PATCH 09/18] config/3_5/test: add ignition 2.x test cases
Subject: [PATCH 09/21] config/3_5/test: add ignition 2.x test cases
Signed-off-by: Mathieu Tortuyaux <mathieu@kinvolk.io>
---
@ -40,5 +40,5 @@ index 7e10866e..58423719 100644
in: in{config: []byte(`{"ignition": {"version": "3.0.0"}}`)},
out: out{config: types.Config{Ignition: types.Ignition{Version: types.MaxVersion.String()}}},
--
2.35.1
2.25.1

View File

@ -1,7 +1,7 @@
From 14818bec1b1abf628cfbc5885063561019679044 Mon Sep 17 00:00:00 2001
From b128acae78ba4ef918fa0d6fe11a13aed9c4c283 Mon Sep 17 00:00:00 2001
From: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
Date: Wed, 22 Sep 2021 14:53:49 +0200
Subject: [PATCH 10/18] internal/disk/fs: ignore fs format mismatches for the
Subject: [PATCH 10/21] internal/disk/fs: ignore fs format mismatches for the
OEM partition
As soon as the OEM partition's filesystem format changes, all users
@ -35,5 +35,5 @@ index 18103f38..72baf50d 100644
(fs.UUID == nil || canonicalizeFilesystemUUID(info.Type, info.UUID) == canonicalizeFilesystemUUID(fileSystemFormat, *fs.UUID)) {
s.Logger.Info("filesystem at %q is already correctly formatted. Skipping mkfs...", fs.Device)
--
2.35.1
2.25.1

View File

@ -1,7 +1,7 @@
From ee9b77b552d65f8620abee384beb60dd3ffeb93d Mon Sep 17 00:00:00 2001
From 8501f155dc800b0a5f22b3329372f647aee56d6f Mon Sep 17 00:00:00 2001
From: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
Date: Wed, 25 May 2022 10:34:32 +0200
Subject: [PATCH 11/18] VMware: Fix guestinfo.*.config.data and *.config.url
Subject: [PATCH 11/21] VMware: Fix guestinfo.*.config.data and *.config.url
variables
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
@ -166,5 +166,5 @@ index b41b54bc..5a660b6c 100644
func DelConfig(f *resource.Fetcher) error {
--
2.35.1
2.25.1

View File

@ -1,7 +1,7 @@
From e5331453b47bd657e6a727f23548283756c326d5 Mon Sep 17 00:00:00 2001
From 7771ba7312c1d3237d9d14cc874da501bf788eb4 Mon Sep 17 00:00:00 2001
From: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
Date: Wed, 2 Feb 2022 13:27:18 +0100
Subject: [PATCH 12/18] config/version: handle configuration version 1
Subject: [PATCH 12/21] config/version: handle configuration version 1
version 2 should be able to translate configuration version 1 but the `GetConfigVersion`
was not able to detect version 1 configuration since for this particular
@ -49,5 +49,5 @@ index 3b9bb22f..f81056fa 100644
return semver.Version{}, report.Report{}, errors.ErrInvalidVersion
}
--
2.35.1
2.25.1

View File

@ -1,7 +1,7 @@
From 105a9165b37c962153a4b671bea8025122e81a72 Mon Sep 17 00:00:00 2001
From e7ce683cec079bbd796827da3bce6cfe2a9fe3cd Mon Sep 17 00:00:00 2001
From: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
Date: Tue, 22 Feb 2022 15:41:13 +0100
Subject: [PATCH 13/18] config/util: add cloud init detection to initial
Subject: [PATCH 13/21] config/util: add cloud init detection to initial
parsing
we detect if the config is not an ignition one (script/cloudinit) and we
@ -75,5 +75,5 @@ index 865d75d2..914bf2bf 100644
if err == nil {
return report.Report{}, nil
--
2.35.1
2.25.1

View File

@ -1,7 +1,7 @@
From ccaf67b639741cd3716c556aad70e5bf32272979 Mon Sep 17 00:00:00 2001
From d745d6f67a2ec9b4bc9cca183ea078ea8be618d1 Mon Sep 17 00:00:00 2001
From: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
Date: Wed, 25 May 2022 10:38:16 +0200
Subject: [PATCH 14/18] Revert "*: drop OEM URI support"
Subject: [PATCH 14/21] Revert "*: drop OEM URI support"
This reverts commit 0c088d6de77aa1b1f47b9252a07f51cb1e249df3.
---
@ -509,5 +509,5 @@ index d5bd3fe7..ea4ff6ab 100644
Env []string // Environment variables for Ignition
Config string
--
2.35.1
2.25.1

View File

@ -1,7 +1,7 @@
From c3308bc57e06947c02100e7befe61bfbdb10052b Mon Sep 17 00:00:00 2001
From 9b450ef48f04f86469d2f403645e9c46e3c5edcd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kai=20L=C3=BCke?= <kailuke@microsoft.com>
Date: Wed, 7 Jul 2021 18:40:52 +0200
Subject: [PATCH 15/18] internal/resource/url: support btrfs as OEM partition
Subject: [PATCH 15/21] internal/resource/url: support btrfs as OEM partition
filesystem
When btrfs is used to fit more content into the partition, mounting
@ -35,5 +35,5 @@ index 3f5fb4ab..3fbda7a7 100644
return nil
--
2.35.1
2.25.1

View File

@ -1,7 +1,7 @@
From e7cfcc2d44f83d2bc7a481c62a09b7d8c7aee2f4 Mon Sep 17 00:00:00 2001
From c1a4912fcdfbb2167d723d65062744997028f07a Mon Sep 17 00:00:00 2001
From: Kai Lueke <kailuke@microsoft.com>
Date: Fri, 11 Feb 2022 15:41:12 +0100
Subject: [PATCH 16/18] internal/exec/stages/disks: prevent races with udev
Subject: [PATCH 16/21] internal/exec/stages/disks: prevent races with udev
The "udevadm settle" command used to wait for udev to process the disk
changes and recreate the entries under /dev was still prone to races
@ -193,5 +193,5 @@ index 41f98a41..d22f604c 100644
return nil
--
2.35.1
2.25.1

View File

@ -1,7 +1,7 @@
From ed28e76ecd79396687137adaeee93c2381b1e95a Mon Sep 17 00:00:00 2001
From ca70b6d21ddacc1addf00bd041485e9ad559a2d4 Mon Sep 17 00:00:00 2001
From: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
Date: Thu, 10 Nov 2022 11:58:49 +0100
Subject: [PATCH 17/18] translation: support OEM and oem
Subject: [PATCH 17/21] translation: support OEM and oem
Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
---
@ -157,5 +157,5 @@ index e81f6bed..68c07109 100644
+ }
+}
--
2.35.1
2.25.1

View File

@ -1,7 +1,7 @@
From 1e5bc7ec945f2dd905235b1019c426a0cfa94e6b Mon Sep 17 00:00:00 2001
From bb172f1cbf23695214e5556b6f40b92eae6af0bb Mon Sep 17 00:00:00 2001
From: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
Date: Wed, 21 Dec 2022 17:25:02 +0100
Subject: [PATCH 18/18] revert: internal/oem: drop noop OEMs
Subject: [PATCH 18/21] revert: internal/oem: drop noop OEMs
This reverts: https://github.com/coreos/ignition/commit/26828f92e00060aa8ebf2197545ad602af237132
@ -75,5 +75,5 @@ index 51bf5174..3169536c 100644
name: "virtualbox",
fetch: virtualbox.FetchConfig,
--
2.35.1
2.25.1

View File

@ -0,0 +1,42 @@
From e27ff547ae16e31e0c61f7e393437f4df57887ed Mon Sep 17 00:00:00 2001
From: Krzesimir Nowak <knowak@microsoft.com>
Date: Fri, 14 Apr 2023 11:37:20 +0200
Subject: [PATCH 19/21] docs: Add re-added platforms to docs to pass tests
---
docs/supported-platforms.md | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/docs/supported-platforms.md b/docs/supported-platforms.md
index f7bb4b40..90df6c6a 100644
--- a/docs/supported-platforms.md
+++ b/docs/supported-platforms.md
@@ -12,18 +12,25 @@ Ignition is currently only supported for the following platforms:
* [Microsoft Azure Stack] (`azurestack`) - Ignition will read its configuration from the custom data provided to the instance. Cloud SSH keys are handled separately.
* Bare Metal - Use the `ignition.config.url` kernel parameter to provide a URL to the configuration. The URL can use the `http://`, `https://`, `tftp://`, `s3://`, or `gs://` schemes to specify a remote config or the `oem://` scheme to specify a local config, rooted in `/usr/share/oem`.
* [Brightbox] (`brightbox`) - Ignition will read its configuration from the instance userdata. Cloud SSH keys are handled separately.
+* `cloudsigma` - Ignition will read its configuration from the instance userdata. Cloud SSH keys are handled separately.
* [CloudStack] (`cloudstack`) - Ignition will read its configuration from the instance userdata via either metadata service or config drive. Cloud SSH keys are handled separately.
* [DigitalOcean] (`digitalocean`) - Ignition will read its configuration from the droplet userdata. Cloud SSH keys and network configuration are handled separately.
* [Exoscale] (`exoscale`) - Ignition will read its configuration from the instance userdata. Cloud SSH keys are handled separately.
* [Google Cloud] (`gcp`) - Ignition will read its configuration from the instance metadata entry named "user-data". Cloud SSH keys are handled separately.
+* `hyperv` - Ignition will read its configuration from the instance userdata. Cloud SSH keys are handled separately.
* [IBM Cloud] (`ibmcloud`) - Ignition will read its configuration from the instance userdata. Cloud SSH keys are handled separately.
+* `interoute` - Ignition will read its configuration from the instance userdata. Cloud SSH keys are handled separately.
* [KubeVirt] (`kubevirt`) - Ignition will read its configuration from the instance userdata via config drive. Cloud SSH keys are handled separately.
* Bare Metal (`metal`) - Use the `ignition.config.url` kernel parameter to provide a URL to the configuration. The URL can use the `http://`, `https://`, `tftp://`, `s3://`, `arn:`, or `gs://` schemes to specify a remote config.
+* `niftycloud` - Ignition will read its configuration from the instance userdata. Cloud SSH keys are handled separately.
* [Nutanix] (`nutanix`) - Ignition will read its configuration from the instance userdata via config drive. Cloud SSH keys are handled separately.
* [OpenStack] (`openstack`) - Ignition will read its configuration from the instance userdata via either metadata service or config drive. Cloud SSH keys are handled separately.
* [Equinix Metal] (`packet`) - Ignition will read its configuration from the instance userdata. Cloud SSH keys are handled separately.
* [IBM Power Systems Virtual Server] (`powervs`) - Ignition will read its configuration from the instance userdata. Cloud SSH keys are handled separately.
* [QEMU] (`qemu`) - Ignition will read its configuration from the 'opt/com.coreos/config' key on the QEMU Firmware Configuration Device (available in QEMU 2.4.0 and higher).
+* `rackspace` - Ignition will read its configuration from the instance userdata. Cloud SSH keys are handled separately.
+* `rackspace-onmetal` - Ignition will read its configuration from the instance userdata. Cloud SSH keys are handled separately.
+* `vagrant` - Ignition will read its configuration from the instance userdata. Cloud SSH keys are handled separately.
* [VirtualBox] (`virtualbox`) - Use the VirtualBox guest property `/Ignition/Config` to provide the config to the virtual machine.
* [VMware] (`vmware`) - Use the VMware Guestinfo variables `ignition.config.data` and `ignition.config.data.encoding` to provide the config and its encoding to the virtual machine. Valid encodings are "", "base64", and "gzip+base64". Guestinfo variables can be provided directly or via an OVF environment, with priority given to variables specified directly.
* [Vultr] (`vultr`) - Ignition will read its configuration from the instance userdata. Cloud SSH keys are handled separately.
--
2.25.1

View File

@ -0,0 +1,56 @@
From 38bc8c588bd7e4c5c6de85ccb182c3c794363448 Mon Sep 17 00:00:00 2001
From: Krzesimir Nowak <knowak@microsoft.com>
Date: Tue, 4 Apr 2023 12:12:42 +0200
Subject: [PATCH 20/21] /usr/share/oem -> /oem
---
config/util/translate.go | 2 +-
docs/supported-platforms.md | 2 +-
internal/distro/distro.go | 5 ++++-
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/config/util/translate.go b/config/util/translate.go
index 347d148c..d4c057b2 100644
--- a/config/util/translate.go
+++ b/config/util/translate.go
@@ -154,7 +154,7 @@ func FSGeneration(name string, fsMap map[string]string) (string, error) {
if _, ok := fsMap[name]; !ok {
addedSuffixCounter += 1
if name == "oem" {
- fsMap[name] = "/usr/share/oem"
+ fsMap[name] = "/oem"
} else {
// generate a new path
fsMap[name] = "/tmp/" + name + "-ign" + strconv.FormatUint(addedSuffixCounter, 10)
diff --git a/docs/supported-platforms.md b/docs/supported-platforms.md
index 90df6c6a..7867ba09 100644
--- a/docs/supported-platforms.md
+++ b/docs/supported-platforms.md
@@ -10,7 +10,7 @@ Ignition is currently only supported for the following platforms:
* [Amazon Web Services] (`aws`) - Ignition will read its configuration from the instance userdata. Cloud SSH keys are handled separately.
* [Microsoft Azure] (`azure`)- Ignition will read its configuration from the custom data provided to the instance. Cloud SSH keys are handled separately.
* [Microsoft Azure Stack] (`azurestack`) - Ignition will read its configuration from the custom data provided to the instance. Cloud SSH keys are handled separately.
-* Bare Metal - Use the `ignition.config.url` kernel parameter to provide a URL to the configuration. The URL can use the `http://`, `https://`, `tftp://`, `s3://`, or `gs://` schemes to specify a remote config or the `oem://` scheme to specify a local config, rooted in `/usr/share/oem`.
+* Bare Metal - Use the `ignition.config.url` kernel parameter to provide a URL to the configuration. The URL can use the `http://`, `https://`, `tftp://`, `s3://`, or `gs://` schemes to specify a remote config or the `oem://` scheme to specify a local config, rooted in `/oem`.
* [Brightbox] (`brightbox`) - Ignition will read its configuration from the instance userdata. Cloud SSH keys are handled separately.
* `cloudsigma` - Ignition will read its configuration from the instance userdata. Cloud SSH keys are handled separately.
* [CloudStack] (`cloudstack`) - Ignition will read its configuration from the instance userdata via either metadata service or config drive. Cloud SSH keys are handled separately.
diff --git a/internal/distro/distro.go b/internal/distro/distro.go
index 644c42c4..9e96166e 100644
--- a/internal/distro/distro.go
+++ b/internal/distro/distro.go
@@ -32,7 +32,10 @@ var (
bootIDPath = "/proc/sys/kernel/random/boot_id"
// initramfs directory containing distro-provided base config
systemConfigDir = "/usr/lib/ignition"
- // initramfs directory to check before retrieving file from OEM partition
+ // initramfs directory to check before retrieving file from
+ // OEM partition; note that OEM partition is mounted on /oem
+ // on the host, but initrds still use /usr/share/oem for
+ // backwards compatilibity
oemLookasideDir = "/usr/share/oem"
// Helper programs
--
2.25.1

View File

@ -0,0 +1,32 @@
From af6e6c898fc3482b2bc4bfd48e47ac69e0564f57 Mon Sep 17 00:00:00 2001
From: Krzesimir Nowak <knowak@microsoft.com>
Date: Tue, 16 May 2023 17:43:43 +0200
Subject: [PATCH 21/21] internal/exec/stages/mount: Mount /oem
When asking to mount the OEM partition to /usr/share/oem, actually
mount it in /oem. The /usr/share/oem is a symlink pointing to /oem, so
the ignition config (or container linux config) trying to put stuff
into /usr/share/oem, should end up having things in /oem.
---
internal/exec/stages/mount/mount.go | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/internal/exec/stages/mount/mount.go b/internal/exec/stages/mount/mount.go
index 8074dbe6..b8cdc5cb 100644
--- a/internal/exec/stages/mount/mount.go
+++ b/internal/exec/stages/mount/mount.go
@@ -118,6 +118,11 @@ func (s stage) mountFs(fs types.Filesystem) error {
// mount paths shouldn't include symlinks or other non-directories so we can use filepath.Join()
// instead of s.JoinPath(). Check that the resulting path is composed of only directories.
relpath := *fs.Path
+ // /usr/share/oem is now a symlink to /oem, so make sure we
+ // rather actually try to mount /oem
+ if relpath == "/usr/share/oem" && fs.Device == "/dev/disk/by-label/OEM" {
+ relpath = "/oem"
+ }
path := filepath.Join(s.DestDir, relpath)
if err := checkForNonDirectories(path); err != nil {
return err
--
2.25.1

View File

@ -60,6 +60,9 @@ PATCHES=(
"${FILESDIR}/0016-internal-exec-stages-disks-prevent-races-with-udev.patch"
"${FILESDIR}/0017-translation-support-OEM-and-oem.patch"
"${FILESDIR}/0018-revert-internal-oem-drop-noop-OEMs.patch"
"${FILESDIR}/0019-docs-Add-re-added-platforms-to-docs-to-pass-tests.patch"
"${FILESDIR}/0020-usr-share-oem-oem.patch"
"${FILESDIR}/0021-internal-exec-stages-mount-Mount-oem.patch"
)
src_compile() {

View File

@ -10,7 +10,7 @@ CROS_WORKON_REPO="https://github.com"
if [[ "${PV}" == 9999 ]]; then
KEYWORDS="~amd64 ~arm ~arm64 ~x86"
else
CROS_WORKON_COMMIT="d3cc0f4b1dce6a5084a8a909810efc30c367020b" # flatcar-master
CROS_WORKON_COMMIT="130003986dfdab46a21c7f34054239e59583e0f6" # flatcar-master
KEYWORDS="amd64 arm arm64 x86"
fi

View File

@ -70,7 +70,7 @@ function extract_nvidia_installer() {
function run_nspawn_container() {
echo Spawn system-nspawn container to install the NVIDIA drivers
sudo systemd-nspawn --read-only --volatile=overlay --image="${FLATCAR_ROOT_WORKDIR}/${FLATCAR_DEVELOPER_CONTAINER}" --bind="${FLATCAR_ROOT_WORKDIR}/${NVIDIA_WORKDIR}":/nvidia --bind=/usr/share/oem/bin:/app/bin/ /app/bin/install-nvidia "$NVIDIA_DRIVER_BASENAME"
sudo systemd-nspawn --read-only --volatile=overlay --image="${FLATCAR_ROOT_WORKDIR}/${FLATCAR_DEVELOPER_CONTAINER}" --bind="${FLATCAR_ROOT_WORKDIR}/${NVIDIA_WORKDIR}":/nvidia --bind=/oem/bin:/app/bin/ /app/bin/install-nvidia "$NVIDIA_DRIVER_BASENAME"
}
function copy_nvidia_build_artifacts() {

View File

@ -7,7 +7,7 @@ After=network-online.target
Type=simple
Restart=no
Environment=PATH=/opt/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
ExecStart=/usr/share/oem/bin/setup-nvidia
ExecStart=/oem/bin/setup-nvidia
[Install]
WantedBy=multi-user.target

View File

@ -20,9 +20,9 @@ RDEPEND="
"
src_install() {
insinto "/usr/share/oem"
insinto "/oem"
doins -r "${FILESDIR}/units"
exeinto "/usr/share/oem/bin"
exeinto "/oem/bin"
doexe "${FILESDIR}/bin/install-nvidia"
doexe "${FILESDIR}/bin/setup-nvidia"
}