Tiny Core Linux

Tiny Core Extensions => TCE Talk => Extension requests => Topic started by: MSumulong on February 25, 2014, 02:00:03 PM

Title: module-init-tools
Post by: MSumulong on February 25, 2014, 02:00:03 PM
I was wondering if someone can update module-init-tools from the 4.x archive so that it can override the default busybox link in /sbin/modprobe.

I wind up having to do the following:

sudo rm /sbin/modprobe
sudo ln -s /usr/local/sbin/modprobe /sbin/modprobe

The VirtualBox Guest Additions looks for modprobe in /sbin and it uses the -c parameter which doesn't exist in the busybox version.
Title: Re: module-init-tools
Post by: gerald_clark on February 25, 2014, 02:07:25 PM
Try adding an alias for use by your VirtualBox Guest Additions.
alias /sbin/modprobe='/usr/local/bin/modprobe'
Title: Re: module-init-tools
Post by: MSumulong on February 25, 2014, 04:00:07 PM
I think it should be (bin -> sbin):

alias /sbin/modprobe='/usr/local/sbin/modprobe'

But when I run VBoxLinuxAdditions.run, it is still running the busybox version... I guess alias doesn't work within shell scripts?
Title: Re: module-init-tools
Post by: gerald_clark on February 25, 2014, 04:20:10 PM
That alias works only for ash, but bash does not allow a path in the alias name.
If you are using ash only, you could put the alias in ~/.ashrc.

[ -f /usr/local/sbin/modprobe ] && alias /sbin/modprobe='/usr/local/sbin/modprobe'
Title: Re: module-init-tools
Post by: tinypoodle on February 25, 2014, 05:08:22 PM
Sounds very similar with a most recently reported and fixed bug:
https://www.virtualbox.org/ticket/12713

Consider submitting a respective bug report.
Title: Re: module-init-tools
Post by: MSumulong on February 26, 2014, 01:36:25 PM
That alias works only for ash, but bash does not allow a path in the alias name.
If you are using ash only, you could put the alias in ~/.ashrc.

[ -f /usr/local/sbin/modprobe ] && alias /sbin/modprobe='/usr/local/sbin/modprobe'

I've added this line to my ~/.ashrc but its still complaining:

/sbin/modprobe: invalid option -- 'c'

Title: Re: module-init-tools
Post by: gerald_clark on February 26, 2014, 01:53:52 PM
Are you sure it is not just a $PATH issue?

Are you using virtualbox-ose-additions.tcz ?
Title: Re: module-init-tools
Post by: MSumulong on February 27, 2014, 12:41:12 PM
I'm not sure if its a $PATH issue. I'll have to look into that.

No, I'm not using the virtualbox-ose-additions.tcz. I'm using the virtual CD that is supplied by VirtualBox and running /mnt/sr0/VBoxLinuxAdditions.run to rebuild the guest additions myself.
Title: Re: module-init-tools
Post by: tinypoodle on February 27, 2014, 12:53:55 PM
Please post output of:
Code: [Select]
type modprobe
Title: Re: module-init-tools
Post by: MSumulong on February 27, 2014, 01:18:58 PM
Please post output of:
Code: [Select]
type modprobe

At what point? After installing module-init-tools from 4.x and before adding [ -f /usr/local/sbin/modprobe ] && alias /sbin/modprobe='/usr/local/sbin/modprobe'? or after?
Title: Re: module-init-tools
Post by: tinypoodle on February 27, 2014, 01:26:47 PM
Both  ;)
Title: Re: module-init-tools
Post by: MSumulong on February 27, 2014, 01:54:27 PM
Both  ;)

Before installing module-init-tools.tcz:

modprobe is /sbin/modprobe


After installing module-init-tools.tcz:

modprobe is a tracked alias for /sbin/modprobe


After editing the .ashrc:

modprobe is a tracked alias for /sbin/modprobe


After typing "alias /sbin/modprobe='/usr/local/sbin/modprobe'":

modprobe is /usr/local/sbin/modprobe
Title: Re: module-init-tools
Post by: tinypoodle on February 27, 2014, 02:12:14 PM
After installing module-init-tools.tcz:

modprobe is a tracked alias for /sbin/modprobe

Try:
Code: [Select]
hash -r
type modprobe
instead.

Quote
After editing the .ashrc:

modprobe is a tracked alias for /sbin/modprobe

Editing .ashrc will only affect shells started after that.
Title: Re: module-init-tools
Post by: MSumulong on February 28, 2014, 08:45:19 AM
After installing module-init-tools.tcz:

modprobe is a tracked alias for /sbin/modprobe

Try:
Code: [Select]
hash -r
type modprobe
instead.

Quote
After editing the .ashrc:

modprobe is a tracked alias for /sbin/modprobe

Editing .ashrc will only affect shells started after that.


Before installing module-init-tools.tcz:

hash -r; type modprobe
modprobe is /sbin/modprobe

After installing module-init-tools.tcz:

hash -r; type modprobe
modprobe is /usr/local/sbin/modprobe

After adding alias:

hash -r; type modprobe
modprobe is /usr/local/sbin/modprobe


Title: Re: module-init-tools
Post by: tinypoodle on February 28, 2014, 09:11:51 AM
Before installing module-init-tools.tcz:

hash -r; type modprobe
modprobe is /sbin/modprobe

After installing module-init-tools.tcz:

hash -r; type modprobe
modprobe is /usr/local/sbin/modprobe

In given context this implies that your PATH and extension both seem to work fine as expected, but that there is a hardcoding bug in the software you try to run as already hinted in Reply #4.

Quote
After adding alias:

hash -r; type modprobe
modprobe is /usr/local/sbin/modprobe

Ah, yes, this is expected, what would be relevant instead would be:
Code: [Select]
type /sbin/modprobe
Title: Re: module-init-tools
Post by: MSumulong on February 28, 2014, 11:04:14 AM
Before installing module-init-tools.tcz:

hash -r; type modprobe
modprobe is /sbin/modprobe

After installing module-init-tools.tcz:

hash -r; type modprobe
modprobe is /usr/local/sbin/modprobe

In given context this implies that your PATH and extension both seem to work fine as expected, but that there is a hardcoding bug in the software you try to run as already hinted in Reply #4.

Quote
After adding alias:

hash -r; type modprobe
modprobe is /usr/local/sbin/modprobe

Ah, yes, this is expected, what would be relevant instead would be:
Code: [Select]
type /sbin/modprobe

type /sbin/modprobe gives me /sbin/modprobe is /sbin/modprobe

I'll go ahead and submit a request to not have modprobe hard-coded.
Title: Re: module-init-tools
Post by: tinypoodle on February 28, 2014, 12:21:35 PM
Code: [Select]
tc@box:~$ type /sbin/modprobe
/sbin/modprobe is /sbin/modprobe
tc@box:~$ alias '/sbin/modprobe'='/usr/local/sbin/modprobe'
tc@box:~$ type /sbin/modprobe
/sbin/modprobe is an alias for /usr/local/sbin/modprobe
tc@box:~$

But then, according to:
http://www.computerworld.com/s/article/9233435/How_to_use_aliases_in_Linux_shell_commands

Quote
Aliases are disabled for noninteractive shells (that is, shell scripts).

So I guess in case in question alias might be sort of a moot point.
Title: Re: module-init-tools
Post by: MSumulong on February 28, 2014, 02:46:05 PM
Code: [Select]
tc@box:~$ type /sbin/modprobe
/sbin/modprobe is /sbin/modprobe
tc@box:~$ alias '/sbin/modprobe'='/usr/local/sbin/modprobe'
tc@box:~$ type /sbin/modprobe
/sbin/modprobe is an alias for /usr/local/sbin/modprobe
tc@box:~$

But then, according to:
http://www.computerworld.com/s/article/9233435/How_to_use_aliases_in_Linux_shell_commands

Quote
Aliases are disabled for noninteractive shells (that is, shell scripts).

So I guess in case in question alias might be sort of a moot point.

Yea, I never had any success using the alias commands... VBoxLinuxGuestAdditions.run always tried to run the busybox version of modprobe.