Thomas Lamprecht [Tue, 25 May 2021 12:34:34 +0000 (14:34 +0200)]
restructure html in repo and installed package
placing the common stuff top-level and the per-product stuff one
directory-level down allows to access all used resources (css,
images) from a common base path without hacking to much around.
Per-product files are always preferred.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
proxmox-boot-tool now supports configuring grub to boot from the ESPs
the installer creates on all (bootable) disks - use this approach
for zfs installs.
Thomas Lamprecht [Thu, 22 Apr 2021 15:13:44 +0000 (17:13 +0200)]
zfs: assume that all devices are boot devices
the argument "but if someting in raid0 fails all is dead" is true but
misses the point completely, namely:
* firmware is weird and sometimes allows booting only from certain
devices, which we cannot know here
* potentially only the boot partition could be corrupted/broken/...
in which case another dev in the raid 0 could allow successful
booting
In short, we can only win if we use all devices as boot devices, the
512 MiB lost in some devices are negligible, and they resulted in an
uneven storage space distribution.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Fri, 26 Mar 2021 14:43:56 +0000 (15:43 +0100)]
fix #3165: start chrony after DHCP client for an opportunistic time-sync
We had reports about problems stemming from skewed clocks during
installation, especially if their time was in the future during
installation and on first real boot got synced up, certs may not be
valid yet, RRD may has written data before that correcting time-sync
went through and errors afterwards, once time jumped back, and lots
of other issues.
So, depend on the modern and nifty, but still small, NTP
implementation `chrony`. Start its daemon just after we asked for a
DHCP lease, as then it can directly try to sync with one of the
(Debian namespaced) NTP pools time server.
In the worst case (no network, no server available) we are as good as
now, but if chrony can sync the time we avoid lots of issues and
breakages
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Dylan Whyte [Fri, 11 Dec 2020 07:55:52 +0000 (08:55 +0100)]
installer: minor language fixup
just some nitpicky changes.
v2:
- remove tag files
@Thomas: Like you thought, they are autogenerated by some vim plugin.
They usually sit quitely in the untracked files, but this time, I guess
I somehow I managed to add them in without noticing.. Apologies!
Stoiko Ivanov [Tue, 10 Nov 2020 14:15:30 +0000 (15:15 +0100)]
set the keymap on the installer console
this patch partially reverts 8bc528041ba85e1b9bd4c17638a2302088bc19ce
by writing /etc/default/keyboard and running `setupcon` in the background
the delay should not harm the UX in the installer
Stoiko Ivanov [Tue, 10 Nov 2020 14:15:29 +0000 (15:15 +0100)]
add run_in_background
certain tasks done during the installer need not block the GUI (e.g. setting
the keymap of the console, to have the correct one set in the shell on vt3)
and take a longer time.
This patch adds a simple run_in_background method, which forks and runs the
provided code in the child. Before exiting the children get reaped.
Stoiko Ivanov [Tue, 10 Nov 2020 14:15:28 +0000 (15:15 +0100)]
memorize keyboard layout selection
currently when using the previous/next buttons the keyboard layout gets
defined based on the detected/selected country, even if it was set to a
different value explicitly.
This patch changes the behaviour to only update the layout and set it in
the installer if it got actively changed, or if a different country was
selected
Oguz Bektas [Mon, 9 Nov 2020 15:17:30 +0000 (16:17 +0100)]
don't configure vt keyboard during installation
in create_country_view() when setting the keyboard config
setupcon is too slow, causing installer to hang for some
seconds when switching to/from country view.
setxkbmap is enough during the installation (next step
password & email works fine with different keymaps), vt
is largely unused during it anyway.
fix #3093: allow to automatically reboot on installation success
Only auto reboot if no error happened.
default to on, as this is normally wanted behavior - the success
screem does not allow to do anything else anyway, and the IP address
gets then also showed as issue banner after that reboot.
show some countdown (it's set to 5 seconds, but due some internal
delay it more like 3s)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Having a shell waiting on vt3, it improves user experience if it has the
same keyboard map as the X11 installer.
This is accomplished by setting the contents of '/etc/default/keyboard' and
then running `setupcon`. Simply calling `loadkeys` would not work, since the
keymaps in debian are generated from the x11 definitions by ckbcomp and then
saved in '/etc/console-setup/'.
currently the installer prepares the ESP disks for ZFS, irrespective of the
boot-mode (EFI, legacy) - in order to enable users to change the boot-mode
in the BIOS and keep the system bootable.
This patch updates /etc/kernel/cmdline in both boot-modes, which is necessary
to make the system actually bootable (else the systemd-boot config uses
the cmdline from the installer).
we now can create a datastore on new disk(s) over api/ui so a
default datastore on the root mountpoint makes no sense anymore.
partially reverts commit ca74501dce14088005bd4a998bfe2d25ca5881f6
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Fri, 24 Apr 2020 13:17:26 +0000 (15:17 +0200)]
unconfigured: make agetty listen on tty9
it's a bit brittle and login is weird (enter root user twice, pw
doesn't matters) and once exited it's gone, but it's just for
"emergency debugging" anyway
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Aaron Lauterer [Mon, 24 Feb 2020 08:37:23 +0000 (09:37 +0100)]
fix behavior if zfs disks have no by-id path
in some situations it is possible, that a disk does not have a
/dev/disk/by-id path. Reported cases are KVM with virtio-blk [0] and
with VMware player / workstation when using the paravirtual SCSI disk
types [1]. It can be reproduced in Proxmox VE by using virtio-blk disks
for the VM.
> The issue at hand happens because udev does not create the
> /dev/disk/by-id symlink in
> '/lib/udev/rules.d/60-persistent-storage.rules', since it does
> not have a serial-number for the device (which in the virtio-blk case
> is in turn maybe caused by qemu-server not adding one to the
> commandline).
Quoted from [2]
This regression was introduced with commit e1b490865f750e08f6c9c6b7e162e7def9dcc411 which always replaced the disks
in the $vdev variable even if the result of the by-id lookup was
`undef`. Thus the paths did not point to any valid disk and the zpool
creation failed.
This patch replaces the disk paths with by-id paths only if they are
present.
`policy-rc.d` invocation is still used by deb-systemd-invoke (1p), despite
it's by now unfitting name.
The policy-rc.d script the installer placed into the chroot prevents the
starting of services by (debianized) maintainer-scripts [0].
This should reduce installation time on one hand, and on the other hand does
mask errors in maintainer-scripts, which error out if no systemd is running
(e.g. inside the chroot)
Noticed the problem, when testing an unrelated patch and running into
an aborted installtion, due to a, already fixed, glitch (missing '||true')
in pve-lxc's postinst script.
[0] https://people.debian.org/~hmh/invokerc.d-policyrc.d-specification.txt
(did not find anything more current, contradicting the information there)
Packages which we have under control have to ensure themself that the
correct permissions are set, else the "install on top of Debian" also
fails. It just crowd proxinstall unecessarily, so avoid to add new
ones if possible. This specific one is handled in the respective
package since quite a bit.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Stoiko Ivanov [Fri, 29 Nov 2019 10:53:44 +0000 (11:53 +0100)]
umount testdir recursively in check-* and clean
recursively unmount testdir before removing it. This prevents the subsequent
call to try to remove files in potentially still bindmounted /proc, /sys, /dev
filesystems.
Dominik Csapak [Thu, 28 Nov 2019 12:39:56 +0000 (13:39 +0100)]
restrict admin email to same format as the JSONSchema
Use the same regex as the 'email' format in JSONSchema (copied from there).
Otherwise, users can enter an email address which does not match our
schema and breaks the userlist API Call with a 'return value
verification failed', and one cannot rectify this via the gui
(the user has to manually edit the user.cfg or set the email via
pveum)
i noticed this while testing and using the 'insert emoji' menu in the
context menu
Stoiko Ivanov [Wed, 27 Nov 2019 16:06:59 +0000 (17:06 +0100)]
use by-id paths for all vdevs on pool creation
currently only the first vdev of a ZFS rpool gets created with the stable
/dev/by-id paths, all later vdevs (in a RAID0 or RAID10 setup) are left as
sdX.
By iterating over all disks in the pool and replacing their occurence with
their by-id path we get consistent and recommended names for all vdevs.
Stoiko Ivanov [Wed, 27 Nov 2019 16:06:58 +0000 (17:06 +0100)]
wipe partitiontable after early exits
by wiping the partition table after the initial sanity checks regarding
minimal size and blocksize of the device, no data is destroyed for an
install that would fail in any case.
Stoiko Ivanov [Wed, 27 Nov 2019 16:06:57 +0000 (17:06 +0100)]
fix #1211: allow install on 4kn disks
Installation on disks with 4k logical blocksize (4kn) failed, because
the bios_boot (a.k.a. gdisk partitiontype EF02, place for grub in
legacy BIOS boot mode) partition is created using start and end
sectors (and sector 2047 is not at 1M, where the ESP starts)
This patch addresses the issue by not creating the bios_boot
partition on 4kn disks at all - legacy boot from 4kn disks is not
supported by most BIOS implementations and grub does not support it
[0].
Checks for 4kn disks, when booted in legacy mode are added, and
prevent from leaving the harddisk selection page, if an not bootable
selection was made.
The partition numbering was kept (esp is partition 2, data is
partition 3, for consistency with other installations)
If any of the bootable disks is 4kn then the installation of the grub
legacy installation is skipped altogether.
Additionally the invocation of mkfs.vfat needs to add the parameter
'-s1' to create a bootable ESP on 4kn disks.
For a 512M vfat partition on a 512n or 512e disk, mkfs.vfat
calculates a default value of 8 sectors per cluster. For a 512M
partition on a 4kn disk, we need to scale this by 512/4096=8 and
explicitly set '-s' to 1 accordingly, since the calculation in
mkfs.vfat is brokenly assuming 512b sectors[1].
Tested with a qemu-machine by passing
'logical_block_size=4096,physical_block_size=4096' to the disk's device lines
and installing in UEFI and legacy booted mode:
* ZFS RAIDZ1
* ZFS single-disk
* ZFS RAID10 (in legacy mode grub fails to install, if any 4kn disk is in the
pool, even if it's not in the first vdev)
* EXT4
Stoiko Ivanov [Wed, 23 Oct 2019 16:10:26 +0000 (18:10 +0200)]
raise postifx main.cf compatibility_level to 2
otherwise a warning was issued (when missing /etc/aliases.db) that the system
is using the backward compatible setting of $mydestination for $relay_domain
(see [0]).
by collecting them, but proceeding with the rest of the installation. it
is possible that only either legacy or EFI boot fails, and even if both
do, manually fixing the bootloader setup by booting a live CD is very
often possible.
still display the error screen at the end if bootloader setup was not
successful, so that expectations are not set too high..
prompt user if a vgrename is OK for exisiting 'pve'/'pmg' VGs
If one has a 'pve' VG on a disks not selected as install target
(e.g., on re-installation to different disk or if putting a used disk
into another server where PVE was installed on) the vgcreate call
errored out, as for creation the VG names must be unique.
Cope with that by asking the users if a rename to a
'<vgname>-OLD-<short-uid>' name is OK in this case. It ensures that
no data is lost and that we can safely continue with the
installation. The admin can then later on wipe the renamed VG if it
was really decommissioned or save data from it (or actually use it)
This can cope (tested) with:
* a single 'pve' VG on another device
* a single 'pve' VG spanning multiple devices
* multiple 'pve' VGs spanning different sets of devices
This is achieved by using the VG UUID for rename, and by recording
all PVs with said UUID as index.
Note, while this commit message talks mostly about 'pve' VG the patch
itself is actually agnostic of the specific name, works for 'pmg' and
possible (future) other VG names too.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
/etc/hostid is used by ZFS (spl.ko) to determine which host last imported a
pool creating and importing a pool with one hostid during install and booting
with a different one (or none) leads to the system refusing to import the pool
see spl-module-parameters(5) and zpool(8).
by copying the /etc/hostid from the installer into the target system we ensure
that it stays consistent
mount efivarfs to ensure we can read bigger variables
In short, EFI variables can get quite big, and the old sysfs
interface was made for when they couldn't. A few firmwares out there
have such big variables, and if those are accessed through the sysfs
backed interface one gets a "Input/Output Error". 'grub-install'
chokes on that error when it iterates over all variables to do it's
stuff, and thus fails our installation. When we mount the efivarfs,
which does not has this limitations, one can read all variables just
fine - at least as long as the NVRAM backing them is not broken.
from Linux Kernel Documentation/filesystems/efivarfs.txt:
> The efivarfs filesystem was created to address the shortcomings of
> using entries in sysfs to maintain EFI variables. The old sysfs EFI
> variables code only supported variables of up to 1024 bytes. This
> limitation existed in version 0.99 of the EFI specification, but was
> removed before any full releases. Since variables can now be larger
> than a single page, sysfs isn't the best interface for this.
> Variables can be created, deleted and modified with the efivarfs
> filesystem.
Also mount it in the installer environment for debugging purpose.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
underline that we detected less than 1024 MB of *useable* memory
firmwar, kernel, and some PCI(e) devices can use some memory, which
then is not available for userspace, thus the total memory installed
for this server normally differs at least about 50 MB from the
useable one.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This ensures that when booting from a USB stick, or similar device,
we do not show that device in the "Target Harddisk" selector.
While there may be some constructed cases where this actually worked
and was wanted, e.g., one created a partition on the end of a USB
storage device, put the ISO on that and used the beginning of that
device as target, I'd say that even if that worked with luck, it's
better not actively not support it.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>