Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 251773 Details for
Bug 342313
sys-apps/openrc: nice support for systems w/out kernel module support (to avoid `modprobe: command not found` warnings)
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Alternative approach
0002-Simplify-modprobe-checks-and-hide-error-output.patch (text/plain), 5.79 KB, created by
Diego Elio Pettenò (RETIRED)
on 2010-10-24 08:23:59 UTC
(
hide
)
Description:
Alternative approach
Filename:
MIME Type:
Creator:
Diego Elio Pettenò (RETIRED)
Created:
2010-10-24 08:23:59 UTC
Size:
5.79 KB
patch
obsolete
>From 1bbe8ec2a8123a3f7334a0423fc62f4c9b099318 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= <flameeyes@gmail.com> >Date: Sun, 24 Oct 2010 03:52:38 +0200 >Subject: [PATCH 2/2] Simplify modprobe checks, and hide error output. > >This allows to hide errors when module-init-tools is missing, as well as >when it is installed but the kernel does not make use of modules. >--- > init.d.misc/openvpn.in | 8 +++----- > init.d/hwclock.in | 2 +- > init.d/procfs.in | 2 +- > net/bonding.sh | 8 +++----- > net/ccwgroup.sh | 9 +++------ > net/clip.sh | 7 ++----- > net/pppd.sh | 20 ++++++++------------ > net/tuntap.sh | 2 +- > net/vlan.sh | 9 +++------ > 9 files changed, 25 insertions(+), 42 deletions(-) > >diff --git a/init.d.misc/openvpn.in b/init.d.misc/openvpn.in >index eb1360b..0cc1bff 100644 >--- a/init.d.misc/openvpn.in >+++ b/init.d.misc/openvpn.in >@@ -40,11 +40,9 @@ start_pre() > { > # Linux has good dynamic tun/tap creation > if [ "$RC_UNAME" = Linux ]; then >- if [ ! -e /dev/net/tun ]; then >- if ! modprobe tun; then >- eerror "TUN/TAP support is not available in this kernel" >- return 1 >- fi >+ if [ ! -e /dev/net/tun ] && ! modprobe tun >/dev/null 2>&1; then >+ eerror "TUN/TAP support is not available in this kernel" >+ return 1 > fi > if [ -h /dev/net/tun -a -c /dev/misc/net/tun ]; then > ebegin "Detected broken /dev/net/tun symlink, fixing..." >diff --git a/init.d/hwclock.in b/init.d/hwclock.in >index e99900f..1598820 100644 >--- a/init.d/hwclock.in >+++ b/init.d/hwclock.in >@@ -78,7 +78,7 @@ start() > for rtc in /dev/rtc /dev/rtc[0-9]*; do > [ -e "$rtc" ] && break > done >- if [ ! -e "${rtc}" ]; then >+ if [ ! -e "${rtc}" ] && type modprobe >/dev/null 2>&1; then > modprobe -q rtc-cmos || modprobe -q rtc || modprobe -q genrtc > fi > fi >diff --git a/init.d/procfs.in b/init.d/procfs.in >index c5331b8..12f2a30 100644 >--- a/init.d/procfs.in >+++ b/init.d/procfs.in >@@ -15,7 +15,7 @@ start() > { > # Make sure we insert usbcore if it's a module > if [ -f /proc/modules -a ! -d /proc/bus/usb ]; then >- modprobe -q usbcore >+ modprobe -q usbcore >/dev/null 2>&1 > fi > > [ -e /proc/filesystems ] || return 0 >diff --git a/net/bonding.sh b/net/bonding.sh >index 1a4886e..424c844 100644 >--- a/net/bonding.sh >+++ b/net/bonding.sh >@@ -27,11 +27,9 @@ bonding_pre_start() > [ -z "${slaves}" ] && return 0 > > # Load the kernel module if required >- if [ ! -d /proc/net/bonding ]; then >- if ! modprobe bonding; then >- eerror "Cannot load the bonding module" >- return 1 >- fi >+ if [ ! -d /proc/net/bonding ] && ! modprobe bonding >/dev/null 2>&1; then >+ eerror "Cannot load the bonding module" >+ return 1 > fi > > # We can create the interface name we like now, but this >diff --git a/net/ccwgroup.sh b/net/ccwgroup.sh >index cf08943..8017a56 100644 >--- a/net/ccwgroup.sh >+++ b/net/ccwgroup.sh >@@ -13,12 +13,9 @@ ccwgroup_pre_start() > local ccwgroup="$(_get_array "ccwgroup_${IFVAR}")" > [ -z "${ccwgroup}" ] && return 0 > >- if [ ! -d /sys/bus/ccwgroup ]; then >- modprobe qeth >- if [ ! -d /sys/bus/ccwgroup ]; then >- eerror "ccwgroup support missing in kernel" >- return 1 >- fi >+ if [ ! -d /sys/bus/ccwgroup ] && ! modprobe qeth >/dev/null 2>&1; then >+ eerror "ccwgroup support missing in kernel" >+ return 1 > fi > > einfo "Enabling ccwgroup on ${IFACE}" >diff --git a/net/clip.sh b/net/clip.sh >index 3cb84e7..c79b20c 100644 >--- a/net/clip.sh >+++ b/net/clip.sh >@@ -90,13 +90,10 @@ clip_pre_start() > eval clip=\$clip_${IFVAR} > [ -z "${clip}" ] && return 0 > >- if [ ! -r /proc/net/atm/arp ]; then >- modprobe clip && sleep 2 >- if [ ! -r /proc/net/atm/arp ]; then >+ if [ ! -r /proc/net/atm/arp ] && ! modprobe clip >/dev/null 2>&1; then > eerror "You need first to enable kernel support for ATM CLIP" > return 1 >- fi >- fi >+ fi > > local started_here= > if ! are_atmclip_svcs_running; then >diff --git a/net/pppd.sh b/net/pppd.sh >index a8c8882..add7107 100644 >--- a/net/pppd.sh >+++ b/net/pppd.sh >@@ -164,12 +164,10 @@ pppd_pre_start() > #Specialized stuff. Insert here actions particular to connection type (pppoe,pppoa,capi) > local insert_link_in_opts=1 > if ${haspppoe}; then >- if [ ! -e /proc/net/pppoe ]; then >- # Load the PPPoE kernel module >- if ! modprobe pppoe; then >- eerror "kernel does not support PPPoE" >- return 1 >- fi >+ # Load the PPPoE kernel module >+ if [ ! -e /proc/net/pppoe ] && ! modprobe pppoe >/dev/null 2>&1; then >+ eerror "kernel does not support PPPoE" >+ return 1 > fi > > # Ensure that the link exists and is up >@@ -178,12 +176,10 @@ pppd_pre_start() > fi > > if ${haspppoa}; then >- if [ ! -d /proc/net/atm ]; then >- # Load the PPPoA kernel module >- if ! modprobe pppoatm; then >- eerror "kernel does not support PPPoATM" >- return 1 >- fi >+ # Load the PPPoA kernel module >+ if [ ! -d /proc/net/atm ] && ! modprobe pppoatm >/dev/null 2>&1; then >+ eerror "kernel does not support PPPoATM" >+ return 1 > fi > > if [ "${link}" != "/dev/null" ]; then >diff --git a/net/tuntap.sh b/net/tuntap.sh >index 2970fdd..19029fb 100644 >--- a/net/tuntap.sh >+++ b/net/tuntap.sh >@@ -21,7 +21,7 @@ tuntap_pre_start() > [ -z "${tuntap}" ] && return 0 > > if [ ! -e /dev/net/tun ]; then >- if ! modprobe tun; then >+ if ! modprobe tun >/dev/null 2>&1; then > eerror "TUN/TAP support is not present in this kernel" > return 1 > fi >diff --git a/net/vlan.sh b/net/vlan.sh >index c245051..8dacb68 100644 >--- a/net/vlan.sh >+++ b/net/vlan.sh >@@ -25,12 +25,9 @@ _get_vlans() > > _check_vlan() > { >- if [ ! -d /proc/net/vlan ]; then >- modprobe 8021q >- if [ ! -d /proc/net/vlan ]; then >- eerror "VLAN (802.1q) support is not present in this kernel" >- return 1 >- fi >+ if [ ! -d /proc/net/vlan ] && ! modprobe 8021q >/dev/null 2>&1; then >+ eerror "VLAN (802.1q) support is not present in this kernel" >+ return 1 > fi > } > >-- >1.7.3.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 342313
:
251759
|
251773