[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#868859: iso-scan: should also scan LVM logical volumes



Source: iso-scan
Version: 1.57
Severity: normal
Tags: patch
User: devel@kali.org
Usertags: origin-kali kali-patch
Control: block -1 by 868848 868852

With this patch, I ensure that we activate LVM logical volumes so that
they are visible by "list-devices" and so that they can be scanned too.

That way we are also able to identify ISO images stored within LVM
logical volumes.
    
Obviously this has implications on the rest of the installation process.
The logical volume will be in use and the partitioning step will have
to preserve the logical volume and its parent volume group.
    
But partman is perfectly able to cope with the logical volumes being
already activated so it should be fine to do this here.
    
For this patch to work, we need some changes in:
- debian-installer-utils: https://bugs.debian.org/868848
- debian-installer hd-media image: https://bugs.debian.org/868852

Please find my suggested (and tested) patch attached.

-- System Information:
Debian Release: buster/sid
  APT prefers oldoldstable
  APT policy: (500, 'oldoldstable'), (500, 'unstable'), (500, 'stable'), (500, 'oldstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.9.0-3-amd64 (SMP w/4 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), LANGUAGE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

-- 
Raphaël Hertzog ◈ Debian Developer

Support Debian LTS: https://www.freexian.com/services/debian-lts.html
Learn to master Debian: https://debian-handbook.info/get/
>From d4914795492c2a4b85bbe1e3a8a7de7f9aa571a1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rapha=C3=ABl=20Hertzog?= <hertzog@debian.org>
Date: Tue, 18 Jul 2017 16:59:32 +0200
Subject: [PATCH] Detect and scan LVM logical volumes too

That way we are also able to identify ISO images stored within LVM
logical volumes.

Obviously this has implications on the rest of the installation process.
The logical volume will be in use and the partitioning step will have
to preserve the logical volume and its parent volume group.

But partman is perfectly able to cope with the logical volumes being
already activated so it should be fine to do this here.

For this patch to work, we need some changes in:
- debian-installer-utils: https://bugs.debian.org/868848
- debian-installer hd-media image: https://bugs.debian.org/868852
---
 debian/changelog         | 7 +++++++
 debian/iso-scan.postinst | 6 ++++++
 2 files changed, 13 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 4345d57..6abd1db 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+iso-scan (1.58) UNRELEASED; urgency=medium
+
+  * Detect LVM logical volumes so that they can be used to find the ISO image
+    that we are looking for.
+
+ -- Raphaël Hertzog <hertzog@debian.org>  Tue, 18 Jul 2017 16:58:13 +0200
+
 iso-scan (1.57) unstable; urgency=medium
 
   [ Updated translations ]
diff --git a/debian/iso-scan.postinst b/debian/iso-scan.postinst
index a21ed85..e34f329 100755
--- a/debian/iso-scan.postinst
+++ b/debian/iso-scan.postinst
@@ -271,6 +271,12 @@ while :; do
 		done
 		modprobe loop >/dev/null || true
 
+		# Detect LVM logical volumes if possible
+		modprobe dm_mod >/dev/null || true
+		if type vgchange >/dev/null; then
+			vgchange -a y >/dev/null || true
+		fi
+
 		mkdir /cdrom 2>/dev/null || true
 		mkdir /hd-media 2>/dev/null || true
 
-- 
2.13.3


Reply to: