Re: [PATCH] mount-boot.eclass: do not create /boot/.keep in pkg_prerm
Ionen Wolkens <[email protected]> Thu, 18 Jun 2026 12:32:26 -0400
| Newsgroups | gmane.linux.gentoo.devel |
|---|---|
| Message-ID | <ajQdmr5w0a1a70Ev@eversor> |
On Thu, Jun 18, 2026 at 06:03:40PM +0200, Ulrich Müller wrote:
> >>>>> On Thu, 18 Jun 2026, Mike Gilbert wrote:
>
> >> > + if [[ -n ${BOOT_EXISTS} && ! -d ${EROOT}/boot ]]; then
> >> > + # Recreate /boot in case it got un-merged
> >> > + mkdir "${EROOT}"/boot
> >> > fi
> >>
> >> That looks like a horrible hack.
>
> > What's so horrible about it? It accomplishes the same goal without
> > leaving an orphaned file behind. If it will cause problems, please
> > elaborate.
>
> Sorry, probably I am missing something here. What is the exact scenario
> where an unmerge can remove the /boot directory, so that it must be
> recreated?
Now that you mention it, do we have anything that installs *tracked*
files in /boot? As-in done in src_install rather than pkg_*
I don't think portage would attempt to remove the directory it didn't
remove any files from it. Not that a safeguard hurts, but it'll
probably just be a no-op.
>
> - If /boot is on a separate FS, then the eclass will have made sure that
> it is mounted at this point, so rmdir won't succeed (and most likely
> the dir won't be empty anyway).
> - If /boot a normal directory as part of the root FS, then it should
> contain a .keep* file owned by baselayout.
Also, baselayout does not install a .keep* for me? A fresh stage3 does
not seem to have one either. In the past, vaguely recall the stage3
did have orphaned .keep files (not made with keepdir) in many
directories though, but these seem to be gone nowadays.
>
> > On the subject of "hacks":
> > I would consider .keep files to be a "hack" to work around a design
> > limitation in the package manager.
>
> Yes, but it may be difficult to do anything about it. For example,
> recording the "keepdir" property in package metadata would have the
> problem that dirs can be shared between packages. But we should think
> about this aspect if we ever try to solve bug 607430 (i.e. if we would
> store permissions then maybe we could also store the keepdir info).
>
> Ulrich
--
ionen
signature.asc
(application/pgp-signature, 525 B)
-----BEGIN PGP SIGNATURE----- iQFPBAABCAA5FiEEx3SLh1HBoPy/yLVYskQGsLCsQzQFAmo0HZkbFIAAAAAABAAO bWFudTIsMi41KzEuMTIsMiwyAAoJELJEBrCwrEM06uMH/1WOZvYJ6HrmIa7dyJCg hKvDAHSh3ey2LbPekedgldloG8kkCgiPHFB3n/3jbvnb7jdxicB9QSxNOC2Gx0FM NIk78I6J09aXTmvWPq64n0d+8jzBFbegt46nj9Dteslqepsm1hk7fJd9p8G564hq 8tqumJl+Rmn/WQfTe9eBCHDCeqY8Nn+kIsgcj+XJfR/uUbJmSwexQnkARu21bgA+ 5+GZPE/dKuOuThghT9LvUlbkx/YM3TYlx16RKJulkuJ92jBgN7IQj7vJy5eaJFqj /0Rb4aa60sIC9H/N55T/HOKqRC1hEDXN5u927qD01RohMsIjjDmmx9mfvKadQSbH j2w= =F+lK -----END PGP SIGNATURE-----