- Log in to post comments
#!/bin/bash
# download netboot image
wget http://archive.ubuntu.com/ubuntu/dists/trusty-updates/main/installer-amd64/current/images/netboot/netboot.tar.gz -P /tmp
# extract and copy install files
tar xzf /tmp/netboot.tar.gz -C /tmp
mkdir /boot/ubuntu
cp /tmp/ubuntu-installer/amd64/initrd.gz /boot/ubuntu/
cp /tmp/ubuntu-installer/amd64/linux /boot/ubuntu/
# create GRUB menu entry
cat < /etc/grub.d/49_ubuntu
#!/bin/sh
exec tail -n +4 $0
menuentry "Network Ubuntu install" {
root (hd0,0)
kernel /boot/ubuntu/linux
initrd /boot/ubuntu/initrd.gz
}
EOF
chmod a+x /etc/grub.d/49_ubuntu
# update GRUB config
update-grub
#
# OLD
#
# add boot menu
cat <> /boot/grub/menu.lst
title Ubuntu HDD install
root (hd0,0)
kernel /boot/ubuntu-installer/linux
initrd /boot/ubuntu-installer/initrd.gz
EOF