Bug#526395: [Pkg-virtualbox-devel] Bug#526395: Save ~10s in virtualbox-ose init script
On Tue, May 05, 2009 at 01:04:51AM +0200, Daniel Hahler wrote: ++# Why is sleep used here (in case of error)? sleep .2 Should have answered this one too. I think the reason for this is to give your system some time to generate the device file after inserting the module. Is this really needed? After all, the boot process goes on after that, and I think loading the module should provide the device file right away?! I'm sure upstream had a reason for this. Keep in mind that the very next command checks for the existance of the device. That's where my guess came from. It's just 0.2s after all, but I'd like to have a reference in the comment there why/when it's required. How about asking upstream? We're patching the init script in quite some places but for the most part it's still the one provided by upstream. I thought about writing my own, but by using the patch system it's easier to follow changes made by upstream for new features etc. Michael -- Michael Meskes Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org) Michael at BorussiaFan dot De, Meskes at (Debian|Postgresql) dot Org ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: mes...@jabber.org Go VfL Borussia! Go SF 49ers! Use Debian GNU/Linux! Use PostgreSQL! -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#526395: [Pkg-virtualbox-devel] Bug#526395: Save ~10s in virtualbox-ose init script
On Thu, Apr 30, 2009 at 11:31:03PM +0200, Daniel Hahler wrote: Please forgive me that I have not actually tested this, but committed it for Ubuntu Karmic already. You might want to change this some or I misunderstood. -+if ! modprobe vboxdrv /dev/null 21; then -+failure modprobe vboxdrv failed. Please use 'dmesg' to find out why ++if ! modprobe -n -q vboxdrv; then ++failure modprobe vboxdrv failed. Please use 'dmesg' to find out why. This change makes sure the script does *not* insert the module at all. I think the original submitter was talking about using modprobe -n instead of find and not instead of the existing modprobe call. I like the idea of saving some time, but I think the find command gives some valuable information if modprobe fails. Michael -- Michael Meskes Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org) Michael at BorussiaFan dot De, Meskes at (Debian|Postgresql) dot Org ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: mes...@jabber.org Go VfL Borussia! Go SF 49ers! Use Debian GNU/Linux! Use PostgreSQL! -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#526395: [Pkg-virtualbox-devel] Bug#526395: Save ~10s in virtualbox-ose init script
On Thu, Apr 30, 2009 at 11:31:03PM +0200, Daniel Hahler wrote: ++# Why is sleep used here (in case of error)? sleep .2 Should have answered this one too. I think the reason for this is to give your system some time to generate the device file after inserting the module. Anyway, here's how I plan to fix the delay: @@ -150,14 +150,15 @@ begin_msg Starting VirtualBox kernel module if ! running vboxdrv; then if [ $LOAD_VBOXDRV_MODULE = 1 ]; then - if ! find /lib/modules/`uname -r` -name vboxdrv\.* 2/dev/null|grep -q vboxdrv; then - failure No suitable module for running kernel found - fi if ! rm -f $DEVICE; then failure Cannot remove $DEVICE fi if ! modprobe vboxdrv /dev/null 21; then - failure modprobe vboxdrv failed. Please use 'dmesg' to find out why + if ! find /lib/modules/`uname -r` -name vboxdrv\.* 2/dev/null|grep -q vboxdrv; then + failure No suitable module for running kernel found + else + failure modprobe vboxdrv failed. Please use 'dmesg' to find out why + fi fi else succ_msg Not tested yet, but I think this way we get the 10 second delay only if something goes wrong. Michael -- Michael Meskes Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org) Michael at BorussiaFan dot De, Meskes at (Debian|Postgresql) dot Org ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: mes...@jabber.org Go VfL Borussia! Go SF 49ers! Use Debian GNU/Linux! Use PostgreSQL! -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#526395: [Pkg-virtualbox-devel] Bug#526395: Save ~10s in virtualbox-ose init script
Am Monday 04 May 2009 16:39:57 Michael Meskes wrote: ++ # Why is sleep used here (in case of error)? sleep .2 Should have answered this one too. I think the reason for this is to give your system some time to generate the device file after inserting the module. Is this really needed? After all, the boot process goes on after that, and I think loading the module should provide the device file right away?! It's just 0.2s after all, but I'd like to have a reference in the comment there why/when it's required. Anyway, here's how I plan to fix the delay: This looks very good, and is just what I've thought about when you told me about the misuse of modprobe -n in your previous email. Thanks for looking into this and improving/fixing this. @@ -150,14 +150,15 @@ begin_msg Starting VirtualBox kernel module if ! running vboxdrv; then if [ $LOAD_VBOXDRV_MODULE = 1 ]; then - if ! find /lib/modules/`uname -r` -name vboxdrv\.* 2/dev/null|grep -q vboxdrv; then - failure No suitable module for running kernel found - fi if ! rm -f $DEVICE; then failure Cannot remove $DEVICE fi if ! modprobe vboxdrv /dev/null 21; then - failure modprobe vboxdrv failed. Please use 'dmesg' to find out why +if ! find /lib/modules/`uname -r` -name vboxdrv\.* 2/dev/null|grep -q vboxdrv; then + failure No suitable module for running kernel found + else + failure modprobe vboxdrv failed. Please use 'dmesg' to find out why + fi fi else succ_msg Not tested yet, but I think this way we get the 10 second delay only if something goes wrong. Cheers, Daniel signature.asc Description: This is a digitally signed message part.