summaryrefslogtreecommitdiff
path: root/dracut.sh
diff options
context:
space:
mode:
authorHarald Hoyer <harald@redhat.com>2013-03-09 15:11:39 +0100
committerHarald Hoyer <harald@redhat.com>2013-03-09 15:17:26 +0100
commitcc2303001e713f2f7c3f70161c28aa95f4d339d1 (patch)
treec16b26a96be506e3e4ba0a60cfe5d63f5f5f6820 /dracut.sh
parent54e7d7c32daf14f7174dd852c64924cb4f2daa69 (diff)
downloaddracut-cc2303001e713f2f7c3f70161c28aa95f4d339d1.tar.gz
dracut-cc2303001e713f2f7c3f70161c28aa95f4d339d1.tar.bz2
dracut-cc2303001e713f2f7c3f70161c28aa95f4d339d1.zip
dracut.sh: add new default path to initramfs according to bootloader spec
see kernel-install(8) and http://www.freedesktop.org/wiki/Specifications/BootLoaderSpec
Diffstat (limited to 'dracut.sh')
-rwxr-xr-xdracut.sh10
1 files changed, 8 insertions, 2 deletions
diff --git a/dracut.sh b/dracut.sh
index 72430789..8f3e5d21 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -442,7 +442,13 @@ if ! [[ $kernel ]]; then
fi
if ! [[ $outfile ]]; then
- outfile="/boot/initramfs-$kernel.img"
+ [[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id
+
+ if [[ $MACHINE_ID ]] && ( [[ -d /boot/${MACHINE_ID} ]] || [[ -L /boot/${MACHINE_ID} ]] ); then
+ outfile="/boot/${MACHINE_ID}/$kernel/initrd"
+ else
+ outfile="/boot/initramfs-$kernel.img"
+ fi
fi
for i in /usr/sbin /sbin /usr/bin /bin; do
@@ -726,7 +732,7 @@ outdir=${outfile%/*}
[[ $outdir ]] || outdir="/"
if [[ ! -d "$outdir" ]]; then
- dfatal "Can't write $outfile: Directory $outdir does not exist."
+ dfatal "Can't write to $outdir: Directory $outdir does not exist or is not accessible."
exit 1
elif [[ ! -w "$outdir" ]]; then
dfatal "No permission to write to $outdir."