Re: [PATCH] mount-boot.eclass: do not create /boot/.keep in pkg_prerm
Mike Gilbert <[email protected]> Thu, 18 Jun 2026 13:39:35 -0400
| Newsgroups | gmane.linux.gentoo.devel |
|---|---|
| Message-ID | <CAJ0EP40CaZ9HEbHi+Q4BwT-k6aZ4a2FMdaTntJCF8bfEZbMogA@mail.gmail.com> |
On Thu, Jun 18, 2026 at 12:03 PM Ulrich Müller <[email protected]> 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? > > - 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). Right, this scenario isn't an issue. > - If /boot a normal directory as part of the root FS, then it should > contain a .keep* file owned by baselayout. baselayout has not installed a .keep file for a few years. See bug 888807. If ${EROOT}/boot is not a mount point, unmerging a package which installs files under that directory may result in the directory being removed.