Received: from ncopa-desktop.lan (ti0056a400-0541.bb.online.no [85.166.229.33]) (Authenticated sender: ncopa@alpinelinux.org) by gbr-app-1.alpinelinux.org (Postfix) with ESMTPSA id B7F9B225A30; Thu, 9 Nov 2023 15:51:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alpinelinux.org; s=smtp; t=1699545090; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QuBuQWtTNrRt0DgEBhumyQ8c2VGiVpsESSuCTStIJyg=; b=LQ9Pi//zaFXjE8TTq8IO02Khb3aqU4TSnlz0uB+3xAbt/FX8pv0XXovskr8vI4nULCoZKI BWMJACt+o5jwLHQ0+NzzpisSRMvpaNV6tkXDSofrWxUpCG908EjRiZkpoMJ0gQkgR5+UTf 1xnND2lA5t0lmLC9RjYpAvE/hTIKuXQ= Date: Thu, 9 Nov 2023 16:51:22 +0100 From: Natanael Copa To: don Rumata Cc: ~alpine/users@lists.alpinelinux.org Subject: Re: alpine linux v3.18 + pxe (ram live) + cloud-init (tiny-cloud) = install Message-ID: <20231109165122.1cccacad@ncopa-desktop.lan> In-Reply-To: <882df88f-5d10-9e6f-a3e5-d529d9b99eec@yandex.ru> References: <882df88f-5d10-9e6f-a3e5-d529d9b99eec@yandex.ru> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-alpine-linux-musl) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Thu, 9 Nov 2023 16:34:03 +0300 don Rumata wrote: > Hi! >=20 > How can I make it so that cloud-init is executed on pxe boot? Here is my= =20 > file structure and settings: FYI, there are cloud-init and tiny-cloud. It looks like you are trying to use tiny-cloud. doing that from pxe boot is currently not supported, but should be relatively easy to fix. Could you please add an issue to https://gitlab.alpinelinux.org/alpine/mkinitfs/-/issues I think we can make this work without needing any apkovl, we simply need to make the initramfs enable tiny-cloud when it finds `ds=3D...`, similar to what we do when it finds cidata disk label. Thanks! -nc >=20 > pxe config: >=20 > ``` > label alpine-with-scipt > =A0=A0=A0 menu label Alpine with my script > =A0=A0=A0 kernel alpine-installer/boot/vmlinuz-lts > =A0=A0=A0 initrd alpine-installer/boot/initramfs-lts > =A0=A0=A0 append modules=3Dloop,squashfs,sd-mod,usb-storage=20 > modloop=3Dhttp://10.10.10.10/alpine-installer/boot/modloop-lts=20 > alpine_repo=3Dalpine_repo=3Dhttp://dl-cdn.alpinelinux.org/alpine/latest-s= table/main=20 > ssh_key=3Dhttp://10.10.10.10/soft/authorized_keys ip=3Ddhcp=20 > apkovl=3Dhttp://10.10.10.10/cloud-init/tmp/alpine-test-01.tar.gz > ``` >=20 > I added=20 > ds=3Dnocloud-net;s=3Dhttp://10.10.10.10/cloud-init/tmp/var/lib/cloud, but > it didn't work >=20 > `alpine-test-01.tar.gz`: >=20 > tree structure: >=20 > ``` > . > *** etc > *=A0=A0 *** apk > *=A0=A0 *=A0=A0 *** world > *=A0=A0 *** cloud > *=A0=A0 *=A0=A0 *** cloud.cfg > *=A0=A0 *** init.d > *=A0=A0 *=A0=A0 *** local.stop > *=A0=A0 *** network > *=A0=A0 *=A0=A0 *** interfaces > *=A0=A0 *** runlevels > *=A0=A0 *=A0=A0 *** default > *=A0=A0 *=A0=A0=A0=A0=A0=A0 *** local.stop -> /etc/init.d/local.stop > *=A0=A0 *** tiny-cloud.conf > *** var > =A0=A0=A0 *** lib > =A0=A0=A0=A0=A0=A0=A0 *** cloud > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 *** user-data > ``` >=20 > `./etc/apk/world`: >=20 > ``` > tiny-cloud > tiny-cloud-alpine > tiny-cloud-openrc > tiny-cloud-nocloud > tiny-cloud-network > nano > htop >=20 > # https://gitlab.alpinelinux.org/alpine/cloud/tiny-cloud#requirements > e2fsprogs-extra > openssh-server > partx > sfdisk > yx > ``` >=20 > `./etc/init.d/local.stop`: >=20 > ``` > #!/sbin/openrc-run >=20 > start () { > tiny-cloud --enable > } > ``` >=20 > `./etc/network/interfaces`: >=20 > ``` > iface eth0 inet dhcp > =A0=A0=A0 udhcpc_opts -O search > ``` >=20 > `./etc/tiny-cloud.conf`: >=20 > ``` > # Tiny Cloud configuration > # /etc/tiny-cloud.conf >=20 > # REQUIRED: The instance's cloud provider > # valid: aws, azure, gcp, oci, nocloud > CLOUD=3Dnocloud >=20 > TINY_CLOUD_LOGS=3D/var/log > ``` >=20 > `./var/lib/cloud/user-data`: >=20 > ``` > #cloud-config >=20 > cloud_final_modules: > =A0 - rightscale_userdata > =A0 - scripts-per-once > =A0 - scripts-per-boot > =A0 - scripts-per-instance > =A0 - scripts-user > =A0 - keys-to-console > =A0 - phone-home > =A0 - final-message > =A0 - always >=20 > packages: > =A0 install: > =A0 - mc >=20 > #autoinstall: > # user-data: > write_files: > =A0=A0=A0=A0=A0 - path: /etc/22222222222 > =A0=A0=A0=A0=A0=A0=A0 content: | > =A0=A0=A0=A0=A0=A0=A0=A0=A0 qweasdzxcqweasdzxc > runcmd: > =A0 - touch /etc/runcmd_$(date) >=20 > chpasswd: > =A0 list: | > =A0=A0=A0=A0 root:myrootpassword > =A0=A0=A0=A0 cloud-user:mypassword > =A0 expire: False > ``` >=20