:: Re: [DNG] Automate devuan install o…
Góra strony
Delete this message
Reply to this message
Autor: wirelessduck
Data:  
Dla: B Stack
CC: Dng
Temat: Re: [DNG] Automate devuan install on VMware vsphere
On Thu, 20 Jul 2023 at 21:50, B Stack <bgstack15@???> wrote:
>
> Hello Tom,
>
> First things first: I've noticed that the netinstalls get out of date
> rather quickly. I think just the package list or other components of
> the installation are updated/removed on the network hosted side. You
> should download the latest netinstall iso and see if that helps.
>
> And now to the virt-install issues: I know at one point the Devuan
> isos used different filenames for the linux and initrd.gz files. You
> might have to inspect whichever iso file you are about to use, and
> modify your urlfetcher.py to use the discovered filenames. The
> --os-variant parameter does not seem to help the parsing of the
> .disk/info file. I described my changes to the urlfetcher.py in the
> aforementioned blog post from March 2020.
>
> I tend to write at least yearly about the current preseed values I
> use, but I can see I've not written since May 2021. I should correct
> this!
>
> B.


Thanks for the tips. I finally got it mostly working.

The changes for `virtinst` package now require a change to
`/usr/share/virt-manager/virtinst/install/urldetect.py`.

/usr/share/virt-manager/virtinst/install# diff urldetect.py
~/urldetect-original.py
786a787,807
> class _DevuanDistro(_DebianDistro):
>     PRETTY_NAME = "Devuan"
>     matching_distros = ["devuan"]
>     _debname = "devuan"

>
>     def _set_installcd_paths(self):
>         if self.arch == "x86_64":
>             kpair = ("boot/isolinux/linux", "boot/isolinux/initrd.gz")
>         elif self.arch == "i686":
>             kpair = ("install.386/vmlinuz", "install.386/initrd.gz")
>         elif self.arch == "aarch64":
>             kpair = ("install.a64/vmlinuz", "install.a64/initrd.gz")
>         elif self.arch == "ppc64le":
>             kpair = ("install/vmlinux", "install/initrd.gz")
>         elif self.arch == "s390x":
>             kpair = ("boot/linux_vm", "boot/root.bin")
>         else:
>             kpair = ("install/vmlinuz", "install/initrd.gz")
>         self._kernel_paths += [kpair]
>         return True

>

865a887
>         _DevuanDistro,


I copied the _set_installcd_paths method from the _DebianDistro method
and modified it to match Devuan. I only use amd64 here so I didn't
change any of the other arch file paths.

I used the documentation at
https://www.debian.org/releases/stable/amd64/apb.en.html to work out
most of the config values. I used the example preseed file linked
from the debian docs at
https://www.debian.org/releases/bookworm/example-preseed.txt.

All of the required values are present in that example file, except
for the init selection "d-i choose-init/select_init select sysvinit"
which is needed between clock setup and partitioning sections. That
is still the same as what appears in your blog posts, but I used the
instructions at
https://www.debian.org/releases/stable/amd64/apbs03.en.html to get
current values from /var/lib/cdebconf/questions.dat during the
install.

Running with this console command:
vm=testhost ; time sudo virt-install --name="${vm}" --memory=2048
--vcpus=1 --os-variant debiantesting --hvm --disk size=20
--location=/home/devuan/Downloads/devuan_chimaera_4.0.0_amd64_netinstall.iso
--initrd-inject=/home/devuan/preseed/preseed.cfg --extra-args
"hostname=${vm} interface=auto" --debug --network
type=bridge,source=virbr0 --noautoconsole

The only missing step is working out how to make the system reboot
instead of poweroff after the install has finished. I can't find any
preseed config that might do that.

Tom