2018-09-27 11:13:27 +02:00
|
|
|
#!/bin/bash
|
|
|
|
dd if=/dev/zero of=harddiskuefi.img count=10 bs=1048576
|
|
|
|
parted -s harddiskuefi.img mklabel gpt
|
|
|
|
parted -s -a cylinder harddiskuefi.img mkpart ESP fat16 63s 7M
|
|
|
|
parted -s -a cylinder harddiskuefi.img mkpart linux ext2 7M 10M
|
|
|
|
parted -s -a cylinder harddiskuefi.img toggle 1 boot
|
|
|
|
lo=`losetup -f`
|
|
|
|
echo ${lo}
|
|
|
|
losetup -P ${lo} harddiskuefi.img
|
|
|
|
mkfs.fat -F16 -s1 ${lo}p1
|
|
|
|
mkfs.ext2 ${lo}p2
|
|
|
|
mount ${lo}p1 /mnt
|
|
|
|
mkdir /mnt/grub
|
|
|
|
echo -en "(hd0) ${lo}\n(hd0,1) ${lo}p1\n(hd0,2) ${lo}p2" > /mnt/grub/device.map
|
2020-09-17 09:52:56 +02:00
|
|
|
#LS MINICMD pour avoir vision paritions
|
|
|
|
grub-install --no-floppy --boot-directory=/mnt/ --efi-directory=/mnt/ ${lo} --install-modules="part_gpt ext2 configfile normal linux16 video video_colors video_cirrus video_fb videotest all_video" --locales=fr --target=x86_64-efi --no-nvram
|
2018-09-27 11:13:27 +02:00
|
|
|
mkdir /mnt/EFI/BOOT
|
2018-11-15 15:14:22 +01:00
|
|
|
cp /mnt/EFI/ubuntu/grubx64.efi /mnt/EFI/BOOT/bootx64.efi
|
|
|
|
#grub-mkimage -d /usr/lib/grub/x86_64-efi -o /mnt/EFI/BOOT/bootx64.efi -c /mnt/EFI/ubuntu/grub.cfg -p "(hd0,1)/grub/" -O x86_64-efi part_gpt ext2 configfile normal multiboot2 video video_color video_cirrus video_fb videotest all_video
|
2020-09-17 09:52:56 +02:00
|
|
|
echo -en "\
|
|
|
|
insmod ext2
|
|
|
|
insmod biosdisk
|
|
|
|
insmod part_msdos
|
|
|
|
insmod linux
|
|
|
|
insmod vbe
|
|
|
|
insmod gfxterm
|
|
|
|
insmod png
|
|
|
|
insmod font
|
|
|
|
set timeout=4\n\
|
|
|
|
set default=0\n\
|
|
|
|
menuentry "cos2000" {\n\
|
|
|
|
set root=(hd0,gpt2)\n\
|
|
|
|
linux16 /boot/system.sys root=hd0,gpt2\n
|
|
|
|
boot\n\
|
|
|
|
}" > /mnt/grub/grub.cfg
|
2018-09-27 11:13:27 +02:00
|
|
|
umount /mnt
|
|
|
|
mount ${lo}p2 /mnt
|
|
|
|
mkdir /mnt/boot/
|
|
|
|
umount /mnt
|
|
|
|
losetup -d ${lo}
|
2020-09-17 09:52:56 +02:00
|
|
|
xz -c harddiskuefi.img > harddiskuefi.img.xz
|