diff --git a/tools-image/Dockerfile b/tools-image/Dockerfile index ef49db8..224abde 100644 --- a/tools-image/Dockerfile +++ b/tools-image/Dockerfile @@ -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" ] diff --git a/tools-image/build-arm-image.sh b/tools-image/build-arm-image.sh index a0934f8..863188c 100755 --- a/tools-image/build-arm-image.sh +++ b/tools-image/build-arm-image.sh @@ -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 diff --git a/tools-image/defaults.yaml b/tools-image/defaults.yaml new file mode 100644 index 0000000..fea0118 --- /dev/null +++ b/tools-image/defaults.yaml @@ -0,0 +1,8 @@ + +name: "Default user" +stages: + initramfs: + - name: "Set default user/pass" + users: + kairos: + passwd: "kairos" \ No newline at end of file