Browse Source

Make using the version from the current directory explicit

Rather than looking at the contents of the current directory always, require
explicitly specifying --local to use those files
master
Jeremy Katz 16 years ago
parent
commit
5c481d345f
  1. 24
      dracut

24
dracut

@ -7,12 +7,6 @@ @@ -7,12 +7,6 @@
# Copyright 2008, Red Hat, Inc. Jeremy Katz <katzj@redhat.com>
# GPLv2 header here

if [ -f ./dracut-functions ]; then
source ./dracut-functions
else
source /usr/libexec/dracut/functions
fi

[ -f /etc/dracut.conf ] && . /etc/dracut.conf

while [ $# -gt 0 ]; do
@ -29,6 +23,10 @@ while [ $# -gt 0 ]; do @@ -29,6 +23,10 @@ while [ $# -gt 0 ]; do
set -x
shift
;;
-l|--local)
allowlocal="yes"
shift
;;
*)
break
esac
@ -50,6 +48,16 @@ if [ -f "$outfile" -a -z "$force" ]; then @@ -50,6 +48,16 @@ if [ -f "$outfile" -a -z "$force" ]; then
exit 1
fi

if [ -n "$allowlocal" -a -f ./init ]; then
source ./dracut-functions
initfile=./init
switchroot=./switchroot
else
source /usr/libexec/dracut/functions
initfile=/usr/libexec/dracut/init
switchroot=/usr/libexec/dracut/switch_root
fi

initdir=$(mktemp -d -t initramfs.XXXXXX)

# executables that we have to have
@ -78,8 +86,8 @@ done @@ -78,8 +86,8 @@ done
for f in $(find /lib/terminfo -type f) ; do cp --parents $f "$initdir" ; done

# install our files
cp init $initdir/init
cp switch_root $initdir/sbin/switch_root
cp $initfile $initdir/init
cp $switchroot $initdir/sbin/switch_root

# and create some directory structure
mkdir -p $initdir/etc $initdir/proc $initdir/sys $initdir/sysroot $initdir/dev/pts

Loading…
Cancel
Save