Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 356409 - app-emulation/virtualbox-modules: ebuild does not create device files in static-/dev configuration
Summary: app-emulation/virtualbox-modules: ebuild does not create device files in stat...
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Lars Wendler (Polynomial-C) (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-25 12:32 UTC by JZd
Modified: 2017-09-05 10:38 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description JZd 2011-02-25 12:32:17 UTC
app-emulation/virtualbox-modules-3.2.12 ebuild does not create device files in static-/dev configuration, nor it elogs the name/type/major/minor numbers for their manual creation.

Reproducible: Always

Steps to Reproduce:
1. emerge -vp =app-emulation/virtualbox-modules-3.2.12

Actual Results:  
/dev/vboxdrv and /dev/vboxnetctl missing.

Expected Results:  
/dev/vboxdrv and /dev/vboxnetctl with correct group ownership and access rights present.

Suggested solution:

--- virtualbox-modules-3.2.12.ebuild    2011-02-03 09:01:02.000000000 +0100
+++ /tmp/virtualbox-modules-3.2.12.ebuild       2011-02-25 13:18:05.192800775 +0100
@@ -43,12 +43,19 @@
 src_install() {
        linux-mod_src_install
 
+if /bin/grep -q '^RC_DEVICES="static"' /etc/conf.d/rc; then
+  /bin/mknod /dev/vboxnetctl c 10 57
+  /bin/mknod /dev/vboxdrv c 10 58
+  /bin/chown root:vboxusers /dev/vboxnetctl /dev/vboxdrv
+  /bin/chmod 0660 /dev/vboxnetctl /dev/vboxdrv
+else
        # udev rule for vboxdrv
        dodir /etc/udev/rules.d
        echo '#SUBSYSTEM=="usb_device", GROUP="vboxusers", MODE="0644"' \
        > "${D}/etc/udev/rules.d/10-virtualbox.rules"
        echo '#SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="vboxusers", MODE="0644"' \
        >> "${D}/etc/udev/rules.d/10-virtualbox.rules"
+fi
 }
 
 pkg_postinst() {

------------
Proposed solution ignores RC_DEVICES="auto" without udev running. In such situation elogs with examples of mknod calls might be sufficient.

Since RC_DEVICES="static" means the user shall manage /dev, please add at least elogs with the major/minor numbers.
Comment 1 JZd 2011-02-25 12:58:03 UTC
% emerge --info
Portage 2.1.9.25 (default/linux/amd64/10.0, gcc-4.4.4, glibc-2.11.2-r3, 2.6.36-gentoo-r5 x86_64)
=================================================================
System uname: Linux-2.6.36-gentoo-r5-x86_64-AMD_Athlon-tm-_64_Processor_3200+-with-gentoo-1.12.13
Timestamp of tree: Fri, 25 Feb 2011 08:15:01 +0000
app-shells/bash:     4.1_p7
dev-java/java-config: 2.1.11-r3
dev-lang/python:     2.6.6-r1, 3.1.2-r4
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 1.12.13
sys-apps/sandbox:    2.4
sys-devel/autoconf:  2.13, 2.65-r1
sys-devel/automake:  1.8.5-r4, 1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.3.4, 4.4.4-r2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.10
sys-devel/make:      3.81-r2
virtual/os-headers:  2.6.36.1 (sys-kernel/linux-headers)
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA dlj-1.1 sun-bcla-java-vm PUEL"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=athlon64 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11 /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=athlon64 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs distlocks fixlafiles fixpackages news nostrip parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv"
GENTOO_MIRRORS="ftp://ftp.sh.cvut.cz/MIRRORS/gentoo ftp://ftp.fi.muni.cz/pub/linux/gentoo ftp://gentoo.mirror.dkm.cz/pub/gentoo http://gd.tuwien.ac.at/opsys/linux/gentoo http://distfiles.gentoo.org http://www.ibiblio.org/pub/Linux/distributions/gentoo"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="3dnow X aac acl acpi alsa amd64 apm berkdb bzip2 caps cli cracklib crypt cups cxx dbus directfb doc dri fbcon gdbm gif gnutls gpm iconv ieee1394 imagemagick jpeg lcms lm_sensors logrotate matroska mikmod mmx modules mp3 mpeg mudflap multilib ncurses nls nptl nptlonly ogg opengl openmp pam pcre pdf perl png posix pppd python readline rle session sse sse2 ssl svg sysfs tcpd tetex theora threads tiff truetype unicode v4l vorbis xml xorg xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" 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" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" APACHE2_MPMS="worker" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="vesa" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, MAKEOPTS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 2 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2013-06-18 11:15:26 UTC
Sorry for ignoring this bug for so long.

I wonder how we can make the ebuild recognize if there's a dynamic device manager in use. Otherwise it makes no sense to let the ebuild create the nodes.
Comment 3 JZd 2013-07-09 05:22:51 UTC
Since I have patched the e-build for myself, I have no problem with the delay.
There was a RC_DEVICES option in the Baselayout 1 `/etc/conf.d/rc', so the detection is based on the status of this option at install time.

Such an explicit option seems to be missing in the current Baselayout version. Is there any equivalent? At the present, checking the output from `rc-config show --all' for udev and `mount' for /dev is a workaround.
Perhaps clarifying this particular point (i.e. how to detect static devices in Baselayout 2) will be interesting.

Another option is to provide a script that can be explicitly called by a user if needed (if Virtualbox fails to start due to missing devices), or to simply document the major/minor numbers and device names.
Comment 4 Ben Kohler gentoo-dev 2017-08-31 18:00:54 UTC
Please provide major/minor info if this is still an issue that needs fixing
Comment 5 JZd 2017-09-05 10:38:09 UTC
I do not use the old rc system. /etc/rc.conf is different and as far as I know, it does not consider static devices configuration anymore.

virtualbox-modules-5.1.12, that I have installed now, do use
vboxnetctl c 10 54
vboxdrvu c 10 55
vboxdrv c 10 56
so these devices are shifted a bit in comparison to 3.2.12 in the original bug report.

Nice to see someone still cares about the bugs opened for so long. I think it can be closed now.