summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2019-05-04 00:10:26 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2019-05-04 00:10:26 +0000
commit7bb2006007c1996f33758e41db070252d4d3607f (patch)
tree3dc03d4f6a8867742961a3dea9ecc96c52d00a10 /Makefile
parent1202c964c4e91083a3c60b41b9c11e220bfa759d (diff)
downloadlh-bootstrap-7bb2006007c1996f33758e41db070252d4d3607f.tar.xz
Make a lean and mean version, as a basis for filling an initramfs
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile53
1 files changed, 6 insertions, 47 deletions
diff --git a/Makefile b/Makefile
index 98891ed..2ee4312 100644
--- a/Makefile
+++ b/Makefile
@@ -45,10 +45,10 @@ NORMALUSER_GID := $(shell id -g $(NORMALUSER))
it: all
-.PHONY: it all clean distclean qemu-boot qemu-image virtualbox-image vmware-image
+.PHONY: it all clean distclean
-all: qemu-image
+all: $(OUTPUT)/tmp/.lh_rootfs_installed
@@ -60,19 +60,11 @@ distclean:
clean:
ls -1 $(OUTPUT) | grep -vF sources | while read a ; do rm -rf $(OUTPUT)/"$$a" & : ; done ; true
-# other available targets to clean subsystems:
-# clean-busybox
-# clean-dropbear
-#
-# can be called with: ./make clean-busybox
-#
-# these targets are defined in the corresponding subsystem Makefile
-
# Prepare the output directory. This is at the bottom of the dependency tree.
$(OUTPUT)/tmp/.lh_prepared: lh-config
- exec mkdir -p -m 0755 -- $(OUTPUT)/tmp $(OUTPUT)/rootfs $(OUTPUT)/rwfs $(OUTPUT)/userfs $(OUTPUT)/build-build/bin $(OUTPUT)/build-build/opt $(OUTPUT)/build-build/tmp $(OUTPUT)/build-host/bin $(OUTPUT)/build-host/opt $(OUTPUT)/build-host/tmp $(OUTPUT)/host-host $(OUTPUT)/sources
+ exec mkdir -p -m 0755 -- $(OUTPUT)/tmp $(OUTPUT)/rootfs $(OUTPUT)/build-build/bin $(OUTPUT)/build-build/opt $(OUTPUT)/build-build/tmp $(OUTPUT)/build-host/bin $(OUTPUT)/build-host/opt $(OUTPUT)/build-host/tmp $(OUTPUT)/host-host $(OUTPUT)/sources
exec chown -R -- $(NORMALUSER_UID):$(NORMALUSER_GID) $(OUTPUT)/tmp $(OUTPUT)/build-build $(OUTPUT)/build-host $(OUTPUT)/host-host
exec chown -- $(NORMALUSER_UID):$(NORMALUSER_GID) $(OUTPUT)/sources $(OUTPUT)
exec setuidgid $(NORMALUSER) touch $@
@@ -80,52 +72,21 @@ $(OUTPUT)/tmp/.lh_prepared: lh-config
# This target builds all the build-time native tools, the real part of the build depends on this target
-$(OUTPUT)/build-build/.lh_done: $(OUTPUT)/build-build/.lh_gcc $(OUTPUT)/build-build/.lh_skarnet_installed $(OUTPUT)/build-build/.lh_util-linux_installed $(OUTPUT)/build-build/.lh_kmod_installed
+$(OUTPUT)/build-build/.lh_done: $(OUTPUT)/build-build/.lh_skarnet_installed $(OUTPUT)/build-build/.lh_util-linux_installed $(OUTPUT)/build-build/.lh_kmod_installed
exec setuidgid $(NORMALUSER) touch $@
# The rootfs
-$(OUTPUT)/tmp/.lh_rootfs_installed: $(OUTPUT)/tmp/.lh_layout_installed $(OUTPUT)/build-host/.lh_skarnet_installed $(OUTPUT)/build-host/.lh_socklog_installed $(OUTPUT)/build-host/.lh_bb_installed $(OUTPUT)/build-host/.lh_bbsuid_installed $(OUTPUT)/build-host/.lh_dnscache_installed $(OUTPUT)/build-host/.lh_dropbear_installed $(OUTPUT)/build-host/kernel/.lh_installed
- exec setuidgid $(NORMALUSER) touch $@
-
-
-# Disk images (raw for qemu, vmdk for virtualbox and vmware)
-
-$(OUTPUT)/tmp/.lh_installed: $(OUTPUT)/tmp/.lh_rootfs_installed $(OUTPUT)/build-host/kernel/.lh_installed
- exec setuidgid $(NORMALUSER) touch $@
-
-$(OUTPUT)/tmp/.lh_diskimage_done: $(OUTPUT)/tmp/.lh_installed $(OUTPUT)/build-build/.lh_done
-
-ifeq ($(KERNEL_GENERIC_ARCH),x86)
-include sub/syslinux/Makefile
-$(OUTPUT)/tmp/.lh_diskimage_done: $(OUTPUT)/build-build/.lh_$(SYSLINUX_NAME)_installed
-endif
-
-$(OUTPUT)/tmp/.lh_diskimage_done:
- exec sub/disk-image/make-disk-image $(OUTPUT) $(ROOTFS_SIZE) $(SWAP_SIZE) $(RWFS_SIZE) $(USERFS_SIZE) $(EXTRA_SIZE)
+$(OUTPUT)/tmp/.lh_rootfs_installed: $(OUTPUT)/tmp/.lh_layout_installed $(OUTPUT)/build-host/.lh_skarnet_installed $(OUTPUT)/build-host/.lh_bb_installed $(OUTPUT)/build-host/.lh_dropbear_installed
exec setuidgid $(NORMALUSER) touch $@
-qemu-image: $(OUTPUT)/tmp/.lh_diskimage_done
-
-$(OUTPUT)/disk-image.vmdk: $(OUTPUT)/tmp/.lh_diskimage_done
- exec setuidgid $(NORMALUSER) qemu-img convert -f raw -O vmdk $(OUTPUT)/disk-image.raw $(OUTPUT)/disk-image.vmdk
-
-virtualbox-image: $(OUTPUT)/disk-image.vmdk
-
-vmware-image: $(OUTPUT)/disk-image.vmdk
-
-qemu-boot: $(OUTPUT)/tmp/.lh_diskimage_done
- ./qemu-boot $(OUTPUT)
-
-
# Subsystems
## libc, toolchains, utilities, for the build itself, or for building the host
-include sub/kernel/Makefile
-include sub/musl/Makefile
+# include sub/kernel/Makefile
include sub/util-linux/Makefile
include sub/xz/Makefile
include sub/kmod/Makefile
@@ -136,7 +97,5 @@ include sub/kmod/Makefile
include sub/layout/Makefile
include sub/bearssl/Makefile
include sub/skarnet.org/Makefile
-include sub/socklog/Makefile
include sub/busybox/Makefile
-include sub/dnscache/Makefile
include sub/dropbear/Makefile