mirror of
https://gitlab.com/bztsrc/bootboot.git
synced 2023-02-13 20:54:32 -05:00
FAT16 or FAT32 option
This commit is contained in:
parent
af218c5185
commit
792d73704b
5 changed files with 13 additions and 5 deletions
|
@ -2,6 +2,8 @@
|
|||
DISKSIZE=128
|
||||
# boot partition size in kilobytes (16M)
|
||||
BOOTSIZE=16384
|
||||
# boot partition FAT type (16 or 32). Note that smallest possible FAT32 is 33M
|
||||
BOOTTYPE=16
|
||||
# platform, either x86 or rpi
|
||||
PLATFORM=x86
|
||||
#PLATFORM=rpi
|
||||
|
@ -28,7 +30,7 @@ endif
|
|||
# assemble the boot partition
|
||||
bootpart.bin: initrd.bin
|
||||
dd if=/dev/zero of=bootpart.bin bs=1024 count=$(BOOTSIZE) >/dev/null 2>/dev/null
|
||||
mkfs.vfat -F 16 -n "EFI System" bootpart.bin 2>/dev/null >/dev/null
|
||||
mkfs.vfat -F $(BOOTTYPE) -n "EFI System" bootpart.bin 2>/dev/null >/dev/null
|
||||
@mkdir boot 2>/dev/null || true
|
||||
@sudo /usr/bin/mount -o loop,user bootpart.bin boot
|
||||
@mkdir boot/BOOTBOOT
|
||||
|
|
|
@ -17,12 +17,15 @@ Nézz bele a Makefile-ba, az elején fogsz látni konfigurálható változókat.
|
|||
|
||||
- DISKSIZE: a teljes generálnadó lemezkép mérete megabájtban
|
||||
- BOOTSIZE: a rendszerbetöltő partíció mérete kilobájtban (nem mega)
|
||||
- BOOTTYPE: a rendszerbetöltő partíció FAT típusa, 16 vagy 32 (12 már nem támogatott)
|
||||
- PLATFORM: vagy "x86" vagy "rpi", ez választja ki, melyik lemezképet generálja
|
||||
|
||||
Ha FAT32-t szeretnél használni (BOOTTYPE=32), akkor a partíció méretét legalább 33 megabájtra kell venni.
|
||||
|
||||
A `make all` parancsot futtatva a következő fájlokat hozza létre:
|
||||
|
||||
- initrd.bin: egy gzippelt hpodc cpio initrd kép, amiben egyelőre csak a futtatható kernel található
|
||||
- bootpart.bin: a rendszerbetöltő partíció (ESP FAT16-al), ami tartalmazza az initrd-t és a betöltő programokat
|
||||
- bootpart.bin: a rendszerbetöltő partíció (ESP FAT16-tal vagy FAT32-vel), ami tartalmazza az initrd-t és a betöltő programokat
|
||||
- disk-(PLATFORM).img: hibrid lemezkép GPT partícióval
|
||||
|
||||
A disk-x86.img egy speciális hibrid lemezkép, amit átnevezhetsz disk-x86.iso-ra és kiégetheted egy CDROM-ra; vagy bebootolhatod
|
||||
|
|
|
@ -17,12 +17,15 @@ Look at the beginning of the Makefile, you'll find configurable variables there.
|
|||
|
||||
- DISKSIZE: the overall disk image size to be generated in Mbytes
|
||||
- BOOTSIZE: the boot partition size in Kbytes (not megabytes)
|
||||
- BOOTTYPE: the boot partition's FAT type, 16 for FAT16 and 32 for FAT32 (12 not supported any more)
|
||||
- PLATFORM: either "x86" or "rpi", this selects which disk image to create
|
||||
|
||||
If you want to use FAT32 (BOOTTYPE=32), then the partition's size must be at least 33 megabytes.
|
||||
|
||||
Executing `make all` will create the following files:
|
||||
|
||||
- initrd.bin: a gzipped hpodc cpio initrd image, containing only the kernel executable for now
|
||||
- bootpart.bin: the boot partition (ESP with FAT16), containing the initrd and the required files for booting
|
||||
- bootpart.bin: the boot partition (ESP with FAT16 or FAT32), containing the initrd and the required files for booting
|
||||
- disk-(PLATFORM).img: a hybrid disk image with GPT partitions
|
||||
|
||||
The disk-x86.img is a special hybrid image, which can be renamed to disk-x86.iso and then burnt to a CDROM; it can also be
|
||||
|
|
Binary file not shown.
|
@ -206,12 +206,12 @@ int createdisk(int disksize, char *diskname)
|
|||
/* MBR, EFI System Partition */
|
||||
loader[j-2]=0x80; /* bootable flag */
|
||||
setint(129,loader+j); /* start CHS */
|
||||
loader[j+2]=0xC; /* type, LBA FAT */
|
||||
loader[j+2]=esp[0x39]=='1' ? 0xE : 0xC; /* type, LBA FAT16 (0xE) or FAT32 (0xC) */
|
||||
setint(((gs+es)/512)+2,loader+j+4); /* end CHS */
|
||||
setint(128,loader+j+6); /* start LBA */
|
||||
setint(((es)/512),loader+j+10); /* number of sectors */
|
||||
j+=16;
|
||||
}
|
||||
j+=16;
|
||||
/* MBR, GPT entry */
|
||||
setint(1,loader+j); /* start CHS */
|
||||
loader[j+2]=0xEE; /* type */
|
||||
|
|
Loading…
Add table
Reference in a new issue