diff --git a/mkbootimg/OLVASSEL.md b/mkbootimg/OLVASSEL.md index 805b144..e3c2d09 100644 --- a/mkbootimg/OLVASSEL.md +++ b/mkbootimg/OLVASSEL.md @@ -5,10 +5,23 @@ BOOTBOOT Bootolható Lemezkép Készítő Ez egy minden az egyben, többplatformos, függőség nélküli lemezkép kreáló (na jó, zlib kell neki, de az statikusan bele van forgatva). Egy lemezkonfigurációt kell megadni neki JSON-ben, és létrehozza az ESP FAT boot partíciót a szükséges betöltő -fájlokkal, GPT táblával, PMBR-el, stb. Továbbá képes létrehozni az induló memórialemezképet egy könyvtár tartalmából (jelenleg -`cpio`, `tar`, `jamesm` (James Molloy initrdje), `echfs` és az `FS/Z` támogatott, de a kód úgy lett megírva, hogy könnyű legyen -bővíteni). Szemben ezzel, könyvtárból generálható partíció `fat` (hosszú fájlnevekkel), `minix` (Minix V3), `ext2` (Rev 1), -`tar`, `echfs` és `FS/Z` fájlrendszerekhez. +fájlokkal, GPT táblával, PMBR-el, stb. Továbbá képes létrehozni az induló memórialemezképet egy könyvtár tartalmából. Támogatott +fájlrendszerek: + +| Formátum | Initrd | Partíció | Specifikáció, forrás | +|----------|--------|----------|-------------------------------------------------| +| `jamesm` | ✔Yes | ✗No | [James Molloy oktatóanyagok](http://jamesmolloy.co.uk/tutorial_html/8.-The+VFS+and+the+initrd.html) | +| `cpio` | ✔Yes | ✗No | [wikipédia](https://en.wikipedia.org/wiki/Cpio) | +| `tar` | ✔Yes | ✔Yes | [wikipédia](https://wiki.osdev.org/USTAR) | +| `echfs` | ✔Yes | ✔Yes | [spec](https://gitlab.com/bztsrc/bootboot/blob/binaries/specs/echfs.md) [forrás repo](https://github.com/echfs/echfs) | +| `FS/Z` | ✔Yes | ✔Yes | [forrás](https://gitlab.com/bztsrc/bootboot/blob/master/mkbootimg/fsZ.h) | +| `boot` | ✗No | ✔Yes | [spec](https://gitlab.com/bztsrc/bootboot/raw/binaries/specs/efifat.pdf) (csak ESP, 8+3 nevek) | +| `fat` | ✗No | ✔Yes | [spec](https://gitlab.com/bztsrc/bootboot/raw/binaries/specs/vfat.pdf) (csak nem-ESP, LFN-el) | +| `minix` | ✗No | ✔Yes | [V2 spec](https://gitlab.com/bztsrc/bootboot/raw/binaries/specs/minix.pdf) [V3 forrás](https://github.com/Stiching-MINIX-Research-Fundation/minix/tree/master/minix/fs/mfs) (V3 támogatott, de csak V2-höz van spec) | +| `ext2` | ✗No | ✔Yes | [spec](https://gitlab.com/bztsrc/bootboot/raw/binaries/specs/ext2.pdf) [dokumentáció](https://www.nongnu.org/ext2-doc/ext2.html) | +| `lean` | ✗No | ✔Yes | [honlap](https://freedos-32.sourceforge.net/lean/specification.php) | + +A kód úgy lett megírva, hogy könnyű legyen bővíteni. A kigenerált képet leellenőriztem fdisk-el, valamint a gdisk verify funkciójával. A FAT partíció tesztelve lett fsck.vfat-al és UEFI förmverrel, továbbá Raspberry Pi-n. Az ISO9660-es rész iat-vel (ISO9660 Analyzer Tool) és Linux mounttal lett tesztelve. diff --git a/mkbootimg/README.md b/mkbootimg/README.md index e359e2c..0b04cbd 100644 --- a/mkbootimg/README.md +++ b/mkbootimg/README.md @@ -5,9 +5,22 @@ See [BOOTBOOT Protocol](https://gitlab.com/bztsrc/bootboot) for common details. This is an all-in-one, multiplatform, dependency-free disk image creator tool. You pass a disk configuration to it in a very flexible JSON, and it generates ESP FAT boot partition with the required loader files, GPT partitioning table, PMBR, etc. It -also creates an initrd from a directory (currently `cpio`, `tar`, `jamesm` (James Molloy's initrd), `echfs` and `FS/Z` -supported, but the code is written in a way that it is easily expandable). In contrast, partitions can be generated from -directories for `fat` (with long file names), `minix` (Minix V3), `ext2` (Rev 1), `tar`, `echfs` and `FS/Z` file systems. +also creates an initrd or a disk partition from a directory. Supported file systems: + +| Format | Initrd | Partition | Specification, source | +|----------|--------|-----------|-------------------------------------------------| +| `jamesm` | ✔Yes | ✗No | [James Molloy's tutorials](http://jamesmolloy.co.uk/tutorial_html/8.-The+VFS+and+the+initrd.html) | +| `cpio` | ✔Yes | ✗No | [wikipedia](https://en.wikipedia.org/wiki/Cpio) | +| `tar` | ✔Yes | ✔Yes | [wikipedia](https://wiki.osdev.org/USTAR) | +| `echfs` | ✔Yes | ✔Yes | [spec](https://gitlab.com/bztsrc/bootboot/blob/binaries/specs/echfs.md) [source repo](https://github.com/echfs/echfs) | +| `FS/Z` | ✔Yes | ✔Yes | [source](https://gitlab.com/bztsrc/bootboot/blob/master/mkbootimg/fsZ.h) | +| `boot` | ✗No | ✔Yes | [spec](https://gitlab.com/bztsrc/bootboot/raw/binaries/specs/efifat.pdf) (ESP only, 8+3 names) | +| `fat` | ✗No | ✔Yes | [spec](https://gitlab.com/bztsrc/bootboot/raw/binaries/specs/vfat.pdf) (non-ESP only, with LFN) | +| `minix` | ✗No | ✔Yes | [V2 spec](https://gitlab.com/bztsrc/bootboot/raw/binaries/specs/minix.pdf) [V3 source](https://github.com/Stiching-MINIX-Research-Fundation/minix/tree/master/minix/fs/mfs) (V3 supported, but there's only V2 spec) | +| `ext2` | ✗No | ✔Yes | [spec](https://gitlab.com/bztsrc/bootboot/raw/binaries/specs/ext2.pdf) [documentation](https://www.nongnu.org/ext2-doc/ext2.html) | +| `lean` | ✗No | ✔Yes | [homepage](https://freedos-32.sourceforge.net/lean/specification.php) | + +The code is written in a way that it is easily expandable. The generated image was tested with fdisk, and with the verify function of gdisk. The FAT partition was tested with fsck.vfat and with TianoCore UEFI firmware and on Raspberry Pi. The ISO9660 part tested with iat (ISO9660 Analyzer Tool) and Linux mount. diff --git a/mkbootimg/fs.h b/mkbootimg/fs.h index 9ab8674..10aa97b 100644 --- a/mkbootimg/fs.h +++ b/mkbootimg/fs.h @@ -56,6 +56,10 @@ void ext_open(gpt_t *gpt_entry); void ext_add(struct stat *st, char *name, unsigned char *content, int size); void ext_close(); +void len_open(gpt_t *gpt_entry); +void len_add(struct stat *st, char *name, unsigned char *content, int size); +void len_close(); + void jamesm_open(gpt_t *gpt_entry); void jamesm_add(struct stat *st, char *name, unsigned char *content, int size); void jamesm_close(); @@ -72,6 +76,7 @@ fsdrv_t fsdrv[] = { { "minix", { 0xB7AADF00, 0xDE27, 0x11CA, { 0xA5,0x74,0x56,0x72,0x69,0x6A,0x65,0x55} }, mnx_open, mnx_add, mnx_close }, { "fat", { 0xEBD0A0A2, 0xB9E5, 0x4433, { 0x87,0xC0,0x68,0xB6,0xB7,0x26,0x99,0xC7} }, fat_open, fat_add, fat_close }, { "ext2", { 0x0FC63DAF, 0x8483, 0x4772, { 0x8E,0x79,0x3D,0x69,0xD8,0x47,0x7D,0xE4} }, ext_open, ext_add, ext_close }, + { "lean", { 0xBB5A91B0, 0x977E, 0x11DB, { 0xB6,0x06,0x08,0x00,0x20,0x0C,0x9A,0x66} }, len_open, len_add, len_close }, { "FS/Z", { 0x5A2F534F, 0x0000, 0x5346, { 0x2F,0x5A,0x00,0x00,0x00,0x00,0x00,0x00} }, fsz_open, fsz_add, fsz_close }, /* partition type only, without drivers */ { "OS/Z usr (x86_64)", { 0x5A2F534F, 0x8664, 0x5346, { 0x2F,0x5A,0x00,0x00,0x75,0x73,0x72,0x00} }, NULL, NULL, NULL }, diff --git a/mkbootimg/lean.c b/mkbootimg/lean.c index 742a58e..8266470 100644 --- a/mkbootimg/lean.c +++ b/mkbootimg/lean.c @@ -30,14 +30,14 @@ */ #include "main.h" -void lean_open(gpt_t *gpt_entry) +void len_open(gpt_t *gpt_entry) { } -void lean_add(struct stat *st, char *name, unsigned char *content, int size) +void len_add(struct stat *st, char *name, unsigned char *content, int size) { } -void lean_close() +void len_close() { }