mirror of
https://github.com/flatcar/scripts.git
synced 2026-05-14 16:46:13 +02:00
Merge pull request #4004 from flatcar/chewi/oem-rework
Convert OEM packages to sysext, drop several images, revamp Vagrant support
This commit is contained in:
commit
835069d985
24
.github/workflows/ci.yaml
vendored
24
.github/workflows/ci.yaml
vendored
@ -189,25 +189,15 @@ jobs:
|
||||
|
||||
images_out="images"
|
||||
|
||||
has_packet=0
|
||||
has_pxe=0
|
||||
formats="${IMAGE_FORMATS}"
|
||||
for format in "${formats}";do
|
||||
[[ "${format}" = 'packet' ]] || [[ "${format}" = 'equinix_metal' ]] && has_packet=1
|
||||
[[ "${format}" = 'pxe' ]] && has_pxe=1
|
||||
done
|
||||
|
||||
[[ ${has_packet} -eq 1 ]] && [[ ${has_pxe} -eq 0 ]] && set -- 'pxe' "${@}"
|
||||
if echo "$formats" | tr ' ' '\n' | grep -q '^vmware'; then
|
||||
formats=$(echo "$formats" | tr ' ' '\n' | sed '/vmware.*/d')
|
||||
formats+=" vmware vmware_insecure vmware_ova vmware_raw"
|
||||
printf -v formats "%s\n" ${IMAGE_FORMATS}
|
||||
if grep -q '^vmware' <<< "${formats}"; then
|
||||
formats=$(grep -v '^vmware' <<< "${formats}")
|
||||
printf -v formats "%s\n" ${formats} vmware vmware_ova vmware_raw
|
||||
fi
|
||||
if echo "$formats" | tr ' ' '\n' | grep -q -P '^(ami|aws)'; then
|
||||
formats=$(echo "$formats" | tr ' ' '\n' | sed '/ami.*/d' | sed '/aws/d')
|
||||
formats+=" ami ami_vmdk"
|
||||
if grep -q '^ami\|^aws' <<< "${formats}"; then
|
||||
formats=$(grep -v '^ami\|^aws' <<< "${formats}")
|
||||
printf -v formats "%s\n" ${formats} ami ami_vmdk
|
||||
fi
|
||||
# Keep compatibility with SDK scripts where "equinix_metal" remains unknown.
|
||||
formats=$(echo "$formats" | tr ' ' '\n' | sed 's/equinix_metal/packet/g')
|
||||
|
||||
for format in ${formats}; do
|
||||
if [ "${format}" = qemu ] || [ "${format}" = qemu_uefi_secure ]; then
|
||||
|
||||
@ -107,7 +107,6 @@ IGNORE_SHEBANG = (
|
||||
"*/python[0-9].[0-9][0-9]/cgi.py",
|
||||
"*/usr/lib64/modules/*/source/scripts/*",
|
||||
"*/usr/lib/modules/*/source/scripts/*",
|
||||
"*/usr/share/nova-agent/*/etc/gentoo/nova-agent",
|
||||
"*/tmp/*",
|
||||
"*/Documentation/*",
|
||||
"*/doc/*",
|
||||
|
||||
@ -98,14 +98,6 @@
|
||||
"blocks":"33845248"
|
||||
}
|
||||
},
|
||||
"onmetal":{
|
||||
"7":{
|
||||
"label":"config-2",
|
||||
"fs_label":"config-2",
|
||||
"type":"data",
|
||||
"fs_type":"ext2"
|
||||
}
|
||||
},
|
||||
"container":{
|
||||
"1":{
|
||||
"type":"blank"
|
||||
|
||||
@ -11,19 +11,3 @@ EXTRA_SYSEXTS=(
|
||||
"python|dev-lang/python,dev-python/pip"
|
||||
"zfs|sys-fs/zfs"
|
||||
)
|
||||
|
||||
_get_unversioned_sysext_packages_unsorted() {
|
||||
for sysext in "${EXTRA_SYSEXTS[@]}"; do
|
||||
IFS="|" read -r _ PACKAGE_ATOMS _ <<< "$sysext"
|
||||
|
||||
IFS=,
|
||||
for atom in $PACKAGE_ATOMS; do
|
||||
qatom "$atom" -F "%{CATEGORY}/%{PN}"
|
||||
done
|
||||
unset IFS
|
||||
done
|
||||
}
|
||||
|
||||
get_unversioned_sysext_packages() {
|
||||
_get_unversioned_sysext_packages_unsorted | sort | uniq
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
# Flatcar GRUB settings
|
||||
|
||||
set oem_id="vagrant"
|
||||
set oem_id="akamai"
|
||||
@ -1,4 +1,6 @@
|
||||
# Flatcar GRUB settings for AMI
|
||||
# Flatcar GRUB settings
|
||||
|
||||
set oem_id="ec2"
|
||||
|
||||
# Blacklist the Xen framebuffer module so it doesn't get loaded at boot
|
||||
# Disable `ens3` style names, so eth0 is used for both ixgbevf or xen.
|
||||
@ -1,3 +1,6 @@
|
||||
# Flatcar GRUB settings
|
||||
|
||||
set oem_id="azure"
|
||||
set linux_append="flatcar.autologin"
|
||||
|
||||
# Azure only has a serial console.
|
||||
3
build_library/oem/digitalocean/grub.cfg
Normal file
3
build_library/oem/digitalocean/grub.cfg
Normal file
@ -0,0 +1,3 @@
|
||||
# Flatcar GRUB settings
|
||||
|
||||
set oem_id="digitalocean"
|
||||
@ -1,3 +1,7 @@
|
||||
# Flatcar GRUB settings
|
||||
|
||||
set oem_id="gce"
|
||||
|
||||
# GCE only has a serial console.
|
||||
set linux_console="console=ttyS0,115200n8"
|
||||
serial com0 --speed=115200 --word=8 --parity=no
|
||||
@ -1,3 +1,3 @@
|
||||
# Flatcar GRUB settings
|
||||
|
||||
set oem_id="rackspace"
|
||||
set oem_id="hetzner"
|
||||
3
build_library/oem/kubevirt/grub.cfg
Normal file
3
build_library/oem/kubevirt/grub.cfg
Normal file
@ -0,0 +1,3 @@
|
||||
# Flatcar GRUB settings
|
||||
|
||||
set oem_id="kubevirt"
|
||||
3
build_library/oem/nutanix/grub.cfg
Normal file
3
build_library/oem/nutanix/grub.cfg
Normal file
@ -0,0 +1,3 @@
|
||||
# Flatcar GRUB settings
|
||||
|
||||
set oem_id="nutanix"
|
||||
4
build_library/oem/openstack/grub.cfg
Normal file
4
build_library/oem/openstack/grub.cfg
Normal file
@ -0,0 +1,4 @@
|
||||
# Flatcar GRUB settings
|
||||
|
||||
set oem_id="openstack"
|
||||
set linux_append="flatcar.autologin"
|
||||
4
build_library/oem/proxmoxve/grub.cfg
Normal file
4
build_library/oem/proxmoxve/grub.cfg
Normal file
@ -0,0 +1,4 @@
|
||||
# Flatcar GRUB settings
|
||||
|
||||
set oem_id="proxmoxve"
|
||||
set linux_append="flatcar.autologin"
|
||||
4
build_library/oem/qemu/grub.cfg
Normal file
4
build_library/oem/qemu/grub.cfg
Normal file
@ -0,0 +1,4 @@
|
||||
# Flatcar GRUB settings
|
||||
|
||||
set oem_id="qemu"
|
||||
set linux_append="flatcar.autologin"
|
||||
@ -1 +1,4 @@
|
||||
# Flatcar GRUB settings
|
||||
|
||||
set oem_id="scaleway"
|
||||
set linux_console="console=ttyS0,115200n8 earlycon=ttyS0,115200"
|
||||
3
build_library/oem/stackit/grub.cfg
Normal file
3
build_library/oem/stackit/grub.cfg
Normal file
@ -0,0 +1,3 @@
|
||||
# Flatcar GRUB settings
|
||||
|
||||
set oem_id="openstack"
|
||||
@ -1,11 +1,8 @@
|
||||
# -*- mode: ruby -*-
|
||||
# # vi: set ft=ruby :
|
||||
|
||||
if Vagrant::VERSION < "1.6.0"
|
||||
raise "Need at least vagrant version 1.6.0, please update"
|
||||
end
|
||||
Vagrant.require_version ">= 2.2.5"
|
||||
|
||||
require_relative 'change_host_name.rb'
|
||||
require_relative 'configure_networks.rb'
|
||||
require_relative 'base_mac.rb'
|
||||
|
||||
@ -27,6 +24,10 @@ Vagrant.configure("2") do |config|
|
||||
# Fix docker not being able to resolve private registry in VirtualBox
|
||||
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
|
||||
vb.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
|
||||
|
||||
if File.exist?("config.ign")
|
||||
vb.customize ["guestproperty", "set", :id, "/Ignition/Config", File.read("config.ign")]
|
||||
end
|
||||
end
|
||||
|
||||
config.vm.provider :vmware_fusion do |vf|
|
||||
@ -38,4 +39,9 @@ Vagrant.configure("2") do |config|
|
||||
prl.check_guest_tools = false
|
||||
prl.functional_psf = false
|
||||
end
|
||||
end
|
||||
|
||||
if File.exist?("user-data")
|
||||
config.vm.provision :file, :source => "user-data", :destination => "/tmp/vagrantfile-user-data"
|
||||
config.vm.provision :shell, :inline => "mv /tmp/vagrantfile-user-data /var/lib/flatcar-vagrant/", :privileged => true
|
||||
end
|
||||
end
|
||||
@ -1,8 +1,9 @@
|
||||
# -*- mode: ruby -*-
|
||||
# # vi: set ft=ruby :
|
||||
|
||||
# NOTE: This monkey-patching is done to disable to old cloud config based
|
||||
# configure_networks built into the upstream vagrant project
|
||||
# NOTE: This monkey-patching is done to force cloud-init over NetworkManager.
|
||||
# Vagrant attempts to detect cloud-init, but Flatcar doesn't have an executable
|
||||
# under that name, only coreos-cloudinit.
|
||||
|
||||
require Vagrant.source_root.join("plugins/guests/coreos/cap/configure_networks.rb")
|
||||
|
||||
@ -11,6 +12,7 @@ module VagrantPlugins
|
||||
module Cap
|
||||
class ConfigureNetworks
|
||||
def self.configure_networks(machine, networks)
|
||||
configure_networks_cloud_init(machine, networks)
|
||||
end
|
||||
end
|
||||
end
|
||||
4
build_library/oem/vmware/grub.cfg
Normal file
4
build_library/oem/vmware/grub.cfg
Normal file
@ -0,0 +1,4 @@
|
||||
# Flatcar GRUB settings
|
||||
|
||||
set oem_id="vmware"
|
||||
set linux_append="flatcar.autologin"
|
||||
@ -20,42 +20,35 @@ get_oem_overlay_root() {
|
||||
printf '%s' "${overlay_root}"
|
||||
}
|
||||
|
||||
_get_oem_ids() {
|
||||
local arch list_var_name
|
||||
arch=${1}; shift
|
||||
list_var_name=${1}; shift
|
||||
|
||||
local overlay_root
|
||||
overlay_root=$(get_oem_overlay_root)
|
||||
|
||||
local -a ebuilds=("${overlay_root}/coreos-base/common-oem-files/common-oem-files-"*'.ebuild')
|
||||
if [[ ${#ebuilds[@]} -eq 0 ]] || [[ ! -e ${ebuilds[0]} ]]; then
|
||||
echo "No coreos-base/common-oem-files ebuilds?!" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# This defines local COMMON_OEMIDS, AMD64_ONLY_OEMIDS,
|
||||
# ARM64_ONLY_OEMIDS and OEMIDS variable. We don't use the last
|
||||
# one. Also defines global-by-default EAPI, which we make local
|
||||
# here to avoid making it global.
|
||||
local EAPI
|
||||
source "${ebuilds[0]}" flatcar-local-variables
|
||||
|
||||
local -n arch_oemids_ref="${arch^^}_ONLY_OEMIDS"
|
||||
local all_oemids=(
|
||||
"${COMMON_OEMIDS[@]}"
|
||||
"${arch_oemids_ref[@]}"
|
||||
)
|
||||
|
||||
mapfile -t "${list_var_name}" < <(printf '%s\n' "${all_oemids[@]}" | sort)
|
||||
}
|
||||
|
||||
# Gets a list of OEMs that are using sysexts.
|
||||
#
|
||||
# 1 - arch
|
||||
# 2 - name of an array variable to store the result in
|
||||
get_oem_id_list() {
|
||||
_get_oem_ids "$@"
|
||||
local arch=${1}; shift
|
||||
local -n list_var_ref=${1}; shift
|
||||
|
||||
local overlay_root dir ebuild regex
|
||||
overlay_root=$(get_oem_overlay_root)
|
||||
|
||||
for dir in "${overlay_root}"/coreos-base/oem-*; do
|
||||
for ebuild in "${dir}"/*.ebuild; do
|
||||
if [[ ! -e ${ebuild} ]]; then
|
||||
echo "No coreos-base/oem-* ebuilds?!" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check the KEYWORDS by sourcing the ebuild. We can't rely on Portage
|
||||
# because this needs to work outside the SDK. OEM ebuilds are relatively
|
||||
# boring, so this should be sufficient. This doesn't check whether the
|
||||
# KEYWORDS are stable, but that shouldn't matter.
|
||||
regex="\b${arch}\b"
|
||||
if ( set +eu; . "${ebuild}" &>/dev/null; [[ ${KEYWORDS} =~ ${regex} ]] ); then
|
||||
list_var_ref+=( "${dir##*/oem-}" )
|
||||
break
|
||||
fi
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
# Gets a list of OEM sysext descriptors.
|
||||
@ -65,19 +58,14 @@ get_oem_id_list() {
|
||||
#
|
||||
# Format: "name|metapackage|useflags"
|
||||
get_oem_sysext_matrix() {
|
||||
local arch list_var_name
|
||||
arch=${1}; shift
|
||||
list_var_name=${1}; shift
|
||||
local arch=${1}; shift
|
||||
declare -n list_var_ref=${1}; shift
|
||||
|
||||
local -a oem_ids
|
||||
_get_oem_ids "${arch}" oem_ids
|
||||
get_oem_id_list "${arch}" oem_ids
|
||||
|
||||
local -a matrix=()
|
||||
local oem_id
|
||||
for oem_id in "${oem_ids[@]}"; do
|
||||
matrix+=("oem-${oem_id}|coreos-base/oem-${oem_id}|${oem_id}")
|
||||
list_var_ref+=( "oem-${oem_id}|coreos-base/oem-${oem_id}|" )
|
||||
done
|
||||
|
||||
local -n matrix_ref="${list_var_name}"
|
||||
matrix_ref=("${matrix[@]}")
|
||||
}
|
||||
|
||||
@ -15,6 +15,7 @@ SCRIPT_ROOT="$(cd "$(dirname "$(readlink -f "$0")")/../"; pwd)"
|
||||
assert_inside_chroot
|
||||
switch_to_strict_mode
|
||||
|
||||
. "${BUILD_LIBRARY_DIR}/toolchain_util.sh" || exit 1
|
||||
. "${BUILD_LIBRARY_DIR}/build_image_util.sh" || exit 1
|
||||
|
||||
# Create a sysext from a package and install it to the OS image.
|
||||
|
||||
@ -1,42 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
SCRIPT_ROOT=$(readlink -f $(dirname "$0")/..)
|
||||
. "${SCRIPT_ROOT}/common.sh" || exit 1
|
||||
. "${BUILD_LIBRARY_DIR}/vm_image_util.sh" || exit 1
|
||||
|
||||
# We're invoked only by build_image, which runs in the chroot
|
||||
assert_inside_chroot
|
||||
|
||||
# Die on any errors
|
||||
switch_to_strict_mode
|
||||
|
||||
# all of this is amd64 only right now
|
||||
BOARD="amd64-usr"
|
||||
|
||||
oem_uses() {
|
||||
local vm oem="$1"
|
||||
for vm in "${VALID_IMG_TYPES[@]}"; do
|
||||
local oem_var="IMG_${vm}_OEM_PACKAGE"
|
||||
local use_var="IMG_${vm}_OEM_USE"
|
||||
if [[ "${!oem_var}" == "${oem}" && -n "${!use_var}" ]]; then
|
||||
echo "${!use_var}"
|
||||
fi
|
||||
done | sort -u
|
||||
}
|
||||
|
||||
for oem in "${VALID_OEM_PACKAGES[@]/#/oem-}"; do
|
||||
uses=( $(oem_uses "${oem}") )
|
||||
if [[ ${#uses} -eq 0 ]]; then
|
||||
uses=( "" )
|
||||
fi
|
||||
|
||||
for use in "${uses[@]}"; do
|
||||
info "Checking ${oem}${use:+[${use}]}"
|
||||
USE="${use}" emerge-${BOARD} --usepkg --getbinpkg \
|
||||
--emptytree --pretend --verbose "coreos-base/${oem}"
|
||||
done
|
||||
done
|
||||
@ -6,9 +6,9 @@
|
||||
SCRIPT_ROOT=$(readlink -f $(dirname "$0")/..)
|
||||
. "${SCRIPT_ROOT}/common.sh" || exit 1
|
||||
|
||||
DEFINE_string vm_name "CoreOS" "Name for this VM"
|
||||
DEFINE_string vm_name "Flatcar" "Name for this VM"
|
||||
DEFINE_string disk_vmdk "" "Disk image to reference, only basename is used."
|
||||
DEFINE_integer memory_size 1024 "Memory size in MB"
|
||||
DEFINE_integer memory_size 2048 "Memory size in MB"
|
||||
DEFINE_string output_ovf "" "Path to write ofv file to, required."
|
||||
DEFINE_string output_vagrant "" "Path to write Vagrantfile to, optional."
|
||||
|
||||
@ -90,12 +90,12 @@ if [[ -n "${FLAGS_output_ovf}" ]]; then
|
||||
<vssd:VirtualSystemType>virtualbox-2.2</vssd:VirtualSystemType>
|
||||
</System>
|
||||
<Item>
|
||||
<rasd:Caption>1 virtual CPU</rasd:Caption>
|
||||
<rasd:Caption>2 virtual CPUs</rasd:Caption>
|
||||
<rasd:Description>Number of virtual CPUs</rasd:Description>
|
||||
<rasd:ElementName>1 virtual CPU</rasd:ElementName>
|
||||
<rasd:ElementName>2 virtual CPUs</rasd:ElementName>
|
||||
<rasd:InstanceID>1</rasd:InstanceID>
|
||||
<rasd:ResourceType>3</rasd:ResourceType>
|
||||
<rasd:VirtualQuantity>1</rasd:VirtualQuantity>
|
||||
<rasd:VirtualQuantity>2</rasd:VirtualQuantity>
|
||||
</Item>
|
||||
<Item>
|
||||
<rasd:AllocationUnits>MegaBytes</rasd:AllocationUnits>
|
||||
@ -108,21 +108,20 @@ if [[ -n "${FLAGS_output_ovf}" ]]; then
|
||||
</Item>
|
||||
<Item>
|
||||
<rasd:Address>0</rasd:Address>
|
||||
<rasd:Caption>ideController0</rasd:Caption>
|
||||
<rasd:Description>IDE Controller</rasd:Description>
|
||||
<rasd:ElementName>ideController0</rasd:ElementName>
|
||||
<rasd:Caption>virtioSCSIController0</rasd:Caption>
|
||||
<rasd:Description>VirtioSCSI Controller</rasd:Description>
|
||||
<rasd:ElementName>virtioSCSIController0</rasd:ElementName>
|
||||
<rasd:InstanceID>3</rasd:InstanceID>
|
||||
<rasd:ResourceSubType>PIIX4</rasd:ResourceSubType>
|
||||
<rasd:ResourceType>5</rasd:ResourceType>
|
||||
<rasd:ResourceSubType>VirtioSCSI</rasd:ResourceSubType>
|
||||
<rasd:ResourceType>20</rasd:ResourceType>
|
||||
</Item>
|
||||
<Item>
|
||||
<rasd:Address>1</rasd:Address>
|
||||
<rasd:Caption>ideController1</rasd:Caption>
|
||||
<rasd:Description>IDE Controller</rasd:Description>
|
||||
<rasd:ElementName>ideController1</rasd:ElementName>
|
||||
<rasd:Address>0</rasd:Address>
|
||||
<rasd:Caption>usb</rasd:Caption>
|
||||
<rasd:Description>USB Controller</rasd:Description>
|
||||
<rasd:ElementName>usb</rasd:ElementName>
|
||||
<rasd:InstanceID>4</rasd:InstanceID>
|
||||
<rasd:ResourceSubType>PIIX4</rasd:ResourceSubType>
|
||||
<rasd:ResourceType>5</rasd:ResourceType>
|
||||
<rasd:ResourceType>23</rasd:ResourceType>
|
||||
</Item>
|
||||
<Item>
|
||||
<rasd:AutomaticAllocation>true</rasd:AutomaticAllocation>
|
||||
@ -130,7 +129,6 @@ if [[ -n "${FLAGS_output_ovf}" ]]; then
|
||||
<rasd:Connection>NAT</rasd:Connection>
|
||||
<rasd:ElementName>Ethernet adapter on 'NAT'</rasd:ElementName>
|
||||
<rasd:InstanceID>5</rasd:InstanceID>
|
||||
<rasd:ResourceSubType>E1000</rasd:ResourceSubType>
|
||||
<rasd:ResourceType>10</rasd:ResourceType>
|
||||
</Item>
|
||||
<Item>
|
||||
@ -144,137 +142,47 @@ if [[ -n "${FLAGS_output_ovf}" ]]; then
|
||||
<rasd:ResourceType>17</rasd:ResourceType>
|
||||
</Item>
|
||||
</VirtualHardwareSection>
|
||||
<vbox:Machine ovf:required="false" version="1.12-linux" uuid="{$(uuidgen)}" name="${FLAGS_vm_name}" OSType="Linux26_64" snapshotFolder="Snapshots" lastStateChange="$(datez)">
|
||||
<vbox:Machine ovf:required="false" version="1.19-linux" uuid="{$(uuidgen)}" name="${FLAGS_vm_name}" OSType="Linux26_64" snapshotFolder="Snapshots" lastStateChange="$(datez)">
|
||||
<ovf:Info>Complete VirtualBox machine configuration in VirtualBox format</ovf:Info>
|
||||
<Hardware version="2">
|
||||
<CPU count="1" hotplug="false">
|
||||
<HardwareVirtEx enabled="true" exclusive="true"/>
|
||||
<HardwareVirtExNestedPaging enabled="true"/>
|
||||
<HardwareVirtExVPID enabled="true"/>
|
||||
<PAE enabled="true"/>
|
||||
<HardwareVirtExLargePages enabled="false"/>
|
||||
<HardwareVirtForce enabled="false"/>
|
||||
</CPU>
|
||||
<Memory RAMSize="${FLAGS_memory_size}" PageFusion="false"/>
|
||||
<HID Pointing="PS2Mouse" Keyboard="PS2Keyboard"/>
|
||||
<HPET enabled="false"/>
|
||||
<Chipset type="PIIX3"/>
|
||||
<Boot>
|
||||
<Order position="1" device="HardDisk"/>
|
||||
<Order position="2" device="DVD"/>
|
||||
<Order position="3" device="None"/>
|
||||
<Order position="4" device="None"/>
|
||||
</Boot>
|
||||
<Display VRAMSize="8" monitorCount="1" accelerate3D="false" accelerate2DVideo="false"/>
|
||||
<VideoRecording enabled="false" file="Test.webm" horzRes="640" vertRes="480"/>
|
||||
<RemoteDisplay enabled="false" authType="Null"/>
|
||||
<Hardware>
|
||||
<Memory RAMSize="${FLAGS_memory_size}"/>
|
||||
<HID Pointing="USBTablet"/>
|
||||
<Display controller="VMSVGA"/>
|
||||
<Firmware type="EFI"/>
|
||||
<BIOS>
|
||||
<ACPI enabled="true"/>
|
||||
<IOAPIC enabled="true"/>
|
||||
<Logo fadeIn="true" fadeOut="true" displayTime="0"/>
|
||||
<BootMenu mode="MessageAndMenu"/>
|
||||
<TimeOffset value="0"/>
|
||||
<PXEDebug enabled="false"/>
|
||||
<SmbiosUuidLittleEndian enabled="true"/>
|
||||
<AutoSerialNumGen enabled="true"/>
|
||||
</BIOS>
|
||||
<USBController enabled="false" enabledEhci="false"/>
|
||||
<USB>
|
||||
<Controllers>
|
||||
<Controller name="OHCI" type="OHCI"/>
|
||||
</Controllers>
|
||||
</USB>
|
||||
<Network>
|
||||
<Adapter slot="0" enabled="true" MACAddress="${PRIMARY_MAC}" cable="true" speed="0" type="virtio">
|
||||
<DisabledModes/>
|
||||
<NAT>
|
||||
<DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/>
|
||||
<Alias logging="false" proxy-only="false" use-same-ports="false"/>
|
||||
</NAT>
|
||||
</Adapter>
|
||||
<Adapter slot="1" enabled="false" MACAddress="$(macgen)" cable="true" speed="0" type="virtio">
|
||||
<DisabledModes>
|
||||
<NAT>
|
||||
<DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/>
|
||||
<Alias logging="false" proxy-only="false" use-same-ports="false"/>
|
||||
</NAT>
|
||||
</DisabledModes>
|
||||
</Adapter>
|
||||
<Adapter slot="2" enabled="false" MACAddress="$(macgen)" cable="true" speed="0" type="virtio">
|
||||
<DisabledModes>
|
||||
<NAT>
|
||||
<DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/>
|
||||
<Alias logging="false" proxy-only="false" use-same-ports="false"/>
|
||||
</NAT>
|
||||
</DisabledModes>
|
||||
</Adapter>
|
||||
<Adapter slot="3" enabled="false" MACAddress="$(macgen)" cable="true" speed="0" type="virtio">
|
||||
<DisabledModes>
|
||||
<NAT>
|
||||
<DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/>
|
||||
<Alias logging="false" proxy-only="false" use-same-ports="false"/>
|
||||
</NAT>
|
||||
</DisabledModes>
|
||||
</Adapter>
|
||||
<Adapter slot="4" enabled="false" MACAddress="$(macgen)" cable="true" speed="0" type="virtio">
|
||||
<DisabledModes>
|
||||
<NAT>
|
||||
<DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/>
|
||||
<Alias logging="false" proxy-only="false" use-same-ports="false"/>
|
||||
</NAT>
|
||||
</DisabledModes>
|
||||
</Adapter>
|
||||
<Adapter slot="5" enabled="false" MACAddress="$(macgen)" cable="true" speed="0" type="virtio">
|
||||
<DisabledModes>
|
||||
<NAT>
|
||||
<DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/>
|
||||
<Alias logging="false" proxy-only="false" use-same-ports="false"/>
|
||||
</NAT>
|
||||
</DisabledModes>
|
||||
</Adapter>
|
||||
<Adapter slot="6" enabled="false" MACAddress="$(macgen)" cable="true" speed="0" type="virtio">
|
||||
<DisabledModes>
|
||||
<NAT>
|
||||
<DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/>
|
||||
<Alias logging="false" proxy-only="false" use-same-ports="false"/>
|
||||
</NAT>
|
||||
</DisabledModes>
|
||||
</Adapter>
|
||||
<Adapter slot="7" enabled="false" MACAddress="$(macgen)" cable="true" speed="0" type="virtio">
|
||||
<DisabledModes>
|
||||
<NAT>
|
||||
<DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/>
|
||||
<Alias logging="false" proxy-only="false" use-same-ports="false"/>
|
||||
</NAT>
|
||||
</DisabledModes>
|
||||
<Adapter slot="0" enabled="true" MACAddress="${PRIMARY_MAC}" type="virtio">
|
||||
<NAT localhost-reachable="true"/>
|
||||
</Adapter>
|
||||
</Network>
|
||||
<UART>
|
||||
<Port slot="0" enabled="false" IOBase="0x3f8" IRQ="4" hostMode="Disconnected"/>
|
||||
<Port slot="1" enabled="false" IOBase="0x2f8" IRQ="3" hostMode="Disconnected"/>
|
||||
</UART>
|
||||
<LPT>
|
||||
<Port slot="0" enabled="false" IOBase="0x378" IRQ="7"/>
|
||||
<Port slot="1" enabled="false" IOBase="0x378" IRQ="7"/>
|
||||
</LPT>
|
||||
<AudioAdapter controller="AC97" driver="Pulse" enabled="false"/>
|
||||
<RTC localOrUTC="local"/>
|
||||
<SharedFolders/>
|
||||
<Clipboard mode="Disabled"/>
|
||||
<DragAndDrop mode="Disabled"/>
|
||||
<IO>
|
||||
<IoCache enabled="true" size="5"/>
|
||||
<BandwidthGroups/>
|
||||
</IO>
|
||||
<HostPci>
|
||||
<Devices/>
|
||||
</HostPci>
|
||||
<EmulatedUSB>
|
||||
<CardReader enabled="false"/>
|
||||
</EmulatedUSB>
|
||||
<Guest memoryBalloonSize="0"/>
|
||||
<GuestProperties/>
|
||||
<AudioAdapter enabled="false"/>
|
||||
<Clipboard/>
|
||||
<StorageControllers>
|
||||
<StorageController name="virtio" type="VirtioSCSI" PortCount="1" useHostIOCache="false" Bootable="true">
|
||||
<AttachedDevice type="HardDisk" port="0" device="0">
|
||||
<Image uuid="{${DISK_UUID}}"/>
|
||||
</AttachedDevice>
|
||||
</StorageController>
|
||||
</StorageControllers>
|
||||
<RTC localOrUTC="UTC"/>
|
||||
<Chipset type="ICH9"/>
|
||||
<CPU count="2">
|
||||
<HardwareVirtExLargePages enabled="false"/>
|
||||
<PAE enabled="false"/>
|
||||
<NestedHWVirt enabled="true"/>
|
||||
<LongMode enabled="true"/>
|
||||
<X2APIC enabled="true"/>
|
||||
</CPU>
|
||||
</Hardware>
|
||||
<StorageControllers>
|
||||
<StorageController name="IDE Controller" type="PIIX4" PortCount="2" useHostIOCache="true" Bootable="true">
|
||||
<AttachedDevice type="HardDisk" port="0" device="0">
|
||||
<Image uuid="{${DISK_UUID}}"/>
|
||||
</AttachedDevice>
|
||||
</StorageController>
|
||||
</StorageControllers>
|
||||
</vbox:Machine>
|
||||
</VirtualSystem>
|
||||
</Envelope>
|
||||
|
||||
@ -23,56 +23,22 @@ VALID_IMG_TYPES=(
|
||||
kubevirt
|
||||
openstack
|
||||
openstack_mini
|
||||
packet
|
||||
parallels
|
||||
proxmoxve
|
||||
pxe
|
||||
qemu_uefi
|
||||
rackspace
|
||||
rackspace_onmetal
|
||||
rackspace_vhd
|
||||
scaleway
|
||||
stackit
|
||||
vagrant
|
||||
vagrant_parallels
|
||||
vagrant_virtualbox
|
||||
vagrant_vmware_fusion
|
||||
virtualbox
|
||||
vmware
|
||||
vmware_insecure
|
||||
vmware_ova
|
||||
vmware_raw
|
||||
xen
|
||||
nutanix
|
||||
)
|
||||
|
||||
#list of oem package names, minus the oem- prefix
|
||||
VALID_OEM_PACKAGES=(
|
||||
akamai
|
||||
azure
|
||||
cloudsigma
|
||||
cloudstack
|
||||
digitalocean
|
||||
exoscale
|
||||
gce
|
||||
hetzner
|
||||
hyperv
|
||||
kubevirt
|
||||
openstack
|
||||
packet
|
||||
proxmoxve
|
||||
qemu
|
||||
rackspace
|
||||
rackspace-onmetal
|
||||
scaleway
|
||||
stackit
|
||||
vagrant
|
||||
vagrant-key
|
||||
vagrant-virtualbox
|
||||
virtualbox
|
||||
vmware
|
||||
)
|
||||
|
||||
# Set at runtime to one of the above types
|
||||
VM_IMG_TYPE=DEFAULT
|
||||
|
||||
@ -94,24 +60,9 @@ VM_GENERATED_FILES=()
|
||||
# If set to 0 then a partition skeleton won't be laid out on VM_TMP_IMG
|
||||
IMG_DEFAULT_PARTITIONED_IMG=1
|
||||
|
||||
# If set install the given package name to the OEM partition
|
||||
IMG_DEFAULT_OEM_PACKAGE=
|
||||
|
||||
# Forced OEM package name overriding what may be in the format
|
||||
IMG_FORCE_OEM_PACKAGE=
|
||||
|
||||
# USE flags for the OEM package
|
||||
IMG_DEFAULT_OEM_USE=
|
||||
|
||||
# Forced USE flags for the OEM package
|
||||
IMG_FORCE_OEM_USE=
|
||||
|
||||
# If set install the given package name to the OEM sysext image
|
||||
IMG_DEFAULT_OEM_SYSEXT=
|
||||
|
||||
# Forced OEM package name overriding what may be in the format
|
||||
IMG_FORCE_OEM_SYSEXT=
|
||||
|
||||
# Hook to do any final tweaks or grab data while fs is mounted.
|
||||
IMG_DEFAULT_FS_HOOK=
|
||||
|
||||
@ -141,9 +92,7 @@ IMG_DEFAULT_CPUS=2
|
||||
IMG_qemu_uefi_DISK_FORMAT=qcow2
|
||||
IMG_qemu_uefi_DISK_LAYOUT=vm
|
||||
IMG_qemu_uefi_CONF_FORMAT=qemu_uefi
|
||||
IMG_qemu_uefi_OEM_USE=qemu
|
||||
IMG_qemu_uefi_OEM_PACKAGE=common-oem-files
|
||||
IMG_qemu_uefi_OEM_SYSEXT=oem-qemu
|
||||
IMG_qemu_uefi_OEM_SYSEXT=qemu
|
||||
|
||||
## xen
|
||||
IMG_xen_CONF_FORMAT=xl
|
||||
@ -152,67 +101,37 @@ IMG_xen_CONF_FORMAT=xl
|
||||
IMG_virtualbox_DISK_FORMAT=vmdk_ide
|
||||
IMG_virtualbox_DISK_LAYOUT=vm
|
||||
IMG_virtualbox_CONF_FORMAT=ovf_virtualbox
|
||||
IMG_virtualbox_OEM_PACKAGE=oem-virtualbox
|
||||
IMG_virtualbox_OEM_SYSEXT=virtualbox
|
||||
|
||||
## vagrant
|
||||
IMG_vagrant_FS_HOOK=box
|
||||
IMG_vagrant_BUNDLE_FORMAT=box
|
||||
IMG_vagrant_DISK_FORMAT=vmdk_ide
|
||||
IMG_vagrant_DISK_LAYOUT=vagrant
|
||||
IMG_vagrant_CONF_FORMAT=vagrant
|
||||
IMG_vagrant_OEM_PACKAGE=oem-vagrant
|
||||
|
||||
## vagrant_virtualbox
|
||||
IMG_vagrant_virtualbox_FS_HOOK=box
|
||||
IMG_vagrant_virtualbox_BUNDLE_FORMAT=box
|
||||
IMG_vagrant_virtualbox_DISK_FORMAT=vmdk_ide
|
||||
IMG_vagrant_virtualbox_DISK_LAYOUT=vagrant
|
||||
IMG_vagrant_virtualbox_CONF_FORMAT=vagrant
|
||||
IMG_vagrant_virtualbox_OEM_PACKAGE=oem-vagrant-virtualbox
|
||||
|
||||
## vagrant_vmware
|
||||
IMG_vagrant_vmware_fusion_FS_HOOK=box
|
||||
IMG_vagrant_vmware_fusion_BUNDLE_FORMAT=box
|
||||
IMG_vagrant_vmware_fusion_DISK_FORMAT=vmdk_scsi
|
||||
IMG_vagrant_vmware_fusion_DISK_LAYOUT=vagrant
|
||||
IMG_vagrant_vmware_fusion_CONF_FORMAT=vagrant_vmware_fusion
|
||||
IMG_vagrant_vmware_fusion_OEM_PACKAGE=oem-vagrant
|
||||
IMG_vagrant_OEM_SYSEXT=vagrant
|
||||
|
||||
## vagrant_parallels
|
||||
IMG_vagrant_parallels_FS_HOOK=box
|
||||
IMG_vagrant_parallels_BUNDLE_FORMAT=box
|
||||
IMG_vagrant_parallels_DISK_FORMAT=hdd
|
||||
IMG_vagrant_parallels_DISK_LAYOUT=vagrant
|
||||
IMG_vagrant_parallels_CONF_FORMAT=vagrant_parallels
|
||||
IMG_vagrant_parallels_OEM_PACKAGE=oem-vagrant
|
||||
IMG_vagrant_parallels_OEM_SYSEXT=vagrant
|
||||
|
||||
## vmware
|
||||
IMG_vmware_DISK_FORMAT=vmdk_scsi
|
||||
IMG_vmware_DISK_LAYOUT=vm
|
||||
IMG_vmware_CONF_FORMAT=vmx
|
||||
IMG_vmware_OEM_USE=vmware
|
||||
IMG_vmware_OEM_PACKAGE=common-oem-files
|
||||
IMG_vmware_OEM_SYSEXT=oem-vmware
|
||||
IMG_vmware_OEM_SYSEXT=vmware
|
||||
|
||||
## vmware_ova
|
||||
IMG_vmware_ova_BUNDLE_FORMAT=ova
|
||||
IMG_vmware_ova_DISK_FORMAT=vmdk_stream
|
||||
IMG_vmware_ova_DISK_LAYOUT=vm
|
||||
IMG_vmware_ova_CONF_FORMAT=ovf_vmware
|
||||
IMG_vmware_ova_BUNDLE_FORMAT=ova
|
||||
IMG_vmware_ova_OEM_USE=vmware
|
||||
IMG_vmware_ova_OEM_PACKAGE=common-oem-files
|
||||
IMG_vmware_ova_OEM_SYSEXT=oem-vmware
|
||||
IMG_vmware_ova_OEM_SYSEXT=vmware
|
||||
|
||||
## vmware_raw
|
||||
IMG_vmware_raw_OEM_USE=vmware
|
||||
IMG_vmware_raw_OEM_PACKAGE=common-oem-files
|
||||
IMG_vmware_raw_OEM_SYSEXT=oem-vmware
|
||||
|
||||
## vmware_insecure
|
||||
IMG_vmware_insecure_DISK_FORMAT=vmdk_scsi
|
||||
IMG_vmware_insecure_DISK_LAYOUT=vm
|
||||
IMG_vmware_insecure_CONF_FORMAT=vmware_zip
|
||||
IMG_vmware_insecure_OEM_PACKAGE=oem-vagrant-key
|
||||
IMG_vmware_raw_OEM_SYSEXT=vmware
|
||||
|
||||
## parallels
|
||||
IMG_parallels_BUNDLE_FORMAT=pvm_tgz
|
||||
@ -222,27 +141,19 @@ IMG_parallels_CONF_FORMAT=pvs
|
||||
|
||||
## ami
|
||||
IMG_ami_vmdk_DISK_FORMAT=vmdk_stream
|
||||
IMG_ami_vmdk_OEM_USE=ami
|
||||
IMG_ami_vmdk_OEM_PACKAGE=common-oem-files
|
||||
IMG_ami_vmdk_SYSEXT=oem-ami
|
||||
IMG_ami_vmdk_DISK_LAYOUT=vm
|
||||
IMG_ami_OEM_USE=ami
|
||||
IMG_ami_OEM_PACKAGE=common-oem-files
|
||||
IMG_ami_OEM_SYSEXT=oem-ami
|
||||
IMG_ami_vmdk_OEM_SYSEXT=ami
|
||||
IMG_ami_DISK_LAYOUT=vm
|
||||
IMG_ami_OEM_SYSEXT=ami
|
||||
|
||||
## openstack
|
||||
IMG_openstack_DISK_FORMAT=qcow2
|
||||
IMG_openstack_DISK_LAYOUT=vm
|
||||
IMG_openstack_OEM_PACKAGE=common-oem-files
|
||||
IMG_openstack_OEM_USE=openstack
|
||||
IMG_openstack_OEM_SYSEXT=oem-openstack
|
||||
IMG_openstack_OEM_SYSEXT=openstack
|
||||
|
||||
## openstack but without a resized root partition for more flexibility
|
||||
IMG_openstack_mini_DISK_FORMAT=qcow2
|
||||
IMG_openstack_mini_OEM_PACKAGE=common-oem-files
|
||||
IMG_openstack_mini_OEM_USE=openstack
|
||||
IMG_openstack_mini_OEM_SYSEXT=oem-openstack
|
||||
IMG_openstack_mini_OEM_SYSEXT=openstack
|
||||
|
||||
## pxe, which is an cpio image
|
||||
IMG_pxe_DISK_FORMAT=cpio
|
||||
@ -259,110 +170,71 @@ IMG_iso_MEM=2048
|
||||
## gce, image tarball
|
||||
IMG_gce_DISK_LAYOUT=vm
|
||||
IMG_gce_CONF_FORMAT=gce
|
||||
IMG_gce_OEM_PACKAGE=common-oem-files
|
||||
IMG_gce_OEM_USE=gce
|
||||
IMG_gce_OEM_SYSEXT=oem-gce
|
||||
|
||||
## rackspace
|
||||
IMG_rackspace_OEM_PACKAGE=oem-rackspace
|
||||
IMG_rackspace_vhd_DISK_FORMAT=vhd
|
||||
IMG_rackspace_vhd_OEM_PACKAGE=oem-rackspace
|
||||
|
||||
## rackspace onmetal
|
||||
IMG_rackspace_onmetal_DISK_FORMAT=qcow2
|
||||
IMG_rackspace_onmetal_DISK_LAYOUT=onmetal
|
||||
IMG_rackspace_onmetal_OEM_PACKAGE=oem-rackspace-onmetal
|
||||
IMG_gce_OEM_SYSEXT=gce
|
||||
|
||||
## cloudstack
|
||||
IMG_cloudstack_OEM_PACKAGE=oem-cloudstack
|
||||
IMG_cloudstack_OEM_SYSEXT=cloudstack
|
||||
IMG_cloudstack_vhd_DISK_FORMAT=vhd
|
||||
IMG_cloudstack_vhd_OEM_PACKAGE=oem-cloudstack
|
||||
IMG_cloudstack_vhd_OEM_SYSEXT=cloudstack
|
||||
|
||||
## digitalocean
|
||||
IMG_digitalocean_OEM_PACKAGE=common-oem-files
|
||||
IMG_digitalocean_OEM_USE=digitalocean
|
||||
IMG_digitalocean_OEM_SYSEXT=oem-digitalocean
|
||||
IMG_digitalocean_OEM_SYSEXT=digitalocean
|
||||
|
||||
## exoscale
|
||||
IMG_exoscale_DISK_FORMAT=qcow2
|
||||
IMG_exoscale_OEM_PACKAGE=oem-exoscale
|
||||
IMG_exoscale_OEM_SYSEXT=exoscale
|
||||
|
||||
## azure
|
||||
IMG_azure_DISK_FORMAT=vhd_fixed
|
||||
IMG_azure_DISK_LAYOUT=azure
|
||||
IMG_azure_OEM_USE=azure
|
||||
IMG_azure_OEM_PACKAGE=common-oem-files
|
||||
IMG_azure_OEM_SYSEXT=oem-azure
|
||||
IMG_azure_OEM_SYSEXT=azure
|
||||
|
||||
## hetzner
|
||||
IMG_hetzner_DISK_LAYOUT=vm
|
||||
IMG_hetzner_OEM_USE=hetzner
|
||||
IMG_hetzner_OEM_PACKAGE=common-oem-files
|
||||
IMG_hetzner_OEM_SYSEXT=oem-hetzner
|
||||
IMG_hetzner_OEM_SYSEXT=hetzner
|
||||
|
||||
## hyper-v
|
||||
IMG_hyperv_DISK_FORMAT=vhd
|
||||
IMG_hyperv_OEM_USE=hyperv
|
||||
IMG_hyperv_OEM_PACKAGE=common-oem-files
|
||||
IMG_hyperv_OEM_SYSEXT=oem-hyperv
|
||||
IMG_hyperv_OEM_SYSEXT=hyperv
|
||||
|
||||
## hyper-v vhdx
|
||||
IMG_hyperv_vhdx_DISK_FORMAT=vhdx
|
||||
IMG_hyperv_vhdx_OEM_USE=hyperv
|
||||
IMG_hyperv_vhdx_OEM_PACKAGE=common-oem-files
|
||||
IMG_hyperv_vhdx_OEM_SYSEXT=oem-hyperv
|
||||
IMG_hyperv_vhdx_OEM_SYSEXT=hyperv
|
||||
|
||||
## cloudsigma
|
||||
IMG_cloudsigma_DISK_FORMAT=qcow2
|
||||
IMG_cloudsigma_OEM_PACKAGE=oem-cloudsigma
|
||||
|
||||
## packet
|
||||
IMG_packet_OEM_PACKAGE=common-oem-files
|
||||
IMG_packet_OEM_SYSEXT=oem-packet
|
||||
IMG_packet_OEM_USE=packet
|
||||
IMG_cloudsigma_OEM_SYSEXT=cloudsigma
|
||||
|
||||
## scaleway
|
||||
IMG_scaleway_DISK_FORMAT=qcow2
|
||||
IMG_scaleway_DISK_LAYOUT=vm
|
||||
IMG_scaleway_OEM_PACKAGE=common-oem-files
|
||||
IMG_scaleway_OEM_USE=scaleway
|
||||
IMG_scaleway_OEM_SYSEXT=oem-scaleway
|
||||
IMG_scaleway_OEM_SYSEXT=scaleway
|
||||
IMG_scaleway_DISK_EXTENSION=qcow2
|
||||
|
||||
## stackit
|
||||
IMG_stackit_DISK_FORMAT=qcow2
|
||||
IMG_stackit_DISK_LAYOUT=vm
|
||||
IMG_stackit_OEM_PACKAGE=common-oem-files
|
||||
IMG_stackit_OEM_USE=stackit
|
||||
IMG_stackit_OEM_SYSEXT=oem-stackit
|
||||
IMG_stackit_OEM_SYSEXT=stackit
|
||||
|
||||
## kubevirt
|
||||
IMG_kubevirt_DISK_FORMAT=qcow2
|
||||
IMG_kubevirt_DISK_LAYOUT=vm
|
||||
IMG_kubevirt_OEM_PACKAGE=common-oem-files
|
||||
IMG_kubevirt_OEM_USE=kubevirt
|
||||
IMG_kubevirt_OEM_SYSEXT=oem-kubevirt
|
||||
IMG_kubevirt_OEM_SYSEXT=kubevirt
|
||||
IMG_kubevirt_DISK_EXTENSION=qcow2
|
||||
|
||||
## akamai (Linode)
|
||||
IMG_akamai_DISK_LAYOUT=vm
|
||||
IMG_akamai_OEM_PACKAGE=common-oem-files
|
||||
IMG_akamai_OEM_USE=akamai
|
||||
IMG_akamai_OEM_SYSEXT=oem-akamai
|
||||
IMG_akamai_OEM_SYSEXT=akamai
|
||||
|
||||
# proxmoxve
|
||||
IMG_proxmoxve_DISK_FORMAT=qcow2
|
||||
IMG_proxmoxve_DISK_LAYOUT=vm
|
||||
IMG_proxmoxve_OEM_PACKAGE=common-oem-files
|
||||
IMG_proxmoxve_OEM_USE=proxmoxve
|
||||
IMG_proxmoxve_OEM_SYSEXT=oem-proxmoxve
|
||||
IMG_proxmoxve_OEM_SYSEXT=proxmoxve
|
||||
|
||||
## nutanix
|
||||
IMG_nutanix_DISK_FORMAT=qcow2
|
||||
IMG_nutanix_DISK_LAYOUT=vm
|
||||
IMG_nutanix_OEM_USE=nutanix
|
||||
IMG_nutanix_OEM_PACKAGE=common-oem-files
|
||||
IMG_nutanix_OEM_SYSEXT=oem-nutanix
|
||||
IMG_nutanix_OEM_SYSEXT=nutanix
|
||||
|
||||
###########################################################
|
||||
|
||||
@ -395,20 +267,6 @@ set_vm_type() {
|
||||
return 1
|
||||
}
|
||||
|
||||
# Validate and set the oem package, colon delimited USE optional
|
||||
set_vm_oem_pkg() {
|
||||
local oem_pkg="${1%:*}" oem_use="${1##*:}"
|
||||
local valid_pkg
|
||||
for valid_pkg in "${VALID_OEM_PACKAGES[@]}"; do
|
||||
if [[ "${oem_pkg}" == "${valid_pkg}" ]]; then
|
||||
IMG_FORCE_OEM_PACKAGE="oem-${oem_pkg}"
|
||||
IMG_FORCE_OEM_USE="${oem_use}"
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
# Validate and set source vm image path
|
||||
set_vm_paths() {
|
||||
local src_dir="${1}"; shift
|
||||
@ -442,8 +300,7 @@ _get_vm_opt() {
|
||||
local opt="$1"
|
||||
local type_opt="IMG_${VM_IMG_TYPE}_${opt}"
|
||||
local default_opt="IMG_DEFAULT_${opt}"
|
||||
local force_opt="IMG_FORCE_${opt}"
|
||||
echo "${!force_opt:-${!type_opt:-${!default_opt}}}"
|
||||
echo "${!type_opt:-${!default_opt}}"
|
||||
}
|
||||
|
||||
# Translate source image names to output names.
|
||||
@ -532,42 +389,6 @@ setup_disk_image() {
|
||||
fi
|
||||
}
|
||||
|
||||
# If the current type defines a oem package install it to the given fs image.
|
||||
install_oem_package() {
|
||||
local oem_pkg=$(_get_vm_opt OEM_PACKAGE)
|
||||
local oem_use=$(_get_vm_opt OEM_USE)
|
||||
# The "${VM_IMG_TYPE}-oem-image-rootfs" directory name is
|
||||
# important - it is used to determine the package target in
|
||||
# coreos/base/profile.bashrc
|
||||
local oem_tmp="${VM_TMP_DIR}/${VM_IMG_TYPE}-oem-image-rootfs"
|
||||
|
||||
if [[ -z "${oem_pkg}" ]]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Split into two steps because we want to always install $oem_pkg from
|
||||
# the ebuild (build_packages doesn't handle it) *but* we never want to
|
||||
# build anything else from source here. emerge doesn't have a way to
|
||||
# enforce this in a single command.
|
||||
info "Building ${oem_pkg}"
|
||||
USE="${oem_use}" emerge-${BOARD} \
|
||||
--nodeps --buildpkgonly --usepkg n \
|
||||
--verbose "${oem_pkg}"
|
||||
|
||||
local getbinpkg
|
||||
if [[ ${FLAGS_getbinpkg} -eq ${FLAGS_TRUE} ]]; then
|
||||
getbinpkg=--getbinpkg
|
||||
fi
|
||||
|
||||
info "Installing ${oem_pkg} to OEM partition"
|
||||
USE="${oem_use}" emerge-${BOARD} \
|
||||
--root="${oem_tmp}" --sysroot="${oem_tmp}" \
|
||||
--usepkgonly ${getbinpkg} \
|
||||
--verbose --jobs=2 "${oem_pkg}"
|
||||
sudo rsync -a "${oem_tmp}/oem/" "${VM_TMP_ROOT}/oem/"
|
||||
sudo rm -rf "${oem_tmp}"
|
||||
}
|
||||
|
||||
# Install the prebuilt OEM sysext file into the OEM partition.
|
||||
# The sysext should have been built by 'build_image oem_sysext'.
|
||||
install_oem_sysext() {
|
||||
@ -577,7 +398,7 @@ install_oem_sysext() {
|
||||
return 0
|
||||
fi
|
||||
|
||||
local prebuilt_sysext_filename="${oem_sysext}.raw"
|
||||
local prebuilt_sysext_filename="oem-${oem_sysext}.raw"
|
||||
local prebuilt_sysext_path="${FLAGS_from}/${prebuilt_sysext_filename}"
|
||||
local version="${FLATCAR_VERSION}"
|
||||
|
||||
@ -586,34 +407,27 @@ install_oem_sysext() {
|
||||
fi
|
||||
|
||||
local installed_sysext_oem_dir='/oem/sysext'
|
||||
local installed_sysext_file_prefix="${oem_sysext}-${version}"
|
||||
local installed_sysext_file_prefix="oem-${oem_sysext}-${version}"
|
||||
local installed_sysext_filename="${installed_sysext_file_prefix}.raw"
|
||||
local installed_sysext_abspath="${installed_sysext_oem_dir}/${installed_sysext_filename}"
|
||||
|
||||
info "Installing ${oem_sysext} sysext from prebuilt image"
|
||||
info "Installing oem-${oem_sysext} sysext from prebuilt image"
|
||||
sudo install -Dpm 0644 \
|
||||
"${prebuilt_sysext_path}" \
|
||||
"${VM_TMP_ROOT}${installed_sysext_abspath}" ||
|
||||
die "Could not install ${oem_sysext} sysext"
|
||||
die "Could not install oem-${oem_sysext} sysext"
|
||||
|
||||
# Mark the installed sysext as active.
|
||||
sudo touch "${VM_TMP_ROOT}${installed_sysext_oem_dir}/active-${oem_sysext}"
|
||||
}
|
||||
sudo touch "${VM_TMP_ROOT}${installed_sysext_oem_dir}/active-oem-${oem_sysext}"
|
||||
|
||||
# Any other tweaks required?
|
||||
run_fs_hook() {
|
||||
local fs_hook=$(_get_vm_opt FS_HOOK)
|
||||
if [[ -n "${fs_hook}" ]]; then
|
||||
info "Running ${fs_hook} fs hook"
|
||||
_run_${fs_hook}_fs_hook "$@"
|
||||
fi
|
||||
}
|
||||
# Extract metadata from the sysext and write it to oem-release. Chop off the
|
||||
# oem- prefix from SYSEXT_ID because that's how it has traditionally looked.
|
||||
sudo systemd-dissect --json=short "${prebuilt_sysext_path}" | jq -r '.sysextRelease[]' |
|
||||
sed --quiet --regexp-extended -e "s/^SYSEXT_ID=oem-/SYSEXT_ID=/" -e "s/^SYSEXT_//p" |
|
||||
sudo install -m0644 /dev/stdin "${VM_TMP_ROOT}/oem/oem-release"
|
||||
|
||||
_run_box_fs_hook() {
|
||||
# Copy basic Vagrant configs from OEM
|
||||
mkdir -p "${VM_TMP_DIR}/box"
|
||||
cp -R "${VM_TMP_ROOT}/oem/box/." "${VM_TMP_DIR}/box"
|
||||
sudo rm -fr "${VM_TMP_ROOT}/oem/box"
|
||||
# Copy the OEM-specific grub.cfg.
|
||||
sudo install -m0644 "${BUILD_LIBRARY_DIR}/oem/${oem_sysext}/grub.cfg" "${VM_TMP_ROOT}/oem/grub.cfg"
|
||||
}
|
||||
|
||||
# Write the vm disk image to the target directory in the proper format
|
||||
@ -922,15 +736,6 @@ You can pass extra kernel parameters with -append, for example:
|
||||
When using -nographic or -serial you must also enable the serial console:
|
||||
./$(basename "${script}") -nographic -append 'console=ttyS0,115200n8'
|
||||
EOF
|
||||
local packetipxe="$(_dst_dir)/flatcar_production_packet.ipxe"
|
||||
cat > "$packetipxe" <<EOF
|
||||
#!ipxe
|
||||
|
||||
kernel flatcar_production_pxe.vmlinuz initrd=flatcar_production_pxe_image.cpio.gz flatcar.first_boot=1 flatcar.oem.id=packet console=ttyS1,115200n8 flatcar.autologin
|
||||
initrd flatcar_production_pxe_image.cpio.gz
|
||||
boot
|
||||
EOF
|
||||
VM_GENERATED_FILES+=( "$packetipxe" )
|
||||
}
|
||||
|
||||
_write_iso_conf() {
|
||||
@ -996,64 +801,6 @@ EOF
|
||||
fi
|
||||
}
|
||||
|
||||
_write_vmware_zip_conf() {
|
||||
local src_name=$(basename "$VM_SRC_IMG")
|
||||
local dst_name=$(basename "$VM_DST_IMG")
|
||||
local dst_dir=$(dirname "$VM_DST_IMG")
|
||||
local vmx_path="${dst_dir}/$(_src_to_dst_name "${src_name}" ".vmx")"
|
||||
local vmx_file=$(basename "${vmx_path}")
|
||||
local zip="${dst_dir}/$(_src_to_dst_name "${src_name}" ".zip")"
|
||||
|
||||
_write_vmx_conf "$1"
|
||||
|
||||
# Move the disk/vmx to tmp, they will be zipped.
|
||||
mv "${VM_DST_IMG}" "${VM_TMP_DIR}/${dst_name}"
|
||||
mv "${vmx_path}" "${VM_TMP_DIR}/${vmx_file}"
|
||||
cat > "${VM_TMP_DIR}/insecure_ssh_key" <<EOF
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIEogIBAAKCAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzI
|
||||
w+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoP
|
||||
kcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2
|
||||
hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NO
|
||||
Td0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcW
|
||||
yLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQIBIwKCAQEA4iqWPJXtzZA68mKd
|
||||
ELs4jJsdyky+ewdZeNds5tjcnHU5zUYE25K+ffJED9qUWICcLZDc81TGWjHyAqD1
|
||||
Bw7XpgUwFgeUJwUlzQurAv+/ySnxiwuaGJfhFM1CaQHzfXphgVml+fZUvnJUTvzf
|
||||
TK2Lg6EdbUE9TarUlBf/xPfuEhMSlIE5keb/Zz3/LUlRg8yDqz5w+QWVJ4utnKnK
|
||||
iqwZN0mwpwU7YSyJhlT4YV1F3n4YjLswM5wJs2oqm0jssQu/BT0tyEXNDYBLEF4A
|
||||
sClaWuSJ2kjq7KhrrYXzagqhnSei9ODYFShJu8UWVec3Ihb5ZXlzO6vdNQ1J9Xsf
|
||||
4m+2ywKBgQD6qFxx/Rv9CNN96l/4rb14HKirC2o/orApiHmHDsURs5rUKDx0f9iP
|
||||
cXN7S1uePXuJRK/5hsubaOCx3Owd2u9gD6Oq0CsMkE4CUSiJcYrMANtx54cGH7Rk
|
||||
EjFZxK8xAv1ldELEyxrFqkbE4BKd8QOt414qjvTGyAK+OLD3M2QdCQKBgQDtx8pN
|
||||
CAxR7yhHbIWT1AH66+XWN8bXq7l3RO/ukeaci98JfkbkxURZhtxV/HHuvUhnPLdX
|
||||
3TwygPBYZFNo4pzVEhzWoTtnEtrFueKxyc3+LjZpuo+mBlQ6ORtfgkr9gBVphXZG
|
||||
YEzkCD3lVdl8L4cw9BVpKrJCs1c5taGjDgdInQKBgHm/fVvv96bJxc9x1tffXAcj
|
||||
3OVdUN0UgXNCSaf/3A/phbeBQe9xS+3mpc4r6qvx+iy69mNBeNZ0xOitIjpjBo2+
|
||||
dBEjSBwLk5q5tJqHmy/jKMJL4n9ROlx93XS+njxgibTvU6Fp9w+NOFD/HvxB3Tcz
|
||||
6+jJF85D5BNAG3DBMKBjAoGBAOAxZvgsKN+JuENXsST7F89Tck2iTcQIT8g5rwWC
|
||||
P9Vt74yboe2kDT531w8+egz7nAmRBKNM751U/95P9t88EDacDI/Z2OwnuFQHCPDF
|
||||
llYOUI+SpLJ6/vURRbHSnnn8a/XG+nzedGH5JGqEJNQsz+xT2axM0/W/CRknmGaJ
|
||||
kda/AoGANWrLCz708y7VYgAtW2Uf1DPOIYMdvo6fxIB5i9ZfISgcJ/bbCUkFrhoH
|
||||
+vq/5CIWxCPp0f85R4qxxQ5ihxJ0YDQT9Jpx4TMss4PSavPaBH3RXow5Ohe+bYoQ
|
||||
NE5OgEXk2wVfZczCZpigBKbKZHNYcelXtTt/nP3rsCuGcM4h53s=
|
||||
-----END RSA PRIVATE KEY-----
|
||||
EOF
|
||||
chmod 600 "${VM_TMP_DIR}/insecure_ssh_key"
|
||||
|
||||
zip --junk-paths "${zip}" \
|
||||
"${VM_TMP_DIR}/${dst_name}" \
|
||||
"${VM_TMP_DIR}/${vmx_file}" \
|
||||
"${VM_TMP_DIR}/insecure_ssh_key"
|
||||
|
||||
cat > "${VM_README}" <<EOF
|
||||
Use insecure_ssh_key in the zip for login access.
|
||||
TODO: more instructions!
|
||||
EOF
|
||||
|
||||
# Replace list, not append, since we packaged up the disk image.
|
||||
VM_GENERATED_FILES=( "${zip}" "${VM_README}" )
|
||||
}
|
||||
|
||||
# Generate a new-style (xl) Xen config file for both pvgrub and pygrub
|
||||
_write_xl_conf() {
|
||||
local vm_mem="${1:-$(_get_vm_opt MEM)}"
|
||||
@ -1124,11 +871,17 @@ EOF
|
||||
VM_GENERATED_FILES+=( "$ovf" "${VM_README}" )
|
||||
}
|
||||
|
||||
_copy_vagrant_files() {
|
||||
local oem_sysext=$(_get_vm_opt OEM_SYSEXT)
|
||||
cp -r "${BUILD_LIBRARY_DIR}/oem/${oem_sysext}/build/box" "${VM_TMP_DIR}/"
|
||||
}
|
||||
|
||||
_write_vagrant_conf() {
|
||||
local vm_mem="${1:-$(_get_vm_opt MEM)}"
|
||||
local ovf="${VM_TMP_DIR}/box/box.ovf"
|
||||
local mac="${VM_TMP_DIR}/box/base_mac.rb"
|
||||
|
||||
_copy_vagrant_files
|
||||
"${BUILD_LIBRARY_DIR}/virtualbox_ovf.sh" \
|
||||
--vm_name "$VM_NAME" \
|
||||
--disk_vmdk "${VM_DST_IMG}" \
|
||||
@ -1137,19 +890,11 @@ _write_vagrant_conf() {
|
||||
--output_vagrant "$mac"
|
||||
}
|
||||
|
||||
_write_vagrant_vmware_fusion_conf() {
|
||||
local vm_mem="${1:-$(_get_vm_opt MEM)}"
|
||||
local vmx=$(_dst_path ".vmx")
|
||||
|
||||
mkdir -p "${VM_TMP_DIR}/box"
|
||||
_write_vmx_conf ${vm_mem}
|
||||
mv "${vmx}" "${VM_TMP_DIR}/box"
|
||||
}
|
||||
|
||||
_write_vagrant_parallels_conf() {
|
||||
local vm_mem="${1:-$(_get_vm_opt MEM)}"
|
||||
local pvs=$(_dst_path ".pvs")
|
||||
|
||||
_copy_vagrant_files
|
||||
"${BUILD_LIBRARY_DIR}/parallels_pvs.sh" \
|
||||
--vm_name "$VM_NAME" \
|
||||
--disk_image "$VM_DST_IMG" \
|
||||
@ -1209,13 +954,17 @@ write_vm_bundle() {
|
||||
|
||||
_write_box_bundle() {
|
||||
local box=$(_dst_path ".box")
|
||||
local json=$(_dst_path ".json")
|
||||
local image=${VM_DST_IMG}
|
||||
local provider="virtualbox"
|
||||
|
||||
if [[ "${VM_IMG_TYPE}" == vagrant_vmware_fusion ]]; then
|
||||
provider="vmware_fusion"
|
||||
elif [[ "${VM_IMG_TYPE}" == vagrant_parallels ]]; then
|
||||
# Share the metadata JSON between providers.
|
||||
local json=${VM_SRC_IMG##*/}
|
||||
json=$(_dst_dir)/${json%_image.bin}_vagrant.json
|
||||
|
||||
local -xI FLATCAR_VERSION FLATCAR_VERSION_ID VM_GROUP
|
||||
local -x provider="virtualbox"
|
||||
local -x arch=${BOARD%-usr}
|
||||
|
||||
if [[ "${VM_IMG_TYPE}" == vagrant_parallels ]]; then
|
||||
provider="parallels"
|
||||
image="${VM_TMP_DIR}/tmp.pvm"
|
||||
mkdir -p "${image}"
|
||||
@ -1223,28 +972,37 @@ _write_box_bundle() {
|
||||
mv "$(_dst_path ".pvs")" "${image}"/config.pvs
|
||||
fi
|
||||
|
||||
cat > "${VM_TMP_DIR}"/box/metadata.json <<EOF
|
||||
{"provider": "${provider}"}
|
||||
EOF
|
||||
jq -n '{ provider: env.provider, architecture: env.arch }' > "${VM_TMP_DIR}"/box/metadata.json
|
||||
|
||||
mv "${image}" "${VM_TMP_DIR}/box"
|
||||
tar -czf "${box}" -C "${VM_TMP_DIR}/box" .
|
||||
|
||||
cat >"${json}" <<EOF
|
||||
{
|
||||
"name": "flatcar-${VM_GROUP}",
|
||||
"description": "Flatcar ${VM_GROUP}",
|
||||
"versions": [{
|
||||
"version": "${FLATCAR_VERSION_ID}",
|
||||
"providers": [{
|
||||
"name": "${provider}",
|
||||
"url": "https://${BUILDCACHE_SERVER:-bincache.flatcar-linux.net}/images/${BOARD%-usr}/${FLATCAR_VERSION}/$(_dst_name ".box")",
|
||||
"checksum_type": "sha256",
|
||||
"checksum": "$(sha256sum "${box}" | awk '{print $1}')"
|
||||
}]
|
||||
}]
|
||||
}
|
||||
EOF
|
||||
local -x checksum=$(sha256sum "${box}")
|
||||
checksum=${checksum%% *}
|
||||
|
||||
# Fetch existing box entries for this Flatcar version that do not match the
|
||||
# provider or architecture we're about to add.
|
||||
local existing="[]"
|
||||
[[ -e ${json} ]] &&
|
||||
existing=$(jq '[ .versions[] | select(.version == env.FLATCAR_VERSION_ID) | .providers[] |
|
||||
select(.name != env.provider or .architecture != env.arch) ]' "${json}")
|
||||
|
||||
# Generate a new metadata JSON that includes the existing box entries.
|
||||
jq -n --argjson existing "${existing}" --arg server "${BUILDCACHE_SERVER:-bincache.flatcar-linux.net}" --arg box "${box##*/}" '{
|
||||
name: "flatcar-\(env.VM_GROUP)",
|
||||
description: "Flatcar \(env.VM_GROUP)",
|
||||
versions: [{
|
||||
version: env.FLATCAR_VERSION_ID,
|
||||
providers: $existing + [{
|
||||
name: env.provider,
|
||||
url: "https://\($server)/images/\(env.arch)/\(env.FLATCAR_VERSION)/\($box)",
|
||||
checksum_type: "sha256",
|
||||
checksum: env.checksum,
|
||||
architecture: env.arch
|
||||
}]
|
||||
}]
|
||||
}' > "${json}"
|
||||
|
||||
VM_GENERATED_FILES+=( "${box}" "${json}" )
|
||||
}
|
||||
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
|
||||
SCRIPT_ROOT=$(readlink -f $(dirname "$0")/..)
|
||||
. "${SCRIPT_ROOT}/common.sh" || exit 1
|
||||
. "${BUILD_LIBRARY_DIR}/toolchain_util.sh" || exit 1
|
||||
. "${BUILD_LIBRARY_DIR}/build_image_util.sh" || exit 1
|
||||
|
||||
DEFINE_string input_disk_image "" "Disk image to convert from, required."
|
||||
|
||||
@ -291,6 +291,10 @@ fi
|
||||
export KBUILD_BUILD_USER="${BUILD_USER:-build}"
|
||||
export KBUILD_BUILD_HOST="${BUILD_HOST:-pony-truck.infra.kinvolk.io}"
|
||||
|
||||
# Gather a list of packages we build with --buildpkgonly to prevent them from
|
||||
# getting cleaned by `eclean --deep packages` below.
|
||||
eclean_excludes=$(mktemp) || die_notrace "Couldn't create temporary exclusions file for eclean"
|
||||
|
||||
# Build sysext packages from an array of sysext definitions.
|
||||
# Usage: build_sysext_packages "description" "${SYSEXT_ARRAY[@]}"
|
||||
# Array format: "name|packages|useflags|arches"
|
||||
@ -307,6 +311,7 @@ build_sysext_packages() {
|
||||
|
||||
info "Building packages for $sysext_name sysext with USE=$useflags"
|
||||
IFS=,
|
||||
qatom -F "%{CATEGORY}/%{PN}" ${package_atoms} >> "${eclean_excludes}"
|
||||
for package in $package_atoms; do
|
||||
# --buildpkgonly does not install dependencies, so we install them
|
||||
# separately before building the binary package
|
||||
@ -375,13 +380,8 @@ if [[ "${FLAGS_usepkgonly}" -eq "${FLAGS_FALSE}" ]]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
exclusions_file=$(mktemp)
|
||||
if [ ! -f "$exclusions_file" ]; then
|
||||
die_notrace "Couldn't create temporary exclusions file $exclusions_file for eclean"
|
||||
fi
|
||||
get_unversioned_sysext_packages > "$exclusions_file"
|
||||
eclean-"$BOARD" -d --exclude-file="$exclusions_file" packages
|
||||
rm -f "$exclusions_file"
|
||||
eclean-"$BOARD" --deep --exclude-file="${eclean_excludes}" packages
|
||||
rm -f "${eclean_excludes}"
|
||||
# run eclean again, this time without the --deep option, to clean old versions
|
||||
# of sysext packages (those, for which .ebuild file no longer exists)
|
||||
eclean-"$BOARD" packages
|
||||
|
||||
60
build_sysext
60
build_sysext
@ -22,7 +22,7 @@ default_install_root_basename='install-root'
|
||||
DEFINE_string board "${DEFAULT_BOARD}" \
|
||||
"The board to build a sysext for."
|
||||
DEFINE_string metapkgs '' \
|
||||
"Comma-separated list of meta-packages to build from source and install into sysext image."
|
||||
"Comma-separated list of binary meta-packages to install into the sysext image."
|
||||
DEFINE_string squashfs_base '' \
|
||||
"The path to the squashfs base image. Defaults to the most current image built in '${default_imagedir}/${FLATCAR_PRODUCTION_IMAGE_SYSEXT_BASE}'."
|
||||
DEFINE_string image_builddir '' \
|
||||
@ -93,8 +93,8 @@ switch_to_strict_mode -uo pipefail
|
||||
|
||||
# Validate command line parameters
|
||||
|
||||
SYSEXTNAME="${1:-}"
|
||||
if [[ -z "${SYSEXTNAME}" ]]; then
|
||||
SYSEXT_ID="${1:-}"
|
||||
if [[ -z "${SYSEXT_ID}" ]]; then
|
||||
die "No sysext name provided."
|
||||
fi
|
||||
shift
|
||||
@ -206,9 +206,9 @@ if [ "$VERSION_BOARD" != "$FLATCAR_VERSION" ]; then
|
||||
fi
|
||||
|
||||
if [[ -n "${FLAGS_metapkgs}" ]]; then
|
||||
mapfile -t metapkgs < <(tr ',' '\n' <<<"${FLAGS_metapkgs}")
|
||||
"emerge-${FLAGS_board}" --nodeps --buildpkgonly --usepkg n --verbose "${metapkgs[@]}"
|
||||
set -- "${metapkgs[@]}" "${@}"
|
||||
IFS=,
|
||||
set -- ${FLAGS_metapkgs} "${@}"
|
||||
unset IFS
|
||||
fi
|
||||
|
||||
if [[ ${#} -lt 1 ]]; then
|
||||
@ -216,7 +216,7 @@ if [[ ${#} -lt 1 ]]; then
|
||||
show_help_if_requested -h
|
||||
fi
|
||||
|
||||
info "Building '${SYSEXTNAME}' sysext with (meta-)packages '${@}' in '${BUILD_DIR}' using '${FLAGS_compression}' compression".
|
||||
info "Building '${SYSEXT_ID}' sysext with (meta-)packages '${@}' in '${BUILD_DIR}' using '${FLAGS_compression}' compression".
|
||||
|
||||
for package; do
|
||||
echo "Installing package into sysext image: $package"
|
||||
@ -232,6 +232,13 @@ for package; do
|
||||
"${package}"
|
||||
done
|
||||
|
||||
# If there's only one package, grab its metadata for the sysext.
|
||||
unset PVR HOMEPAGE SYSEXT_NAME
|
||||
if [[ ${#} -eq 1 ]]; then
|
||||
CPV=$(portageq best_version "${BUILD_DIR}/${FLAGS_install_root_basename}" "$1")
|
||||
IFS=$'\n' read -r -d '' PVR HOMEPAGE SYSEXT_NAME < <(portageq metadata "${BUILD_DIR}/${FLAGS_install_root_basename}" installed "${CPV}" PVR HOMEPAGE SYSEXT_NAME; printf '\0')
|
||||
fi
|
||||
|
||||
# Make squashfs generation more reproducible.
|
||||
export SOURCE_DATE_EPOCH=$(stat -c '%Y' "${BUILD_DIR}/fs-root/usr/lib/os-release")
|
||||
|
||||
@ -240,16 +247,16 @@ umount "${BUILD_DIR}/${FLAGS_install_root_basename}"
|
||||
umount "${BUILD_DIR}/fs-root"
|
||||
|
||||
if [[ "$FLAGS_generate_pkginfo" = "${FLAGS_TRUE}" ]] ; then
|
||||
info " Creating pkginfo squashfs '${BUILD_DIR}/${SYSEXTNAME}_pkginfo.raw'"
|
||||
info " Creating pkginfo squashfs '${BUILD_DIR}/${SYSEXT_ID}_pkginfo.raw'"
|
||||
mkdir -p "${BUILD_DIR}/img-pkginfo/var/db"
|
||||
cp -R "${BUILD_DIR}/${FLAGS_install_root_basename}/var/db/pkg" "${BUILD_DIR}/img-pkginfo/var/db/"
|
||||
mksquashfs "${BUILD_DIR}/img-pkginfo" "${BUILD_DIR}/${SYSEXTNAME}_pkginfo.raw" \
|
||||
mksquashfs "${BUILD_DIR}/img-pkginfo" "${BUILD_DIR}/${SYSEXT_ID}_pkginfo.raw" \
|
||||
-noappend -xattrs-exclude '^btrfs.' -comp zstd -Xcompression-level 22 -b 512k
|
||||
fi
|
||||
|
||||
info "Writing ${SYSEXTNAME}_packages.txt"
|
||||
info "Writing ${SYSEXT_ID}_packages.txt"
|
||||
ROOT="${BUILD_DIR}/${FLAGS_install_root_basename}" PORTAGE_CONFIGROOT="/build/${FLAGS_board}" \
|
||||
equery --no-color list --format '$cpv::$repo' '*' > "${BUILD_DIR}/${SYSEXTNAME}_packages.txt"
|
||||
equery --no-color list --format '$cpv::$repo' '*' > "${BUILD_DIR}/${SYSEXT_ID}_packages.txt"
|
||||
|
||||
|
||||
if [[ "${FLAGS_strip_binaries}" = "${FLAGS_TRUE}" ]]; then
|
||||
@ -282,15 +289,18 @@ for entry in "${BUILD_DIR}/${FLAGS_install_root_basename}"/*; do
|
||||
info " Removing ${entry##*/}"
|
||||
rm -rf "${entry}"
|
||||
done
|
||||
mkdir -p "${BUILD_DIR}/${FLAGS_install_root_basename}/usr/lib/extension-release.d"
|
||||
version_field="${VERSION_FIELD_OVERRIDE:-VERSION_ID=${FLATCAR_VERSION_ID}}"
|
||||
all_fields=(
|
||||
'ID=flatcar'
|
||||
"${version_field}"
|
||||
"ARCHITECTURE=${ARCH}"
|
||||
"EXTENSION_RELOAD_MANAGER=1"
|
||||
)
|
||||
printf '%s\n' "${all_fields[@]}" >"${BUILD_DIR}/${FLAGS_install_root_basename}/usr/lib/extension-release.d/extension-release.${SYSEXTNAME}"
|
||||
|
||||
grep . <<EOF | install -m0644 -D /dev/stdin "${BUILD_DIR}/${FLAGS_install_root_basename}/usr/lib/extension-release.d/extension-release.${SYSEXT_ID}"
|
||||
ID='flatcar'
|
||||
${VERSION_FIELD_OVERRIDE:-VERSION_ID}=${FLATCAR_VERSION_ID@Q}
|
||||
ARCHITECTURE=${ARCH@Q}
|
||||
EXTENSION_RELOAD_MANAGER=1
|
||||
SYSEXT_ID=${SYSEXT_ID@Q}
|
||||
${SYSEXT_NAME:+SYSEXT_NAME=${SYSEXT_NAME@Q}}
|
||||
${PVR:+SYSEXT_VERSION_ID=${PVR@Q}}
|
||||
${HOMEPAGE:+SYSEXT_HOME_URL=${HOMEPAGE@Q}}
|
||||
SYSEXT_BUG_REPORT_URL='https://issues.flatcar.org'
|
||||
EOF
|
||||
|
||||
info "Removing opaque directory markers to always merge all contents"
|
||||
find "${BUILD_DIR}/${FLAGS_install_root_basename}" -xdev -type d -exec sh -c 'if [ "$(attr -R -q -g overlay.opaque {} 2>/dev/null)" = y ]; then attr -R -r overlay.opaque {}; fi' \;
|
||||
@ -325,7 +335,7 @@ systemd-repart \
|
||||
--certificate="${SYSEXT_SIGNING_KEY_DIR}/sysexts.crt" \
|
||||
--make-ddi=sysext \
|
||||
--copy-source="${BUILD_DIR}/${FLAGS_install_root_basename}" \
|
||||
"${BUILD_DIR}/${SYSEXTNAME}.raw"
|
||||
"${BUILD_DIR}/${SYSEXT_ID}.raw"
|
||||
|
||||
rm -rf "${BUILD_DIR}"/{fs-root,"${FLAGS_install_root_basename}",workdir}
|
||||
|
||||
@ -335,10 +345,10 @@ systemd-dissect --read-only \
|
||||
--mount \
|
||||
--mkdir \
|
||||
--image-policy='root=encrypted+unprotected+absent:usr=encrypted+unprotected+absent' \
|
||||
"${BUILD_DIR}/${SYSEXTNAME}.raw" \
|
||||
"${BUILD_DIR}/${SYSEXT_ID}.raw" \
|
||||
"${BUILD_DIR}/img-rootfs"
|
||||
|
||||
write_contents "${BUILD_DIR}/img-rootfs" "${BUILD_DIR}/${SYSEXTNAME}_contents.txt"
|
||||
write_contents_with_technical_details "${BUILD_DIR}/img-rootfs" "${BUILD_DIR}/${SYSEXTNAME}_contents_wtd.txt"
|
||||
write_disk_space_usage_in_paths "${BUILD_DIR}/img-rootfs" "${BUILD_DIR}/${SYSEXTNAME}_disk_usage.txt"
|
||||
write_contents "${BUILD_DIR}/img-rootfs" "${BUILD_DIR}/${SYSEXT_ID}_contents.txt"
|
||||
write_contents_with_technical_details "${BUILD_DIR}/img-rootfs" "${BUILD_DIR}/${SYSEXT_ID}_contents_wtd.txt"
|
||||
write_disk_space_usage_in_paths "${BUILD_DIR}/img-rootfs" "${BUILD_DIR}/${SYSEXT_ID}_disk_usage.txt"
|
||||
systemd-dissect --umount --rmdir "${BUILD_DIR}/img-rootfs"
|
||||
|
||||
1
changelog/bugfixes/2026-04-28-virtualbox.md
Normal file
1
changelog/bugfixes/2026-04-28-virtualbox.md
Normal file
@ -0,0 +1 @@
|
||||
- Fixed booting the VirtualBox image, which was broken since upstream Ignition changed how their VirtualBox support works. The Vagrant VirtualBox image was unaffected.
|
||||
1
changelog/changes/2026-04-23-equinix-metal.md
Normal file
1
changelog/changes/2026-04-23-equinix-metal.md
Normal file
@ -0,0 +1 @@
|
||||
- Dropped support for Equinix Metal (Packet). The servers are due to be switched off on June 30th 2026.
|
||||
1
changelog/changes/2026-04-23-rackspace.md
Normal file
1
changelog/changes/2026-04-23-rackspace.md
Normal file
@ -0,0 +1 @@
|
||||
- Dropped support for Rackspace, including OnMetal. Rackspace-specific images are no longer built or published. Flatcar only had community level support for Rackspace, and the Flatcar team is no longer confident that this support actually works. Rackspace themselves have pivoted from being an independent cloud provider to being a management platform for other clouds.
|
||||
1
changelog/changes/2026-04-27-vagrant-virtualbox.md
Normal file
1
changelog/changes/2026-04-27-vagrant-virtualbox.md
Normal file
@ -0,0 +1 @@
|
||||
- Dropped the Vagrant VirtualBox image because the regular Vagrant image also targets VirtualBox. The only difference between them was that the former was geared for provisioning with Ignition and Afterburn rather than cloud-config and Vagrant itself. The Ignition support was broken when it was dropped by upstream. A single image can handle Ignition, cloud-config, and Vagrant. The Afterburn support has been dropped entirely.
|
||||
1
changelog/changes/2026-04-27-vmware-insecure.md
Normal file
1
changelog/changes/2026-04-27-vmware-insecure.md
Normal file
@ -0,0 +1 @@
|
||||
- Dropped the VMware "insecure" image. This was added a long time ago, and it is not clear to the current Flatcar team what purpose it served. It included the Vagrant insecure SSH key but without the other Vagrant files. If you want to use Vagrant, then do so with VirtualBox or Parallels. If you want to deploy onto VMware quickly, then use the OVA image.
|
||||
1
changelog/changes/2026-04-29-oem-sysexts.md
Normal file
1
changelog/changes/2026-04-29-oem-sysexts.md
Normal file
@ -0,0 +1 @@
|
||||
- All the legacy OEMs (CloudSigma, CloudStack, Exoscale, Vagrant, VirtualBox) have been converted to sysexts. The transition should be seamless, but the Flatcar team was only able to test VirtualBox with and without Vagrant, so please report any issues.
|
||||
1
changelog/changes/2026-04-29-vagrant.md
Normal file
1
changelog/changes/2026-04-29-vagrant.md
Normal file
@ -0,0 +1 @@
|
||||
- Refreshed the Vagrant and Vagrant Parallels images for use with recent Vagrant releases, adding implicit support for provisioning with Ignition (VirtualBox only) or cloud-config. Vagrant 2.2.5 is now required. See the revised documentation for further details.
|
||||
1
changelog/changes/2026-05-06-ovf-refresh.md
Normal file
1
changelog/changes/2026-05-06-ovf-refresh.md
Normal file
@ -0,0 +1 @@
|
||||
- Refreshed the VirtualBox OVF (which is also used by the Vagrant image) so that VMs are configured with modern hardware, including a VirtIO storage controller and UEFI. The clock is configured for UTC rather than local time.
|
||||
@ -27,7 +27,7 @@
|
||||
#
|
||||
# 1. Architecture (ARCH) of the TARGET vm images ("arm64", "amd64").
|
||||
# 2. Image type to be tested. One of:
|
||||
# ami, azure, azure_pro, digitalocean, gce, gce_pro, packet, qemu, qemu_uefi, vmware
|
||||
# ami, azure, azure_pro, digitalocean, gce, gce_pro, qemu, qemu_uefi, vmware
|
||||
#
|
||||
# OPTIONAL INPUT:
|
||||
#
|
||||
|
||||
@ -79,28 +79,16 @@ function _vm_build_impl() {
|
||||
|
||||
apply_local_patches
|
||||
|
||||
# automatically add PXE to formats if we build for Equinix Metal (packet).
|
||||
local has_packet=0
|
||||
local has_pxe=0
|
||||
for format; do
|
||||
[[ "${format}" = 'packet' ]] || [[ "${format}" = 'equinix_metal' ]] && has_packet=1
|
||||
[[ "${format}" = 'pxe' ]] && has_pxe=1
|
||||
done
|
||||
|
||||
[[ ${has_packet} -eq 1 ]] && [[ ${has_pxe} -eq 0 ]] && set -- 'pxe' "${@}"
|
||||
|
||||
# Convert platform names (also used to find the test scripts) to image formats they entail
|
||||
formats="$*"
|
||||
if echo "$formats" | tr ' ' '\n' | grep -q '^vmware'; then
|
||||
formats=$(echo "$formats" | tr ' ' '\n' | sed '/vmware.*/d')
|
||||
formats+=" vmware vmware_insecure vmware_ova vmware_raw"
|
||||
printf -v formats "%s\n" "${@}"
|
||||
if grep -q '^vmware' <<< "${formats}"; then
|
||||
formats=$(grep -v '^vmware' <<< "${formats}")
|
||||
printf -v formats "%s\n" ${formats} vmware vmware_ova vmware_raw
|
||||
fi
|
||||
if echo "$formats" | tr ' ' '\n' | grep -q -P '^(ami|aws)'; then
|
||||
formats=$(echo "$formats" | tr ' ' '\n' | sed '/ami.*/d' | sed '/aws/d')
|
||||
formats+=" ami ami_vmdk"
|
||||
if grep -q '^ami\|^aws' <<< "${formats}"; then
|
||||
formats=$(grep -v '^ami\|^aws' <<< "${formats}")
|
||||
printf -v formats "%s\n" ${formats} ami ami_vmdk
|
||||
fi
|
||||
# Keep compatibility with SDK scripts where "equinix_metal" remains unknown.
|
||||
formats=$(echo "$formats" | tr ' ' '\n' | sed 's/equinix_metal/packet/g')
|
||||
|
||||
source sdk_lib/sdk_container_common.sh
|
||||
|
||||
|
||||
@ -38,8 +38,6 @@ DEFINE_integer mem "${DEFAULT_MEM}" \
|
||||
"Memory size for the vm config in MBs."
|
||||
DEFINE_string to "" \
|
||||
"Destination folder for VM output file(s)"
|
||||
DEFINE_string oem_pkg "" \
|
||||
"OEM package to install"
|
||||
DEFINE_boolean getbinpkg "${FLAGS_FALSE}" \
|
||||
"Download binary packages from remote repository."
|
||||
DEFINE_string getbinpkgver "" \
|
||||
@ -67,10 +65,6 @@ if ! set_vm_type "${FLAGS_format}"; then
|
||||
die_notrace "Invalid format: ${FLAGS_format}"
|
||||
fi
|
||||
|
||||
if [ ! -z "${FLAGS_oem_pkg}" ] && ! set_vm_oem_pkg "${FLAGS_oem_pkg}"; then
|
||||
die_notrace "Invalid oem : ${FLAGS_oem_pkg}"
|
||||
fi
|
||||
|
||||
if [ -z "${FLAGS_board}" ] ; then
|
||||
die_notrace "--board is required."
|
||||
fi
|
||||
@ -117,10 +111,8 @@ fix_mtab
|
||||
# Setup new (raw) image, possibly resizing filesystems
|
||||
setup_disk_image "${FLAGS_disk_layout}"
|
||||
|
||||
# Optionally install any OEM packages
|
||||
install_oem_package
|
||||
# Optionally install any OEM sysexts
|
||||
install_oem_sysext
|
||||
run_fs_hook
|
||||
|
||||
# Changes done, glue it together
|
||||
write_vm_disk
|
||||
|
||||
@ -56,7 +56,6 @@ LISTING_KINDS=(
|
||||
['hetzner']='oem-hetzner_packages.txt'
|
||||
['kubevirt']='oem-kubevirt_packages.txt'
|
||||
['openstack']='oem-openstack_packages.txt'
|
||||
['packet']='oem-packet_packages.txt'
|
||||
['prod']='flatcar_production_image_packages.txt'
|
||||
['proxmoxve']='oem-proxmoxve_packages.txt'
|
||||
['qemu']='oem-qemu_packages.txt'
|
||||
|
||||
@ -23,13 +23,10 @@ gets built into a developer image and is not OEM specific.
|
||||
gets built into the Container Linux SDK.
|
||||
|
||||
`coreos-devel/board-packages` is everything that could be built into a
|
||||
development or production image, plus any OEM specific packages.
|
||||
development or production image.
|
||||
|
||||
`coreos-base/oem-*` are the OEM specific packages. They mostly install things
|
||||
that belong in the OEM partition. Any RDEPENDS from these packages should
|
||||
be copied to the RDEPENDS in `board-packages` to ensure they are built.
|
||||
|
||||
`coreos-base/coreos-oem-*` are metapackages for OEM specific ACIs.
|
||||
that belong in the OEM partition.
|
||||
|
||||
# Updating
|
||||
|
||||
|
||||
@ -1,3 +1,2 @@
|
||||
DIST afterburn-5.10.0-vendor.tar.gz 21824451 BLAKE2B fe263d51ce29ac6cee2d3974153ee73acca9f40abc80747cf40ab7ee69638a66fa3861f288033a976ecacaaf047611f547364e4abb9ed6a729cd7d77b498441e SHA512 ac186e88a9ced2195f80540ad686ce34352c9d854439afabc31ec0838c12e4f8614e273370b3778137a435b7fc088a040106ea29b7ed8df3c70caeac7a0bb6ec
|
||||
DIST afterburn-5.10.0.tar.gz 133765 BLAKE2B 3297a99d744a446532f8811f4d68741fafac32d47b6e7fcc63d5f7ec8f126462f76f3dbf5674e4267ae393c245f01c8a4ff2daaafa783cef44dededfdaa1c3eb SHA512 4f1f61b385d109451908c996336a6491323ac531d730a974ec23ef30d90fba75f07f530936dcccd35239e6a394a93e633db21dafd599a374bea9f342fd221c83
|
||||
DIST hostname-0.4.2.crate 12983 BLAKE2B a72e015d1bfd99828a9b1402a745968d578343c81301549cca0d5a4a5814a51c1eb58f7ed937ed75a6a6be385c340bf662d5d51cf401aa21809d1c893ff207f2 SHA512 57d7688fd7e724fe95b2d275d7cd11056e829318ff9683b59617575d94d5951eeb328ef2426bb16f4172bea461d0248cece573f212b6d2d8d3d0252981def4a6
|
||||
|
||||
@ -3,12 +3,8 @@
|
||||
|
||||
EAPI=8
|
||||
|
||||
# This crate is required by our patch but missing from the vendor tarball.
|
||||
CRATES="hostname@0.4.2"
|
||||
|
||||
inherit cargo systemd
|
||||
|
||||
SRC_URI="${CARGO_CRATE_URIS}"
|
||||
DESCRIPTION="A tool for collecting instance metadata from various providers"
|
||||
HOMEPAGE="https://github.com/coreos/afterburn"
|
||||
|
||||
@ -16,7 +12,7 @@ if [[ ${PV} == 9999 ]]; then
|
||||
EGIT_REPO_URI="https://github.com/coreos/afterburn.git"
|
||||
inherit git-r3
|
||||
else
|
||||
SRC_URI+=" https://github.com/coreos/afterburn/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
|
||||
SRC_URI="https://github.com/coreos/afterburn/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
|
||||
https://github.com/coreos/afterburn/releases/download/v${PV}/${P}-vendor.tar.gz"
|
||||
KEYWORDS="amd64 arm64"
|
||||
ECARGO_VENDOR="${WORKDIR}/vendor"
|
||||
|
||||
@ -5,73 +5,14 @@ Subject: [PATCH 1/3] Revert "*: remove cl-legacy feature"
|
||||
|
||||
This reverts commit 3e4b623b390ab756a6be963eec7198b3e7f44e20.
|
||||
|
||||
(dpark: Re-add hostname crate and its dependencies, as they are not
|
||||
included by default in 5.5.)
|
||||
|
||||
Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
|
||||
Signed-off-by: Dongsu Park <dpark@linux.microsoft.com>
|
||||
---
|
||||
Cargo.lock | 33 ++++++++++-
|
||||
Cargo.toml | 4 ++
|
||||
src/metadata.rs | 8 +++
|
||||
src/providers/mod.rs | 2 +
|
||||
src/providers/vagrant_virtualbox/mod.rs | 79 +++++++++++++++++++++++++
|
||||
src/util/cmdline.rs | 4 ++
|
||||
6 files changed, 129 insertions(+), 1 deletion(-)
|
||||
create mode 100644 src/providers/vagrant_virtualbox/mod.rs
|
||||
|
||||
diff --git a/Cargo.lock b/Cargo.lock
|
||||
index a4b7224..c2e3cc9 100644
|
||||
--- a/Cargo.lock
|
||||
+++ b/Cargo.lock
|
||||
@@ -31,6 +31,7 @@ dependencies = [
|
||||
"base64 0.22.1",
|
||||
"cfg-if",
|
||||
"clap",
|
||||
+ "hostname",
|
||||
"ipnetwork",
|
||||
"libflate",
|
||||
"libsystemd",
|
||||
@@ -812,6 +813,17 @@ dependencies = [
|
||||
"digest",
|
||||
]
|
||||
|
||||
+[[package]]
|
||||
+name = "hostname"
|
||||
+version = "0.4.2"
|
||||
+source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
+checksum = "617aaa3557aef3810a6369d0a99fac8a080891b68bd9f9812a1eeda0c0730cbd"
|
||||
+dependencies = [
|
||||
+ "cfg-if",
|
||||
+ "libc",
|
||||
+ "windows-link 0.2.0",
|
||||
+]
|
||||
+
|
||||
[[package]]
|
||||
name = "http"
|
||||
version = "1.3.1"
|
||||
@@ -2478,6 +2490,16 @@ version = "0.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "45e46c0661abb7180e7b9c281db115305d49ca1709ab8242adf09666d2173c65"
|
||||
|
||||
+[[package]]
|
||||
+name = "windows"
|
||||
+version = "0.62.0"
|
||||
+source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
+checksum = "9579d0e6970fd5250aa29aba5994052385ff55cf7b28a059e484bb79ea842e42"
|
||||
+dependencies = [
|
||||
+ "windows-core",
|
||||
+ "windows-targets 0.52.6",
|
||||
+]
|
||||
+
|
||||
[[package]]
|
||||
name = "windows-registry"
|
||||
version = "0.5.3"
|
||||
diff --git a/Cargo.toml b/Cargo.toml
|
||||
index 0929be8..7cd4b91 100644
|
||||
--- a/Cargo.toml
|
||||
+++ b/Cargo.toml
|
||||
@@ -33,11 +33,15 @@ path = "src/main.rs"
|
||||
@@ -33,6 +33,9 @@ path = "src/main.rs"
|
||||
# We assume we're being delivered via e.g. RPM which supports split debuginfo
|
||||
debug = true
|
||||
|
||||
@ -81,25 +22,10 @@ index 0929be8..7cd4b91 100644
|
||||
[dependencies]
|
||||
anyhow = "1.0"
|
||||
base64 = "0.22"
|
||||
cfg-if = "1.0"
|
||||
clap = { version = "4", "default-features" = false, "features" = ["std", "cargo", "derive", "error-context", "help", "suggestions", "usage", "wrap_help"] }
|
||||
+hostname = "0.4.0"
|
||||
ipnetwork = ">= 0.17, < 0.22"
|
||||
libflate = "2.1"
|
||||
libsystemd = ">= 0.2.1, < 0.8.0"
|
||||
diff --git a/src/metadata.rs b/src/metadata.rs
|
||||
index 94f9238..2ad1c8e 100644
|
||||
--- a/src/metadata.rs
|
||||
+++ b/src/metadata.rs
|
||||
@@ -35,6 +35,8 @@ use crate::providers::packet::PacketProvider;
|
||||
use crate::providers::powervs::PowerVSProvider;
|
||||
use crate::providers::proxmoxve;
|
||||
use crate::providers::scaleway::ScalewayProvider;
|
||||
+#[cfg(feature = "cl-legacy")]
|
||||
+use crate::providers::vagrant_virtualbox::VagrantVirtualboxProvider;
|
||||
use crate::providers::upcloud::UpCloudProvider;
|
||||
use crate::providers::vmware::VmwareProvider;
|
||||
use crate::providers::vultr::VultrProvider;
|
||||
@@ -60,6 +62,10 @@ pub fn fetch_metadata(provider: &str) -> Result<Box<dyn providers::MetadataProvi
|
||||
"cloudstack-configdrive" => box_result!(ConfigDrive::try_new()?),
|
||||
"digitalocean" => box_result!(DigitalOceanProvider::try_new()?),
|
||||
@ -111,114 +37,6 @@ index 94f9238..2ad1c8e 100644
|
||||
"gcp" => box_result!(GcpProvider::try_new()?),
|
||||
"hetzner" => box_result!(HetznerProvider::try_new()?),
|
||||
// IBM Cloud - VPC Generation 2.
|
||||
@@ -73,6 +79,8 @@ pub fn fetch_metadata(provider: &str) -> Result<Box<dyn providers::MetadataProvi
|
||||
"powervs" => box_result!(PowerVSProvider::try_new()?),
|
||||
"proxmoxve" => proxmoxve::try_config_drive_else_leave(),
|
||||
"scaleway" => box_result!(ScalewayProvider::try_new()?),
|
||||
+ #[cfg(feature = "cl-legacy")]
|
||||
+ "vagrant-virtualbox" => box_result!(VagrantVirtualboxProvider::new()),
|
||||
"upcloud" => box_result!(UpCloudProvider::try_new()?),
|
||||
"vmware" => box_result!(VmwareProvider::try_new()?),
|
||||
"vultr" => box_result!(VultrProvider::try_new()?),
|
||||
diff --git a/src/providers/mod.rs b/src/providers/mod.rs
|
||||
index e17d551..6fe44b6 100644
|
||||
--- a/src/providers/mod.rs
|
||||
+++ b/src/providers/mod.rs
|
||||
@@ -40,6 +40,8 @@ pub mod packet;
|
||||
pub mod powervs;
|
||||
pub mod proxmoxve;
|
||||
pub mod scaleway;
|
||||
+#[cfg(feature = "cl-legacy")]
|
||||
+pub mod vagrant_virtualbox;
|
||||
pub mod upcloud;
|
||||
pub mod vmware;
|
||||
pub mod vultr;
|
||||
|
||||
diff --git a/src/providers/vagrant_virtualbox/mod.rs b/src/providers/vagrant_virtualbox/mod.rs
|
||||
new file mode 100644
|
||||
index 0000000..d7a9e0e
|
||||
--- /dev/null
|
||||
+++ b/src/providers/vagrant_virtualbox/mod.rs
|
||||
@@ -0,0 +1,79 @@
|
||||
+// Copyright 2017 CoreOS, Inc.
|
||||
+//
|
||||
+// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
+// you may not use this file except in compliance with the License.
|
||||
+// You may obtain a copy of the License at
|
||||
+//
|
||||
+// http://www.apache.org/licenses/LICENSE-2.0
|
||||
+//
|
||||
+// Unless required by applicable law or agreed to in writing, software
|
||||
+// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
+// See the License for the specific language governing permissions and
|
||||
+// limitations under the License.
|
||||
+
|
||||
+//! vagrant/virtualbox metadata fetcher
|
||||
+
|
||||
+use std::collections::HashMap;
|
||||
+use std::net::IpAddr;
|
||||
+use std::thread;
|
||||
+use std::time::Duration;
|
||||
+
|
||||
+use anyhow::{anyhow,Context,Result};
|
||||
+use slog_scope::info;
|
||||
+
|
||||
+use crate::providers::MetadataProvider;
|
||||
+
|
||||
+#[derive(Clone, Copy, Debug)]
|
||||
+pub struct VagrantVirtualboxProvider;
|
||||
+
|
||||
+impl VagrantVirtualboxProvider {
|
||||
+ pub fn new() -> Self {
|
||||
+ Self
|
||||
+ }
|
||||
+
|
||||
+ fn get_ip() -> Result<String> {
|
||||
+ let max_attempts = 30;
|
||||
+ for _ in 0..max_attempts {
|
||||
+ if let Some(iface) = Self::find_eth1() {
|
||||
+ for a in iface.ips {
|
||||
+ if let IpAddr::V4(a) = a.ip() {
|
||||
+ return Ok(format!("{}", a));
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ info!("eth1 not found or is lacking an ipv4 address; waiting 2 seconds");
|
||||
+ thread::sleep(Duration::from_secs(2));
|
||||
+ }
|
||||
+ Err(anyhow!("eth1 was not found!"))
|
||||
+ }
|
||||
+
|
||||
+ fn find_eth1() -> Option<pnet_datalink::NetworkInterface> {
|
||||
+ pnet_datalink::interfaces()
|
||||
+ .into_iter()
|
||||
+ .find(|i| i.name == "eth1")
|
||||
+ }
|
||||
+
|
||||
+ /// Get the hostname from local system settings.
|
||||
+ fn system_hostname() -> Result<String> {
|
||||
+ let hostname = hostname::get()
|
||||
+ .context("unable to get hostname")?
|
||||
+ .to_string_lossy()
|
||||
+ .into_owned();
|
||||
+ Ok(hostname)
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+impl MetadataProvider for VagrantVirtualboxProvider {
|
||||
+ fn attributes(&self) -> Result<HashMap<String, String>> {
|
||||
+ let hostname = Self::system_hostname()?;
|
||||
+ let ip = Self::get_ip()?;
|
||||
+
|
||||
+ let attributes = maplit::hashmap! {
|
||||
+ "VAGRANT_VIRTUALBOX_HOSTNAME".to_string() => hostname,
|
||||
+ "VAGRANT_VIRTUALBOX_PRIVATE_IPV4".to_string() => ip,
|
||||
+ };
|
||||
+
|
||||
+ Ok(attributes)
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/util/cmdline.rs b/src/util/cmdline.rs
|
||||
index d07cfeb..2e96ce4 100644
|
||||
--- a/src/util/cmdline.rs
|
||||
|
||||
@ -14,9 +14,6 @@ ConditionKernelCommandLine=|coreos.oem.id=gce
|
||||
ConditionKernelCommandLine=|flatcar.oem.id=openstack
|
||||
ConditionKernelCommandLine=|coreos.oem.id=openstack
|
||||
|
||||
ConditionKernelCommandLine=|flatcar.oem.id=packet
|
||||
ConditionKernelCommandLine=|coreos.oem.id=packet
|
||||
|
||||
ConditionKernelCommandLine=|flatcar.oem.id=scaleway
|
||||
|
||||
ConditionKernelCommandLine=|flatcar.oem.id=hetzner
|
||||
|
||||
@ -1,159 +0,0 @@
|
||||
# Copyright (c) 2023 The Flatcar Maintainers.
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
# The hack below is there in order to avoid excessive duplication of
|
||||
# OEM IDs around the place. This ebuild serves as a Gentoo ebuild and
|
||||
# as a bash file to be sourced in order to get arch-specific
|
||||
# information about possible OEM IDs. The latter role is assumed when
|
||||
# the ebuild is sourced with first argument being
|
||||
# 'flatcar-local-variables'. Due to the requirements imposed by the
|
||||
# section 7.3.1 in Package Manager Specification (that says that EAPI
|
||||
# assignment must be the first non-comment, non-blank line in the
|
||||
# file), shell scripts wanting to source this ebuild for geting OEM
|
||||
# IDs, may need to declare EAPI as local, if it finds it suitable. The
|
||||
# role of sourced script is used by our image-changes job. All this
|
||||
# fluff needs to happen before we define or invoke any other
|
||||
# Gentoo-specific variables or functions like "DEPEND" or "inherit"
|
||||
# that may mess up sourcing.
|
||||
#
|
||||
# This can't be done with a separate shell file in FILESDIR, because
|
||||
# portage moves the ebuild into some temporary directory where
|
||||
# FILESDIR, although defined, does not even exist at first - it shows
|
||||
# up during the invocation of any src_ functions. Probably a security
|
||||
# measure or something.
|
||||
|
||||
if [[ ${1:-} = 'flatcar-local-variables' ]]; then
|
||||
local -a COMMON_OEMIDS ARM64_ONLY_OEMIDS AMD64_ONLY_OEMIDS OEMIDS
|
||||
fi
|
||||
|
||||
COMMON_OEMIDS=(
|
||||
akamai
|
||||
ami
|
||||
azure
|
||||
hetzner
|
||||
openstack
|
||||
packet
|
||||
proxmoxve
|
||||
qemu
|
||||
scaleway
|
||||
stackit
|
||||
kubevirt
|
||||
)
|
||||
|
||||
ARM64_ONLY_OEMIDS=(
|
||||
)
|
||||
|
||||
AMD64_ONLY_OEMIDS=(
|
||||
digitalocean
|
||||
gce
|
||||
hyperv
|
||||
vmware
|
||||
nutanix
|
||||
)
|
||||
|
||||
OEMIDS=(
|
||||
"${COMMON_OEMIDS[@]}"
|
||||
"${ARM64_ONLY_OEMIDS[@]}"
|
||||
"${AMD64_ONLY_OEMIDS[@]}"
|
||||
)
|
||||
|
||||
if [[ ${1:-} = 'flatcar-local-variables' ]]; then
|
||||
return 0
|
||||
else
|
||||
unset COMMON_OEMIDS ARM64_ONLY_OEMIDS AMD64_ONLY_OEMIDS
|
||||
fi
|
||||
|
||||
DESCRIPTION='Common OEM files'
|
||||
HOMEPAGE='https://www.flatcar.org/'
|
||||
|
||||
LICENSE='Apache-2.0'
|
||||
SLOT='0'
|
||||
KEYWORDS='amd64 arm64'
|
||||
IUSE="${OEMIDS[*]}"
|
||||
REQUIRED_USE="^^ ( ${OEMIDS[*]} )"
|
||||
|
||||
# No source directory.
|
||||
S="${WORKDIR}"
|
||||
|
||||
DEPEND=""
|
||||
RDEPEND="${DEPEND}"
|
||||
BDEPEND="
|
||||
app-portage/gentoolkit
|
||||
"
|
||||
|
||||
src_compile() {
|
||||
local oemid package ebuild version name homepage lines oemid_cmdline
|
||||
|
||||
for oemid in "${OEMIDS[@]}"; do
|
||||
if use "${oemid}"; then break; fi
|
||||
done
|
||||
|
||||
package="coreos-base/oem-${oemid}"
|
||||
ebuild=$(equery which "${package}")
|
||||
version=${ebuild##*"oem-${oemid}-"}
|
||||
version=${version%%'.ebuild'}
|
||||
if [[ -z "${version}" ]]; then
|
||||
die "Could not deduce a version from ebuild ${ebuild##*/} (${ebuild})"
|
||||
fi
|
||||
name=$(source <(grep -F 'OEM_NAME=' "${ebuild}"); echo "${OEM_NAME}")
|
||||
if [[ -z "${name}" ]]; then
|
||||
die "Missing OEM_NAME variable in ${ebuild##*/}"
|
||||
fi
|
||||
# We need to prefix the HOMEPAGE variable with SYSEXT_, because
|
||||
# portage marks HOMEPAGE as readonly and this gets propagated to
|
||||
# subshells, so sourcing a snippet with HOMEPAGE=foo won't
|
||||
# overwrite the readonly variable.
|
||||
homepage=$(source <(grep -F 'HOMEPAGE=' "${ebuild}" | sed -e 's/^/SYSEXT_/'); echo "${SYSEXT_HOMEPAGE}")
|
||||
lines=(
|
||||
"ID=${oemid}"
|
||||
"VERSION_ID=${version}"
|
||||
"NAME=\"${name}\""
|
||||
)
|
||||
if [[ -n "${homepage}" ]]; then
|
||||
lines+=( "HOME_URL=\"${homepage}\"" )
|
||||
fi
|
||||
lines+=(
|
||||
'BUG_REPORT_URL="https://issues.flatcar.org"'
|
||||
)
|
||||
|
||||
{
|
||||
printf '%s\n' "${lines[@]}"
|
||||
if [[ -e "${FILESDIR}/${oemid}/oem-release.frag" ]]; then
|
||||
cat "${FILESDIR}/${oemid}/oem-release.frag"
|
||||
fi
|
||||
} >"${T}/oem-release"
|
||||
|
||||
oemid_cmdline="${oemid}"
|
||||
|
||||
# In this specific case, the OEM ID from the oem-release file ('ami')
|
||||
# is different from the OEM ID kernel command line parameter ('ec2')
|
||||
# because some services like Afterburn or Ignition expects 'ec2|aws' value.
|
||||
if [[ "${oemid}" == "ami" ]]; then
|
||||
oemid_cmdline="ec2"
|
||||
fi
|
||||
|
||||
# STACKIT is running on top of OpenStack, so the `oem_cmdline` has to be `openstack` for Ignition/Afterburn integration but the `oemid` has to stay `stackit` to load the correct `oem-stackit` sysext image.
|
||||
if [[ "${oemid}" == "stackit" ]]; then
|
||||
oemid_cmdline="openstack"
|
||||
fi
|
||||
|
||||
lines=(
|
||||
'# Flatcar GRUB settings'
|
||||
''
|
||||
"set oem_id=\"${oemid_cmdline}\""
|
||||
)
|
||||
{
|
||||
printf '%s\n' "${lines[@]}"
|
||||
if [[ -e "${FILESDIR}/${oemid}/grub.cfg.frag" ]]; then
|
||||
cat "${FILESDIR}/${oemid}/grub.cfg.frag"
|
||||
fi
|
||||
} >"${T}/grub.cfg"
|
||||
}
|
||||
|
||||
src_install() {
|
||||
insinto "/oem"
|
||||
doins "${T}/grub.cfg"
|
||||
doins "${T}/oem-release"
|
||||
}
|
||||
@ -1 +0,0 @@
|
||||
set linux_append="flatcar.autologin"
|
||||
@ -1,6 +0,0 @@
|
||||
set linux_append="flatcar.autologin"
|
||||
|
||||
if [ "$grub_cpu" = i386 ] || [ "$grub_cpu" = x86_64 ]; then
|
||||
set gfxpayload="1024x768x8,1024x768"
|
||||
set linux_console="console=tty0 console=ttyS1,115200n8"
|
||||
fi
|
||||
@ -1 +0,0 @@
|
||||
set linux_append="flatcar.autologin"
|
||||
@ -1 +0,0 @@
|
||||
set linux_append="flatcar.autologin"
|
||||
@ -1 +0,0 @@
|
||||
set linux_append="flatcar.autologin"
|
||||
@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
</pkgmetadata>
|
||||
@ -1 +1 @@
|
||||
DIST coreos-cloudinit-1c1d7f4ae6b933350d7fd36e882dda170123cccc.tar.gz 310707 BLAKE2B 13cb6b452c71285983b6446ec4a40e24a862fe029744b0c66c39e7d0e69616343d70717e94f94ef152ab5a23bdef096bc46df4593ee679a340ef292b81d9df17 SHA512 b3fd07e1e5b26e530cd36cc33d06e5eeeb707ec3c0fef5126c51a4a8d7d68eed2b74aebb0777030fc595dcae3c22f9dffde8ceed914db7ce8323cf4ad22b9710
|
||||
DIST coreos-cloudinit-8df59e8f39474510fbde9440f16b5587b9a3c82d.tar.gz 311296 BLAKE2B 1795f0bce9bc8166de26d6891457d3c37c0d1754b714be0dadade9c4b363e29cf98edfb907f68d842e1c2c4003ff125608691c01c42a683bb624355d92f20b3d SHA512 2ae95c375f2411eb901bda3a529380460d341623b02fa53d267491822fb0dec5c5a02945ac2cca66353febe53182cbdacdfad189628286fb05fda043e1353440
|
||||
|
||||
@ -14,7 +14,7 @@ if [[ ${PV} == 9999 ]]; then
|
||||
EGIT_REPO_URI="https://github.com/flatcar/coreos-cloudinit.git"
|
||||
inherit git-r3
|
||||
else
|
||||
EGIT_VERSION="1c1d7f4ae6b933350d7fd36e882dda170123cccc" # main
|
||||
EGIT_VERSION="8df59e8f39474510fbde9440f16b5587b9a3c82d" # main
|
||||
SRC_URI="https://github.com/flatcar/coreos-cloudinit/archive/${EGIT_VERSION}.tar.gz -> ${PN}-${EGIT_VERSION}.tar.gz"
|
||||
S="${WORKDIR}/${PN}-${EGIT_VERSION}"
|
||||
KEYWORDS="amd64 arm64"
|
||||
|
||||
@ -1 +0,0 @@
|
||||
DIST nova-agent-container-0.0.1.tar.gz 6634988 SHA256 ccaea8ea597111d5b89649e9fb03f6a9fdf8530e69c18c8af6e059d7ac20a029 SHA512 71468307ed8d87fafcaf44d1cb48b5499a42e9902a61d97d6ea191fed3e0e81cc8c3beb61839449f5ec87f54717801d2aa56df848bfa2b6602419360e3196005 WHIRLPOOL 0989323868fcf751c8aa4381130c0607cb19f8271c531018ee7bc12676b89e0f908f3999a7da6462c4654673eed822f427ed24d93da4e46d3ea0ddf7a8cc6eed
|
||||
@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
</pkgmetadata>
|
||||
@ -1,18 +0,0 @@
|
||||
# Copyright (c) 2013 CoreOS, Inc.. All rights reserved.
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
|
||||
DESCRIPTION="nova agent for rackspace images"
|
||||
HOMEPAGE="https://github.com/coreos/nova-agent-container"
|
||||
SRC_URI="${HOMEPAGE}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
|
||||
|
||||
LICENSE="Apache-2.0"
|
||||
SLOT="0"
|
||||
KEYWORDS="amd64 x86"
|
||||
IUSE=""
|
||||
|
||||
src_install() {
|
||||
dodir /oem/nova-agent
|
||||
rsync -aq "${S}/" "${D}/oem/nova-agent/" || die
|
||||
}
|
||||
@ -1 +0,0 @@
|
||||
DIST nova-agent-watcher-f750d8e5e91a7e7e22e26c9d241d27b1b7563d70.tar.gz 217622 BLAKE2B 73c2975faba141cb5d259adf0f8ae8a9bbe7e89fd94e9a66577ad67798c5a740d2e25b8d826ee1241b3ebfb783df5ea42bf747bc5d6b12fe5f2624950d367e00 SHA512 0e684f95328c253734f9f5feac9340d403f4f50b5e87cc4a5eab95dde2a13a5eef9c967bbede7b315757063a9b2aef557a5370b489e0a781a072eec0c4b2e25c
|
||||
@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
<upstream>
|
||||
<remote-id type="github">coreos/nova-agent-watcher</remote-id>
|
||||
</upstream>
|
||||
</pkgmetadata>
|
||||
@ -1 +0,0 @@
|
||||
nova-agent-watcher-9999.ebuild
|
||||
@ -1,30 +0,0 @@
|
||||
# Copyright (c) 2014 CoreOS, Inc.. All rights reserved.
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
COREOS_GO_PACKAGE="github.com/coreos/nova-agent-watcher"
|
||||
COREOS_GO_GO111MODULE="off"
|
||||
inherit coreos-go
|
||||
|
||||
DESCRIPTION="Watches for changes from Nova and reapplies them with coreos-cloudinit"
|
||||
HOMEPAGE="https://github.com/coreos/nova-agent-watcher"
|
||||
|
||||
if [[ ${PV} == 9999 ]]; then
|
||||
EGIT_REPO_URI="https://github.com/coreos/nova-agent-watcher.git"
|
||||
inherit git-r3
|
||||
else
|
||||
EGIT_VERSION="f750d8e5e91a7e7e22e26c9d241d27b1b7563d70"
|
||||
SRC_URI="https://github.com/coreos/nova-agent-watcher/archive/${EGIT_VERSION}.tar.gz -> ${PN}-${EGIT_VERSION}.tar.gz"
|
||||
S="${WORKDIR}/${PN}-${EGIT_VERSION}"
|
||||
KEYWORDS="amd64 arm64"
|
||||
fi
|
||||
|
||||
LICENSE="Apache-2.0"
|
||||
SLOT="0"
|
||||
|
||||
src_install() {
|
||||
into /oem
|
||||
dobin scripts/gentoo-to-networkd
|
||||
dobin "${GOBIN}"/nova-agent-watcher
|
||||
}
|
||||
@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
</pkgmetadata>
|
||||
@ -5,11 +5,9 @@ EAPI=8
|
||||
|
||||
DESCRIPTION="OEM suite for Akamai (previously Linode)"
|
||||
HOMEPAGE="https://www.linode.com"
|
||||
SRC_URI=""
|
||||
|
||||
LICENSE="GPL-2"
|
||||
LICENSE="metapackage"
|
||||
SLOT="0"
|
||||
KEYWORDS="amd64 arm64"
|
||||
IUSE=""
|
||||
|
||||
OEM_NAME="Akamai"
|
||||
SYSEXT_NAME="Akamai"
|
||||
|
||||
@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
</pkgmetadata>
|
||||
@ -7,22 +7,18 @@ inherit systemd
|
||||
|
||||
DESCRIPTION="OEM suite for Amazon Machine Images"
|
||||
HOMEPAGE="http://aws.amazon.com/ec2/"
|
||||
SRC_URI=""
|
||||
S="${WORKDIR}"
|
||||
|
||||
LICENSE="Apache-2.0"
|
||||
SLOT="0"
|
||||
KEYWORDS="amd64 arm64"
|
||||
IUSE=""
|
||||
|
||||
RDEPEND="
|
||||
~app-emulation/amazon-ssm-agent-${PV}
|
||||
coreos-base/flatcar-eks
|
||||
~app-emulation/amazon-ssm-agent-${PV}
|
||||
coreos-base/flatcar-eks
|
||||
"
|
||||
|
||||
# for coreos-base/common-oem-files
|
||||
OEM_NAME="Amazon EC2"
|
||||
|
||||
S="${WORKDIR}"
|
||||
SYSEXT_NAME="Amazon EC2"
|
||||
|
||||
src_install() {
|
||||
systemd_dounit "${FILESDIR}/setup-oem.service"
|
||||
|
||||
@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
</pkgmetadata>
|
||||
@ -7,12 +7,11 @@ inherit systemd tmpfiles
|
||||
|
||||
DESCRIPTION="OEM suite for Azure"
|
||||
HOMEPAGE="https://azure.microsoft.com/"
|
||||
SRC_URI=""
|
||||
S="${WORKDIR}"
|
||||
|
||||
LICENSE="Apache-2.0"
|
||||
SLOT="0"
|
||||
KEYWORDS="amd64 arm64"
|
||||
IUSE=""
|
||||
|
||||
RDEPEND="
|
||||
~app-emulation/wa-linux-agent-${PV}
|
||||
@ -22,10 +21,8 @@ RDEPEND="
|
||||
sys-fs/inotify-tools
|
||||
"
|
||||
|
||||
# for coreos-base/common-oem-files
|
||||
OEM_NAME="Microsoft Azure"
|
||||
SYSEXT_NAME="Microsoft Azure"
|
||||
|
||||
S="${WORKDIR}"
|
||||
|
||||
src_install() {
|
||||
systemd_enable_service multi-user.target chronyd.service
|
||||
|
||||
@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
</pkgmetadata>
|
||||
@ -1,27 +0,0 @@
|
||||
# Copyright (c) 2015 CoreOS, Inc.. All rights reserved.
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
|
||||
DESCRIPTION="OEM suite for CloudSigma images"
|
||||
HOMEPAGE=""
|
||||
SRC_URI=""
|
||||
|
||||
LICENSE="Apache-2.0"
|
||||
SLOT="0"
|
||||
KEYWORDS="amd64 x86"
|
||||
|
||||
# no source directory
|
||||
S="${WORKDIR}"
|
||||
|
||||
src_prepare() {
|
||||
default
|
||||
sed -e "s\\@@OEM_VERSION_ID@@\\${PVR}\\g" \
|
||||
"${FILESDIR}/cloud-config.yml" > "${T}/cloud-config.yml" || die
|
||||
}
|
||||
|
||||
src_install() {
|
||||
insinto "/oem"
|
||||
doins "${T}/cloud-config.yml"
|
||||
doins "${FILESDIR}/grub.cfg"
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
# Copyright (c) 2015 CoreOS, Inc.. All rights reserved.
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
DESCRIPTION="OEM suite for CloudSigma"
|
||||
HOMEPAGE="https://www.cloudsigma.com/"
|
||||
S="${WORKDIR}"
|
||||
|
||||
LICENSE="Apache-2.0"
|
||||
SLOT="0"
|
||||
KEYWORDS="amd64"
|
||||
|
||||
SYSEXT_NAME="CloudSigma"
|
||||
|
||||
src_install() {
|
||||
insinto /usr/share/flatcar
|
||||
sed "s:@@OEM_VERSION_ID@@:${PVR}:g" "${FILESDIR}/cloud-config.yml" | newins - cloud-config.yml
|
||||
}
|
||||
@ -12,7 +12,7 @@ coreos:
|
||||
[Service]
|
||||
Type=oneshot
|
||||
StandardOutput=journal+console
|
||||
ExecStart=/oem/bin/cloudstack-ssh-key
|
||||
ExecStart=/usr/bin/cloudstack-ssh-key
|
||||
- name: cloudstack-cloudinit.service
|
||||
command: restart
|
||||
runtime: yes
|
||||
@ -25,10 +25,10 @@ coreos:
|
||||
[Service]
|
||||
Type=oneshot
|
||||
EnvironmentFile=/etc/environment
|
||||
ExecStart=/oem/bin/cloudstack-coreos-cloudinit
|
||||
ExecStart=/usr/bin/cloudstack-coreos-cloudinit
|
||||
oem:
|
||||
id: cloudstack
|
||||
name: CloudStack
|
||||
version-id: @@OEM_VERSION_ID@@
|
||||
home-url: http://cloudstack.apache.org/
|
||||
home-url: https://cloudstack.apache.org/
|
||||
bug-report-url: https://github.com/coreos/coreos-overlay
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
. /oem/bin/cloudstack-dhcp
|
||||
. /usr/bin/cloudstack-dhcp
|
||||
|
||||
DHCP_SERVER=$(get_dhcp_ip)
|
||||
USERDATA_URL="http://${DHCP_SERVER}/latest/user-data"
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
. /oem/bin/cloudstack-dhcp
|
||||
. /usr/bin/cloudstack-dhcp
|
||||
|
||||
DHCP_SERVER=$(get_dhcp_ip)
|
||||
KEY_URL="http://${DHCP_SERVER}/latest/meta-data/public-keys"
|
||||
|
||||
@ -18,7 +18,7 @@ sed -i -e '/^COREOS_PUBLIC_IPV4=/d' \
|
||||
-e '/^COREOS_PRIVATE_IPV4=/d' \
|
||||
"${ENV}"
|
||||
|
||||
. /oem/bin/cloudstack-dhcp
|
||||
. /usr/bin/cloudstack-dhcp
|
||||
|
||||
DHCP_SERVER=$(get_dhcp_ip)
|
||||
METADATA_URL="http://${DHCP_SERVER}/latest/meta-data/"
|
||||
|
||||
@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
</pkgmetadata>
|
||||
@ -1,38 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
|
||||
# Copyright (c) 2014 CoreOS, Inc.. All rights reserved.
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header:$
|
||||
#
|
||||
|
||||
EAPI=7
|
||||
|
||||
DESCRIPTION="OEM suite for CloudStack images"
|
||||
HOMEPAGE=""
|
||||
SRC_URI=""
|
||||
|
||||
LICENSE="Apache-2.0"
|
||||
SLOT="0"
|
||||
KEYWORDS="amd64 x86"
|
||||
IUSE=""
|
||||
|
||||
# no source directory
|
||||
S="${WORKDIR}"
|
||||
|
||||
src_prepare() {
|
||||
default
|
||||
sed -e "s\\@@OEM_VERSION_ID@@\\${PVR}\\g" \
|
||||
"${FILESDIR}/cloud-config.yml" > "${T}/cloud-config.yml" || die
|
||||
}
|
||||
|
||||
src_install() {
|
||||
into "/oem"
|
||||
dobin "${FILESDIR}/cloudstack-dhcp"
|
||||
dobin "${FILESDIR}/cloudstack-ssh-key"
|
||||
dobin "${FILESDIR}/cloudstack-coreos-cloudinit"
|
||||
dobin "${FILESDIR}/flatcar-setup-environment"
|
||||
|
||||
insinto "/oem"
|
||||
doins "${T}/cloud-config.yml"
|
||||
doins "${FILESDIR}/grub.cfg"
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
|
||||
# Copyright (c) 2014 CoreOS, Inc.. All rights reserved.
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
DESCRIPTION="OEM suite for CloudStack"
|
||||
HOMEPAGE="https://cloudstack.apache.org/"
|
||||
S="${WORKDIR}"
|
||||
|
||||
LICENSE="Apache-2.0"
|
||||
SLOT="0"
|
||||
KEYWORDS="amd64"
|
||||
|
||||
SYSEXT_NAME="CloudStack"
|
||||
|
||||
src_install() {
|
||||
insinto /usr/share/flatcar
|
||||
sed "s:@@OEM_VERSION_ID@@:${PVR}:g" "${FILESDIR}/cloud-config.yml" | newins - cloud-config.yml
|
||||
|
||||
dobin "${FILESDIR}"/{cloudstack-{coreos-cloudinit,dhcp,ssh-key},flatcar-setup-environment}
|
||||
}
|
||||
@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
</pkgmetadata>
|
||||
@ -3,13 +3,11 @@
|
||||
|
||||
EAPI=8
|
||||
|
||||
DESCRIPTION="DigitalOcean suite for DigitalOcean"
|
||||
DESCRIPTION="OEM suite for DigitalOcean"
|
||||
HOMEPAGE="https://www.digitalocean.com/"
|
||||
SRC_URI=""
|
||||
|
||||
LICENSE="GPL-2"
|
||||
LICENSE="metapackage"
|
||||
SLOT="0"
|
||||
KEYWORDS="amd64 arm64"
|
||||
IUSE=""
|
||||
KEYWORDS="amd64"
|
||||
|
||||
OEM_NAME="DigitalOcean"
|
||||
SYSEXT_NAME="DigitalOcean"
|
||||
|
||||
@ -12,7 +12,7 @@ coreos:
|
||||
[Service]
|
||||
Type=oneshot
|
||||
StandardOutput=journal+console
|
||||
ExecStart=/oem/bin/exoscale-ssh-key
|
||||
ExecStart=/usr/bin/exoscale-ssh-key
|
||||
- name: exoscale-cloudinit.service
|
||||
command: restart
|
||||
runtime: yes
|
||||
@ -25,10 +25,10 @@ coreos:
|
||||
[Service]
|
||||
Type=oneshot
|
||||
EnvironmentFile=/etc/environment
|
||||
ExecStart=/oem/bin/exoscale-coreos-cloudinit
|
||||
ExecStart=/usr/bin/exoscale-coreos-cloudinit
|
||||
oem:
|
||||
id: exoscale
|
||||
name: exoscale
|
||||
version-id: @@OEM_VERSION_ID@@
|
||||
home-url: http://www.exoscale.ch
|
||||
home-url: https://www.exoscale.com/
|
||||
bug-report-url: https://github.com/coreos/coreos-overlay
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
. /oem/bin/exoscale-dhcp
|
||||
. /usr/bin/exoscale-dhcp
|
||||
|
||||
DHCP_SERVER=$(get_dhcp_ip)
|
||||
USERDATA_URL="http://${DHCP_SERVER}/latest/user-data"
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
. /oem/bin/exoscale-dhcp
|
||||
. /usr/bin/exoscale-dhcp
|
||||
|
||||
DHCP_SERVER=$(get_dhcp_ip)
|
||||
KEY_URL="http://${DHCP_SERVER}/latest/public-keys"
|
||||
|
||||
@ -18,7 +18,7 @@ sed -i -e '/^COREOS_PUBLIC_IPV4=/d' \
|
||||
-e '/^COREOS_PRIVATE_IPV4=/d' \
|
||||
"${ENV}"
|
||||
|
||||
. /oem/bin/exoscale-dhcp
|
||||
. /usr/bin/exoscale-dhcp
|
||||
|
||||
DHCP_SERVER=$(get_dhcp_ip)
|
||||
METADATA_URL="http://${DHCP_SERVER}/latest/"
|
||||
|
||||
@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
</pkgmetadata>
|
||||
@ -1,38 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
|
||||
# Copyright (c) 2014 CoreOS, Inc.. All rights reserved.
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header:$
|
||||
#
|
||||
|
||||
EAPI=7
|
||||
|
||||
DESCRIPTION="OEM suite for Exoscale images"
|
||||
HOMEPAGE=""
|
||||
SRC_URI=""
|
||||
|
||||
LICENSE="Apache-2.0"
|
||||
SLOT="0"
|
||||
KEYWORDS="amd64 x86"
|
||||
IUSE=""
|
||||
|
||||
# no source directory
|
||||
S="${WORKDIR}"
|
||||
|
||||
src_prepare() {
|
||||
default
|
||||
sed -e "s\\@@OEM_VERSION_ID@@\\${PVR}\\g" \
|
||||
"${FILESDIR}/cloud-config.yml" > "${T}/cloud-config.yml" || die
|
||||
}
|
||||
|
||||
src_install() {
|
||||
into "/oem"
|
||||
dobin "${FILESDIR}/exoscale-dhcp"
|
||||
dobin "${FILESDIR}/exoscale-ssh-key"
|
||||
dobin "${FILESDIR}/exoscale-coreos-cloudinit"
|
||||
dobin "${FILESDIR}/flatcar-setup-environment"
|
||||
|
||||
insinto "/oem"
|
||||
doins "${T}/cloud-config.yml"
|
||||
doins "${FILESDIR}/grub.cfg"
|
||||
}
|
||||
22
sdk_container/src/third_party/coreos-overlay/coreos-base/oem-exoscale/oem-exoscale-1.0.0.ebuild
vendored
Normal file
22
sdk_container/src/third_party/coreos-overlay/coreos-base/oem-exoscale/oem-exoscale-1.0.0.ebuild
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
|
||||
# Copyright (c) 2014 CoreOS, Inc.. All rights reserved.
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
DESCRIPTION="OEM suite for Exoscale"
|
||||
HOMEPAGE="https://www.exoscale.com/"
|
||||
S="${WORKDIR}"
|
||||
|
||||
LICENSE="Apache-2.0"
|
||||
SLOT="0"
|
||||
KEYWORDS="amd64"
|
||||
|
||||
SYSEXT_NAME="Exoscale"
|
||||
|
||||
src_install() {
|
||||
insinto /usr/share/flatcar
|
||||
sed "s:@@OEM_VERSION_ID@@:${PVR}:g" "${FILESDIR}/cloud-config.yml" | newins - cloud-config.yml
|
||||
|
||||
dobin "${FILESDIR}"/{exoscale-{coreos-cloudinit,dhcp,ssh-key},flatcar-setup-environment}
|
||||
}
|
||||
@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
</pkgmetadata>
|
||||
@ -1,42 +0,0 @@
|
||||
# Copyright (c) 2013 CoreOS, Inc.. All rights reserved.
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# Copyright (c) 2020 Kinvolk GmbH. All rights reserved.
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
inherit systemd
|
||||
|
||||
DESCRIPTION="OEM suite for Google Compute Engine images"
|
||||
HOMEPAGE="https://cloud.google.com/products/compute-engine/"
|
||||
SRC_URI=""
|
||||
|
||||
LICENSE="Apache-2.0"
|
||||
SLOT="0"
|
||||
KEYWORDS="amd64"
|
||||
IUSE=""
|
||||
|
||||
# no source directory
|
||||
S="${WORKDIR}"
|
||||
|
||||
RDEPEND="
|
||||
app-emulation/google-compute-engine
|
||||
"
|
||||
|
||||
OEM_NAME="Google Compute Engine"
|
||||
|
||||
src_install() {
|
||||
systemd_dounit "${FILESDIR}/units/oem-gce.service"
|
||||
systemd_dounit "${FILESDIR}/units/oem-gce-enable-oslogin.service"
|
||||
systemd_dounit "${FILESDIR}/units/setup-oem.service"
|
||||
systemd_install_dropin "multi-user.target" "${FILESDIR}/units/10-oem-gce.conf"
|
||||
systemd_enable_service "multi-user.target" "ntpd.service"
|
||||
|
||||
dobin "${FILESDIR}/bin/enable-oslogin"
|
||||
dobin "${FILESDIR}/bin/init.sh"
|
||||
|
||||
# These files will be symlinked to /etc via 'setup-oem.service'
|
||||
insinto /usr/share/gce/
|
||||
doins "${FILESDIR}/files/hosts"
|
||||
doins "${FILESDIR}/files/google-cloud-sdk.sh"
|
||||
}
|
||||
34
sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/oem-gce-20190124.ebuild
vendored
Normal file
34
sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/oem-gce-20190124.ebuild
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
# Copyright (c) 2013 CoreOS, Inc.. All rights reserved.
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# Copyright (c) 2020 Kinvolk GmbH. All rights reserved.
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
inherit systemd
|
||||
|
||||
DESCRIPTION="OEM suite for Google Compute Engine"
|
||||
HOMEPAGE="https://cloud.google.com/products/compute-engine/"
|
||||
S="${WORKDIR}"
|
||||
|
||||
LICENSE="Apache-2.0"
|
||||
SLOT="0"
|
||||
KEYWORDS="amd64"
|
||||
|
||||
RDEPEND="
|
||||
~app-emulation/google-compute-engine-${PV}
|
||||
"
|
||||
|
||||
SYSEXT_NAME="Google Compute Engine"
|
||||
|
||||
src_install() {
|
||||
systemd_dounit "${FILESDIR}"/units/{oem-gce,oem-gce-enable-oslogin,setup-oem}.service
|
||||
systemd_install_dropin multi-user.target "${FILESDIR}"/units/10-oem-gce.conf
|
||||
systemd_enable_service multi-user.target ntpd.service
|
||||
|
||||
dobin "${FILESDIR}"/bin/{enable-oslogin,init.sh}
|
||||
|
||||
# These files will be symlinked to /etc via 'setup-oem.service'
|
||||
insinto /usr/share/gce
|
||||
doins "${FILESDIR}"/files/{google-cloud-sdk.sh,hosts}
|
||||
}
|
||||
@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
</pkgmetadata>
|
||||
@ -5,11 +5,9 @@ EAPI=8
|
||||
|
||||
DESCRIPTION="OEM suite for Hetzner"
|
||||
HOMEPAGE="https://hetzner.com"
|
||||
SRC_URI=""
|
||||
|
||||
LICENSE="GPL-2"
|
||||
LICENSE="metapackage"
|
||||
SLOT="0"
|
||||
KEYWORDS="amd64 arm64"
|
||||
IUSE=""
|
||||
|
||||
OEM_NAME="Hetzner"
|
||||
SYSEXT_NAME="Hetzner"
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user