Bug#656135: Add findiso boot parametre

2012-04-15 Thread adrian15

El 09/04/12 19:28, Daniel Baumann escribió:

what i don't get is why the thing is mounted in /root/live/$whatever in
the first place if it is unmounted their afterwards anyway.

or in other words: there should be nothing interfering with /root/*
unless it's staying there after the initramfs-real-system switch, so
the temporary mounting should be somewhere in initramfs, like
/live/$whatever that it was (in parts) before.

..or am i missing something?



According to Michael Prokop (I sent him an email) if findiso option 
works without that code we should remove it. It describes the grml 
live-boot ancestors to be live-initramfs and knoppix. So he means that 
some code might be unneccesary.


Being that fromiso and findiso are very similar in functionality and 
that fromiso does not have similar code I apply for removing it.


Not to say that findiso option has to be tested after removing it just 
to be sure that we aren't breaking anything.


adrian15
--
Support free software. Donate to Super Grub Disk. Apoya el software 
libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/donate/




--
To UNSUBSCRIBE, email to debian-live-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4f8a93f4.8000...@gmail.com



Bug#656135: Add findiso boot parametre

2012-04-15 Thread intrigeri
Hi,

adrian15 wrote (15 Apr 2012 09:25:08 GMT) :
 El 09/04/12 19:28, Daniel Baumann escribió:
 what i don't get is why the thing is mounted in /root/live/$whatever in
 the first place if it is unmounted their afterwards anyway.

 or in other words: there should be nothing interfering with /root/*
 unless it's staying there after the initramfs-real-system switch, so
 the temporary mounting should be somewhere in initramfs, like
 /live/$whatever that it was (in parts) before.

 ..or am i missing something?

 According to Michael Prokop (I sent him an email) if findiso option
 works without that code we should remove it. It describes the grml
 live-boot ancestors to be live-initramfs and knoppix. So he means
 that some code might be unneccesary.

 Being that fromiso and findiso are very similar in functionality and
 that fromiso does not have similar code I apply for removing it.

 Not to say that findiso option has to be tested after removing it
 just to be sure that we aren't breaking anything.

If you're interested in improving this, this is great!

Please note that we're discussing, on a closed bug report, of matters
that don't exactly fit the purpose of the original bug report. I find
it slightly suboptimal.

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



--
To UNSUBSCRIBE, email to debian-live-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/85d37948h3@boum.org



Bug#656135: Add findiso boot parametre

2012-04-09 Thread intrigeri
Hi,

adrian15 wrote (08 Apr 2012 20:54:39 GMT) :
 But according to current fromiso implementation it would seem that
 you have to check exactly the same directory as the one
 you're umounting.

 I'm not very sure about this reasoning so please take my patch
 with caution.

Looks great, but may you please test this patch (against current
debian-next) and confirm it works fine?

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



-- 
To UNSUBSCRIBE, email to debian-live-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/85pqbh5ov1@boum.org



Bug#656135: Add findiso boot parametre

2012-04-09 Thread adrian15

El 09/04/12 09:46, intrigeri escribió:

Hi,

adrian15 wrote (08 Apr 2012 20:54:39 GMT) :

But according to current fromiso implementation it would seem that
you have to check exactly the same directory as the one
you're umounting.



I'm not very sure about this reasoning so please take my patch
with caution.


Looks great, but may you please test this patch (against current
debian-next) and confirm it works fine?

Cheers,


I have tested it (toram and findiso boot parametres together) and I 
suppose it works ok because:


* Inside /proc/mounts there's no reference to findiso string.
* Inside /live folder I only find: image, overlay and rofs folders.

adrian15
--
Support free software. Donate to Super Grub Disk. Apoya el software 
libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/donate/




--
To UNSUBSCRIBE, email to debian-live-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4f830f47.60...@gmail.com



Bug#656135: Add findiso boot parametre

2012-04-08 Thread adrian15

El 08/04/12 07:11, Daniel Baumann escribió:

On 04/08/2012 12:19 AM, adrian15 wrote:

I rewrote the patch according to intrigeri wishes and with some pieces
of advice from Daniel.


but now you did worsen it a bit compared to the last iteration :)

   * use 'mkdir -p /live/findiso' instead of 'mkdir /live/findiso -p'
 for consistency.

   * use 'if [ -d /live/findiso ]  [ ! -d /root/live/findiso ]'
 instead of 'if [ -d /live/findiso -a ! -d /root/live/findiso ]'
 which is a bashism.

   * don't use 'local' when declaring variables, it's a bashism.

other than that, looks good to me.



I rewrote the patch with your pieces of advice implemented.

adrian15
--
Support free software. Donate to Super Grub Disk. Apoya el software 
libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/donate/
diff --git a/manpages/en/live-boot.7 b/manpages/en/live-boot.7
index ed66ad7..29c577a 100644
--- a/manpages/en/live-boot.7
+++ b/manpages/en/live-boot.7
@@ -66,6 +66,8 @@ Target target-name
   Lun 0 Path=path-to-your-live-image.iso,Type=fileio,IOMode=ro
   # If you want to boot multiple machines you might want to look at tuning some parameters like
   # Wthreads or MaxConnections
+.IP \fBfindiso\fR=\fI/PATH/TO/IMAGE\fI 4
+Look for the specified ISO file on all disks where it usually looks for the .squashfs file (so you don't have to know the device name as in fromiso=).
 .IP \fBfromiso\fR=\fI/PATH/TO/IMAGE\fI 4
 Allows to use a filesystem from within an iso image that's available on live-media.
 .IP \fBignore_uuid\fR 4
diff --git a/scripts/live b/scripts/live
index e248937..77ca9d1 100755
--- a/scripts/live
+++ b/scripts/live
@@ -1357,6 +1357,21 @@ check_dev ()
 		mount -t ${fstype} -o ro,noatime ${devname} ${mountpoint} || continue
 		[ -n $devuid ]  echo $devuid  $tried
 
+		if [ -n ${FINDISO} ]
+		then
+			if [ -f ${mountpoint}/${FINDISO} ]
+			then
+umount ${mountpoint}
+mkdir -p /live/findiso
+mount -t ${fstype} -o ro,noatime ${devname} /live/findiso
+loopdevname=$(setup_loop /live/findiso/${FINDISO} loop /sys/block/loop* 0 )
+devname=${loopdevname}
+mount -t iso9660 -o ro,noatime ${devname} ${mountpoint}
+			else
+umount ${mountpoint}
+			fi
+		fi
+
 		if is_live_path ${mountpoint}  \
 			([ ${skip_uuid_check} ] || matches_uuid ${mountpoint})
 		then
@@ -1643,6 +1658,26 @@ mountroot ()
 	# when booting FAI, this simple workaround solves it
 	ls /root/* /dev/null 21
 
+	# Move findiso directory to the new root filesystem so that programs there can get at it.
+	if [ -d /live/findiso ]  [ ! -d /root/live/findiso ]
+	then
+		mkdir -p /root/live/findiso
+		mount -n --move /live/findiso /root/live/findiso
+	fi
+
+	# if we do not unmount the ISO we can't run fsck /dev/ice later on
+	# because the mountpoint is left behind in /proc/mounts, so let's get
+	# rid of it when running from RAM
+	if [ -n $FINDISO ]  [ ${TORAM} ]
+	then
+		losetup -d /dev/loop0
+
+		if is_mountpoint /live/findiso
+		then
+			umount /root/live/findiso
+		fi
+	fi
+
 	# copy snapshot configuration if exists
 	if [ -f snapshot.conf ]
 	then
diff --git a/scripts/live-helpers b/scripts/live-helpers
index 889d157..2c943f1 100644
--- a/scripts/live-helpers
+++ b/scripts/live-helpers
@@ -143,6 +143,11 @@ Arguments ()
 export STATICIP
 ;;
 
+			findiso=*)
+FINDISO=${ARGUMENT#findiso=}
+export FINDISO
+;;
+
 			live-getty)
 LIVE_GETTY=1
 export LIVE_GETTY
@@ -1579,3 +1584,15 @@ fix_home_rw_compatibility ()
 /home source=.  ${include_list}
 	fi
 }
+
+is_mountpoint () {
+
+	directory=$1
+
+	if [ $(stat -fc%d:%D ${directory}) != $(stat -fc%d:%D ${directory}/..) ]
+	then
+		return 0
+	else
+		return 1
+	fi
+}


Bug#656135: Add findiso boot parametre

2012-04-08 Thread Daniel Baumann
On 04/08/2012 12:50 PM, adrian15 wrote:
 I rewrote the patch with your pieces of advice implemented.

looks good to me, thanks for you patience with it.

intrigeri, ack for applying it?

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



-- 
To UNSUBSCRIBE, email to debian-live-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4f817698.5040...@progress-technologies.net



Bug#656135: Add findiso boot parametre

2012-04-08 Thread adrian15

El 08/04/12 13:29, Daniel Baumann escribió:

On 04/08/2012 12:50 PM, adrian15 wrote:

I rewrote the patch with your pieces of advice implemented.


looks good to me, thanks for you patience with it.

intrigeri, ack for applying it?


This is another patch that would complement the first one.

It includes reducing the is_mountpoint function and making sure that the 
filesystem is not cluttered with unused mountpoint directorios (findiso 
in this specific case).


adrian15
--
Support free software. Donate to Super Grub Disk. Apoya el software 
libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/donate/
diff --git a/scripts/live b/scripts/live
index 77ca9d1..b7ab159 100755
--- a/scripts/live
+++ b/scripts/live
@@ -1675,6 +1675,7 @@ mountroot ()
 		if is_mountpoint /live/findiso
 		then
 			umount /root/live/findiso
+			rmdir --ignore-fail-on-non-empty /root/live/findiso  /dev/null 21 || true
 		fi
 	fi
 
diff --git a/scripts/live-helpers b/scripts/live-helpers
index 2c943f1..d8e1ca3 100644
--- a/scripts/live-helpers
+++ b/scripts/live-helpers
@@ -1589,10 +1589,6 @@ is_mountpoint () {
 
 	directory=$1
 
-	if [ $(stat -fc%d:%D ${directory}) != $(stat -fc%d:%D ${directory}/..) ]
-	then
-		return 0
-	else
-		return 1
-	fi
+	[ $(stat -fc%d:%D ${directory}) != $(stat -fc%d:%D ${directory}/..) ]
+
 }


Bug#656135: Add findiso boot parametre

2012-04-08 Thread intrigeri
tags 656135 + fixed-upstream
thanks

Daniel Baumann wrote (08 Apr 2012 11:29:28 GMT) :
 intrigeri, ack for applying it?

Applied in Git, with a few improvements as follow-up commits.

Thanks adrian15!

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



-- 
To UNSUBSCRIBE, email to debian-live-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/85aa2m6pku@boum.org



Processed: Re: Bug#656135: Add findiso boot parametre

2012-04-08 Thread Debian Bug Tracking System
Processing commands for cont...@bugs.debian.org:

 tags 656135 + fixed-upstream
Bug #656135 [live-boot] support findiso functionality
Bug #659073 [live-boot] support findiso functionality
Added tag(s) fixed-upstream.
Added tag(s) fixed-upstream.
 thanks
Stopping processing here.

Please contact me if you need assistance.
-- 
656135: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=656135
659073: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=659073
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems


--
To UNSUBSCRIBE, email to debian-live-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/handler.s.c.133391003424910.transcr...@bugs.debian.org



Bug#656135: Add findiso boot parametre

2012-04-08 Thread adrian15

El 08/04/12 20:33, intrigeri escribió:

tags 656135 + fixed-upstream
thanks

Daniel Baumann wrote (08 Apr 2012 11:29:28 GMT) :

intrigeri, ack for applying it?


Applied in Git, with a few improvements as follow-up commits.

Thanks adrian15!

Cheers,


While trying to improve fromiso/isofrom option I've just realised that 
the original grml implementation of findiso checked for: /live/findiso 
on /proc/mounts while what it was unmounted was: /root/live/findiso .


But according to current fromiso implementation it would seem that you 
have to check exactly the same directory as the one you're umounting.


I'm not very sure about this reasoning so please take my patch with caution.

adrian15
--
Support free software. Donate to Super Grub Disk. Apoya el software 
libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/donate/
diff --git a/scripts/live b/scripts/live
index f4f4059..97f548d 100755
--- a/scripts/live
+++ b/scripts/live
@@ -1670,7 +1670,7 @@ mountroot ()
 	then
 		losetup -d /dev/loop0
 
-		if is_mountpoint /live/findiso
+		if is_mountpoint /root/live/findiso
 		then
 			umount /root/live/findiso
 			rmdir --ignore-fail-on-non-empty /root/live/findiso \


Bug#656135: Add findiso boot parametre

2012-04-07 Thread intrigeri
Hi,

adrian15 wrote (06 Apr 2012 18:39:46 GMT) :
 I've even improved the part about checking that the iso was mounted
 that intrigeri pointed out at:
 http://lists.debian.org/debian-live/2011/09/msg00067.html

 So you have replaced

grep -q /live/findiso /proc/mounts  umount /root/live/findiso

 with

[ ! -z ${mountpoint} ]  umount /root/live/findiso

 It seems more fragile to me than what the original patch did (although
 it did in a way I did not like); but maybe you can explain us why this
 new check is sufficient and/or better suited than the old one?

 Well, actually, I wanted to ask you what did you mean when you said
 that exactly but I didn't think of sending you an email.

I suggested using the mountpoint *command* instead of the ugly
grep hack.

 I can re-submit the patch without this change or try to implement
 whatever you meant if you explain it.

Please do.

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



-- 
To UNSUBSCRIBE, email to debian-live-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/858vi8m2et@boum.org



Bug#656135: Add findiso boot parametre

2012-04-07 Thread adrian15

El 07/04/12 09:22, intrigeri escribió:

Hi,

adrian15 wrote (06 Apr 2012 18:39:46 GMT) :

I've even improved the part about checking that the iso was mounted
that intrigeri pointed out at:
http://lists.debian.org/debian-live/2011/09/msg00067.html


So you have replaced

grep -q /live/findiso /proc/mounts   umount /root/live/findiso

with

[ ! -z ${mountpoint} ]   umount /root/live/findiso

It seems more fragile to me than what the original patch did (although
it did in a way I did not like); but maybe you can explain us why this
new check is sufficient and/or better suited than the old one?



Well, actually, I wanted to ask you what did you mean when you said
that exactly but I didn't think of sending you an email.


I suggested using the mountpoint *command* instead of the ugly
grep hack.


I can re-submit the patch without this change or try to implement
whatever you meant if you explain it.


Please do.


Ok. I have included mountpoint command (now the copy_exec part makes 
sense to me :)). And I have used it as requested.


Given the trivial changes I have done I have not tested it (not even 
sure how to test that).


I am supposing that mountpoint is an standard command that comes with 
Debian standard packages and thus you don't have to edit any 
build-depends variable on the package definition. If my supposition is 
false please complain.


adrian15
--
Support free software. Donate to Super Grub Disk. Apoya el software 
libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/donate/
diff --git a/hooks/live b/hooks/live
index 40802d0..82eca8d 100755
--- a/hooks/live
+++ b/hooks/live
@@ -229,6 +229,13 @@ then
 	copy_exec /sbin/blockdev /sbin
 fi
 
+# Program: mountpoint
+if [ -x /bin/mountpoint ]
+then
+	[ ${QUIET} ] || echo -n  mountpoint
+	copy_exec /bin/mountpoint /bin
+fi
+
 # FUSE kernel module
 manual_add_modules fuse
 
diff --git a/manpages/en/live-boot.7 b/manpages/en/live-boot.7
index 6a46d9b..77ac29f 100644
--- a/manpages/en/live-boot.7
+++ b/manpages/en/live-boot.7
@@ -66,6 +66,8 @@ Target target-name
   Lun 0 Path=path-to-your-live-image.iso,Type=fileio,IOMode=ro
   # If you want to boot multiple machines you might want to look at tuning some parameters like
   # Wthreads or MaxConnections
+.IP \fBfindiso\fR=\fI/PATH/TO/IMAGE\fI 4
+Look for the specified ISO file on all disks where it usually looks for the .squashfs file (so you don't have to know the device name as in fromiso=).
 .IP \fBfromiso\fR=\fI/PATH/TO/IMAGE\fI 4
 Allows to use a filesystem from within an iso image that's available on live-media.
 .IP \fBignore_uuid\fR 4
diff --git a/scripts/live b/scripts/live
index e248937..ebc3cb2 100755
--- a/scripts/live
+++ b/scripts/live
@@ -1357,6 +1357,21 @@ check_dev ()
 		mount -t ${fstype} -o ro,noatime ${devname} ${mountpoint} || continue
 		[ -n $devuid ]  echo $devuid  $tried
 
+		if [ -n ${FINDISO} ]
+		then
+			if [ -f ${mountpoint}/${FINDISO} ]
+			then
+umount ${mountpoint}
+mkdir /live/findiso -p
+mount -t ${fstype} -o ro,noatime ${devname} /live/findiso
+loopdevname=$(setup_loop /live/findiso/${FINDISO} loop /sys/block/loop* 0 )
+devname=${loopdevname}
+mount -t iso9660 -o ro,noatime ${devname} ${mountpoint}
+			else
+umount ${mountpoint}
+			fi
+		fi
+
 		if is_live_path ${mountpoint}  \
 			([ ${skip_uuid_check} ] || matches_uuid ${mountpoint})
 		then
@@ -1643,6 +1658,22 @@ mountroot ()
 	# when booting FAI, this simple workaround solves it
 	ls /root/* /dev/null 21
 
+	# Move findiso directory to the new root filesystem so that programs there can get at it.
+	if [ -d /live/findiso -a ! -d /root/live/findiso ]
+	then
+		mkdir -p /root/live/findiso
+		mount -n --move /live/findiso /root/live/findiso
+	fi
+
+	# if we do not unmount the ISO we can't run fsck /dev/ice later on
+	# because the mountpoint is left behind in /proc/mounts, so let's get
+	# rid of it when running from RAM
+	if [ -n $FINDISO ]  [ ${TORAM} ]
+	then
+		losetup -d /dev/loop0
+		mountpoint -q /live/findiso  umount /root/live/findiso
+	fi
+
 	# copy snapshot configuration if exists
 	if [ -f snapshot.conf ]
 	then
diff --git a/scripts/live-helpers b/scripts/live-helpers
index 889d157..2d90162 100644
--- a/scripts/live-helpers
+++ b/scripts/live-helpers
@@ -143,6 +143,11 @@ Arguments ()
 export STATICIP
 ;;
 
+			findiso=*)
+FINDISO=${ARGUMENT#findiso=}
+export FINDISO
+;;
+
 			live-getty)
 LIVE_GETTY=1
 export LIVE_GETTY


Bug#656135: Add findiso boot parametre

2012-04-07 Thread Daniel Baumann
On 04/07/2012 04:06 PM, adrian15 wrote:
 I am supposing that mountpoint is an standard command that comes with
 Debian standard packages and thus you don't have to edit any
 build-depends variable on the package definition.

it would be a depends, not a build-depends. the initrd is build on the
target system, not on the build system.

/bin/mountpoint is part of initscripts from sysvinit. i'm afraid we
cannot use this - a depends on initscripts is too invasive for systems
running alternative init systems (systemd, upstart, etc).

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



-- 
To UNSUBSCRIBE, email to debian-live-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4f806b6c.7070...@progress-technologies.net



Bug#656135: Add findiso boot parametre

2012-04-07 Thread intrigeri
Hi,

Daniel Baumann wrote (07 Apr 2012 16:29:32 GMT) :
 /bin/mountpoint is part of initscripts from sysvinit. i'm afraid we
 cannot use this - a depends on initscripts is too invasive for
 systems running alternative init systems (systemd, upstart, etc).

May I ask why?

System-V's /sbin/init is provided by the sysvinit binary package.
I think the initscripts binary package, even if it's built from the
sysvinit source package, can perfectly coexist with alternative init
systems, can't it?

Moreover, initscripts is Priority: required, so...

Did I miss anything?

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



-- 
To UNSUBSCRIBE, email to debian-live-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/85obr3jwx8@boum.org



Bug#656135: Add findiso boot parametre

2012-04-07 Thread adrian15

El 07/04/12 18:29, Daniel Baumann escribió:

On 04/07/2012 04:06 PM, adrian15 wrote:

I am supposing that mountpoint is an standard command that comes with
Debian standard packages and thus you don't have to edit any
build-depends variable on the package definition.


it would be a depends, not a build-depends. the initrd is build on the
target system, not on the build system.

/bin/mountpoint is part of initscripts from sysvinit. i'm afraid we
cannot use this - a depends on initscripts is too invasive for systems
running alternative init systems (systemd, upstart, etc).


This is the alternate patch then.

adrian15
--
Support free software. Donate to Super Grub Disk. Apoya el software 
libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/donate/
diff --git a/manpages/en/live-boot.7 b/manpages/en/live-boot.7
index 6a46d9b..77ac29f 100644
--- a/manpages/en/live-boot.7
+++ b/manpages/en/live-boot.7
@@ -66,6 +66,8 @@ Target target-name
   Lun 0 Path=path-to-your-live-image.iso,Type=fileio,IOMode=ro
   # If you want to boot multiple machines you might want to look at tuning some parameters like
   # Wthreads or MaxConnections
+.IP \fBfindiso\fR=\fI/PATH/TO/IMAGE\fI 4
+Look for the specified ISO file on all disks where it usually looks for the .squashfs file (so you don't have to know the device name as in fromiso=).
 .IP \fBfromiso\fR=\fI/PATH/TO/IMAGE\fI 4
 Allows to use a filesystem from within an iso image that's available on live-media.
 .IP \fBignore_uuid\fR 4
diff --git a/scripts/live b/scripts/live
index e248937..8435ccd 100755
--- a/scripts/live
+++ b/scripts/live
@@ -1357,6 +1357,21 @@ check_dev ()
 		mount -t ${fstype} -o ro,noatime ${devname} ${mountpoint} || continue
 		[ -n $devuid ]  echo $devuid  $tried
 
+		if [ -n ${FINDISO} ]
+		then
+			if [ -f ${mountpoint}/${FINDISO} ]
+			then
+umount ${mountpoint}
+mkdir /live/findiso -p
+mount -t ${fstype} -o ro,noatime ${devname} /live/findiso
+loopdevname=$(setup_loop /live/findiso/${FINDISO} loop /sys/block/loop* 0 )
+devname=${loopdevname}
+mount -t iso9660 -o ro,noatime ${devname} ${mountpoint}
+			else
+umount ${mountpoint}
+			fi
+		fi
+
 		if is_live_path ${mountpoint}  \
 			([ ${skip_uuid_check} ] || matches_uuid ${mountpoint})
 		then
@@ -1643,6 +1658,22 @@ mountroot ()
 	# when booting FAI, this simple workaround solves it
 	ls /root/* /dev/null 21
 
+	# Move findiso directory to the new root filesystem so that programs there can get at it.
+	if [ -d /live/findiso -a ! -d /root/live/findiso ]
+	then
+		mkdir -p /root/live/findiso
+		mount -n --move /live/findiso /root/live/findiso
+	fi
+
+	# if we do not unmount the ISO we can't run fsck /dev/ice later on
+	# because the mountpoint is left behind in /proc/mounts, so let's get
+	# rid of it when running from RAM
+	if [ -n $FINDISO ]  [ ${TORAM} ]
+	then
+		losetup -d /dev/loop0
+		grep -q /live/findiso /proc/mounts  umount /root/live/findiso
+	fi
+
 	# copy snapshot configuration if exists
 	if [ -f snapshot.conf ]
 	then
diff --git a/scripts/live-helpers b/scripts/live-helpers
index 889d157..2d90162 100644
--- a/scripts/live-helpers
+++ b/scripts/live-helpers
@@ -143,6 +143,11 @@ Arguments ()
 export STATICIP
 ;;
 
+			findiso=*)
+FINDISO=${ARGUMENT#findiso=}
+export FINDISO
+;;
+
 			live-getty)
 LIVE_GETTY=1
 export LIVE_GETTY


Bug#656135: Add findiso boot parametre

2012-04-07 Thread Daniel Baumann
On 04/07/2012 07:04 PM, intrigeri wrote:
 May I ask why?

sure.

there are two reasons, mainly:

first, it clutters the system uselessly. it seems overkill to me to need
the whole initscripts package just for that single program. granted,
initscripts is not a really huge package.

second, i prefere to avoid packages of other init systems when using
non-sysvinit init. some init systems behave different (switching to
'legacy' mode automatically, rather than to run in 'native' mode) when
initscripts is installed.

if /bin/mountpoint would be a complex and very handy program, well, i
would not have much of a problem (maybe trying to get it moved to
another binary or source package (e.g. util-linux where it would be a
proper fit)). however.. /bin/mountpoints can be replicaeded as a
function of two lines of shell only, so, weighting above two issues
(which are not that convincing by itself) against a trivial shell
function, i'd go for the latter.

 I think the initscripts binary package, even if it's built from the
 sysvinit source package, can perfectly coexist with alternative init
 systems, can't it?

absolutely. i didn't ment to imply a conflict between the two packages.

 Moreover, initscripts is Priority: required, so...

first, this will change as soon as debian allows to have non-sysvinit
initsystems choosen by the user. granted, probably not for wheezy, but
we shouldn't rely on it when we know that this will change anytime
'soon' anyway.

second, e.g. on progress linux, the wheezy based system will use systemd
by default. being nice to derivatives, it would be nice to not need to
ship custom live-boot just because of this.

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



-- 
To UNSUBSCRIBE, email to debian-live-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4f807728.2060...@progress-technologies.net



Bug#656135: Add findiso boot parametre

2012-04-07 Thread intrigeri
Hi,

adrian15 wrote (07 Apr 2012 17:14:08 GMT) :
 This is the alternate patch then.

I'm fine with the reasons Daniel provided against using mountpoint in
live-boot, but I still don't consider grep -q /live/findiso
/proc/mounts as a robust way to check that /root/live/findiso (or
/live/findiso?) is mounted.

I think we need to use something similar to mountpoint but written in
shell, that is either parse /proc/mounts, or copy the way
/bin/mountpoint works (its algorithm boils down comparing if the
major:minor matches the ones of the parent directory).

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



-- 
To UNSUBSCRIBE, email to debian-live-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/85aa2njsnn@boum.org



Bug#656135: Add findiso boot parametre

2012-04-07 Thread Daniel Baumann
On 04/07/2012 08:36 PM, intrigeri wrote:
 I think we need to use something similar to mountpoint but written in
 shell, that is either parse /proc/mounts, or copy the way
 /bin/mountpoint works (its algorithm boils down comparing if the
 major:minor matches the ones of the parent directory).

alternatively, we could ask to move mountpoint from initscripts to
util-linux, though, that might take a very long time to accomplish.

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



-- 
To UNSUBSCRIBE, email to debian-live-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4f808f4e.8070...@progress-technologies.net



Bug#656135: Add findiso boot parametre

2012-04-07 Thread intrigeri
Hi,

Daniel Baumann wrote (07 Apr 2012 19:02:38 GMT) :
 alternatively, we could ask to move mountpoint from initscripts to
 util-linux, though, that might take a very long time to accomplish.

Moving /bin/mountpoint to another, better suited package would
be great.

However, I would not like to see the current effort of getting findiso
into live-boot, to be stalled by the outcome of this move.

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



-- 
To UNSUBSCRIBE, email to debian-live-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/85k41ribo0@boum.org



Bug#656135: Add findiso boot parametre

2012-04-07 Thread Daniel Baumann
On 04/07/2012 09:28 PM, intrigeri wrote:
 Moving /bin/mountpoint to another, better suited package would
 be great.

i'll open a bug on sysvinit for that.

 However, I would not like to see the current effort of getting findiso
 into live-boot, to be stalled by the outcome of this move.

sure.

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



-- 
To UNSUBSCRIBE, email to debian-live-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4f809ccf.2080...@progress-technologies.net



Bug#656135: Add findiso boot parametre

2012-04-07 Thread adrian15

El 07/04/12 20:36, intrigeri escribió:

Hi,

adrian15 wrote (07 Apr 2012 17:14:08 GMT) :

This is the alternate patch then.


I'm fine with the reasons Daniel provided against using mountpoint in
live-boot, but I still don't consider grep -q /live/findiso
/proc/mounts as a robust way to check that /root/live/findiso (or
/live/findiso?) is mounted.

I think we need to use something similar to mountpoint but written in
shell, that is either parse /proc/mounts, or copy the way
/bin/mountpoint works (its algorithm boils down comparing if the
major:minor matches the ones of the parent directory).

Cheers,


I rewrote the patch according to intrigeri wishes and with some pieces 
of advice from Daniel.


After testing this patch with boot parametres: findiso and to ram.

I have run:

cat /proc/mounts

and the results are:

rootfs / rootfs rw 0 0
sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
udev /dev devtmpfs 
rw,relatime,size=506840k,nr_inodes=126710,mode=755 0 0
devpts /dev/pts devpts 
rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0

tmpfs /run tmpfs rw,nosuid,noexec,relatime,size=102704k,mode=755 0 0
/dev/sr0 /live/findiso iso9660 ro,noatime 0 0
/dev/shm /live/image tmpfs rw,relatime,size=144388k 0 0
/dev/loop1 /live/rofs/filesystem.squashfs squashfs ro,noatime 0 0
tmpfs /live/cow tmpfs rw,noatime,mode=755 0 0
aufs / aufs rw,relatime,si=12f0b3e00b69d11c,noxino 0 0
tmpfs /live tmpfs rw,relatime 0 0
proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
tmpfs /run/lock tmpfs rw,nosuid,nodev,noexec,relatime,size=5120k 0 0
tmpfs /tmp tmpfs rw,nosuid,nodev,relatime,size=205404k 0 0
sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
tmpfs /run/shm tmpfs rw,nosuid,nodev,relatime,size=205404k 0 0


I don't see any /root/live/findiso so I guess it's ok.

If the patch is accepted I will send a similar patch for fromiso/isofrom 
option so that it uses the is_mountpoint function.


adrian15
--
Support free software. Donate to Super Grub Disk. Apoya el software 
libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/donate/
diff --git a/manpages/en/live-boot.7 b/manpages/en/live-boot.7
index 6a46d9b..77ac29f 100644
--- a/manpages/en/live-boot.7
+++ b/manpages/en/live-boot.7
@@ -66,6 +66,8 @@ Target target-name
   Lun 0 Path=path-to-your-live-image.iso,Type=fileio,IOMode=ro
   # If you want to boot multiple machines you might want to look at tuning some parameters like
   # Wthreads or MaxConnections
+.IP \fBfindiso\fR=\fI/PATH/TO/IMAGE\fI 4
+Look for the specified ISO file on all disks where it usually looks for the .squashfs file (so you don't have to know the device name as in fromiso=).
 .IP \fBfromiso\fR=\fI/PATH/TO/IMAGE\fI 4
 Allows to use a filesystem from within an iso image that's available on live-media.
 .IP \fBignore_uuid\fR 4
diff --git a/scripts/live b/scripts/live
index e248937..4954ce3 100755
--- a/scripts/live
+++ b/scripts/live
@@ -1357,6 +1357,21 @@ check_dev ()
 		mount -t ${fstype} -o ro,noatime ${devname} ${mountpoint} || continue
 		[ -n $devuid ]  echo $devuid  $tried
 
+		if [ -n ${FINDISO} ]
+		then
+			if [ -f ${mountpoint}/${FINDISO} ]
+			then
+umount ${mountpoint}
+mkdir /live/findiso -p
+mount -t ${fstype} -o ro,noatime ${devname} /live/findiso
+loopdevname=$(setup_loop /live/findiso/${FINDISO} loop /sys/block/loop* 0 )
+devname=${loopdevname}
+mount -t iso9660 -o ro,noatime ${devname} ${mountpoint}
+			else
+umount ${mountpoint}
+			fi
+		fi
+
 		if is_live_path ${mountpoint}  \
 			([ ${skip_uuid_check} ] || matches_uuid ${mountpoint})
 		then
@@ -1643,6 +1658,26 @@ mountroot ()
 	# when booting FAI, this simple workaround solves it
 	ls /root/* /dev/null 21
 
+	# Move findiso directory to the new root filesystem so that programs there can get at it.
+	if [ -d /live/findiso -a ! -d /root/live/findiso ]
+	then
+		mkdir -p /root/live/findiso
+		mount -n --move /live/findiso /root/live/findiso
+	fi
+
+	# if we do not unmount the ISO we can't run fsck /dev/ice later on
+	# because the mountpoint is left behind in /proc/mounts, so let's get
+	# rid of it when running from RAM
+	if [ -n $FINDISO ]  [ ${TORAM} ]
+	then
+		losetup -d /dev/loop0
+
+		if is_mountpoint /live/findiso
+		then
+			umount /root/live/findiso
+		fi
+	fi
+
 	# copy snapshot configuration if exists
 	if [ -f snapshot.conf ]
 	then
diff --git a/scripts/live-helpers b/scripts/live-helpers
index 889d157..4258ab3 100644
--- a/scripts/live-helpers
+++ b/scripts/live-helpers
@@ -143,6 +143,11 @@ Arguments ()
 export STATICIP
 ;;
 
+			findiso=*)
+FINDISO=${ARGUMENT#findiso=}
+export FINDISO
+;;
+
 			live-getty)
 LIVE_GETTY=1
 export LIVE_GETTY
@@ -1579,3 +1584,15 @@ fix_home_rw_compatibility ()
 /home source=.  ${include_list}
 	fi
 }
+
+is_mountpoint () {
+
+	local directory=$1
+
+	if [ $(stat -fc%d:%D ${directory}) != $(stat 

Bug#656135: Add findiso boot parametre

2012-04-07 Thread Daniel Baumann
On 04/08/2012 12:19 AM, adrian15 wrote:
 I rewrote the patch according to intrigeri wishes and with some pieces
 of advice from Daniel.

but now you did worsen it a bit compared to the last iteration :)

  * use 'mkdir -p /live/findiso' instead of 'mkdir /live/findiso -p'
for consistency.

  * use 'if [ -d /live/findiso ]  [ ! -d /root/live/findiso ]'
instead of 'if [ -d /live/findiso -a ! -d /root/live/findiso ]'
which is a bashism.

  * don't use 'local' when declaring variables, it's a bashism.

other than that, looks good to me.

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



-- 
To UNSUBSCRIBE, email to debian-live-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4f811dea.2040...@progress-technologies.net



Bug#656135: Add findiso boot parametre

2012-04-06 Thread adrian15

El 16/01/12 22:04, Daniel Baumann escribió:

retitle 656135 support findiso functionality
tag 656135 moreinfo
thanks

On 01/16/2012 08:02 PM, Adrian Gibanel Lopez wrote:

* Discussion of findiso option and other boot parametres in debian-live mailing
list: http://lists.debian.org/debian-live/2011/07/msg00146.html


after that mail end of july where the patches were problems, we gave
feedback right away[0], and even pinged again[1] later in beginning of
september. so far no answer/action from grml.

if you're interested in getting findiso merged, can you have a look at it?

Regards,
Daniel

[0] http://lists.debian.org/debian-live/2011/08/msg00020.html
[1] http://lists.debian.org/debian-live/2011/09/msg00067.html



I think I've finally managed to make the patch.

I've even improved the part about checking that the iso was mounted that 
intrigeri pointed out at:

http://lists.debian.org/debian-live/2011/09/msg00067.html

I've tested the findiso option from a grub2 cdrom iso in a virtualbox VM.
I've tested the findiso option from a grub2 usb pendrive in an actual 
machine.


I've also tested normal boot and I haven't noticed anything strange on it.

Here you are (attached).

adrian15
--
Support free software. Donate to Super Grub Disk. Apoya el software 
libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/donate/
diff --git a/manpages/en/live-boot.7 b/manpages/en/live-boot.7
index 6a46d9b..77ac29f 100644
--- a/manpages/en/live-boot.7
+++ b/manpages/en/live-boot.7
@@ -66,6 +66,8 @@ Target target-name
   Lun 0 Path=path-to-your-live-image.iso,Type=fileio,IOMode=ro
   # If you want to boot multiple machines you might want to look at tuning some parameters like
   # Wthreads or MaxConnections
+.IP \fBfindiso\fR=\fI/PATH/TO/IMAGE\fI 4
+Look for the specified ISO file on all disks where it usually looks for the .squashfs file (so you don't have to know the device name as in fromiso=).
 .IP \fBfromiso\fR=\fI/PATH/TO/IMAGE\fI 4
 Allows to use a filesystem from within an iso image that's available on live-media.
 .IP \fBignore_uuid\fR 4
diff --git a/scripts/live b/scripts/live
index e248937..d47feba 100755
--- a/scripts/live
+++ b/scripts/live
@@ -1357,6 +1357,21 @@ check_dev ()
 		mount -t ${fstype} -o ro,noatime ${devname} ${mountpoint} || continue
 		[ -n $devuid ]  echo $devuid  $tried
 
+		if [ -n ${FINDISO} ]
+		then
+			if [ -f ${mountpoint}/${FINDISO} ]
+			then
+umount ${mountpoint}
+mkdir /live/findiso -p
+mount -t ${fstype} -o ro,noatime ${devname} /live/findiso
+loopdevname=$(setup_loop /live/findiso/${FINDISO} loop /sys/block/loop* 0 )
+devname=${loopdevname}
+mount -t iso9660 -o ro,noatime ${devname} ${mountpoint}
+			else
+umount ${mountpoint}
+			fi
+		fi
+
 		if is_live_path ${mountpoint}  \
 			([ ${skip_uuid_check} ] || matches_uuid ${mountpoint})
 		then
@@ -1643,6 +1658,22 @@ mountroot ()
 	# when booting FAI, this simple workaround solves it
 	ls /root/* /dev/null 21
 
+	# Move findiso directory to the new root filesystem so that programs there can get at it.
+	if [ -d /live/findiso -a ! -d /root/live/findiso ]
+	then
+		mkdir -p /root/live/findiso
+		mount -n --move /live/findiso /root/live/findiso
+	fi
+
+	# if we do not unmount the ISO we can't run fsck /dev/ice later on
+	# because the mountpoint is left behind in /proc/mounts, so let's get
+	# rid of it when running from RAM
+	if [ -n $FINDISO ]  [ ${TORAM} ]
+	then
+		losetup -d /dev/loop0
+		[ ! -z ${mountpoint} ]  umount /root/live/findiso
+	fi
+
 	# copy snapshot configuration if exists
 	if [ -f snapshot.conf ]
 	then
diff --git a/scripts/live-helpers b/scripts/live-helpers
index 889d157..2d90162 100644
--- a/scripts/live-helpers
+++ b/scripts/live-helpers
@@ -143,6 +143,11 @@ Arguments ()
 export STATICIP
 ;;
 
+			findiso=*)
+FINDISO=${ARGUMENT#findiso=}
+export FINDISO
+;;
+
 			live-getty)
 LIVE_GETTY=1
 export LIVE_GETTY


Bug#656135: Add findiso boot parametre

2012-01-16 Thread Adrian Gibanel Lopez
Package: live-boot
Version: 3.0~a24-1
Severity: wishlist

Dear Maintainer,

  I am trying to loop-mount-and-boot a debian-live-iso from grub2.
Grub2 has loop-mount capabilities so it can do it.

  It seems that Grml, a debian live derivative has already this feature and
they name it: findiso.

Some links that might help you:

* About loop-mount-and-boot from grub2:
http://www.supergrubdisk.org/wiki/Loopback.cfg
* Findiso patch from grml: http://git.grml.org/?p=live-boot-
grml.git;a=blob;f=debian/patches/07_support_findiso.patch;hb=HEAD
* Discussion of findiso option and other boot parametres in debian-live mailing
list: http://lists.debian.org/debian-live/2011/07/msg00146.html

My egoist reasons for this feature are:
* I could make a Rescatux + Super Grub2 Disk disk.
* Rescatux iso can be boot from grub2 thus from live pendrives
* I won't have to switch to an ubuntu base for making the live cd.

Making multi debian-live pendrives would be easier than ever and the pendrive
would be nicer. Only one iso file per iso.

Thank you very much!




-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.0.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=es_ES.UTF-8, LC_CTYPE=es_ES.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash



-- 
To UNSUBSCRIBE, email to debian-live-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/20120116190250.30573.24925.reportbug@adrianworktop



Processed: Re: Bug#656135: Add findiso boot parametre

2012-01-16 Thread Debian Bug Tracking System
Processing commands for cont...@bugs.debian.org:

 retitle 656135 support findiso functionality
Bug #656135 [live-boot] Add findiso boot parametre
Changed Bug title to 'support findiso functionality' from 'Add findiso boot 
parametre'
 tag 656135 moreinfo
Bug #656135 [live-boot] support findiso functionality
Added tag(s) moreinfo.
 thanks
Stopping processing here.

Please contact me if you need assistance.
-- 
656135: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=656135
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems


-- 
To UNSUBSCRIBE, email to debian-live-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/handler.s.c.13267479504015.transcr...@bugs.debian.org