|
|

02-04-2010, 05:58 PM
|
|
|
Bug#568317: linux-image-* postinst did not correctly run lilo
reassign 568317 linux-2.6
retitle 568317 linux-image-* postinst did not correctly run lilo
thanks
On Thu, Feb 04, 2010 at 04:49:23PM +1100, paul.szabo@sydney.edu.au wrote:
> This is not a bug in perl, works as documented in 'man perlretut'.
Right.
> The issue is with the /g modifier, as shown with script:
> This is bad usage in the linux-source-2.6.26 package.
> My /var/lib/dpkg/info/linux-image-2.6.26-*.postinst file has header:
> Should I report this bug (spurious, un-needed /g) to the
> linux-source-2.6.26 package, or will you be able to re-assign, or
> otherwise let Mr Srivastava know?
Reassigning now. I see similar m//g usage in
/var/lib/dpkg/info/linux-image-2.6.32-trunk-amd64.postinst
but you could probably follow up and explain what exactly was incorrect
about running lilo.
--
Niko Tyni ntyni@debian.org
--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
|
|

02-04-2010, 08:15 PM
|
|
|
Bug#568317: linux-image-* postinst did not correctly run lilo
Niko Tyni wrote:
> Reassigning now. ...
Thanks.
> ... you could probably follow up and explain what exactly was incorrect
> about running lilo.
Looking at my /var/lib/dpkg/info/linux-image-*.postinst files, I see in
the code reading and parsing $CONF_LOC = '/etc/kernel-img.conf':
...
$do_symlink = "" if /do_symlinkss*=s*(no|false|0)s*$/ig;
...
$do_bootloader = "Yes" if /do_bootloaders*=s*(yes|true|1)s*$/ig;
$explicit_do_loader = "YES" if /do_bootloaders*=s*(yes|true|1)s*$/ig;
...
Most of the match patterns are used once only; using /g on them is not
necessary, and is probably wasteful (though perl is fast enough to
handle such things).
The pattern /do_bootloader.../ig is used twice. The first one may match;
the second one will surely not match because of the spurious /g, thus
explicit_do_loader will never be set (and lilo not run, or run after a
question left un-answered in unattended runs of "apt-get install").
---
Minor issues, while I am criticizing perl style...
These patterns are anchored at the end, should also be anchored at the
beginning (and with explicit m//) like:
$do_symlink = "" if m/^s*do_symlinkss*=s*(no|false|0)s*$/i;
...
$image_dest = "$1" if m/^s*image_dests*=s*(S+)s*$/i;
I wonder about the need to use my() in a single-level script.
---
Cheers, Paul
Paul Szabo psz@maths.usyd.edu.au http://www.maths.usyd.edu.au/u/psz/
School of Mathematics and Statistics University of Sydney Australia
--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
|
|

02-04-2010, 09:58 PM
|
|
|
Bug#568317: linux-image-* postinst did not correctly run lilo
The linux-image postinst is known to be in bad shape but we are slowly
cleaning it up. If you can provide patches, that would be most helpful.
Ben.
--
Ben Hutchings
In a hierarchy, every employee tends to rise to his level of incompetence.
|
|

02-04-2010, 10:54 PM
|
|
|
Bug#568317: linux-image-* postinst did not correctly run lilo
Dear Ben,
> ... If you can provide patches, that would be most helpful.
See below. I now see that the sources of these files are in package
kernel-package (I do not know how that relates to linux-2.6).
I only patched the spurious /g modifiers and "cleaned up" the patterns
e.g. to anchor at the beginning; did not drop the unnecessary my().
Cheers, Paul
Paul Szabo psz@maths.usyd.edu.au http://www.maths.usyd.edu.au/u/psz/
School of Mathematics and Statistics University of Sydney Australia
--- usr/share/kernel-package/pkg/headers/postinst.bak 2008-05-02 15:06:28.000000000 +1000
+++ usr/share/kernel-package/pkg/headers/postinst 2010-02-05 10:30:23.000000000 +1100
@@ -146,8 +146,8 @@
s/#.*$//g;
next if /^s*$/;
- $src_postinst_hook = "$1" if /src_postinst_hooks*=s*(S+)/ig;
- $header_postinst_hook = "$1" if /header_postinst_hooks*=s*(S+)/ig;
+ $src_postinst_hook = "$1" if m/^s*src_postinst_hooks*=s*(S+)s*$/i;
+ $header_postinst_hook = "$1" if m/^s*header_postinst_hooks*=s*(S+)s*$/i;
}
close CONF;
$have_conffile = "Yes";
--- usr/share/kernel-package/pkg/source/postinst.bak 2008-05-02 15:06:28.000000000 +1000
+++ usr/share/kernel-package/pkg/source/postinst 2010-02-05 10:31:06.000000000 +1100
@@ -57,7 +57,7 @@
s/#.*$//g;
next if /^s*$/;
- $src_postinst_hook = "$1" if /src_postinst_hooks*=s*(S+)/ig;
+ $src_postinst_hook = "$1" if m/^s*src_postinst_hooks*=s*(S+)s*$/i;
}
close CONF;
$have_conffile = "Yes";
--- usr/share/kernel-package/pkg/doc/postinst.bak 2008-05-02 15:06:28.000000000 +1000
+++ usr/share/kernel-package/pkg/doc/postinst 2010-02-05 10:31:51.000000000 +1100
@@ -57,7 +57,7 @@
s/#.*$//g;
next if /^s*$/;
- $src_postinst_hook = "$1" if /src_postinst_hooks*=s*(S+)/ig;
+ $src_postinst_hook = "$1" if m/^s*src_postinst_hooks*=s*(S+)s*$/i;
}
close CONF;
$have_conffile = "Yes";
--- usr/share/kernel-package/pkg/image/postinst.bak 2008-11-25 04:01:32.000000000 +1100
+++ usr/share/kernel-package/pkg/image/postinst 2010-02-05 10:43:59.000000000 +1100
@@ -116,60 +116,60 @@
warn "Option image_in_boot is deprecated, and will go away. Use link_in_boot instead.
"
if m/image_in_boots*=s*/;
- $do_symlink = "" if /do_symlinkss*=s*(no|false|0)s*$/ig;
- $no_symlink = "" if /no_symlinkss*=s*(no|false|0)s*$/ig;
- $reverse_symlink = "" if /reverse_symlinks*=s*(no|false|0)s*$/ig;
- $link_in_boot = "" if /link_in_boots*=s*(no|false|0)s*$/ig;
- $link_in_boot = "" if /image_in_boots*=s*(no|false|0)s*$/ig;
- $move_image = "" if /move_images*=s*(no|false|0)s*$/ig;
- $clobber_modules = ' if /clobber_moduless*=s*(no|false|0)s*$/ig;
- $do_boot_enable = ' if /do_boot_enables*=s*(no|false|0)s*$/ig;
- $do_bootfloppy = ' if /do_bootfloppys*=s*(no|false|0)s*$/ig;
- $relative_links = ' if /relative_links s*=s*(no|false|0)s*$/ig;
- $do_bootloader = ' if /do_bootloaders*=s*(no|false|0)s*$/ig;
- $do_initrd = ' if /do_initrds*=s*(no|false|0)s*$/ig;
- $warn_initrd = ' if /warn_initrds*=s*(no|false|0)s*$/ig;
- $use_hard_links = ' if /use_hard_linkss*=s*(no|false|0)s*$/ig;
- $silent_modules = ' if /silent_moduless*=s*(no|false|0)s*$/ig;
- $silent_loader = ' if /silent_loaders*=s*(no|false|0)s*$/ig;
- $warn_reboot = ' if /warn_reboots*=s*(no|false|0)s*$/ig;
- $minimal_swap = ' if /minimal_swaps*=s*(no|false|0)s*$/ig;
- $ignore_depmod_err = ' if /ignore_depmod_errs*=s*(no|false|0)s*$/ig;
- $relink_src_link = ' if /relink_src_links*=s*(no|false|0)s*$/ig;
- $relink_build_link = ' if /relink_build_links*=s*(no|false|0)s*$/ig;
- $force_build_link = ' if /force_build_links*=s*(no|false|0)s*$/ig;
-
- $do_symlink = "Yes" if /do_symlinkss*=s*(yes|true|1)s*$/ig;
- $no_symlink = "Yes" if /no_symlinkss*=s*(yes|true|1)s*$/ig;
- $reverse_symlink = "Yes" if /reverse_symlinkss*=s*(yes|true|1)s*$/ig;
- $link_in_boot = "Yes" if /link_in_boots*=s*(yes|true|1)s*$/ig;
- $link_in_boot = "Yes" if /image_in_boots*=s*(yes|true|1)s*$/ig;
- $move_image = "Yes" if /move_images*=s*(yes|true|1)s*$/ig;
- $clobber_modules = "Yes" if /clobber_moduless*=s*(yes|true|1)s*$/ig;
- $do_boot_enable = "Yes" if /do_boot_enables*=s*(yes|true|1)s*$/ig;
- $do_bootfloppy = "Yes" if /do_bootfloppys*=s*(yes|true|1)s*$/ig;
- $do_bootloader = "Yes" if /do_bootloaders*=s*(yes|true|1)s*$/ig;
- $explicit_do_loader = "YES" if /do_bootloaders*=s*(yes|true|1)s*$/ig;
- $relative_links = "Yes" if /relative_linkss*=s*(yes|true|1)s*$/ig;
- $do_initrd = "Yes" if /do_initrds*=s*(yes|true|1)s*$/ig;
- $warn_initrd = "Yes" if /warn_initrds*=s*(yes|true|1)s*$/ig;
- $use_hard_links = "Yes" if /use_hard_linkss*=s*(yes|true|1)s*$/ig;
- $silent_modules = 'Yes' if /silent_moduless*=s*(yes|true|1)s*$/ig;
- $silent_loader = 'Yes' if /silent_loaders*=s*(yes|true|1)s*$/ig;
- $warn_reboot = 'Yes' if /warn_reboots*=s*(yes|true|1)s*$/ig;
- $minimal_swap = 'Yes' if /minimal_swaps*=s*(yes|true|1)s*$/ig;
- $ignore_depmod_err = 'Yes' if /ignore_depmod_errs*=s*(yes|true|1)s*$/ig;
- $relink_src_link = 'Yes' if /relink_src_links*=s*(yes|true|1)s*$/ig;
- $relink_build_link = 'Yes' if /relink_build_links*=s*(yes|true|1)s*$/ig;
- $force_build_link = 'Yes' if /force_build_links*=s*(yes|true|1)s*$/ig;
-
- $image_dest = "$1" if /image_dests*=s*(S+)/ig;
- $postinst_hook = "$1" if /postinst_hooks*=s*(S+)/ig;
- $postrm_hook = "$1" if /postrm_hooks*=s*(S+)/ig;
- $preinst_hook = "$1" if /preinst_hooks*=s*(S+)/ig;
- $prerm_hook = "$1" if /prerm_hooks*=s*(S+)/ig;
- $mkimage = "$1" if /mkimages*=s*(.+)$/ig;
- $ramdisk = "$1" if /ramdisks*=s*(.+)$/ig;
+ $do_symlink = "" if m/^s*do_symlinkss*=s*(no|false|0)s*$/i;
+ $no_symlink = "" if m/^s*no_symlinkss*=s*(no|false|0)s*$/i;
+ $reverse_symlink = "" if m/^s*reverse_symlinks*=s*(no|false|0)s*$/i;
+ $link_in_boot = "" if m/^s*link_in_boots*=s*(no|false|0)s*$/i;
+ $link_in_boot = "" if m/^s*image_in_boots*=s*(no|false|0)s*$/i;
+ $move_image = "" if m/^s*move_images*=s*(no|false|0)s*$/i;
+ $clobber_modules = ' if m/^s*clobber_moduless*=s*(no|false|0)s*$/i;
+ $do_boot_enable = ' if m/^s*do_boot_enables*=s*(no|false|0)s*$/i;
+ $do_bootfloppy = ' if m/^s*do_bootfloppys*=s*(no|false|0)s*$/i;
+ $relative_links = ' if m/^s*relative_links s*=s*(no|false|0)s*$/i;
+ $do_bootloader = ' if m/^s*do_bootloaders*=s*(no|false|0)s*$/i;
+ $do_initrd = ' if m/^s*do_initrds*=s*(no|false|0)s*$/i;
+ $warn_initrd = ' if m/^s*warn_initrds*=s*(no|false|0)s*$/i;
+ $use_hard_links = ' if m/^s*use_hard_linkss*=s*(no|false|0)s*$/i;
+ $silent_modules = ' if m/^s*silent_moduless*=s*(no|false|0)s*$/i;
+ $silent_loader = ' if m/^s*silent_loaders*=s*(no|false|0)s*$/i;
+ $warn_reboot = ' if m/^s*warn_reboots*=s*(no|false|0)s*$/i;
+ $minimal_swap = ' if m/^s*minimal_swaps*=s*(no|false|0)s*$/i;
+ $ignore_depmod_err = ' if m/^s*ignore_depmod_errs*=s*(no|false|0)s*$/i;
+ $relink_src_link = ' if m/^s*relink_src_links*=s*(no|false|0)s*$/i;
+ $relink_build_link = ' if m/^s*relink_build_links*=s*(no|false|0)s*$/i;
+ $force_build_link = ' if m/^s*force_build_links*=s*(no|false|0)s*$/i;
+
+ $do_symlink = "Yes" if m/^s*do_symlinkss*=s*(yes|true|1)s*$/i;
+ $no_symlink = "Yes" if m/^s*no_symlinkss*=s*(yes|true|1)s*$/i;
+ $reverse_symlink = "Yes" if m/^s*reverse_symlinkss*=s*(yes|true|1)s*$/i;
+ $link_in_boot = "Yes" if m/^s*link_in_boots*=s*(yes|true|1)s*$/i;
+ $link_in_boot = "Yes" if m/^s*image_in_boots*=s*(yes|true|1)s*$/i;
+ $move_image = "Yes" if m/^s*move_images*=s*(yes|true|1)s*$/i;
+ $clobber_modules = "Yes" if m/^s*clobber_moduless*=s*(yes|true|1)s*$/i;
+ $do_boot_enable = "Yes" if m/^s*do_boot_enables*=s*(yes|true|1)s*$/i;
+ $do_bootfloppy = "Yes" if m/^s*do_bootfloppys*=s*(yes|true|1)s*$/i;
+ $do_bootloader = "Yes" if m/^s*do_bootloaders*=s*(yes|true|1)s*$/i;
+ $explicit_do_loader = "YES" if m/^s*do_bootloaders*=s*(yes|true|1)s*$/i;
+ $relative_links = "Yes" if m/^s*relative_linkss*=s*(yes|true|1)s*$/i;
+ $do_initrd = "Yes" if m/^s*do_initrds*=s*(yes|true|1)s*$/i;
+ $warn_initrd = "Yes" if m/^s*warn_initrds*=s*(yes|true|1)s*$/i;
+ $use_hard_links = "Yes" if m/^s*use_hard_linkss*=s*(yes|true|1)s*$/i;
+ $silent_modules = 'Yes' if m/^s*silent_moduless*=s*(yes|true|1)s*$/i;
+ $silent_loader = 'Yes' if m/^s*silent_loaders*=s*(yes|true|1)s*$/i;
+ $warn_reboot = 'Yes' if m/^s*warn_reboots*=s*(yes|true|1)s*$/i;
+ $minimal_swap = 'Yes' if m/^s*minimal_swaps*=s*(yes|true|1)s*$/i;
+ $ignore_depmod_err = 'Yes' if m/^s*ignore_depmod_errs*=s*(yes|true|1)s*$/i;
+ $relink_src_link = 'Yes' if m/^s*relink_src_links*=s*(yes|true|1)s*$/i;
+ $relink_build_link = 'Yes' if m/^s*relink_build_links*=s*(yes|true|1)s*$/i;
+ $force_build_link = 'Yes' if m/^s*force_build_links*=s*(yes|true|1)s*$/i;
+
+ $image_dest = "$1" if m/^s*image_dests*=s*(S+)s*$/i;
+ $postinst_hook = "$1" if m/^s*postinst_hooks*=s*(S+)s*$/i;
+ $postrm_hook = "$1" if m/^s*postrm_hooks*=s*(S+)s*$/i;
+ $preinst_hook = "$1" if m/^s*preinst_hooks*=s*(S+)s*$/i;
+ $prerm_hook = "$1" if m/^s*prerm_hooks*=s*(S+)s*$/i;
+ $mkimage = "$1" if m/^s*mkimages*=s*(S.*)$/i;
+ $ramdisk = "$1" if m/^s*ramdisks*=s*(S.*)$/i;
}
close CONF;
$have_conffile = "Yes";
--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
|
|

02-04-2010, 11:21 PM
|
|
|
Bug#568317: linux-image-* postinst did not correctly run lilo
On Fri, Feb 05, 2010 at 10:54:33AM +1100, paul.szabo@sydney.edu.au wrote:
> Dear Ben,
>
> > ... If you can provide patches, that would be most helpful.
>
> See below. I now see that the sources of these files are in package
> kernel-package (I do not know how that relates to linux-2.6).
> I only patched the spurious /g modifiers and "cleaned up" the patterns
> e.g. to anchor at the beginning; did not drop the unnecessary my().
[...]
kernel-package has an old version of the script templates.
The templates used by linux-2.6 are in debian/templates/temp.image.plain.
Ben.
--
Ben Hutchings
In a hierarchy, every employee tends to rise to his level of incompetence.
|
|

02-05-2010, 12:10 AM
|
|
|
Bug#568317: linux-image-* postinst did not correctly run lilo
Dear Ben,
> kernel-package has an old version of the script templates.
> The templates used by linux-2.6 are in debian/templates/temp.image.plain.
Where do I find that? I am using (working, building on) Debian lenny,
building from linux-source-2.6.26-21.tar.bz2 . (Anyway, are not my
suggested changes simple enough so you do not need actual patch files?)
Thanks, Paul
Paul Szabo psz@maths.usyd.edu.au http://www.maths.usyd.edu.au/u/psz/
School of Mathematics and Statistics University of Sydney Australia
--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
|
|

02-05-2010, 08:34 AM
|
|
|
Bug#568317: linux-image-* postinst did not correctly run lilo
On Fri, Feb 05, 2010 at 12:10:46PM +1100, paul.szabo@sydney.edu.au wrote:
> Dear Ben,
>
> > kernel-package has an old version of the script templates.
> > The templates used by linux-2.6 are in debian/templates/temp.image.plain.
>
> Where do I find that?
apt-get source linux-2.6
or
svn co svn://svn.debian.org/svn/kernel/dists/trunk/linux-2.6
> I am using (working, building on) Debian lenny,
> building from linux-source-2.6.26-21.tar.bz2 . (Anyway, are not my
> suggested changes simple enough so you do not need actual patch files?)
Possibly... I haven't compared yet.
Ben.
--
Ben Hutchings
Beware of programmers who carry screwdrivers. - Leonard Brandwein
|
|

02-05-2010, 10:20 PM
|
|
|
Bug#568317: linux-image-* postinst did not correctly run lilo
Dear Ben,
>>> kernel-package has an old version of the script templates.
>>> The templates used by linux-2.6 are in debian/templates/temp.image.plain.
>>
>> Where do I find that?
>
> apt-get source linux-2.6
Sorry, am confused. Is that the same as
apt-get install linux-source-2.6.26
which would get me (and install)
linux-source-2.6.26_2.6.26-21_all.deb
and suggest to get/install
kernel-package_11.015_all.deb
? I do not see anything about "templates" in either deb file,
but see /usr/share/kernel-package/pkg/image/postinst in kernel-package.
BTW... lenny 5.0.4, with 2.6.26-21, was announced some time ago, but
still
http://packages.debian.org/search?keywords=linux-2.6&searchon=sourcenames&suite=stable§ion=all
http://packages.debian.org/source/lenny/linux-2.6
show 2.6.26-19lenny2 : is that a problem?
Thanks, Paul
Paul Szabo psz@maths.usyd.edu.au http://www.maths.usyd.edu.au/u/psz/
School of Mathematics and Statistics University of Sydney Australia
--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
|
|

02-07-2010, 10:02 AM
|
|
|
Bug#568317: linux-image-* postinst did not correctly run lilo
Dear Ben,
>>>>> kernel-package has an old version of the script templates.
>>>>> The templates used by linux-2.6 are in debian/templates/temp.image.plain.
>>>>
>>>> Where do I find that?
>>>
>>> apt-get source linux-2.6
>>
>> Sorry, am confused. Is that the same as
>> apt-get install linux-source-2.6.26
>
> It is not.
I now tried that (not with apt-get but manually). I guess I needed the
files:
.../pool/main/l/linux-2.6/linux-2.6_2.6.26.orig.tar.gz
.../pool/main/l/linux-2.6/linux-2.6_2.6.26-21.diff.gz
(please confirm, or tell me what I messed up). After unpacking those,
I find (essentially in the diff file) the
.../linux-2.6-2.6.26/debian/templates/temp.image.plain/
directory. However, to my surprise, those files are older than those
from the kernel-package directory, for example:
diff -r /usr/share/kernel-package/pkg/image/postinst linux-2.6-2.6.26/debian/templates/temp.image.plain/postinst
8,10c8,10
< # Last Modified On : Wed Oct 8 00:03:41 2008
< # Last Machine Used: anzu.internal.golden-gryphon.com
< # Update Count : 360
---
> # Last Modified On : Fri Sep 29 10:08:18 2006
> # Last Machine Used: glaurung.internal.golden-gryphon.com
> # Update Count : 357
...
Does that mean that kernel-package is in fact newer, and you should
"import" again then use my patches (sent previously)?
-----
Should this bug somehow be "given" to kernel-package also (clone and
reassign?): would you be able to do that?
-----
>> BTW... lenny 5.0.4, with 2.6.26-21, was announced some time ago, but
>> still
>> http://packages.debian.org/search?keywords=linux-2.6&searchon=sourcenames&suite=stable§ion=all
>> http://packages.debian.org/source/lenny/linux-2.6
>> show 2.6.26-19lenny2 : is that a problem?
>
> That is strange. Perhaps you should report a bug against www.debian.org.
Would you be able to do that? (I guess should not use reportbug for
that, am not sure how.)
Thanks, Paul
Paul Szabo psz@maths.usyd.edu.au http://www.maths.usyd.edu.au/u/psz/
School of Mathematics and Statistics University of Sydney Australia
--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
|
|

02-07-2010, 08:36 PM
|
|
|
Bug#568317: linux-image-* postinst did not correctly run lilo
On Sat, Feb 06, 2010 at 10:20:13AM +1100, paul.szabo@sydney.edu.au wrote:
> Dear Ben,
>
> >>> kernel-package has an old version of the script templates.
> >>> The templates used by linux-2.6 are in debian/templates/temp.image.plain.
> >>
> >> Where do I find that?
> >
> > apt-get source linux-2.6
>
> Sorry, am confused. Is that the same as
> apt-get install linux-source-2.6.26
> which would get me (and install)
> linux-source-2.6.26_2.6.26-21_all.deb
> and suggest to get/install
> kernel-package_11.015_all.deb
> ? I do not see anything about "templates" in either deb file,
> but see /usr/share/kernel-package/pkg/image/postinst in kernel-package.
please 2.6.26 is old, we are working in sid on 2.6.32.
--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
|
|
|
All times are GMT. The time now is 09:20 AM.
VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org
|