Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
mdev, net, and /dev/shm [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
The Doctor
Veteran
Veteran


Joined: 27 Jul 2010
Posts: 1265

PostPosted: Sun Mar 31, 2013 12:11 am    Post subject: mdev, net, and /dev/shm [SOLVED] Reply with quote

I have installed sys-apps/busybox-1.21.0 with mdev use flag. I have been able to get my system to boot smoothly, with a few minor setbacks. First, I don't have any network interfaces (wlan0 or eth0) unless I start and stop udev. Second is a persistent permissions problem on /dev/shm. I can fix this easily enough by manually chmod 1777 /dev/shm. I have placed this in a startup script, which does not seem to work. The script does runs, but the problem remains.

Can anyone offer any guidance to these problems? Thanks.
_________________
First things first, but not necessarily in that order.


Last edited by The Doctor on Sun Mar 31, 2013 7:28 am; edited 1 time in total
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Sun Mar 31, 2013 6:08 am    Post subject: Reply with quote

I use non-systemd udev (currently eudev), but my /dev/shm gets its permissions from this line in /etc/fstab:
Code:
shm /dev/shm tmpfs defaults,nodev,nosuid,mode=1777 0 0
Back to top
View user's profile Send private message
The Doctor
Veteran
Veteran


Joined: 27 Jul 2010
Posts: 1265

PostPosted: Sun Mar 31, 2013 6:28 am    Post subject: Reply with quote

Thanks PaulBredbury, that solves my problem with /dev/shm.
_________________
First things first, but not necessarily in that order.
Back to top
View user's profile Send private message
lost+found
Guru
Guru


Joined: 15 Nov 2004
Posts: 402
Location: North~Sea~Coa~s~~t~~~

PostPosted: Sun Mar 31, 2013 7:09 am    Post subject: Reply with quote

Maybe the drivers for the netcards didn't get loaded, and need to be listed in /etc/conf.d/modules.
That was mostly the case in the past, before udev.
Back to top
View user's profile Send private message
lost+found
Guru
Guru


Joined: 15 Nov 2004
Posts: 402
Location: North~Sea~Coa~s~~t~~~

PostPosted: Sun Mar 31, 2013 7:18 am    Post subject: Reply with quote

I'm interested too in moving to the mdev/busybox approach. Please post any amazing discoveries... 8)
Back to top
View user's profile Send private message
The Doctor
Veteran
Veteran


Joined: 27 Jul 2010
Posts: 1265

PostPosted: Sun Mar 31, 2013 7:28 am    Post subject: Reply with quote

OK, I beleve I have the answer. mdev was not probing the network interfaces, so, after borrowing code from the mdev-like-a-boss project, I added the following code to my /etc/init.d/mdev runscript following the mdev -s line:
Code:
# for luks support, completely unrelated to this thread
dmsetup mknodes

  # network probe
        for i in /sys/class/net/*/uevent; do printf 'add' > "$i"; done 2>/dev/null; unset i
     # usb probe
        for i in /sys/bus/usb/devices/*; do
                        case "${i##*/}" in
                        [0-9]*-[0-9]*)
                                printf 'add' > "$i/uevent"
                        ;;
                esac
        done; unset i

  # mount /dev/pts
        if ! fstabinfo --mount /dev/pts; then
                mount -n -t devpts -o noexec,nosuid,gid=5,mode=0620 devpts /dev/pts
        fi
        #eend "$?"

        # mount /dev/shm
        if ! fstabinfo --mount /dev/shm; then
                mount -n -t tmpfs -o noexec,nosuid,nodev,mode=1777 shm-tmpfs /dev/shm
        fi

        # module loading       
        find /sys -name 'modalias' -type f -exec cat '{}' + | sort -u | xargs modprobe -b -a 2>/dev/null
        find /sys -name 'modalias' -type f -exec cat '{}' + | sort -u | xargs modprobe -b -a 2>/dev/null
Part of the problem was that I was not loading the wireless driver, although I think the steps mdev does are needed to.

Anyway, I now have mdev working, and I am sure I a gained a shorter boot over udev.


@lost+found The gentoo wiki is out of date on the proper mdev switch. You don't need the linixrc file or the 000.start file. The modifications here are the only changes I made to the mdev runscript and I simply needed to replace udev and udev-mount with mdev via rc-update to get it to work. I did modify fstab as suggested on this thread and on the wiki.
_________________
First things first, but not necessarily in that order.
Back to top
View user's profile Send private message
lost+found
Guru
Guru


Joined: 15 Nov 2004
Posts: 402
Location: North~Sea~Coa~s~~t~~~

PostPosted: Sun Mar 31, 2013 8:34 am    Post subject: Reply with quote

Thanks for the helpful tips, Doctor. First I'm going to try this on the kitchen computer. :) It already got no hard udev deps.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum