Create cloud-config dir when preparing ARM, add default config

This commit is contained in:
Ettore Di Giacinto
2022-10-26 11:37:13 +00:00
parent a2e9c158be
commit 5c9e0a35e4
3 changed files with 19 additions and 4 deletions

View File

@@ -71,5 +71,7 @@ COPY ./add-cloud-init.sh /add-cloud-init.sh
COPY ./build-arm-image.sh /build-arm-image.sh
COPY ./arm /arm
COPY defaults.yaml /defaults.yaml
ENTRYPOINT [ "/entrypoint.sh" ]

View File

@@ -374,15 +374,20 @@ mount $recovery $WORKDIR/recovery
mount $state $WORKDIR/state
mount $efi $WORKDIR/efi
mkdir $WORKDIR/persistent
mount $persistent $WORKDIR/persistent
mkdir -p $WORKDIR/persistent/cloud-config
cp -rfv /defaults.yaml $WORKDIR/persistent/cloud-config/01_defaults.yaml
grub2-editenv $WORKDIR/state/grub_oem_env set "display_name=Kairos"
# Set a OEM config file if specified
if [ -n "$config" ]; then
echo ">> Copying $config OEM config file"
mkdir $WORKDIR/persistent
mount $persistent $WORKDIR/persistent
mkdir $WORKDIR/persistent/cloud-config
get_url $config $WORKDIR/persistent/cloud-config/99_custom.yaml
umount $WORKDIR/persistent
fi
umount $WORKDIR/persistent
# Copy over content
cp -arf $EFI/* $WORKDIR/efi

View File

@@ -0,0 +1,8 @@
name: "Default user"
stages:
initramfs:
- name: "Set default user/pass"
users:
kairos:
passwd: "kairos"