readme,to_ram

This commit is contained in:
Marc Beninca 2023-11-21 14:29:08 +01:00
parent 4f563bcc20
commit 2ab2f2032e
6 changed files with 159 additions and 74 deletions

View file

@ -259,7 +259,10 @@ data_uuid=${DATA}
" "
write_env "${GRUB_ENV}" "\ write_env "${GRUB_ENV}" "\
check_squashfs=enforce
grub_sleep=999 grub_sleep=999
time_out=10
to_ram=enforce
" "
# grub / fonts ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ # grub / fonts ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅

Binary file not shown.

View file

@ -10,6 +10,8 @@ menuentry '↑ cmd →' { menu 'cmd' }
menu_split menu_split
menuentry 'check_squashfs = enforce' { check_squashfs='enforce' } menuentry 'check_squashfs = enforce' { check_squashfs='enforce' }
menuentry 'check_squashfs = no' { check_squashfs='no' } menuentry 'check_squashfs = no' { check_squashfs='no' }
menuentry 'to_ram = enforce' { to_ram='enforce' }
menuentry 'to_ram = no' { to_ram='no' }
menu_split menu_split
menuentry 'bash / stable / tui' { debsquash '/boot/bash/stable/tui' } menuentry 'bash / stable / tui' { debsquash '/boot/bash/stable/tui' }
menuentry 'bash / stable / gui' { debsquash '/boot/bash/stable/gui' } menuentry 'bash / stable / gui' { debsquash '/boot/bash/stable/gui' }

View file

@ -23,6 +23,10 @@ function debsquash {
echo echo
echo 'linux' echo 'linux'
echo "${linux_path}" echo "${linux_path}"
toram='toram'
if [ "${to_ram}" == 'enforce' ] ; then
toram="${toram}=${sfs}"
fi
linux \ linux \
"${linux_path}" \ "${linux_path}" \
boot="live" \ boot="live" \
@ -30,7 +34,7 @@ elevator="deadline" \
ip="frommedia" \ ip="frommedia" \
live-media-path="${lmp}" \ live-media-path="${lmp}" \
live-media-uuid="${data_uuid}" \ live-media-uuid="${data_uuid}" \
toram="${sfs}" "${toram}"
# #
echo echo
echo 'initrd' echo 'initrd'

View file

@ -1,7 +1,7 @@
function env { function env {
action="${1}" action="${1}"
setparams \ setparams \
'check_squashfs' 'time_out' 'check_squashfs' 'grub_sleep' 'time_out' 'to_ram'
if [ "${action}" == 'load' ] ; then if [ "${action}" == 'load' ] ; then
load_env \ load_env \
--skip-sig \ --skip-sig \
@ -49,5 +49,7 @@ function env_mod {
function env_set { function env_set {
check_squashfs='enforce' check_squashfs='enforce'
grub_sleep=999
time_out=10 time_out=10
to_ram='enforce'
} }

218
readme.md
View file

@ -4,84 +4,79 @@ Build an ESP File System including:
* standalone EFI & BIOS GRUB images * standalone EFI & BIOS GRUB images
* boot time dynamic GRUB menu * boot time dynamic GRUB menu
## Dependencies
* grub-common
* grub-mkimage
* grub-efi-amd64-bin
* x86_64-efi
* grub-efi-amd64-signed
* grubx64.efi.signed
* grub-pc-bin
* i386-pc
* boot.img
* grub-bios-setup
* shim-signed
* shimx64.efi.signed
* grub-theme-breeze
* themes/breeze
* grub-theme-starfield
* themes/starfield
## Project ## Project
* build.mod ```
* build.py ├── __init__.py
* build.sh ├── __main__.py
* images ├── build.mod
* nightly.png ├── build.sh
* license.md ├── doc.py
* live ├── esp.py
* env.sh ├── grub.cfg.sh
* main.sh ├── grubx64.efi.signed.sh
* menu ├── images
* cmd.sh │ └── nightly.png
* env.sh ├── license.md
* gfx.sh ├── live
* main.sh │ ├── main.sh
* menu.sh │ ├── menu
* scan.sh │ │ ├── cmd.sh
* util.sh │ │ ├── env.sh
* var.sh │ │ ├── gfx.sh
* menu │ │ ├── scan.sh
* main.sh │ │ └── set.sh
* todo.gv │ └── source
│ ├── boot.sh
│ ├── env.sh
│ ├── menu.sh
│ ├── probe.sh
│ ├── scan.sh
│ └── util.sh
├── readme
│ └── grub.md
├── readme.md
├── todo.gv
└── todo.svg
```
* todo.svg ## Usage
## Build ### build
* bios ```
* boot.img build.sh pgp_fingerprint /esp/mount/point [/data/mount/point]
* core.img ```
* setup.sh
* efi #### example
* boot
* bootx64.efi ```
* grub /rwx/lsgm/build.sh 9C7613450C80C24F /media/ssd/esp /media/ssd/data
* fonts ```
* *.pf2
* grub.cfg #### output
* i386-pc
* *.lst
* *.mod
* locale
* *.mo
* themes
* breeze
* starfield
* x86_64-efi
* *.lst
* *.mod
* grub.env
## Tasks
- [x] comply with secure boot
- [x] choose to check squashfs or not
- [ ] bash
- [ ] mimic grubx64.efi.signed ←
- [ ] efi
- [ ] include fonts/unicode
- [ ] bios
- [ ] find & setup bios device
- [ ] rewrite in python
![Graph](todo.svg)
### Later
- [ ] target arm
- [ ] make keyboard layouts
- [ ] make custom fonts
- [ ] target specific live-media
- [ ] -mount-opts?
``` ```
/esp
├── bios ├── bios
│ ├── boot.img │ ├── boot.img
│ ├── core.img │ ├── core.img
@ -137,3 +132,82 @@ Build an ESP File System including:
│ └── grubx64.efi │ └── grubx64.efi
└── grub.env └── grub.env
``` ```
### setup
```
setup.sh /dev/device
```
* example:
```
bash /media/ssd/esp/bios/setup.sh /dev/sda
```
## Roadmap
![Graph](todo.svg)
### BASH
#### build
* [ ] make custom
* [ ] fonts
* [ ] keyboard layouts
* [ ] make images
* [ ] mimic grubx64.efi.signed
* [ ] targets
* [ ] arm
* [x] i386-pc
* [x] x86_64-efi
* [x] x86_64-efi-signed
* [ ] embed extra
* [ ] fonts
* [ ] keyboard layouts
* [ ] locales
* [x] copy
* [x] fonts
* [x] locales
* [x] themes
* [x] sign files
* [ ] setup bios
* [x] write for manual call
* [x] boot image
* [x] core image
* [x] setup script
* [ ] auto
* [ ] find esp device
* [ ] write bios_grub partition
#### live
* [x] check signatures
* [ ] options
* [x] check signatures for *.squashfs
* [x] boot to ram
* [ ] locales
* [ ] themes
* [ ] target specific live-media
* [ ] try -mount-opts
### Python