Bug#859438: preseed header magic

2017-04-22 Thread Geert Stappers

Hi,

On Sat, Apr 22, 2017 at 10:30:31PM +0200, Holger Wansing wrote:
> Geert Stappers wrote:
> > Holger Wansing  wrote:
> > > And there is nothing like that ATM in the manual.
> > 
> > True.
> > I tried with
> > --- build/build.sh  (revision 70653)
> > +++ build/build.sh  (working copy)
> > @@ -59,7 +59,8 @@
> >  if [ -f $PRESEED ] && [ -f preseed.pl ] ; then
> >  for arch in $architectures; do
> > eval arch_destination=$destination
> > -   ./preseed.pl -r $manual_release $PRESEED 
> > >$arch_destination/example-preseed.txt
> > +   echo '#_preseed_V1' >$arch_destination/example-preseed.txt
> > +   ./preseed.pl -r $manual_release $PRESEED 
> > >>$arch_destination/example-preseed.txt
> >  done
> >  fi
> > 
> > 
> > > >
> > > > The attached patch adds the needed paragraph in B.4 chapter at the very
> > > > beginning (the already existing content regarding the new header is in 
> > > > B.3).
> > >
> > > Any objections against me committing the attached patch, to fix the
> > > example-preseed.txt file?
> > 
> > No objection. It is better then I patch against the create script.
} } No objection. It is better then my patch against the create script.
> 
> Ahh, I see.
> 
> Geert: to be honest, I overlooked your changing in build.sh.
> And now, double-checking that, it works. The header is there in
> https://d-i.debian.org/manual/example-preseed.txt
> 
> So I have to correct myself a bit: 
> The example-pressed.txt file would be ok so far, strictly spoken.
> 
> So, the only argument to still change something now, would be:
> The whole content of example-preseed.txt is generated from text examples
> within the chapter B.4 of the installation-guide.
> To be consistent with this, it would require to apply my proposed patch.

Indeed

> It would also give possibility to explain, what this header line is for.

But below the top line. So the file starts with the actual header.


> But: Applying my patch would make above's changing in build.sh useless, so
> this would have to be reverted, right?


Find attached a patch that does _both_ things.



Groeten
Geert Stappers
-- 
Leven en laten leven
Index: build/build.sh
===
--- build/build.sh	(revision 70708)
+++ build/build.sh	(working copy)
@@ -59,8 +59,7 @@
 if [ -f $PRESEED ] && [ -f preseed.pl ] ; then
 for arch in $architectures; do
 	eval arch_destination=$destination
-	echo '#_preseed_V1' >$arch_destination/example-preseed.txt
-	./preseed.pl -r $manual_release $PRESEED >>$arch_destination/example-preseed.txt
+	./preseed.pl -r $manual_release $PRESEED >$arch_destination/example-preseed.txt
 done
 fi
 
Index: en/appendix/preseed.xml
===
--- en/appendix/preseed.xml	(revision 70708)
+++ en/appendix/preseed.xml	(working copy)
@@ -762,6 +762,16 @@
 
 
 
+For the  to be able to automatically detect preseed files, such files
+need to start with the #_preseed_V1 header:
+
+
+#_preseed_V1
+# Header for installer preseed files for automatical detection of preseedfile
+
+
+
+
 Details on how the different Debian Installer components actually work can be
 found in .
 


signature.asc
Description: Digital signature


Bug#859438: preseed header magic

2017-04-22 Thread Holger Wansing
Hi,

Geert Stappers  wrote:
> On Sat, Apr 22, 2017 at 09:35:18PM +0200, Holger Wansing wrote:
> > Holger Wansing  wrote:
> > > The patch for the manual was committed in the meantime, but now the new
> > > header is not included in the example-preseed.txt file, see
> > > http://d-i.alioth.debian.org/manual/example-preseed.txt
> > >
> > > This is, because the script, which generates the example-preseed.txt file,
> > > only parses parts of the preseed.xml which are between 
> > > tags that have the attribute 'role="example"' set.
> > > (This documented at the beginning of the ../en/appendix/preseed.xml.)
> > > And there is nothing like that ATM in the manual.
> 
> True.
> I tried with
> --- build/build.sh  (revision 70653)
> +++ build/build.sh  (working copy)
> @@ -59,7 +59,8 @@
>  if [ -f $PRESEED ] && [ -f preseed.pl ] ; then
>  for arch in $architectures; do
> eval arch_destination=$destination
> -   ./preseed.pl -r $manual_release $PRESEED 
> >$arch_destination/example-preseed.txt
> +   echo '#_preseed_V1' >$arch_destination/example-preseed.txt
> +   ./preseed.pl -r $manual_release $PRESEED 
> >>$arch_destination/example-preseed.txt
>  done
>  fi
> 
> 
> > >
> > > The attached patch adds the needed paragraph in B.4 chapter at the very
> > > beginning (the already existing content regarding the new header is in 
> > > B.3).
> >
> > Any objections against me committing the attached patch, to fix the
> > example-preseed.txt file?
> 
> No objection. It is better then I patch against the create script.

Ahh, I see.

Geert: to be honest, I overlooked your changing in build.sh.
And now, double-checking that, it works. The header is there in
https://d-i.debian.org/manual/example-preseed.txt

So I have to correct myself a bit: 
The example-pressed.txt file would be ok so far, strictly spoken.

So, the only argument to still change something now, would be:
The whole content of example-preseed.txt is generated from text examples
within the chapter B.4 of the installation-guide.
To be consistent with this, it would require to apply my proposed patch.
It would also give possibility to explain, what this header line is for.


But: Applying my patch would make above's changing in build.sh useless, so
this would have to be reverted, right?


Holger

-- 

Created with Sylpheed 3.5.0 under
D E B I A N   L I N U X   8 . 0   " J E S S I E " .

Registered Linux User #311290 - https://linuxcounter.net/




Bug#859438: preseed header magic

2017-04-22 Thread Geert Stappers
On Sat, Apr 22, 2017 at 09:35:18PM +0200, Holger Wansing wrote:
> Holger Wansing  wrote:
> > Geert Stappers  wrote:
> > >
> > > The long run goal is to make preseed
> > > being able to identify that it is reading a preseed file.
> > >
> > > The wanted way to go is adding header magic.
> > >
> > > In https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=848726
> > > is a bugreport against preseed. This one against installation-guide
> >
> > The patch for the manual was committed in the meantime, but now the new
> > header is not included in the example-preseed.txt file, see
> > http://d-i.alioth.debian.org/manual/example-preseed.txt
> >
> > This is, because the script, which generates the example-preseed.txt file,
> > only parses parts of the preseed.xml which are between 
> > tags that have the attribute 'role="example"' set.
> > (This documented at the beginning of the ../en/appendix/preseed.xml.)
> > And there is nothing like that ATM in the manual.

True.
I tried with
--- build/build.sh  (revision 70653)
+++ build/build.sh  (working copy)
@@ -59,7 +59,8 @@
 if [ -f $PRESEED ] && [ -f preseed.pl ] ; then
 for arch in $architectures; do
eval arch_destination=$destination
-   ./preseed.pl -r $manual_release $PRESEED 
>$arch_destination/example-preseed.txt
+   echo '#_preseed_V1' >$arch_destination/example-preseed.txt
+   ./preseed.pl -r $manual_release $PRESEED 
>>$arch_destination/example-preseed.txt
 done
 fi


> >
> > The attached patch adds the needed paragraph in B.4 chapter at the very
> > beginning (the already existing content regarding the new header is in B.3).
>
> Any objections against me committing the attached patch, to fix the
> example-preseed.txt file?

No objection. It is better then I patch against the create script.


But wait ...

> Index: en/appendix/preseed.xml
> ===
> --- en/appendix/preseed.xml   (Revision 70688)
> +++ en/appendix/preseed.xml   (Arbeitskopie)
> @@ -762,6 +762,16 @@
>
>  
>
> +For the  to be able to automatically detect preseed files, such files
> +need to start with the #_preseed_V1 header:
> +
> +
> +# Header for installer preseed files, for automatical detection of these 
> files:
> +#_preseed_V1
> +
> +
> +
> +
>  Details on how the different Debian Installer components actually work can be
>  found in .
>

It should

+
+#_preseed_V1
+# Header for installer preseed files for automatical detection of preseedfile
+

Because it gets

#_preseed_V1

at the very first line (the line with usual !#/bin/something )



@Holger: thanks for the retransmit


Groeten
Geert Stappers
--
Leven en laten leven



Bug#859438: preseed header magic

2017-04-22 Thread Holger Wansing
Hi,

Holger Wansing  wrote:
> Hi,
> 
> Geert Stappers  wrote:
> > Package: installation-guide
> > Version: 20161031
> > Tags: patch stretch
> > 
> > 
> > Hi,
> > 
> > The long run goal is to make preseed
> > being able to identify that it is reading a preseed file.
> > 
> > The wanted way to go is adding header magic.
> > 
> > In https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=848726
> > is a bugreport against preseed. This one against installation-guide
> 
> The patch for the manual was committed in the meantime, but now the new
> header is not included in the example-preseed.txt file, see
> http://d-i.alioth.debian.org/manual/example-preseed.txt
> 
> This is, because the script, which generates the example-preseed.txt file,
> only parses parts of the preseed.xml which are between  
> tags that have the attribute 'role="example"' set.
> (This documented at the beginning of the ../en/appendix/preseed.xml.)
> And there is nothing like that ATM in the manual.
> 
> The attached patch adds the needed paragraph in B.4 chapter at the very
> beginning (the already existing content regarding the new header is in B.3).

Any objections against me committing the attached patch, to fix the
example-preseed.txt file?


Holger

-- 

Created with Sylpheed 3.5.0 under
D E B I A N   L I N U X   8 . 0   " J E S S I E " .

Registered Linux User #311290 - https://linuxcounter.net/

Index: en/appendix/preseed.xml
===
--- en/appendix/preseed.xml	(Revision 70688)
+++ en/appendix/preseed.xml	(Arbeitskopie)
@@ -762,6 +762,16 @@
 
 
 
+For the  to be able to automatically detect preseed files, such files
+need to start with the #_preseed_V1 header:
+
+
+# Header for installer preseed files, for automatical detection of these files:
+#_preseed_V1
+
+
+
+
 Details on how the different Debian Installer components actually work can be
 found in .
 


Bug#859438: preseed header magic

2017-04-15 Thread Holger Wansing
Hi,

Geert Stappers  wrote:
> Package: installation-guide
> Version: 20161031
> Tags: patch stretch
> 
> 
> Hi,
> 
> The long run goal is to make preseed
> being able to identify that it is reading a preseed file.
> 
> The wanted way to go is adding header magic.
> 
> In https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=848726
> is a bugreport against preseed. This one against installation-guide

The patch for the manual was committed in the meantime, but now the new
header is not included in the example-preseed.txt file, see
http://d-i.alioth.debian.org/manual/example-preseed.txt

This is, because the script, which generates the example-preseed.txt file,
only parses parts of the preseed.xml which are between  
tags that have the attribute 'role="example"' set.
(This documented at the beginning of the ../en/appendix/preseed.xml.)
And there is nothing like that ATM in the manual.

The attached patch adds the needed paragraph in B.4 chapter at the very
beginning (the already existing content regarding the new header is in B.3).


Holger


-- 

Created with Sylpheed 3.5.0 under
D E B I A N   L I N U X   8 . 0   " J E S S I E " .

Registered Linux User #311290 - https://linuxcounter.net/

Index: en/appendix/preseed.xml
===
--- en/appendix/preseed.xml	(Revision 70688)
+++ en/appendix/preseed.xml	(Arbeitskopie)
@@ -762,6 +762,16 @@
 
 
 
+For the  to be able to automatically detect preseed files, such files
+need to start with the #_preseed_V1 header:
+
+
+# Header for installer preseed files, for automatical detection of these files:
+#_preseed_V1
+
+
+
+
 Details on how the different Debian Installer components actually work can be
 found in .
 


Bug#859438: preseed header magic

2017-04-03 Thread Geert Stappers
Package: installation-guide
Version: 20161031
Tags: patch stretch


Hi,

The long run goal is to make preseed
being able to identify that it is reading a preseed file.

The wanted way to go is adding header magic.

In https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=848726
is a bugreport against preseed. This one against installation-guide

Groeten
Geert Stappers

- Forwarded message from Geert Stappers -

Date: Mon, 3 Apr 2017 15:40:13 +0200
From: Geert Stappers 
To: Pali Rohár , 848...@bugs.debian.org
Subject: Re: shebang preseed / header magic

On Sun, Jan 15, 2017 at 11:09:02AM +0100, Pali Rohár wrote:
] ]  Goal is having a "header" which make it possible
] ]  to check that actual a preseed file is being downloaded.
] ]  
] ]  Step 1:
] ]  Document all "stretch" preseed files begining with '#_preseed_V1'
] ]  
] ]  Step 2:
] ]  In "stretch+1", a.k.a. "buster", implement code that checks '#_preseed_V1'
] ]  and informs netbooting user when not found.
] ]  
> 
> Hi! Any progress on this particular problem?

Find attached a patch  against the installation guide.


> I fully agree that pressed file should be identifiable by either some
> magic line or header.

Yes. The challenge now is to get beyond "we didn't need in the past" ...


Index: build/build.sh
===
--- build/build.sh  (revision 70653)
+++ build/build.sh  (working copy)
@@ -59,7 +59,8 @@
 if [ -f $PRESEED ] && [ -f preseed.pl ] ; then
 for arch in $architectures; do
eval arch_destination=$destination
-   ./preseed.pl -r $manual_release $PRESEED 
>$arch_destination/example-preseed.txt
+   echo '#_preseed_V1' >$arch_destination/example-preseed.txt
+   ./preseed.pl -r $manual_release $PRESEED 
>>$arch_destination/example-preseed.txt
 done
 fi
 
Index: en/appendix/preseed.xml
===
--- en/appendix/preseed.xml (revision 70653)
+++ en/appendix/preseed.xml (working copy)
@@ -633,6 +633,18 @@
 
 
 
+The file should start with #_preseed_V1
+
+
+
+
+
 There are a few rules to keep in mind when writing a preconfiguration file.
 
 
@@ -667,6 +679,10 @@
   Some questions take a code as value instead of the English text that is
   shown during installation.
 
+
+  Start with #_preseed_V1
+  
+
 
 
 
@@ -682,7 +698,8 @@
 database and the installer's cdebconf database to a single file:
 
 
-$ debconf-get-selections --installer  file
+$ echo "#_preseed_V1"  file
+$ debconf-get-selections --installer  file
 $ debconf-get-selections  file
 
 


- End forwarded message -
Index: build/build.sh
===
--- build/build.sh	(revision 70653)
+++ build/build.sh	(working copy)
@@ -59,7 +59,8 @@
 if [ -f $PRESEED ] && [ -f preseed.pl ] ; then
 for arch in $architectures; do
 	eval arch_destination=$destination
-	./preseed.pl -r $manual_release $PRESEED >$arch_destination/example-preseed.txt
+	echo '#_preseed_V1' >$arch_destination/example-preseed.txt
+	./preseed.pl -r $manual_release $PRESEED >>$arch_destination/example-preseed.txt
 done
 fi
 
Index: en/appendix/preseed.xml
===
--- en/appendix/preseed.xml	(revision 70653)
+++ en/appendix/preseed.xml	(working copy)
@@ -633,6 +633,18 @@
 
 
 
+The file should start with #_preseed_V1
+
+
+
+
+
 There are a few rules to keep in mind when writing a preconfiguration file.
 
 
@@ -667,6 +679,10 @@
   Some questions take a code as value instead of the English text that is
   shown during installation.
 
+
+  Start with #_preseed_V1
+  
+
 
 
 
@@ -682,7 +698,8 @@
 database and the installer's cdebconf database to a single file:
 
 
-$ debconf-get-selections --installer  file
+$ echo "#_preseed_V1"  file
+$ debconf-get-selections --installer  file
 $ debconf-get-selections  file
 
 


signature.asc
Description: Digital signature