use JSON qw(from_json to_json);
use Proxmox::Log;
+use Proxmox::Sys::File qw(file_read_firstline);
my sub fromjs : prototype($) {
return from_json($_[0], { utf8 => 1 });
my sub query_blockdevs : prototype() {
my $disks = {};
+ # FIXME: not the same as the battle proven way we used in the installer for years!
my $lsblk = fromjs(qx/lsblk -e 230 --bytes --json/);
for my $disk ($lsblk->{blockdevices}->@*) {
my ($name, $ro, $size, $type, $mountpoints) = $disk->@{qw(name ro size type mountpoints)};
my $ifs = {};
my $default;
+ # FIXME: not the same as the battle proven way we used in the installer for years?
my $interfaces = fromjs(qx/ip --json address show/);
for my $if (@$interfaces) {
dns => query_dns(),
};
+ $output->{kernel_cmdline} = file_read_firstline("/proc/cmdline");
$output->{total_memory} = query_total_memory();
$output->{boot_type} = -d '/sys/firmware/efi' ? 'efi' : 'bios';