galeb

Једноставна статичка дистрибуција заснована на musl-у
Дневник | Датотеке | Референце | ПРОЧИТАЈМЕ | ЛИЦЕНЦА

чување 545f684a3f18e3be5bf15e688b2ecbbf7bbec0dc
родитељ 3cbc45df3deba18106be717fda9edad7c5e63309
Аутор: Страхиња Радић <contact@strahinja.org>
Датум:   Tue,  9 Aug 2022 22:49:45 +0200

BOOTING: New file; start adding shim

Signed-off-by: Страхиња Радић <contact@strahinja.org>

Diffstat:
M03-packages.sh | 45++++++++++++++++++++++++++++++++++++++++++++-
ABOOTING | 121+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
MFAQ | 3+++
MTODO | 3+++
Mlib/pkgs.tsv | 1+
измењених датотека: 5, додавања: 172(+), брисања: 1(-)

diff --git a/03-packages.sh b/03-packages.sh @@ -6184,6 +6184,46 @@ end_substep # fi # end_substep +# TODO +begin_substep shim-15.6 +if [ -x /share/shim ]; then + msg info "%s exists, skipping %s" /share/shim \ + ${pkg} +elif [ -e ${G_SPKG}/${pkg}.tar.xz ]; then + unpack_pkg ${pkg} / +else + extract_pkg ${G_SRC} ${pkg} ${pkg}.tar.bz2 + ( + cd_or_fail ${G_SRC}/${pkg} + + cat <<! >MKPK +mkpk_name() +{ + printf "%s" "${pkg}" +} + +mkpk_install() +{ + CFLAGS='-Os -pipe' + LDFLAGS='' + DESTDIR=/build + export CFLAGS LDFLAGS DESTDIR + + ./configure --prefix=/sucks || exit 1 + + make ${JN} || exit 1 + make install +} +! + mkpk ${pkg} + remove_dir ${G_SRC}/${pkg} + unpack_pkg ${pkg} / + ) || exit 1 +fi +timestamp=$(date +'%Y-%m-%d %T') +printf "%s\t%s\t%s\n" shim 15.6 "${timestamp}" >>${G_PKGDB} +end_substep + begin_substep libevent-2.1.12 if [ -x /sucks/lib/libevent-2.1.so.7.0.1 ]; then msg info "%s exists, skipping %s" /sucks/lib/libevent-2.1.so.7.0.1 \ @@ -6477,7 +6517,10 @@ msg warn " cp arch/x86/boot/bzImage /boot/vmlinuz && \\\\ " msg warn " cp System.map /boot/ && \\\\ " msg warn " cp .config /boot/config " msg warn " mv /bin/_ln /bin/ln " -msg warn "You might want to then use efibootmgr to add vmlinuz to EFI. " +msg warn "You might want to then use efibootmgr to add efistub to EFI. " +msg warn "For example (efibootmgr -h for help): " +msg warn " efibootmgr -c -d /dev/sda -l '\\\\vmlinuz' \\\\ " +msg warn " -L 'Galeb EFISTUB' -p1 -u root=/dev/sda2 " PATH=/local/bin:/bin:/sucks/bin:/tools/bin export PATH diff --git a/BOOTING b/BOOTING @@ -0,0 +1,121 @@ +Booting +======= + +One of the perhaps most frequent issues with configuring a Unix-like OS is +setting up boot configuration correctly. The perceived difficulty mostly comes +from not understanding the basic concepts behind booting. + + +Firmware type +------------- + +There are two firmware types: the older, BIOS, and newer, UEFI. Which one of the +two is used depends on your system. If you can run + + $ efibootmgr -v + +and it doesn't give an error message but a list of boot entries, then you have +UEFI. + + +Partition table type +-------------------- + +There are two partition table types: older, Master Boot Record (MBR), and newer, +GUID Partition Table (GPT). UEFI systems usually use GPT, but other combinations +are also possible. + + +Boot loader +----------- + +The program which carries out the initial stage of booting an OS is called a +boot loader. This can be a program like GRUB, rEFInd, SYSLINUX, LILO and so on, +on, or, in the case of Linux with UEFI, the kernel itself (EFISTUB). + +* With BIOS, bootloaders are written into the (master or volume) boot records of + disk partitions themselves (BIOS/MBR) or BIOS boot partitions (BIOS/GPT), and + this is where the system will look for them. + +* With UEFI/GPT, bootloaders are normal files on an EFI System Partition (ESP). + In order for the system to find them, their boot entries must be written to + EFI variables. This can be done by the program efibootmgr(8), but it can also + be done by the UEFI interface or an UEFI shell. + + +Linux boot +---------- + +During the boot process, Linux executes the init program (usually /sbin/init) +on the system root partition. This can be done in two ways: + +* By creating an initial root partition (initramfs) having a temporary init + program, which if needed handles loading the necessary kernel modules + (drivers) to access the root partition. This method supports advanced + partition selection, for example by their UUIDs or PARTUUIDs, and doesn't + require the support for filesystem type of the root partition to be compiled + in the kernel. + +* By specifying the root partition on the kernel command line (through a kernel + parameter), for example `root=/dev/sda2`. This is more minimal, as it doesn't + require initramfs, but prone to being unable to boot a system if the disk + configuration is changed, for example by plugging in a USB flash drive or + otherwise changing the order of the hard disks. + + +Recommended setup in Galeb +-------------------------- + +The following is the basic recommended partition configuration in Galeb. It +assumes an UEFI/GPT system. + + Partition Mountpoint Filesystem Type Size + -------------------------------------------------------------- + /dev/sda1 /boot vfat (32-bit) ~500MB + /dev/sda2 / ext4 Rest + +When configuring a boot entry, this means that the kernel command line will be + + root=/dev/sda2 + +and that the ESP is in /dev/sda1, mounted later during the boot process to +/boot. This is where the kernel stub should go into, and will later be +accessible from the booted system at /boot/vmlinuz. + + +Creating a boot entry in efibootmgr +----------------------------------- + +The necessary command line parameters will be briefly explained here. For more +information, see `man 8 efibootmgr` and `efibootmgr -h`. + + efibootmgr -c -d /dev/sda -l '\vmlinuz' -L 'Galeb EFISTUB' -p1 \ + -u root=/dev/sda2 + +-c Create a new boot entry. + +-d /dev/sda + Disk on which the root partition is (boot disk). + +-l '\vmlinuz' + Boot loader (our EFISTUB) is in the file vmlinuz on ESP. UEFI uses DOS + filesystem path separator, backslash (\), instead of a slash (/) used on + Unix-like systems. + +-L 'Galeb EFISTUB' + Label for the boot entry. + +-p1 ESP is the partition #1 on the boot disk (/dev/sda1). + +-u Treat the kernel command line as UCS-2. + +root=/dev/sda2 + Kernel command line. + + +See also +-------- + +1. https://wiki.archlinux.org/title/Partitioning#Example\_layouts +2. https://wiki.archlinux.org/title/EFI_system_partition +3. https://wiki.archlinux.org/title/EFISTUB diff --git a/FAQ b/FAQ @@ -28,6 +28,9 @@ Q: No thanks, I will instead go back to another distro or Windoze. But won't that hurt your business? A: What business? Use whatever software you like, or don't, it's up to you. +Q: How to boot? There's no GRUB! +A: See BOOTING. + Q: How do I install a package? A: cd / && xz -dc /pkg/some_pkg.tar.xz | tar -xf - or use mkpk(8)[1]: diff --git a/TODO b/TODO @@ -1,6 +1,9 @@ TODO ==== +[ ] Add shim + [ ] Use shim and mksquashfs to create boot iso + [ ] See if any packages can be trimmed from the bootstrap diff --git a/lib/pkgs.tsv b/lib/pkgs.tsv @@ -93,6 +93,7 @@ https://github.com/pullmoll/musl-fts/archive/v1.2.7.tar.gz musl-fts-1.2.7.tar.gz https://github.com/pullmoll/musl-obstack/archive/v1.1.tar.gz musl-obstack-1.1.tar.gz e3a9956133d72a00663cf8d9720e62002142e113e7d67e2338a2bce1bdfac9eefd4290db8add15eabafdf01065f7fe9bb6754faa36b88df819c53d44fa140757 https://github.com/rhboot/efibootmgr/archive/17.tar.gz efibootmgr-17.tar.gz 10c7ad9a79f23dcd4708dc4f42701196af7aa11f5e9a6468ea51f7013d4caeba6c92527ba1304f6e3b2ef3b51b3b69ea1a30f81bb099a8aea49eeb30eb631e1d https://github.com/rhboot/efivar/releases/download/37/efivar-37.tar.bz2 305a82ed103c7e3d8f723934019d552677c73558768dd5341f87d0364f5c60824d24f5a8e1bf90075e825908085083d4ecdccec5ac757fd38ee6ac8fea28c3e4 +https://github.com/rhboot/shim/releases/download/15.6/shim-15.6.tar.bz2 ddc5d5234851d05ed7124ad748ad3fee2df8a335493948a045653322c873f3f055d34894aeb2ac7495086984ca62183907d341e46e6bdf108856e39c646455fc https://github.com/rkd77/elinks/releases/download/v0.15.0/elinks-0.15.0.tar.xz 550f7a1a94334c6c28c8874cb9fbc2ed76d9e4a86c521845e7355f6505f2b7f842a4e250a02b4bb238ea1fa8322e2c12214c53d8df3a211c56869e86bfcc7f2b https://github.com/rpm-software-management/popt/archive/refs/tags/popt-1.18-release.tar.gz popt-1.18.tar.gz 689c125331944f71813c922120223eb8a9fce4d93eaa558bd2bd7edb81fc53f193414ce06d3a3c22dbb3de981e91f237b591de5806b08364d8c9f21fce73200d https://github.com/shadow-maint/shadow/releases/download/v4.11.1/shadow-4.11.1.tar.xz 12fbe4d6ac929ad3c21525ed0f1026b5b678ccec9762f2ec7e611d9c180934def506325f2835fb750dd30af035b592f827ff151cd6e4c805aaaf8e01425c279f