sector-f-linux

Sector F Linux
git clone https://git.sectorflabs.com/sector-f-linux.git
Log | Files | Refs | README | LICENSE

Makefile (3500B)


      1 # Sector F Linux: build the image (Fedora bootc on Btrfs), run it in a VM, make the install ISO, and publish.
      2 # Nothing leaves this machine until `make publish`.
      3 # These wrap the scripts in linux/ (see linux/vm/README.md). Needs Docker, QEMU with KVM and OVMF.
      4 
      5 VM   := linux/vm/vm.sh
      6 DISK := linux/out/disk.raw
      7 
      8 .DEFAULT_GOAL := help
      9 .PHONY: help build desktop greeter installer updater iso iso-run iso-stop iso-shot iso-ssh iso-reset check publish disk run console stop ssh view screenshot log upgrade rollback clean distclean
     10 
     11 help: ## List the targets
     12 	@grep -E '^[a-zA-Z_-]+:.*## ' $(MAKEFILE_LIST) | \
     13 		awk 'BEGIN{FS=":.*## "} {printf "  %-12s %s\n", $$1, $$2}'
     14 
     15 build: ## Build the desktop, greeter, updater and image on this machine, no push (QUICK=1 skips the first two)
     16 	linux/vm/build.sh
     17 
     18 desktop: ## Build only the Patina desktop into linux/build/desktop/
     19 	linux/desktop/build.sh
     20 
     21 greeter: ## Build only the greeter into linux/build/greeter/ (in the Fedora builder)
     22 	linux/greeter-build.sh
     23 
     24 installer: ## Build only the installer into linux/build/installer/ (in the Fedora builder)
     25 	linux/installer-build.sh
     26 
     27 updater: ## Build only the updater into linux/build/updater/ (in the Fedora builder)
     28 	linux/updater-build.sh
     29 
     30 iso: ## Build the install ISO to linux/out/iso/ from the published image, so after `make publish` (builds in the VM; takes a while; DEBUG=1 adds SSH for the rig)
     31 	$(if $(DEBUG),LIVE_DEBUG=1 )linux/live/build.sh
     32 
     33 iso-run: ## Boot the ISO in QEMU with two blank drives (VNC localhost:5902)
     34 	linux/live/try.sh start
     35 
     36 iso-stop: ## Power the ISO's VM off
     37 	linux/live/try.sh stop
     38 
     39 iso-shot: ## Save the ISO VM's screen to linux/out/iso/screen.png
     40 	linux/live/try.sh screenshot
     41 
     42 iso-ssh: ## A root shell in the ISO VM (needs an ISO built with DEBUG=1; or: make iso-ssh CMD='lsblk')
     43 	linux/live/try.sh ssh $(CMD)
     44 
     45 iso-reset: ## Stop the ISO VM and blank its two drives
     46 	linux/live/try.sh reset
     47 
     48 check: ## Tests and clippy for the greeter, the installer and the updater, and the login script's tests
     49 	$(MAKE) -C greeter check
     50 	$(MAKE) -C installer check
     51 	$(MAKE) -C updater check
     52 	sh linux/tests/patina-firefox-theme.sh
     53 
     54 publish: ## Push the image `make build` made to ghcr.io/sector-f-labs (the only target that pushes)
     55 	linux/publish.sh
     56 
     57 disk: ## Install the image onto linux/out/disk.raw (replaces the disk)
     58 	linux/vm/disk.sh
     59 
     60 $(DISK):
     61 	linux/vm/disk.sh
     62 
     63 run: $(DISK) ## Boot the built image in a VM (installs it first if there is no disk)
     64 	$(VM) start
     65 	$(VM) wait
     66 	@echo "Up. The greeter shows on 'make view' (VNC localhost:5901); log in as patina / patina."
     67 	@echo "make ssh for a root shell, make stop to power off."
     68 
     69 console: $(DISK) ## Boot the image on this terminal instead (Ctrl-a x quits)
     70 	$(VM) console
     71 
     72 stop: ## Power the VM off
     73 	$(VM) stop
     74 
     75 ssh: ## A root shell in the running VM (or: make ssh CMD='uname -a')
     76 	$(VM) ssh $(CMD)
     77 
     78 view: ## Show the VM's screen over VNC (localhost:5901)
     79 	$(VM) view
     80 
     81 screenshot: ## Save the VM's screen to linux/out/screen.png
     82 	$(VM) screenshot
     83 
     84 log: ## Follow the VM's serial console
     85 	$(VM) log
     86 
     87 upgrade: ## In the running VM: fetch the latest published image and stage it (after `make publish`) (rpm-ostree: bootc refuses once a package is layered; ADR-0009)
     88 	$(VM) ssh rpm-ostree upgrade
     89 
     90 rollback: ## In the running VM: boot the previous build at the next reboot
     91 	$(VM) ssh rpm-ostree rollback
     92 
     93 clean: ## Stop the VM and delete linux/out/
     94 	linux/vm/clean.sh
     95 
     96 distclean: ## Also delete the built images
     97 	linux/vm/clean.sh --all