summary refs log blame commit diff
path: root/Makefile
blob: 7f8aedb1c4029b70f5635f70b4521320ea362336 (plain) (tree)
1
2
3
4
5
6
7
8
9


                                                         


                                           


                                                             
                                  
 




                                                                               
 



                                                       



                    
# SPDX-License-Identifier: EUPL-1.2
# SPDX-FileCopyrightText: 2021 Alyssa Ross <hi@alyssa.is>

CPIO = cpio
CPIOFLAGS = --reproducible -R +0:+0 -H newc

build/initramfs: build/local.cpio $(PACKAGES_CPIO)
	cat build/local.cpio $(PACKAGES_CPIO) | gzip -9n > $@

MOUNTPOINTS = dev mnt proc sys tmp

build/local.cpio: etc/init etc/mdev.conf build/mountpoints
	printf "%s\n" etc etc/mdev.conf | $(CPIO) -o $(CPIOFLAGS) > $@
	cd etc && echo init | $(CPIO) -o $(CPIOFLAGS) -AF ../$@
	cd build/mountpoints && \
	    printf "%s\n" $(MOUNTPOINTS) | $(CPIO) -o $(CPIOFLAGS) -AF ../../$@

build/mountpoints:
	rm -rf build/mountpoints
	mkdir -p build/mountpoints
	cd build/mountpoints && mkdir -p $(MOUNTPOINTS)

clean:
	rm -rf build
.PHONY: clean