Debian Bug report logs - #700920
improving live-media= to immediately detect medium

Package: live-boot; Maintainer for live-boot is Live Systems Maintainers <debian-live@lists.debian.org>; Source for live-boot is src:live-boot.

Reported by: Gaudenz Steinlin <gaudenz@debian.org>

Date: Tue, 19 Feb 2013 10:24:01 UTC

Severity: wishlist

Done: Daniel Baumann <daniel.baumann@progress-technologies.net>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, ronny.standtke@fhnw.ch, Debian Live Project <debian-live@lists.debian.org>:
Bug#700920; Package live-boot. (Tue, 19 Feb 2013 10:24:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Gaudenz Steinlin <gaudenz@debian.org>:
New Bug report received and forwarded. Copy sent to ronny.standtke@fhnw.ch, Debian Live Project <debian-live@lists.debian.org>. (Tue, 19 Feb 2013 10:24:04 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Gaudenz Steinlin <gaudenz@debian.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: Immediately detect medium from live-media parameter
Date: Tue, 19 Feb 2013 11:19:30 +0100
[Message part 1 (text/plain, inline)]
Package: live-boot
Severity: wishlist
Tags: patch

If a preferred medium (device or medium type) is given with the
live-media parameter then waiting for the timeout to expire before
scaning for these devices is not necessary. Just pick the device as soon
as it appears. If a criterium would match several devices the outcome is
undefined anyway. So choosing the first one is good enough.

If no removable or removable-usb device is found after the timeout
expires, just boot any live medium available instead of panicing.

The second change makes it possible to have a non-wirteable (ISO)
live-image with the default boot parameter set to
live-media=removable-usb for machines that can't boot directly from USB
devices. If a live medium on an USB device is present it'll be
preferred, but the ISO will also boot without an USB device.

The attached patch implements a solution to both of these issues.

Gaudenz

-- System Information:
Debian Release: 7.0
  APT prefers testing
  APT policy: (800, 'testing'), (700, 'unstable'), (50, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.2.0-4-amd64 (SMP w/2 CPU cores)
Locale: LANG=de_CH.UTF-8, LC_CTYPE=de_CH.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
[0001-Immediately-detect-medium-from-live-media-parameter.patch (text/x-diff, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Live Project <debian-live@lists.debian.org>:
Bug#700920; Package live-boot. (Tue, 19 Feb 2013 10:30:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to daniel.baumann@progress-technologies.net:
Extra info received and forwarded to list. Copy sent to Debian Live Project <debian-live@lists.debian.org>. (Tue, 19 Feb 2013 10:30:03 GMT) Full text and rfc822 format available.

Message #10 received at 700920@bugs.debian.org (full text, mbox):

From: Daniel Baumann <daniel.baumann@progress-technologies.net>
To: Gaudenz Steinlin <gaudenz@debian.org>
Cc: 700920@bugs.debian.org
Subject: Re: Bug#700920: Immediately detect medium from live-media parameter
Date: Tue, 19 Feb 2013 11:27:29 +0100
On 02/19/2013 11:19 AM, Gaudenz Steinlin wrote:
> The attached patch implements a solution to both of these issues.

can you split it in two patches please?

-- 
Address:        Daniel Baumann, Donnerbuehlweg 3, CH-3012 Bern
Email:          daniel.baumann@progress-technologies.net
Internet:       http://people.progress-technologies.net/~daniel.baumann/



Information forwarded to debian-bugs-dist@lists.debian.org, Debian Live Project <debian-live@lists.debian.org>:
Bug#700920; Package live-boot. (Tue, 19 Feb 2013 11:09:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to intrigeri <intrigeri+debian-live@boum.org>:
Extra info received and forwarded to list. Copy sent to Debian Live Project <debian-live@lists.debian.org>. (Tue, 19 Feb 2013 11:09:03 GMT) Full text and rfc822 format available.

Message #15 received at submit@bugs.debian.org (full text, mbox):

From: intrigeri <intrigeri+debian-live@boum.org>
To: Gaudenz Steinlin <gaudenz@debian.org>
Cc: 700920@bugs.debian.org, Debian Bug Tracking System <submit@bugs.debian.org>
Subject: Re: Bug#700920: Immediately detect medium from live-media parameter
Date: Tue, 19 Feb 2013 12:07:17 +0100
Hi,

Gaudenz Steinlin wrote (19 Feb 2013 10:19:30 GMT) :
> If no removable or removable-usb device is found after the timeout
> expires, just boot any live medium available instead of panicing.

In Tails [1], we rely on live-media=removable to avoid trusting the
content of internal drives. So it's critical for us to have live-boot
*always* obey live-media=removable.

I've not looked at the details of the proposed patches, so I may be
totally wrong about what the exact proposed behaviour would change for
us, though.

[1] https://tails.boum.org/

Cheers,
-- 
  intrigeri
  | GnuPG key @ https://gaffer.ptitcanardnoir.org/intrigeri/intrigeri.asc
  | OTR fingerprint @ https://gaffer.ptitcanardnoir.org/intrigeri/otr.asc



Information forwarded to debian-bugs-dist@lists.debian.org, Debian Live Project <debian-live@lists.debian.org>:
Bug#700920; Package live-boot. (Tue, 19 Feb 2013 11:09:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to intrigeri <intrigeri+debian-live@boum.org>:
Extra info received and forwarded to list. Copy sent to Debian Live Project <debian-live@lists.debian.org>. (Tue, 19 Feb 2013 11:09:05 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Live Project <debian-live@lists.debian.org>:
Bug#700920; Package live-boot. (Tue, 19 Feb 2013 11:12:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Gaudenz Steinlin <gaudenz@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Live Project <debian-live@lists.debian.org>. (Tue, 19 Feb 2013 11:12:03 GMT) Full text and rfc822 format available.

Message #25 received at 700920@bugs.debian.org (full text, mbox):

From: Gaudenz Steinlin <gaudenz@debian.org>
To: daniel.baumann@progress-technologies.net
Cc: 700920@bugs.debian.org
Subject: Re: Bug#700920: Immediately detect medium from live-media parameter
Date: Tue, 19 Feb 2013 12:00:05 +0100
[Message part 1 (text/plain, inline)]
Daniel Baumann <daniel.baumann@progress-technologies.net> writes:

> On 02/19/2013 11:19 AM, Gaudenz Steinlin wrote:
>> The attached patch implements a solution to both of these issues.
>
> can you split it in two patches please?

OK. See attached patches. 

Gaudenz

[0001-Immediately-detect-medium-from-live-media-parameter.patch (text/x-diff, inline)]
From 8b6eb6772526e2a9ab1b944132e8887cd2b2761a Mon Sep 17 00:00:00 2001
From: Gaudenz Steinlin <gaudenz@debian.org>
Date: Thu, 17 Jan 2013 16:45:27 +0100
Subject: [PATCH 1/2] Immediately detect medium from live-media parameter

If a preferred medium (device or medium type) is given with the
live-media parameter then waiting for the timeout to expire before
scaning for these devices is not necessary. Just pick the device as soon
as it appears. If a criterium would match several devices the outcome is
undefined anyway. So choosing the first one is good enough.
---
 scripts/boot/9990-misc-helpers.sh |   25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)

diff --git a/scripts/boot/9990-misc-helpers.sh b/scripts/boot/9990-misc-helpers.sh
index 888eeaf..2813ac0 100755
--- a/scripts/boot/9990-misc-helpers.sh
+++ b/scripts/boot/9990-misc-helpers.sh
@@ -259,16 +259,10 @@ find_livefs ()
 {
 	timeout="${1}"
 
-	# don't start autodetection before timeout has expired
-	if [ -n "${LIVE_MEDIA_TIMEOUT}" ]
-	then
-		if [ "${timeout}" -lt "${LIVE_MEDIA_TIMEOUT}" ]
-		then
-			return 1
-		fi
-	fi
-
-	# first look at the one specified in the command line
+	# first look at the one specified in the command line This is OK
+	# before the timeout has expired, if more than one device matches the
+	# criteria the outcome is undefined anyway, so we can pick the first
+	# one that appears.
 	case "${LIVE_MEDIA}" in
 		removable-usb)
 			for sysblock in $(removable_usb_dev "sys")
@@ -309,7 +303,16 @@ find_livefs ()
 			;;
 	esac
 
-	# or do the scan of block devices
+	# don't start autodetection before timeout has expired
+	if [ -n "${LIVE_MEDIA_TIMEOUT}" ]
+	then
+		if [ "${timeout}" -lt "${LIVE_MEDIA_TIMEOUT}" ]
+		then
+			return 1
+		fi
+	fi
+
+	# autodetection of live media
 	# prefer removable devices over non-removable devices, so scan them first
 	devices_to_scan="$(removable_dev 'sys') $(non_removable_dev 'sys')"
 
-- 
1.7.10.4

[0002-Use-any-medium-if-preferred-medium-type-is-not-found.patch (text/x-diff, inline)]
From 1b7d2426f39309bacd282768ef7a6d8bddd9a961 Mon Sep 17 00:00:00 2001
From: Gaudenz Steinlin <gaudenz@debian.org>
Date: Tue, 19 Feb 2013 11:50:19 +0100
Subject: [PATCH 2/2] Use any medium if preferred medium type is not found

Use any available live medium if the preferred medium type given with
the live-media parameter is not found. This aligns the behavior of the
"removeable" and "removeable-usb" values with the behavior already
present when specifying a device path.

This makes it possible to have a non-wirteable (ISO) live-image with the
default boot parameter set to live-media=removable-usb for machines that
can't boot directly from USB devices. If a live medium on an USB device
is present it'll be preferred, but the ISO will also boot without an USB
device.
---
 scripts/boot/9990-misc-helpers.sh |    2 --
 1 file changed, 2 deletions(-)

diff --git a/scripts/boot/9990-misc-helpers.sh b/scripts/boot/9990-misc-helpers.sh
index 2813ac0..1341972 100755
--- a/scripts/boot/9990-misc-helpers.sh
+++ b/scripts/boot/9990-misc-helpers.sh
@@ -275,7 +275,6 @@ find_livefs ()
 					fi
 				done
 			done
-			return 1
 			;;
 
 		removable)
@@ -289,7 +288,6 @@ find_livefs ()
 					fi
 				done
 			done
-			return 1
 			;;
 
 		*)
-- 
1.7.10.4

[Message part 4 (text/plain, inline)]
-- 
Ever tried. Ever failed. No matter.
Try again. Fail again. Fail better.
~ Samuel Beckett ~

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Live Project <debian-live@lists.debian.org>:
Bug#700920; Package live-boot. (Tue, 19 Feb 2013 11:45:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to daniel.baumann@progress-technologies.net:
Extra info received and forwarded to list. Copy sent to Debian Live Project <debian-live@lists.debian.org>. (Tue, 19 Feb 2013 11:45:03 GMT) Full text and rfc822 format available.

Message #30 received at 700920@bugs.debian.org (full text, mbox):

From: Daniel Baumann <daniel.baumann@progress-technologies.net>
To: intrigeri <intrigeri+debian-live@boum.org>
Cc: 700920@bugs.debian.org
Subject: Re: Bug#700920: Immediately detect medium from live-media parameter
Date: Tue, 19 Feb 2013 12:43:39 +0100
On 02/19/2013 12:07 PM, intrigeri wrote:
> In Tails [1], we rely on live-media=removable to avoid trusting the
> content of internal drives. So it's critical for us to have live-boot
> *always* obey live-media=removable.

as usual, we should allow both use cases to co-exist.

imho the default behaviour should be to boot 'no matter what', and the 
non-default option should be try to boot a certain subset only and fail 
as desired in your use case.. therefore.. if such fail-to-boot is 
desired, the parameter should be something like 
live-media=strict-removable or something like that.

-- 
Address:        Daniel Baumann, Donnerbuehlweg 3, CH-3012 Bern
Email:          daniel.baumann@progress-technologies.net
Internet:       http://people.progress-technologies.net/~daniel.baumann/



Information forwarded to debian-bugs-dist@lists.debian.org, Debian Live Project <debian-live@lists.debian.org>:
Bug#700920; Package live-boot. (Tue, 19 Feb 2013 13:24:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to daniel.baumann@progress-technologies.net:
Extra info received and forwarded to list. Copy sent to Debian Live Project <debian-live@lists.debian.org>. (Tue, 19 Feb 2013 13:24:03 GMT) Full text and rfc822 format available.

Message #35 received at 700920@bugs.debian.org (full text, mbox):

From: Daniel Baumann <daniel.baumann@progress-technologies.net>
To: Ronny Standtke <ronny.standtke@fhnw.ch>
Cc: 700920@bugs.debian.org
Subject: Re: Bug#700920: Immediately detect medium from live-media parameter
Date: Tue, 19 Feb 2013 14:21:29 +0100
[ do not drop the bts from CC. ]

On 02/19/2013 01:28 PM, Ronny Standtke wrote:
> How about a priority list, e.g.
> "live-media=removable-usb,removable,any"

sounds good.

>, where "any" is a wildcard
> keyword that allows booting from whatever medium is found. This way
> Tails developers could just use "live-media=removable" without the wildcard.
>
> Cheers
>
> Ronny
>

-- 
Address:        Daniel Baumann, Donnerbuehlweg 3, CH-3012 Bern
Email:          daniel.baumann@progress-technologies.net
Internet:       http://people.progress-technologies.net/~daniel.baumann/



Information forwarded to debian-bugs-dist@lists.debian.org, Debian Live Project <debian-live@lists.debian.org>:
Bug#700920; Package live-boot. (Tue, 19 Feb 2013 14:00:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to intrigeri <intrigeri+debian-live@boum.org>:
Extra info received and forwarded to list. Copy sent to Debian Live Project <debian-live@lists.debian.org>. (Tue, 19 Feb 2013 14:00:05 GMT) Full text and rfc822 format available.

Message #40 received at 700920@bugs.debian.org (full text, mbox):

From: intrigeri <intrigeri+debian-live@boum.org>
To: daniel.baumann@progress-technologies.net
Cc: 700920@bugs.debian.org, Ronny Standtke <ronny.standtke@fhnw.ch>
Subject: Re: Bug#700920: Immediately detect medium from live-media parameter
Date: Tue, 19 Feb 2013 14:56:35 +0100
Hi,

Daniel Baumann wrote (19 Feb 2013 13:21:29 GMT) :
> On 02/19/2013 01:28 PM, Ronny Standtke wrote:
>> How about a priority list, e.g.
>> "live-media=removable-usb,removable,any"

> sounds good.

Looks good to me too :)




Removed tag(s) patch. Request was from Daniel Baumann <daniel.baumann@progress-technologies.net> to control@bugs.debian.org. (Tue, 26 Feb 2013 14:15:05 GMT) Full text and rfc822 format available.

Changed Bug title to 'improving live-media= to immediately detect medium' from 'Immediately detect medium from live-media parameter' Request was from Daniel Baumann <daniel.baumann@progress-technologies.net> to control@bugs.debian.org. (Tue, 26 Feb 2013 14:15:06 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Live Systems Maintainers <debian-live@lists.debian.org>:
Bug#700920; Package live-boot. (Mon, 06 May 2013 12:24:08 GMT) Full text and rfc822 format available.

Acknowledgement sent to daniel.baumann@progress-technologies.net:
Extra info received and forwarded to list. Copy sent to Live Systems Maintainers <debian-live@lists.debian.org>. (Mon, 06 May 2013 12:24:08 GMT) Full text and rfc822 format available.

Message #49 received at 700920@bugs.debian.org (full text, mbox):

From: Daniel Baumann <daniel.baumann@progress-technologies.net>
To: 700920-submitter@bugs.debian.org
Cc: 700920@bugs.debian.org
Subject: Re: improving live-media= to immediately detect medium
Date: Mon, 06 May 2013 14:15:22 +0200
can you provide an updated patch for this?

-- 
Address:        Daniel Baumann, Donnerbuehlweg 3, CH-3012 Bern
Email:          daniel.baumann@progress-technologies.net
Internet:       http://people.progress-technologies.net/~daniel.baumann/



Message sent on to Gaudenz Steinlin <gaudenz@debian.org>:
Bug#700920. (Mon, 06 May 2013 12:24:11 GMT) Full text and rfc822 format available.

Reply sent to daniel.baumann@progress-technologies.net:
You have taken responsibility. (Tue, 28 May 2013 04:45:06 GMT) Full text and rfc822 format available.

Notification sent to Gaudenz Steinlin <gaudenz@debian.org>:
Bug acknowledged by developer. (Tue, 28 May 2013 04:45:06 GMT) Full text and rfc822 format available.

Message #57 received at 700920-done@bugs.debian.org (full text, mbox):

From: Daniel Baumann <daniel.baumann@progress-technologies.net>
To: 700920-done@bugs.debian.org
Subject: Re: improving live-media= to immediately detect medium
Date: Tue, 28 May 2013 06:42:53 +0200
apparently nobody wants to work on that, moving on..

-- 
Address:        Daniel Baumann, Donnerbuehlweg 3, CH-3012 Bern
Email:          daniel.baumann@progress-technologies.net
Internet:       http://people.progress-technologies.net/~daniel.baumann/



Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Tue, 25 Jun 2013 07:30:46 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Wed Apr 16 16:40:34 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.