public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH proxmox-backup 0/2] port 2 checks from pve7to8 to pbs2to3
@ 2023-11-29 14:17 Stoiko Ivanov
  2023-11-29 14:17 ` [pbs-devel] [PATCH proxmox-backup 1/2] pbs2to3: add check for dkms modules Stoiko Ivanov
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Stoiko Ivanov @ 2023-11-29 14:17 UTC (permalink / raw)
  To: pbs-devel

tested in a vm by:
* not having dkms installed, installing dkms, installing tp-smapi-dkms
* having an empty /etc/kernel/proxmox-boot-uuids, w/o systemd-boot installed,
  with systemd-boot installed, removing the proxmox-boot-uuids, not having
  grub-efi-amd64 installed, installing it
and running pbs2to3 for all the cases.

Stoiko Ivanov (2):
  pbs2to3: add check for dkms modules
  pbs2to3: check for proper grub meta-package for bootmode

 src/bin/pbs2to3.rs | 66 ++++++++++++++++++++++++++++++++++------------
 1 file changed, 49 insertions(+), 17 deletions(-)

-- 
2.39.2





^ permalink raw reply	[flat|nested] 4+ messages in thread

* [pbs-devel] [PATCH proxmox-backup 1/2] pbs2to3: add check for dkms modules
  2023-11-29 14:17 [pbs-devel] [PATCH proxmox-backup 0/2] port 2 checks from pve7to8 to pbs2to3 Stoiko Ivanov
@ 2023-11-29 14:17 ` Stoiko Ivanov
  2023-11-29 14:17 ` [pbs-devel] [PATCH proxmox-backup 2/2] pbs2to3: check for proper grub meta-package for bootmode Stoiko Ivanov
  2023-11-29 14:26 ` [pbs-devel] applied: [PATCH proxmox-backup 0/2] port 2 checks from pve7to8 to pbs2to3 Thomas Lamprecht
  2 siblings, 0 replies; 4+ messages in thread
From: Stoiko Ivanov @ 2023-11-29 14:17 UTC (permalink / raw)
  To: pbs-devel

ported over from pve-manager: 'pve7to8: Add check for dkms modules'
`0329876ccf1d78b848897718bb0c2337c6a55fbb`

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
---
 src/bin/pbs2to3.rs | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/src/bin/pbs2to3.rs b/src/bin/pbs2to3.rs
index 9a18d7b2..a9b537fd 100644
--- a/src/bin/pbs2to3.rs
+++ b/src/bin/pbs2to3.rs
@@ -263,12 +263,38 @@ impl Checker {
         Ok(())
     }
 
+    fn check_dkms_modules(&mut self) -> Result<(), Error> {
+        let kver = std::process::Command::new("uname")
+            .arg("-r")
+            .output()
+            .map_err(|err| format_err!("failed to retrieve running kernel version - {err}"))?;
+
+        let output = std::process::Command::new("dkms")
+            .arg("status")
+            .arg("-k")
+            .arg(std::str::from_utf8(&kver.stdout)?)
+            .output();
+        match output {
+            Err(_err) => self.output.log_skip("could not get dkms status")?,
+            Ok(ret) => {
+                let num_dkms_modules = std::str::from_utf8(&ret.stdout)?.lines().count();
+                if num_dkms_modules == 0 {
+                    self.output.log_pass("no dkms modules found")?;
+                } else {
+                    self.output.log_warn("dkms modules found, this might cause issues during upgrade.")?;
+                }
+            }
+        }
+        Ok(())
+    }
+
     pub fn check_misc(&mut self) -> Result<(), Error> {
         self.output.print_header("MISCELLANEOUS CHECKS")?;
         self.check_pbs_services()?;
         self.check_time_sync()?;
         self.check_apt_repos()?;
         self.check_bootloader()?;
+        self.check_dkms_modules()?;
         Ok(())
     }
 
-- 
2.39.2





^ permalink raw reply	[flat|nested] 4+ messages in thread

* [pbs-devel] [PATCH proxmox-backup 2/2] pbs2to3: check for proper grub meta-package for bootmode
  2023-11-29 14:17 [pbs-devel] [PATCH proxmox-backup 0/2] port 2 checks from pve7to8 to pbs2to3 Stoiko Ivanov
  2023-11-29 14:17 ` [pbs-devel] [PATCH proxmox-backup 1/2] pbs2to3: add check for dkms modules Stoiko Ivanov
@ 2023-11-29 14:17 ` Stoiko Ivanov
  2023-11-29 14:26 ` [pbs-devel] applied: [PATCH proxmox-backup 0/2] port 2 checks from pve7to8 to pbs2to3 Thomas Lamprecht
  2 siblings, 0 replies; 4+ messages in thread
From: Stoiko Ivanov @ 2023-11-29 14:17 UTC (permalink / raw)
  To: pbs-devel

ported over from pve-manager:
'pve7to8: check for proper grub meta-package for bootmode'
`67c655b9333714f31d5115de80961a2abc4b6506`

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
---
 src/bin/pbs2to3.rs | 40 +++++++++++++++++++++++-----------------
 1 file changed, 23 insertions(+), 17 deletions(-)

diff --git a/src/bin/pbs2to3.rs b/src/bin/pbs2to3.rs
index a9b537fd..177d3b37 100644
--- a/src/bin/pbs2to3.rs
+++ b/src/bin/pbs2to3.rs
@@ -191,34 +191,40 @@ impl Checker {
         self.output
             .log_info("Checking bootloader configuration...")?;
 
-        // PBS packages version check needs to be run before
-        if !self.upgraded {
-            self.output
-                .log_skip("not yet upgraded, no need to check the presence of systemd-boot")?;
-        }
-
-        if !Path::new("/etc/kernel/proxmox-boot-uuids").is_file() {
-            self.output
-                .log_skip("proxmox-boot-tool not used for bootloader configuration")?;
-            return Ok(());
-        }
-
         if !Path::new("/sys/firmware/efi").is_dir() {
             self.output
                 .log_skip("System booted in legacy-mode - no need for systemd-boot")?;
             return Ok(());
         }
 
-        if Path::new("/usr/share/doc/systemd-boot/changelog.Debian.gz").is_file() {
-            self.output.log_pass("systemd-boot is installed")?;
-        } else {
+        if Path::new("/etc/kernel/proxmox-boot-uuids").is_file() {
+            // PBS packages version check needs to be run before
+            if !self.upgraded {
+                self.output
+                    .log_skip("not yet upgraded, no need to check the presence of systemd-boot")?;
+                return Ok(());
+            }
+            if Path::new("/usr/share/doc/systemd-boot/changelog.Debian.gz").is_file() {
+                self.output.log_pass("bootloader packages installed correctly")?;
+                return Ok(());
+            }
             self.output.log_warn(
                 "proxmox-boot-tool is used for bootloader configuration in uefi mode \
-                 but the separate systemd-boot package, existing in Debian Bookworm \
-                 is not installed.\n\
+                 but the separate systemd-boot package, is not installed.\n\
                  initializing new ESPs will not work unitl the package is installed.",
             )?;
+            return Ok(());
+        } else if !Path::new("/usr/share/doc/grub-efi-amd64/changelog.Debian.gz").is_file() {
+            self.output.log_warn(
+            "System booted in uefi mode but grub-efi-amd64 meta-package not installed, \
+             new grub versions will not be installed to /boot/efi!
+             Install grub-efi-amd64."
+            )?;
+            return Ok(());
+        } else {
+            self.output.log_pass("bootloader packages installed correctly")?;
         }
+
         Ok(())
     }
 
-- 
2.39.2





^ permalink raw reply	[flat|nested] 4+ messages in thread

* [pbs-devel] applied: [PATCH proxmox-backup 0/2] port 2 checks from pve7to8 to pbs2to3
  2023-11-29 14:17 [pbs-devel] [PATCH proxmox-backup 0/2] port 2 checks from pve7to8 to pbs2to3 Stoiko Ivanov
  2023-11-29 14:17 ` [pbs-devel] [PATCH proxmox-backup 1/2] pbs2to3: add check for dkms modules Stoiko Ivanov
  2023-11-29 14:17 ` [pbs-devel] [PATCH proxmox-backup 2/2] pbs2to3: check for proper grub meta-package for bootmode Stoiko Ivanov
@ 2023-11-29 14:26 ` Thomas Lamprecht
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Lamprecht @ 2023-11-29 14:26 UTC (permalink / raw)
  To: Proxmox Backup Server development discussion, Stoiko Ivanov

Am 29/11/2023 um 15:17 schrieb Stoiko Ivanov:
> tested in a vm by:
> * not having dkms installed, installing dkms, installing tp-smapi-dkms
> * having an empty /etc/kernel/proxmox-boot-uuids, w/o systemd-boot installed,
>   with systemd-boot installed, removing the proxmox-boot-uuids, not having
>   grub-efi-amd64 installed, installing it
> and running pbs2to3 for all the cases.
> 
> Stoiko Ivanov (2):
>   pbs2to3: add check for dkms modules
>   pbs2to3: check for proper grub meta-package for bootmode
> 
>  src/bin/pbs2to3.rs | 66 ++++++++++++++++++++++++++++++++++------------
>  1 file changed, 49 insertions(+), 17 deletions(-)
> 


applied to stable-2 and master, thanks!




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-11-29 14:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-29 14:17 [pbs-devel] [PATCH proxmox-backup 0/2] port 2 checks from pve7to8 to pbs2to3 Stoiko Ivanov
2023-11-29 14:17 ` [pbs-devel] [PATCH proxmox-backup 1/2] pbs2to3: add check for dkms modules Stoiko Ivanov
2023-11-29 14:17 ` [pbs-devel] [PATCH proxmox-backup 2/2] pbs2to3: check for proper grub meta-package for bootmode Stoiko Ivanov
2023-11-29 14:26 ` [pbs-devel] applied: [PATCH proxmox-backup 0/2] port 2 checks from pve7to8 to pbs2to3 Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal