From 82d0f92ab8b84466ae20ab919c1f9c3577b5cecb Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Mon, 22 May 2017 21:56:04 +0000 Subject: Initial commit --- sub/busybox/Makefile | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 sub/busybox/Makefile (limited to 'sub/busybox/Makefile') diff --git a/sub/busybox/Makefile b/sub/busybox/Makefile new file mode 100644 index 0000000..7cc255c --- /dev/null +++ b/sub/busybox/Makefile @@ -0,0 +1,74 @@ +# Version from 2017-04-07 +# BUSYBOX_VERSION := 1140bf39ab113aefee8079755fac618bf6314db6 + +# Version from 2017-05-22 +BUSYBOX_VERSION := f5470419404d643070db99d058405b714695b817 + +clean-busybox: + rm -f $(OUTPUT)/sources/.lh_bb_cloned + rm -rf $(OUTPUT)/sources/busybox + rm -f $(OUTPUT)/sources/.lh_bb_dled + rm -rf $(OUTPUT)/build-host/.lh_bb_* + rm -rf $(OUTPUT)/build-host/busybox-$(BUSYBOX_VERSION) + rm -f $(OUTPUT)/build-host/.lh_mdev_* + rm -rf $(OUTPUT)/build-host/mdev + rm -f $(OUTPUT)/build-host/bbsuid.c $(OUTPUT)/build-host/bbsuid $(OUTPUT)/build-host/.lh_bbsuid_installed + + +$(OUTPUT)/sources/.lh_bb_cloned: | $(OUTPUT)/tmp/.lh_prepared $(OUTPUT)/build-build/.lh_skarnet_installed + exec setuidgid $(NORMALUSER) s6-rmrf $(OUTPUT)/sources/busybox + exec setuidgid $(NORMALUSER) cd $(OUTPUT)/sources git clone git://git.busybox.net/busybox + exec setuidgid $(NORMALUSER) touch $@ + +$(OUTPUT)/sources/.lh_bb_dled: $(OUTPUT)/sources/.lh_bb_cloned | $(OUTPUT)/build-build/.lh_skarnet_installed + exec setuidgid $(NORMALUSER) cd $(OUTPUT)/sources/busybox git checkout $(BUSYBOX_VERSION) + exec setuidgid $(NORMALUSER) touch $@ + + +$(OUTPUT)/build-host/.lh_bb_copied: $(OUTPUT)/sources/.lh_bb_dled | $(OUTPUT)/build-build/.lh_skarnet_installed $(OUTPUT)/tmp/.lh_prepared + exec setuidgid $(NORMALUSER) s6-rmrf $(OUTPUT)/build-host/busybox-$(BUSYBOX_VERSION) + exec setuidgid $(NORMALUSER) s6-hiercopy $(OUTPUT)/sources/busybox $(OUTPUT)/build-host/busybox-$(BUSYBOX_VERSION) + exec setuidgid $(NORMALUSER) s6-touch $@ + +$(OUTPUT)/build-host/busybox-$(BUSYBOX_VERSION)/.config: $(OUTPUT)/build-host/.lh_bb_copied sub/busybox/host-full-config | $(OUTPUT)/build-build/.lh_skarnet_installed $(OUTPUT)/tmp/.lh_prepared + exec setuidgid $(NORMALUSER) cp -f $(WD)/sub/busybox/host-full-config $@ + +$(OUTPUT)/build-host/.lh_bb_built: $(OUTPUT)/build-host/busybox-$(BUSYBOX_VERSION)/.config $(OUTPUT)/build-host/bin/muslgcc | $(OUTPUT)/build-build/.lh_skarnet_installed + exec setuidgid $(NORMALUSER) cd $(OUTPUT)/build-host/busybox-$(BUSYBOX_VERSION) $(MAKE) -j1 busybox install CROSS_COMPILE=$(TRIPLE)- CC=$(TRIPLE)-muslgcc + exec setuidgid $(NORMALUSER) s6-touch $@ + +$(OUTPUT)/build-host/.lh_bb_installed: $(OUTPUT)/build-host/.lh_bb_built $(OUTPUT)/build-host/bin/muslgcc $(OUTPUT)/tmp/.lh_layout_installed | $(OUTPUT)/build-build/.lh_skarnet_installed + exec s6-rmrf $(OUTPUT)/rootfs/opt/busybox-$(BUSYBOX_VERSION) + exec cp -RP $(OUTPUT)/build-host/busybox-$(BUSYBOX_VERSION)/_install $(OUTPUT)/rootfs/opt/busybox-$(BUSYBOX_VERSION) + exec makenamelink $(OUTPUT)/rootfs/opt busybox busybox-$(BUSYBOX_VERSION) $(OUTPUT)/tmp + exec makelinks $(OUTPUT)/rootfs /bin /opt/busybox/bin + exec makelinks $(OUTPUT)/rootfs /bin /opt/busybox/sbin + exec setuidgid $(NORMALUSER) s6-touch $@ + + +$(OUTPUT)/build-host/.lh_mdev_copied: $(OUTPUT)/sources/.lh_bb_dled | $(OUTPUT)/build-build/.lh_skarnet_installed $(OUTPUT)/tmp/.lh_prepared + exec setuidgid $(NORMALUSER) s6-rmrf $(OUTPUT)/build-host/mdev-$(BUSYBOX_VERSION) + exec setuidgid $(NORMALUSER) s6-hiercopy $(OUTPUT)/sources/busybox $(OUTPUT)/build-host/mdev-$(BUSYBOX_VERSION) + exec setuidgid $(NORMALUSER) s6-touch $@ + +$(OUTPUT)/build-host/mdev-$(BUSYBOX_VERSION)/.config: $(OUTPUT)/build-host/.lh_mdev_copied sub/busybox/host-mdev-config $(OUTPUT)/build-host/bin/muslgcc | $(OUTPUT)/build-build/.lh_skarnet_installed + exec setuidgid $(NORMALUSER) cp -f $(WD)/sub/busybox/host-mdev-config $@ + +$(OUTPUT)/build-host/.lh_mdev_built: $(OUTPUT)/build-host/mdev-$(BUSYBOX_VERSION)/.config $(OUTPUT)/build-host/bin/muslgcc | $(OUTPUT)/build-build/.lh_skarnet_installed + exec setuidgid $(NORMALUSER) cd $(OUTPUT)/build-host/mdev-$(BUSYBOX_VERSION) $(MAKE) -j1 busybox install CROSS_COMPILE=$(TRIPLE)- CC=$(TRIPLE)-muslgcc + exec setuidgid $(NORMALUSER) s6-touch $@ + +$(OUTPUT)/build-host/.lh_mdev_installed: $(OUTPUT)/build-host/.lh_mdev_built | $(OUTPUT)/tmp/.lh_prepared $(OUTPUT)/build-build/.lh_skarnet_installed + exec cp -f -L $(OUTPUT)/build-host/mdev-$(BUSYBOX_VERSION)/_install/sbin/mdev $(OUTPUT)/initramfs/sbin/mdev + exec setuidgid $(NORMALUSER) s6-touch $@ + + +$(OUTPUT)/build-host/bbsuid.c: sub/busybox/SUIDLIST sub/busybox/bbsuid-header sub/busybox/bbsuid-footer | $(OUTPUT)/tmp/.lh_prepared $(OUTPUT)/build-build/.lh_skarnet_installed + exec setuidgid $(NORMALUSER) redirfd -w 1 $@ foreground cat sub/busybox/bbsuid-header "" foreground sed s/.*/\"\&\",/ sub/busybox/SUIDLIST "" cat sub/busybox/bbsuid-footer + +$(OUTPUT)/build-host/bbsuid: $(OUTPUT)/build-host/bbsuid.c $(OUTPUT)/build-host/bin/muslgcc $(OUTPUT)/build-host/.lh_skalibs_installed + exec setuidgid $(NORMALUSER) muslgcc -o $@ -I $(OUTPUT)/rootfs/package/prog/skalibs/include -L $(OUTPUT)/rootfs/package/prog/skalibs/library $(OUTPUT)/build-host/bbsuid.c -lskarnet + +$(OUTPUT)/build-host/.lh_bbsuid_installed: sub/busybox/SUIDLIST $(OUTPUT)/build-host/bbsuid $(OUTPUT)/build-host/.lh_bb_installed | $(OUTPUT)/tmp/.lh_prepared $(OUTPUT)/build-build/.lh_skarnet_installed + exec sub/busybox/install-bbsuid $(OUTPUT) sub/busybox/SUIDLIST + exec setuidgid $(NORMALUSER) s6-touch $@ -- cgit v1.2.3