Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 274130 - mount-boot.eclass: unmerging with unmounted /boot often results in portage deleting empty /boot directory
Summary: mount-boot.eclass: unmerging with unmounted /boot often results in portage de...
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
: 288351 (view as bug list)
Depends on:
Reported: 2009-06-14 16:03 UTC by Jochums Johannes
Modified: 2009-10-09 21:20 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---

mount-boot.eclass.diff (mount-boot.eclass.diff,624 bytes, patch)
2009-06-17 20:26 UTC, Lars Wendler (Polynomial-C) (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jochums Johannes 2009-06-14 16:03:08 UTC
uninstall sys-apps/memtest86-3.3 or sys-apps/memtest86+-2.01 when /boot partition is not mounted will delete /boot directory instead of uninstalling the memtest86(+)

Reproducible: Always

Steps to Reproduce:
1. umount /boot
2. emerge --unmerge memtest86+

Actual Results:  
"/boot" directory got deleted from "/"

Expected Results:  
delete "/boot/memtest86plus/"

this is for both the "sys-apps/memtest86" and "sys-apps/memtest86+"
when /boot was mounted everthing went as expected

its easy to fix

# mkdir /boot
# mount /boot
# rm -R /boot/memtest86plus or
# rm -R /boot/memtest86
Comment 1 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2009-06-17 20:03:33 UTC
I can confirm this:

shanghai:~ # emerge -Cv memtest86+

    selected: 2.11
   protected: none
     omitted: none

>>> 'Selected' packages are slated for removal.
>>> 'Protected' and 'omitted' packages will not be removed.

>>> Waiting 5 seconds before starting...
>>> (Control-C to abort)...
>>> Unmerging in: 5 4 3 2 1
>>> Unmerging sys-apps/memtest86+-2.11...
No package files given... Grabbing a set.
<<<          obj /usr/share/doc/memtest86+-2.11/README.bz2
<<<          obj /usr/share/doc/memtest86+-2.11/
--- !found   obj /boot/memtest86plus/memtest
--- !found   dir /boot/memtest86plus
<<<          dir /usr/share/doc/memtest86+-2.11
--- !empty   dir /usr/share/doc
--- !empty   dir /usr/share
--- !empty   dir /usr
<<<          dir /boot

Another problem is that all files residing in the real /boot partition weren't unmerged.
Adding a ".keep" file into the unmounted /boot directory prevents the deletion of the /boot mount point.

shanghai:~ # emerge --info
Portage 2.2_rc33 (default/linux/amd64/2008.0/desktop, gcc-4.3.3, glibc-2.8_p20080602-r1, x86_64)
System uname: Linux-
Timestamp of tree: Wed, 17 Jun 2009 17:45:01 +0000
app-shells/bash:     4.0_p24
dev-java/java-config: 2.1.8-r1
dev-lang/python:     2.6.2-r1
dev-util/cmake:      2.6.4
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.4.3-r3
sys-apps/sandbox:    2.0
sys-devel/autoconf:  2.13, 2.63-r1
sys-devel/automake:  1.5, 1.7.9-r1, 1.9.6-r2, 1.10.2, 1.11
sys-devel/binutils:  2.19.1-r1
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.28-r1
ACCEPT_KEYWORDS="amd64 ~amd64"
CFLAGS="-march=barcelona -mtune=barcelona -O2 -pipe"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/X11/Sessions /etc/X11/app-defaults /etc/X11/xinit /etc/adobe /etc/bonobo-activation /etc/ca-certificates /etc/ca-certificates.conf /etc/dbus-1 /etc/env.d /etc/env.d/java/ /etc/fonts /etc/fonts/fonts.conf /etc/foomatic /etc/games /etc/gconf /etc/gentoo-release /etc/gimp /etc/gnome-vfs-2.0 /etc/gre.d /etc/gtk-2.0 /etc/hp /etc/hsqldb /etc/htdig /etc/init.d /etc/iproute2 /etc/java-config-2 /etc/lftp /etc/logrotate.d /etc/ntop /etc/opt /etc/pango /etc/profile.d /etc/qt4 /etc/revdep-rebuild /etc/sandbox.d /etc/sasl2 /etc/sensors.d /etc/sgml /etc/sound /etc/ssl /etc/ssmtp /etc/t1lib /etc/terminfo /etc/udev/rules.d /etc/vbox /etc/xdg /etc/xinetd.d /etc/xml"
CXXFLAGS="-march=barcelona -mtune=barcelona -O2 -pipe"
EMERGE_DEFAULT_OPTS="--alphabetical --with-bdeps=y"
FEATURES="collision-protect distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch userpriv usersandbox"
LINGUAS="de en"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
USE="3dnow 3dnowext X a52 aac acpi alsa amd64 berkdb branding bzip2 cairo cdda cdr cli cracklib crypt cups dbus dri dvd dvdr dvdread emboss encode evo fam ffmpeg firefox flac gdbm gif gnutls gtk iconv idn isdnlog jpeg jpeg2k kde lame libnotify mad midi mikmod mmap mmx mmxext mp3 mp4 mpeg mudflap multilib ncurses nls nptl nptlonly nsplugin ogg opengl openmp pam pcre pdf png ppds pppd qt3 qt3support qt4 quicktime readline reflection sdl session slang spell spl sse sse2 ssl startup-notification svg sysfs theora threads tiff truetype unicode usb vcd vorbis x264 xml xorg xulrunner xv xvid zlib" ALSA_CARDS="emu10k1 hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LINGUAS="de en" USERLAND="GNU" VIDEO_CARDS="nv nvidia"
Comment 2 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2009-06-17 20:25:43 UTC
This happens due to the mount-boot.eclass not having a pkg_postrm function mounting /boot like the pkg_preinst function of that eclass already does...
Comment 3 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2009-06-17 20:26:06 UTC
Created attachment 195022 [details, diff]

How about this possible fix?
Comment 4 Sebastian Luther (few) 2009-10-09 18:34:04 UTC
*** Bug 288351 has been marked as a duplicate of this bug. ***
Comment 5 Sebastian Pipping gentoo-dev 2009-10-09 19:33:32 UTC
am i the first who believes portage should not mount or unmount anything but fail with an error and a hint to mount manually?  what if there's a different partition behind it now?
Comment 6 SpanKY gentoo-dev 2009-10-09 20:57:45 UTC
baselayout should already handle installing of a .keep files, but sometimes the .keep file ends up in the mounted partition (or people delete things as they're creating the sep partition).  this isnt a bug in the mount-boot eclass as even if it werent in use, things installing into unmounted /boot would trigger the same exact problem.

should be easy to workaround in the eclass using Lars' fix as a base
Comment 7 Sebastian Pipping gentoo-dev 2009-10-09 21:20:44 UTC
"should be easy to workaround" doesn't really sounds like fixed!?