Received: from forward500b.mail.yandex.net (forward500b.mail.yandex.net [IPv6:2a02:6b8:c02:900:1:45:d181:d500]) by gbr-app-1.alpinelinux.org (Postfix) with ESMTPS id 2A3C4225D4A for <~alpine/users@lists.alpinelinux.org>; Fri, 10 Nov 2023 09:35:17 +0000 (UTC) Received: from mail-nwsmtp-smtp-production-main-39.myt.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-39.myt.yp-c.yandex.net [IPv6:2a02:6b8:c12:581d:0:640:8985:0]) by forward500b.mail.yandex.net (Yandex) with ESMTP id 19F0A61708; Fri, 10 Nov 2023 12:35:13 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-39.myt.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id BZblmR2UliE0-Fk0e4svp; Fri, 10 Nov 2023 12:35:12 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1699608912; bh=ORsJM5sebquxM0KZwwB5hmb3JaBqq0K9OL0384V8nKg=; h=Cc:References:Date:Message-ID:In-Reply-To:From:To:Subject; b=d29qZ+YFwSLu7mJZS3BD0v7Mqi3ZZKD6ycJF1UK0vXYxPGPT6e6uy0VyftUzWGKGj p7Y/1Zg5BqPZ+zUOcvUo/9MN4mw6V5FQye/BxtVkR/gapI4n/Of1atB0B4hmbewFMs NZWcr2p2m++EL7IR/YuLSL4AuazCQZ2g5kf2Q6to= Authentication-Results: mail-nwsmtp-smtp-production-main-39.myt.yp-c.yandex.net; dkim=pass header.i=@yandex.ru Subject: Re: alpine linux v3.18 + pxe (ram live) + cloud-init (tiny-cloud) = install To: Natanael Copa Cc: ~alpine/users@lists.alpinelinux.org References: <882df88f-5d10-9e6f-a3e5-d529d9b99eec@yandex.ru> <20231109165122.1cccacad@ncopa-desktop.lan> From: don Rumata Message-ID: <911b6c73-b7e9-a096-ca29-7d0b55f2f2fd@yandex.ru> Date: Fri, 10 Nov 2023 12:35:11 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20231109165122.1cccacad@ncopa-desktop.lan> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Done: https://gitlab.alpinelinux.org/alpine/mkinitfs/-/issues/49 09.11.2023 18:51, Natanael Copa пишет: > On Thu, 9 Nov 2023 16:34:03 +0300 > don Rumata wrote: > >> Hi! >> >> How can I make it so that cloud-init is executed on pxe boot? Here is my >> 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=...`, > similar to what we do when it finds cidata disk label. > > Thanks! > -nc >> pxe config: >> >> ``` >> label alpine-with-scipt >>     menu label Alpine with my script >>     kernel alpine-installer/boot/vmlinuz-lts >>     initrd alpine-installer/boot/initramfs-lts >>     append modules=loop,squashfs,sd-mod,usb-storage >> modloop=http://10.10.10.10/alpine-installer/boot/modloop-lts >> alpine_repo=alpine_repo=http://dl-cdn.alpinelinux.org/alpine/latest-stable/main >> ssh_key=http://10.10.10.10/soft/authorized_keys ip=dhcp >> apkovl=http://10.10.10.10/cloud-init/tmp/alpine-test-01.tar.gz >> ``` >> >> I added >> ds=nocloud-net;s=http://10.10.10.10/cloud-init/tmp/var/lib/cloud, but >> it didn't work >> >> `alpine-test-01.tar.gz`: >> >> tree structure: >> >> ``` >> . >> *** etc >> *   *** apk >> *   *   *** world >> *   *** cloud >> *   *   *** cloud.cfg >> *   *** init.d >> *   *   *** local.stop >> *   *** network >> *   *   *** interfaces >> *   *** runlevels >> *   *   *** default >> *   *       *** local.stop -> /etc/init.d/local.stop >> *   *** tiny-cloud.conf >> *** var >>     *** lib >>         *** cloud >>             *** user-data >> ``` >> >> `./etc/apk/world`: >> >> ``` >> tiny-cloud >> tiny-cloud-alpine >> tiny-cloud-openrc >> tiny-cloud-nocloud >> tiny-cloud-network >> nano >> htop >> >> # https://gitlab.alpinelinux.org/alpine/cloud/tiny-cloud#requirements >> e2fsprogs-extra >> openssh-server >> partx >> sfdisk >> yx >> ``` >> >> `./etc/init.d/local.stop`: >> >> ``` >> #!/sbin/openrc-run >> >> start () { >> tiny-cloud --enable >> } >> ``` >> >> `./etc/network/interfaces`: >> >> ``` >> iface eth0 inet dhcp >>     udhcpc_opts -O search >> ``` >> >> `./etc/tiny-cloud.conf`: >> >> ``` >> # Tiny Cloud configuration >> # /etc/tiny-cloud.conf >> >> # REQUIRED: The instance's cloud provider >> # valid: aws, azure, gcp, oci, nocloud >> CLOUD=nocloud >> >> TINY_CLOUD_LOGS=/var/log >> ``` >> >> `./var/lib/cloud/user-data`: >> >> ``` >> #cloud-config >> >> cloud_final_modules: >>   - rightscale_userdata >>   - scripts-per-once >>   - scripts-per-boot >>   - scripts-per-instance >>   - scripts-user >>   - keys-to-console >>   - phone-home >>   - final-message >>   - always >> >> packages: >>   install: >>   - mc >> >> #autoinstall: >> # user-data: >> write_files: >>       - path: /etc/22222222222 >>         content: | >>           qweasdzxcqweasdzxc >> runcmd: >>   - touch /etc/runcmd_$(date) >> >> chpasswd: >>   list: | >>      root:myrootpassword >>      cloud-user:mypassword >>   expire: False >> ``` >>