From: Harald Hoyer Date: Wed, 26 Jan 2011 11:58:52 +0000 (+0100) Subject: add 97biosdevname dracut module X-Git-Tag: 008~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=07caee2662c97d302cde244a1f7b22f9a089fd3f;p=platform%2Fupstream%2Fdracut.git add 97biosdevname dracut module --- diff --git a/dracut.kernel.7.xml b/dracut.kernel.7.xml index 35cf255..21cfecd 100644 --- a/dracut.kernel.7.xml +++ b/dracut.kernel.7.xml @@ -439,6 +439,14 @@ Required if multiple ip= lines are used. specify nameserver(s) to use + + + biosdevname={0|1} + + + turn on/off biosdevname network interface renaming + + diff --git a/modules.d/97biosdevname/check b/modules.d/97biosdevname/check new file mode 100755 index 0000000..f269c69 --- /dev/null +++ b/modules.d/97biosdevname/check @@ -0,0 +1,7 @@ +#!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh +type -P biosdevname >/dev/null || exit 1 + +# do not enable bootchartd by default +exit 0 diff --git a/modules.d/97biosdevname/install b/modules.d/97biosdevname/install new file mode 100755 index 0000000..a108d46 --- /dev/null +++ b/modules.d/97biosdevname/install @@ -0,0 +1,14 @@ +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh +dracut_install biosdevname +inst_rules 71-biosdevname.rules +inst_hook pre-trigger 30 "$moddir/parse-biosdevname.sh" + +# set the default state according to the config +if [[ -e /etc/sysconfig/network ]]; then + . /etc/sysconfig/network +fi + +if [[ "$BIOSDEVNAME" = "no" ]]; then + echo "biosdevname=0" >> ${initdir}/etc/cmdline +fi diff --git a/modules.d/97biosdevname/parse-biosdevname.sh b/modules.d/97biosdevname/parse-biosdevname.sh new file mode 100755 index 0000000..5ba0698 --- /dev/null +++ b/modules.d/97biosdevname/parse-biosdevname.sh @@ -0,0 +1,10 @@ +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh +if ! getargbool 1 biosdevname; then + info "biosdevname=0: removing biosdevname network renaming" + udevproperty UDEV_BIOSDEVNAME= + rm -f /etc/udev/rules.d/71-biosdevname.rules +else + udevproperty UDEV_BIOSDEVNAME=1 +fi +