mirror of
https://github.com/armbian/build
synced 2025-09-24 19:47:06 +07:00
fixed indentation on cloud-init extension (#6231)
* fixed indentation on cloud-init extension * indentation --------- Co-authored-by: rafael <rvalle@privaz.io>
This commit is contained in:
@@ -22,51 +22,51 @@ function extension_prepare_config__ci_image_suffix() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function extension_prepare_config__prepare_ci() {
|
function extension_prepare_config__prepare_ci() {
|
||||||
# Cloud Init related packages selected from Ubuntu RPI distirbution
|
# Cloud Init related packages selected from Ubuntu RPI distirbution
|
||||||
add_packages_to_image cloud-init cloud-initramfs-dyn-netconf
|
add_packages_to_image cloud-init cloud-initramfs-dyn-netconf
|
||||||
}
|
}
|
||||||
|
|
||||||
function extension_prepare_config__ci_compatibility_check(){
|
function extension_prepare_config__ci_compatibility_check(){
|
||||||
# We require fat boot partition, will change and if the user provided another type, will fail.
|
# We require fat boot partition, will change and if the user provided another type, will fail.
|
||||||
if [[ -z "${BOOTFS_TYPE}" ]]; then
|
if [[ -z "${BOOTFS_TYPE}" ]]; then
|
||||||
declare -g BOOTFS_TYPE="fat"
|
declare -g BOOTFS_TYPE="fat"
|
||||||
display_alert "Changing BOOTFS_TYPE" "cloud_init requires a fat partition" "warn"
|
display_alert "Changing BOOTFS_TYPE" "cloud_init requires a fat partition" "warn"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${BOOTFS_TYPE}" != "fat" ]]; then
|
if [[ "${BOOTFS_TYPE}" != "fat" ]]; then
|
||||||
exit_with_error "BOOTFS_TYPE ${BOOTFS_TYPE} not compatible with cloud-init"
|
exit_with_error "BOOTFS_TYPE ${BOOTFS_TYPE} not compatible with cloud-init"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function pre_customize_image__inject_cloud_init_config() {
|
function pre_customize_image__inject_cloud_init_config() {
|
||||||
# Copy the NoCLoud Cloud-Init Configuration
|
# Copy the NoCLoud Cloud-Init Configuration
|
||||||
display_alert "Configuring" "cloud-init" "info"
|
display_alert "Configuring" "cloud-init" "info"
|
||||||
local config_src="${EXTENSION_DIR}/config"
|
local config_src="${EXTENSION_DIR}/config"
|
||||||
local config_dst="${SDCARD}/etc/cloud/cloud.cfg.d"
|
local config_dst="${SDCARD}/etc/cloud/cloud.cfg.d"
|
||||||
run_host_command_logged cp ${config_src}/* $config_dst
|
run_host_command_logged cp ${config_src}/* $config_dst
|
||||||
|
|
||||||
# Provide default cloud-init files
|
# Provide default cloud-init files
|
||||||
display_alert "Defaults" "cloud-init" "info"
|
display_alert "Defaults" "cloud-init" "info"
|
||||||
local defaults_src="${EXTENSION_DIR}/defaults"
|
local defaults_src="${EXTENSION_DIR}/defaults"
|
||||||
local defaults_dst="${SDCARD}/boot"
|
local defaults_dst="${SDCARD}/boot"
|
||||||
run_host_command_logged cp ${defaults_src}/* $defaults_dst
|
run_host_command_logged cp ${defaults_src}/* $defaults_dst
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# @TODO: would be better to have "armbian first run" as an extension that can be disabled
|
# @TODO: would be better to have "armbian first run" as an extension that can be disabled
|
||||||
function pre_customize_image__disable_armbian_first_run() {
|
function pre_customize_image__disable_armbian_first_run() {
|
||||||
display_alert "Disabling" "armbian first run" "info"
|
display_alert "Disabling" "armbian first run" "info"
|
||||||
|
|
||||||
# Clean up default profile and network
|
# Clean up default profile and network
|
||||||
rm -f ${SDCARD}/etc/profile.d/armbian-check-first-*
|
rm -f ${SDCARD}/etc/profile.d/armbian-check-first-*
|
||||||
rm -f ${SDCARD}/etc/netplan/armbian-*
|
rm -f ${SDCARD}/etc/netplan/armbian-*
|
||||||
|
|
||||||
# remove any networkd config leftover from armbian build
|
# remove any networkd config leftover from armbian build
|
||||||
rm -f "${SDCARD}"/etc/systemd/network/*.network || true
|
rm -f "${SDCARD}"/etc/systemd/network/*.network || true
|
||||||
|
|
||||||
# cleanup -- cloud-init makes some Armbian stuff actually get in the way
|
# cleanup -- cloud-init makes some Armbian stuff actually get in the way
|
||||||
[[ -f "${SDCARD}/boot/armbian_first_run.txt.template" ]] && rm -f "${SDCARD}/boot/armbian_first_run.txt.template"
|
[[ -f "${SDCARD}/boot/armbian_first_run.txt.template" ]] && rm -f "${SDCARD}/boot/armbian_first_run.txt.template"
|
||||||
[[ -f "${SDCARD}/root/.not_logged_in_yet" ]] && rm -f "${SDCARD}/root/.not_logged_in_yet"
|
[[ -f "${SDCARD}/root/.not_logged_in_yet" ]] && rm -f "${SDCARD}/root/.not_logged_in_yet"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,4 +4,4 @@ ethernets:
|
|||||||
dhcp4: true
|
dhcp4: true
|
||||||
optional: true
|
optional: true
|
||||||
match:
|
match:
|
||||||
name: "en*,eth*"
|
name: "en*,eth*"
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ ethernets:
|
|||||||
dhcp4: true
|
dhcp4: true
|
||||||
optional: true
|
optional: true
|
||||||
match:
|
match:
|
||||||
name: "en*,eth*"
|
name: "en*,eth*"
|
||||||
|
|
||||||
# Static Ethernet Example
|
# Static Ethernet Example
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user