Explorar el Código

Build PLATFORMFS with Makefile

Michael Aldridge hace 7 años
padre
commit
20ce939c01
Se han modificado 3 ficheros con 29 adiciones y 11 borrados
  1. 15 6
      Makefile
  2. 14 0
      lib.sh.in
  3. 0 5
      mkplatformfs.sh.in

+ 15 - 6
Makefile

@@ -4,13 +4,14 @@ SHIN    += $(shell find -type f -name '*.sh.in')
 SCRIPTS += $(SHIN:.sh.in=.sh)
 DATE=$(shell date "+%Y%m%d")
 
-T_IMAGES=rpi{,2,3}{,-musl} beaglebone{,-musl} cubieboard2{,-musl} odroid-c2{,-musl} usbarmory{,-musl}
-T_ARCHS=i686 x86_64{,-musl} armv{6,7}l{,-musl}
-
+T_PLATFORMS=rpi{,2,3}{,-musl} beaglebone{,-musl} cubieboard2{,-musl} odroid-c2{,-musl} usbarmory{,-musl} GCP{,-musl}
+T_ARCHS=i686 x86_64{,-musl} armv{6,7}l{,-musl} aarch64{,-musl}
 
 ARCHS=$(shell echo $(T_ARCHS))
-IMAGES=$(shell echo $(T_IMAGES))
+PLATFORMS=$(shell echo $(T_PLATFORMS))
+
 ALL_ROOTFS=$(foreach arch,$(ARCHS),void-$(arch)-ROOTFS-$(DATE).tar.xz)
+ALL_PLATFORMFS=$(foreach platform,$(PLATFORMS),void-$(platform)-PLATFORMFS-$(DATE).tar.xz)
 
 SUDO := sudo
 
@@ -31,7 +32,15 @@ rootfs-all: $(ALL_ROOTFS)
 rootfs-all-print:
 	echo $(ALL_ROOTFS)
 
-void-%-ROOTFS-$(DATE).tar.xz:
+void-%-ROOTFS-$(DATE).tar.xz: $(SCRIPTS)
 	$(SUDO) ./mkrootfs.sh $*
 
-.PHONY: clean rootfs-all rootfs-all-print
+void-%-PLATFORMFS-$(DATE).tar.xz: $(SCRIPTS)
+	$(SUDO) ./mkplatformfs.sh $* void-$(shell ./lib.sh platform2arch $*)-ROOTFS-$(DATE).tar.xz
+
+platformfs-all: $(ALL_PLATFORMFS)
+
+platformfs-all-print:
+	@echo $(ALL_PLATFORMFS) | sed "s: :\n:g"
+
+.PHONY: clean rootfs-all-print platformfs-all-print

+ 14 - 0
lib.sh.in

@@ -264,3 +264,17 @@ set_cachedir() {
                       --repository=http://repo.voidlinux.eu/current/musl \
                       --repository=http://repo.voidlinux.eu/current/aarch64}"
 
+
+
+# This library is the authoritative source of the platform map,
+# because of this we may need to get this information from the command
+# line.  This select allows us to get that information out.  This
+# fails silently if the toolname isn't known since this script is
+# sourced.
+case $1 in
+    platform2arch)
+        PLATFORM=$2
+        set_target_arch_from_platform
+        echo "$XBPS_TARGET_ARCH"
+        ;;
+esac

+ 0 - 5
mkplatformfs.sh.in

@@ -122,11 +122,6 @@ case "$PLATFORM" in
     *) die "$PROGNAME: invalid platform!";;
 esac
 
-# Check if we should be using the -musl variant
-if [ -z "${BASE_TARBALL##*-musl-*}" ] ; then
-    PLATFORM="${PLATFORM}-musl"
-fi
-
 # Derive the target architecture using the static map
 set_target_arch_from_platform