SpecialistOff.NET / Вопросы / Статьи / Фрагменты кода / Резюме / Метки / Помощь / Файлы

Список вопросов Печать

Как добавить iPXE в загрузку GRUB2?


Метки: ipxe grub pxe загрузка системы centos ubuntu 

Ответы

RemiZOffAlex  Создано: 2018-05-10 13:07:48.219908  Обновлено: 2018-05-10 13:07:48.219908

Загрузить ipxe.lkrn

wget http://boot.ipxe.org/ipxe.lkrn -O /boot/ipxe.lkrn

Создать конфигурационный файл

cat << EOF >> /boot/ipxe.conf
#!ipxe

prompt --key 0x02 --timeout 5000 Press Ctrl-B for the iPXE command line... || goto no_shell
shell
goto no_shell

:no_shell
ifopen
dhcp
chain http://pxe.local/ipxe/boot
EOF

Добавить пункт меню

cat << EOF >> /etc/grub.d/40_custom
menuentry "iPXE" {
    linux16 /boot/ipxe.lkrn
    initrd16 /boot/ipxe.conf
}
EOF

Проверить таймаут в фале /etc/default/grub

GRUB_TIMEOUT=5

CentOS 7

Пересоздать конфигурационный файл GRUB2

grub2-mkconfig -o /boot/grub2/grub.cfg

Ubuntu 16.04

sed -i 's/GRUB_DEFAULT=0/GRUB_DEFAULT="iPXE"/g' /etc/default/grub
grub-mkconfig -o /boot/grub/grub.cfg

Возможно будут интересны и другие вопросы