[15:34] <ogra_> rtg, do you happen to be around ? seems there is something broken with triggers in the linux-raspi2 package ...  https://launchpadlibrarian.net/224109673/buildlog_ubuntu_xenial_armhf_ubuntu-core-system-image_BUILDING.txt.gz (i thought it was 1:1 based on -generric packaging which would enforce the trigger execution ?)
[15:38] <rtg> ogra_, I don't think we've even upload raspi2 to xenial yet. I'll sic Paolo on it. 
[15:38] <ogra_> rtg, it was synced over from wily 
[15:49] <ogra_> ppisati, yo 
[15:49] <apw> ogra_, which triggers ?
[15:49] <ogra_> apw, postinst initrd creation doesnt run 
[15:49] <ogra_> https://launchpadlibrarian.net/224109673/buildlog_ubuntu_xenial_armhf_ubuntu-core-system-image_BUILDING.txt.gz
[15:49] <ogra_> (see the bottom)
[15:50] <ogra_> Setting up linux-image-4.2.0-1013-raspi2 (4.2.0-1013.19) ...
[15:50] <ogra_> Running depmod.
[15:50] <ogra_> update-initramfs: deferring update (hook will be called later)
[15:50] <ogra_> cp: cannot stat '/boot/initrd.img-4.2.0-1013-raspi2': No such file or directory
[15:50] <ogra_> Failed to copy /boot/initrd.img-4.2.0-1013-raspi2 to /boot/initrd.img at /var/lib/dpkg/info/linux-image-4.2.0-1013-raspi2.postinst line 745.
[15:50] <ogra_> dpkg: error processing package linux-image-4.2.0-1013-raspi2 (--configure):
[15:51] <ogra_> it seems to completely skip /etc/kernel/postinst.d/initramfs-tools for some reason
[15:51] <ogra_> (if you scroll up in the log you see the same thing work for -generic)
[15:51] <apw> ogra_, it decided this was a delayable initramfs build
[15:51] <apw> update-initramfs: deferring update (hook will be called later)
[15:52] <ogra_> apw, -generic prints the same and then executes /etc/kernel/postinst.d/initramfs-tools
[15:52] <ogra_> before trying to copy the initrd 
[15:52] <ogra_> update-initramfs: deferring update (hook will be called later)
[15:52] <ogra_> Examining /etc/kernel/postinst.d.
[15:52] <ogra_> run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.2.0-16-generic /boot/vmlinuz-4.2.0-16-generic
[15:52] <ogra_> run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.2.0-16-generic /boot/vmlinuz-4.2.0-16-generic
[15:52] <ogra_> thats a bit further up in the log 
[15:53] <apw> ogra_, who is doing that copy ?
[15:53] <ogra_> so it works for generic but not for raspi2 in the same chroot 
[15:53] <apw> ogra_, that is not a "standard" behavour
[15:53] <ogra_> apw, your postinst
[15:53] <ogra_> in line 745 obviously :)
[15:53] <apw> we would not normally copy it
[15:53] <ogra_> well, i see the code here 
[15:54] <apw> we don't make the name "/boot/initrd.img" on a default install
[15:54] <ogra_> Failed to copy /boot/initrd.img-4.2.0-1013-raspi2 to /boot/initrd.img at /var/lib/dpkg/info/linux-image-4.2.0-1013-raspi2.postinst line 745.
[15:54] <ogra_> well, thats definitely your postinst 
[15:55] <apw> ogra_, indeed, i am not disputing it, i am saying we don't normally copy it, we normally symlink it, which isn't order dependant
[15:57] <ogra_> right, looks like it uses a wrong code path or some such 
[15:58] <apw> ogra_, so the / and /boot we are building here, what are they, what filesystem type etc
[15:59] <apw> ogra_, what is in your /etc/kernel.conf in that filesystem
[16:03] <ogra_> apw, no idea, it is the rootfs of an image build ... the config should be fine and -generic installs fine on the same setup (as i said, a few lines up -generic gets installed in the log)
[16:04] <apw> ogra_, can we find out ?
[16:08] <ogra_> apw, thats quite some work and hackery to livecd-rootfs, but yes, i can .,.. just takes long
[16:09] <apw> ogra_, hmm
[16:14] <apw> ogra_, so the -generic which works, was that a fresh install or an upgrade, was there a generic kernle in whatever you started from ?
[16:15] <ogra_> apw, this is a livefs build, it starts from a basic debootstrap 
[16:15] <ogra_> installs the ubuntu-core task and then installs kernel packages 
[16:16] <apw> ogasawara, all starting with an empty directory i assume
[16:16] <apw> ogra_, ^^
[16:17] <apw> ogra_, and i assume this is the "same" as wily was and it works there ?
[16:17] <ogra_> apw, well, except that i additionaly try to install the raspi package now to create a device tarball from that later 
[16:17] <ogra_> it works, yes
[16:23] <apw> ogra_, ok so the code is trying to use "cp" because when we try and buid the symlink called /initrd.img and that is already present and is already not a symlink
[16:23] <apw> ogra_, what that file is is hard to understand given you have no kernel installed when you do that, right ?
[16:24] <ogra_> apw, so i apt-get purge linux-image-*-generic ... then i install linux-raspi2 
[16:24] <ogra_> technically it should remove all symlinks 
[16:24] <ogra_> and re-create them
[16:25] <apw> update-initramfs: diverted by livecd-rootfs (will be called later)
[16:25] <apw> ogra_, what is that all about
[16:26] <ogra_> thats normal, livecd-toofs does that ... but wont matter for our issue
[16:28] <ogra_> (that diversion is gone at the point where i install the kernel package)
[16:36] <apw> ogra_, in the generic it appears to be still active when the kernel was installed
[16:36] <apw> ogra_, yeah it was still in place when the delayed trigger in the generic case was called
[16:38] <ogra_> well, /etc/kernel/postinst.d/initramfs-tools generates the initrd just fine for -generic ... with or without the diversion 
[16:39] <apw> ogra_, but what does it divert it to
[16:40] <ogra_> it diverts the update-initramfs executable to /bin/true
[16:40] <ogra_> but thats moot 
[16:40] <ogra_> as i said, -generic creates the initrd at package install time 
[16:40] <apw> why it is moot, we are doing the initramfs handling completely different in the two cases
[16:40] <ogra_> (and it woorks fine in all image builds)
[16:41] <apw> and the working one has the divert and then makes the initrd itself (i assume)
[16:41] <apw> whereas the one which does not, doesn't work
[16:41] <ogra_> the working one execs /etc/kernel/postinst.d ... the non working one ignores that comepletely 
[16:41] <ogra_> totally independent of that diversion 
[16:47] <apw> ogra_, the non working one fails before it calls those hooks because it found a /initrd.img which was not a symlink, and so it tried to cp, and failed ... so processing is aborted before we call out to the hooks
[16:48] <ogra_> apw, hmm, so me simply doing an "rm /initrd.img" before installing the package would help ? 
[16:48] <ogra_> thats trivially added to the code :)
[16:48] <apw> ogra_, maybe, i would love you to do an ls -l /initrd.img as well so we can find out what it is
[16:49] <apw> ogra_, why are we installing -generic and then ripping it anyhow, why arn't we just seeding he right packages i wonder ?
[16:49] <ogra_> (sadly the armhf image builder doesnt like me now and wants to delay the image build by 35min :/ )
[16:50] <ogra_> apw, i plan to do all device tarball generation from the code i'm currently adding ... to not break beaglebone snappy i simpply left the old code in place for now ... later this will be a loop over the different kernels 
[16:51] <ogra_> the current snappy installs the kernel in the rootfs, then does a ton of hackery to create a device tarball from it and remove all traces of the kernel from the rootfs again ... i'm currently trying to move all this to a point after the rootfs tarball was created (so abusing the still existing builkd chroot) to get rid of all that awful hackery
[17:22] <cristian_c> jsalisbury: hi
[18:04] <ogra_> apw, hmm ... could it be that the postinst parses /etc/kernel-img.conf first ? 
[18:05] <ogra_> (we dont configure that file on snappy rootfses ... so there is no "do_initrd = yes" in it)
[18:06] <ogra_> (though this wouldnt explain the discrepancy to -generic )
[18:40] <ogra_> apw, ok, test build has run, there is definitely no /initrd.img in the rootfs
[22:22] <apw> ogra_, and it worked or failed ?
[22:23] <ogra_> apw, well, forget about it ... what i'm trying to do here is to re-use the build chroot from the snappy rootfs ... it didnt strike me until 1h ago that we remove half of apt and dpkg .... which means ... well .... you know ... *blush*
[22:25] <apw> ogra_, ahh heh, oops