# mdev, net, and /dev/shm [SOLVED]

## The Doctor

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.

----------

## PaulBredbury

I use non-systemd udev (currently eudev), but my /dev/shm gets its permissions from this line in /etc/fstab:

```
shm /dev/shm tmpfs defaults,nodev,nosuid,mode=1777 0 0
```

----------

## The Doctor

Thanks PaulBredbury, that solves my problem with /dev/shm.

----------

## lost+found

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.

----------

## lost+found

I'm interested too in moving to the mdev/busybox approach. Please post any amazing discoveries...   :Cool: 

----------

## The Doctor

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:

```
# 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.

----------

## lost+found

Thanks for the helpful tips, Doctor. First I'm going to try this on the kitchen computer.   :Smile:   It already got no hard udev deps.

----------

