forked from ungleich-public/cdist
no point generating grub.conf at this time, there is no kernel installed yet
Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
This commit is contained in:
parent
5417471dff
commit
f97e6c42c7
2 changed files with 1 additions and 46 deletions
|
@ -45,27 +45,7 @@ case "$target_os" in
|
||||||
printf 'grub-mkconfig -o /boot/grub/grub.cfg\n'
|
printf 'grub-mkconfig -o /boot/grub/grub.cfg\n'
|
||||||
;;
|
;;
|
||||||
centos)
|
centos)
|
||||||
cat << centos_DONE
|
:
|
||||||
(
|
|
||||||
printf '# Generated by cdist ${__type##*/}'
|
|
||||||
printf 'default=0'
|
|
||||||
printf 'timeout=3'
|
|
||||||
for kernel in \$(find /boot -mindepth 1 -maxdepth 2 -name "vmlinuz-*"); do
|
|
||||||
kernel_version="\${kernel#*-}"
|
|
||||||
initramfs="\$(echo "\$kernel" | sed 's|/boot/vmlinuz-|/boot/initramfs-|').img"
|
|
||||||
root_device="\$(awk '\$2 == "/" {print \$1}' /etc/fstab)"
|
|
||||||
cat << centos_entry_DONE
|
|
||||||
title \$(cat /etc/redhat-release) (\$kernel_version)
|
|
||||||
# root is assumed to be on the first partition
|
|
||||||
root (hd0,0)
|
|
||||||
kernel \$kernel ro root=\$root_device norhgb noquiet
|
|
||||||
initrd \$initramfs
|
|
||||||
centos_entry_DONE
|
|
||||||
done
|
|
||||||
) > /boot/grub/grub.conf
|
|
||||||
cd /boot/grub
|
|
||||||
ln -sf grub.conf menu.lst
|
|
||||||
centos_DONE
|
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Your operating system ($os) is currently not supported by this type (${__type##*/})." >&2
|
echo "Your operating system ($os) is currently not supported by this type (${__type##*/})." >&2
|
||||||
|
|
|
@ -1,25 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
#
|
|
||||||
# 2011 Steven Armstrong (steven-cdist at armstrong.cc)
|
|
||||||
#
|
|
||||||
# This file is part of cdist.
|
|
||||||
#
|
|
||||||
# cdist is free software: you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
#
|
|
||||||
# cdist is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
#
|
|
||||||
|
|
||||||
# set defaults
|
|
||||||
device="$(cat "$__object/parameter/device" 2>/dev/null \
|
|
||||||
|| echo "/$__object_id" | tee "$__object/parameter/device")"
|
|
||||||
chroot="$(cat "$__object/parameter/chroot" 2>/dev/null \
|
|
||||||
|| echo "/target" | tee "$__object/parameter/chroot")"
|
|
Loading…
Reference in a new issue