Builds a bootable Folk OS image.
To run Folk on a PC, download the latest pre-built Folk image for USB stick from the Releases page. Follow the instructions there.
Below are details on how the Folk OS image is constructed; you don't need to worry about any of the below if you're just trying to install Folk.
folk-live/
: becomes writable partition on disk, including Folk repoconfig/package-lists/folk.list.chroot
: apt packagesconfig/hooks/normal/9999-setup-folk.hook.chroot
: executed in
/
chroot at image construction timeconfig/includes.chroot_after_packages/
: copied into /
at bootconfig/includes.chroot_after_packages/lib/live/config/9999-folk
:
executed at bootYou need to build on a computer running amd64 Debian Bookworm. (Use a virtual machine if you need to. A Folk system built by folk-live-build itself should work, though, whether on a virtual or physical machine.)
# apt install live-build parted dosfstools zip
$ git submodule update --init
$ make
emits folk-amd64.img
.
(It runs from scratch each time -- can take 30 minutes or more.)
Image (-> USB drive) contains Master Boot Record with:
'Binary' ext4 partition (~1.3GB)
EFI system partition (100MB)
Writable FAT32 partition (~500MB)
Cannot have FAT32 partition be same as efi partition (and use iso loopback) because macOS (and probably other OSes?) won't automount an efi partition.
The build process uses Debian live-build to build a live image, then appends EFI system partition (to make it bootable on UEFI machines) and a writable partition (to make it easy for end-user to set config settings and update Folk).
(live-build can make a complete bootable disk image on its own, but only in iso-hybrid mode, which doesn't let you modify the partition table to add the writable partition, so we instead use hdd mode and modify the partition table ourselves.)
Run live-build, emit a disk image (with MBR with only a binary partition. not bootable on many modern systems)
Use parted to mutate the disk image to add EFI system partition
Copy syslinux-efi bootloader and bootloader config and Linux kernel etc onto EFI system partition
Use parted to mutate the disk image to add the writable FAT32 partition
Apache 2.0