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

Re: [kernel] r16958 - in dists/trunk/linux-2.6/debian: . bin config



Hi

On Friday 04 March 2011, Ben Hutchings wrote:
> On Fri, Mar 04, 2011 at 12:00:48AM +0100, Stefan Lippers-Hollmann wrote:
[...]
> > > Modified: dists/trunk/linux-2.6/debian/templates/temp.image.plain/postinst
> > > ==============================================================================
> > > --- dists/trunk/linux-2.6/debian/templates/temp.image.plain/postinst	Tue Mar  1 02:19:31 2011	(r16957)
> > > +++ dists/trunk/linux-2.6/debian/templates/temp.image.plain/postinst	Tue Mar  1 05:44:42 2011	(r16958)
> > > [...]
> > > @@ -821,6 +793,10 @@
> > >      die "Error asking debconf question $question: $seen" if $ret && $ret != 30;
> > >  }
> > >  
> > > +if ($initrd && ! -e "initrd.img-$version") {
> > 
> > I think this needs to be prepended by the full install path, like:
> >    if ($initrd && ! -e "${realimageloc}initrd.img-$version") {
> [...]
> 
> We have already chdir()'d to that directory.

I'm certainly not overly fluent in perl, but I'm pretty sure that cwd 
is / at that stage
[...]
	#known variables
	my $image_dest      = "/";
	my $realimageloc    = "/boot/";
	my $have_conffile   = "";
[...]
	# Do some preliminary sanity checks here to ensure we actually have an
	# valid image dir
	chdir('/')           or die "could not chdir to /:$!\n";
[...]
	# most of our work is done in $image_dest (nominally /)
	chdir("$image_dest") or die "could not chdir to $image_dest:$!\n";
[...]
the only remaining chdir() call is in test_relative() and doesn't 
appear to have an effect on the cwd.

Likewise extending the afforementioned check with a quick and dirty call to 
getcwd() seems to agree with / being the cwd at that stage:
[...]
	if ($initrd && ! -e "initrd.img-$version") {
	  use Cwd;
	  print STDERR "Current working directory: " . getcwd() . "\n";
	  die "Failed to create initrd image.\n";
	}
[...]

Which results in:
[...]
	run-parts: executing /etc/kernel/postinst.d/initramfs-tools 2.6.38-rc7-amd64 /boot/vmlinuz-2.6.38-rc7-amd64
	update-initramfs: Generating /boot/initrd.img-2.6.38-rc7-amd64
	run-parts: executing /etc/kernel/postinst.d/zz-update-grub 2.6.38-rc7-amd64 /boot/vmlinuz-2.6.38-rc7-amd64
	Generating grub.cfg ...
[...]
	Current working directory: /
	Failed to create initrd image.
	dpkg: error processing linux-image-2.6.38-rc7-amd64 (--configure):
	 subprocess installed post-installation script returned error exit status 2

While it succeeds correctly with (after convincing 
/etc/kernel/postinst.d/initramfs-tools to generate initrds for official
Debian kernels as well) by using:
	 if ($initrd && ! -e "${realimageloc}initrd.img-$version") {

Regards
	Stefan Lippers-Hollmann


Reply to: