dracut-functions: try to find dracutbasedir, if not set
authorHarald Hoyer <harald@redhat.com>
Fri, 25 Mar 2011 14:40:51 +0000 (15:40 +0100)
committerHarald Hoyer <harald@redhat.com>
Fri, 25 Mar 2011 15:10:47 +0000 (16:10 +0100)
dracut-functions

index fa75642..bf2581e 100755 (executable)
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
+if ! [[ $dracutbasedir ]]; then
+    dracutbasedir=${BASH_SOURCE[0]%/*}
+    [[ $dracutbasedir = "dracut-functions" ]] && dracutbasedir="."
+    [[ $dracutbasedir ]] || dracutbasedir="."
+    dracutbasedir="$(readlink -f $dracutbasedir)"
+fi
+
 if ! type dinfo >/dev/null 2>&1; then
     . "$dracutbasedir/dracut-logger"
     dlog_init