-
Notifications
You must be signed in to change notification settings - Fork 2
/
makeisolinux_tar.sh
54 lines (33 loc) · 889 Bytes
/
makeisolinux_tar.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/sh
export BINDIR=bin
export OS_NAME=ToastOS
rm -Rf $BINDIR/*.img
dd if=/dev/zero of=$BINDIR/$OS_NAME.img bs=1M count=1024
(echo g
echo n
echo 1
echo 2048
echo +1000M
echo t
echo 1
echo p
echo w) |
fdisk -u -C500 -S63 -H16 $BINDIR/$OS_NAME.img
git clone https://github.com/limine-bootloader/limine.git --branch=v2.0-branch-binary --depth=1
make -C limine
./limine/limine-install $BINDIR/$OS_NAME.img
sudo mkdir -p /mnt/osdev
export LOOP=`sudo losetup -f`
#offset is 2048 * 512 (start of the partition)
sudo losetup -o1048576 $LOOP $BINDIR/$OS_NAME.img
sudo mkfs.vfat -F32 -n "EFI System" $LOOP
sudo mount -tvfat $LOOP /mnt/osdev
sudo cp limine_tar.cfg limine/limine.sys boot/
sudo mv boot/limine_tar.cfg boot/limine.cfg
sudo cp limine/BOOTX64.EFI boot/EFI/BOOT/
sudo cp -R boot/* /mnt/osdev
sync
rm -Rf limine
sudo umount $LOOP
sudo losetup -d $LOOP
echo Done!