sry, i dont understand what is this [pinning hook] for.
I may be wrong, but AFAIK kernel upgrade in a live system can't be done
because live-build prevent it from happening by "trunkating"
update-initramfs command before it is included in the final live system.
So the installed kernel will not be able to execute update-initramfs
upon the kernel upgrade and won't build the new initrd/vmlinux files.
The pinning can be done all the way of the build (at least with
live-build 2.x). You could do it just using config/chroot_apt/.
To "pin" debootstrap and chroot install one have to include apt.conf and
preferences file in config/chroot_apt/ directory and add the desired
sources file in config/chroot_sources/*.chroot. Nothing more is needed.
To pin the chroot install of the packages *from hooks* one must add the
apt.conf and preferences files in config/chroot_local-includes/etc/apt/,
where they will be, if not changed/removed by a hook, in the final
binary. Sources used still are the config/chroot_sources/*.chroot ones
(still, it can be changed by a hook during the hook phase).
To pin the binary final image, change or add the new
apt.conf/preferences files from a hook. If not, the files in
config/chroot_local-includes/etc/apt/ will be kept. If those were not
included, config/chroot_apt/ ones will be used. The final sources.list
files for binary are set in config/chroot_sources/*.binary.
That's what i know one can do about pinning an image using live-build.
So i think pinning is not the issue here, it can be done just by setting
it in config/chroot_apt and config/chroot_sources/ from the start until
the binary without any files in config/chroot_local-includes/etc/apt/
because, as i said, the config/chroot_apt/ files are preserved 'till the
end if none are included in config/chroot_local-includes/.
Even using pinning the kernel upgrade can't build new initrd/vmlinux
files and can't install them anyway. Even with *live-rw* persistence
those files can't be upgraded, because they are in a *ro* mount. And
that's why i think update-initramfs was disabled in
live-helper/live-build. So, can anyone say that initrd/vmlinuz can be
created AND installed in the same media it was booted from? If yes then
i think the issue is in update-initramfs.
Sorry for so much wording, i just want to be clear on how pinning is
working in live-build.
Rui Miguel P. Bernardo