Add xbps-local and xbps-remote and logging

master
Corné Oppelaar 5 years ago
parent 5f6599c893
commit 770bd1f250

@ -1,4 +1,6 @@
MAINTAINER?==@eater.me
# Docker executable to use (default: docker, but img may be used)
DOCKER_EXEC?=docker
# Name of image
IMAGE?=d.xr.to/base
# Arch to be used
@ -83,6 +85,11 @@ endif
# Create lsb_release file
cp files/lsb_release $(BUILDDIR)/bin/lsb_release
chmod +x $(BUILDDIR)/bin/lsb_release
# Create xbps helpers
cp files/xbps-remote $(BUILDDIR)/bin/xbps-remote
chmod +x $(BUILDDIR)/bin/xbps-remote
cp files/xbps-local $(BUILDDIR)/bin/xbps-local
chmod +x $(BUILDDIR)/bin/xbps-local
# Create passwd, shadow and group file
cp files/passwd $(BUILDDIR)/etc/passwd
cp files/group $(BUILDDIR)/etc/group
@ -90,7 +97,7 @@ endif
install: build
# Import directory as tar (owned by root) into docker
tar --owner 0 --group 0 -pC $(BUILDDIR) -c . | docker import -m '$(IMAGE) initialization from chroot' -c 'LABEL maintainer="$(MAINTAINER)"' - $(IMAGE)
tar --owner 0 --group 0 -pC $(BUILDDIR) -c . | $(DOCKER_EXEC) import -m '$(IMAGE) initialization from chroot' -c 'LABEL maintainer="$(MAINTAINER)"' - $(IMAGE)
clean:
# Remove build directory

@ -1,8 +1,12 @@
#!/usr/bin/env bash
DOCKER_EXEC="${DOCKER_EXEC:-docker}";
IMAGE="${1:-d.xr.to/base}";
MAINTAINER="${2:-=@eater.me}";
build_dir="$(dirname "$0")/build"
test -d "${build_dir}" && rm -rf "${build_dir}";
for toolbox in "none" "toybox" "busybox" "default"; do
make IMAGE="${IMAGE}:${toolbox}" TOOLBOX="${toolbox}";
make IMAGE="${IMAGE}:${toolbox}" TOOLBOX="${toolbox}" DOCKER_EXEC="${DOCKER_EXEC}" all > "${toolbox}.log";
done
docker tag "${IMAGE}:toybox" "${IMAGE}:latest";
make IMAGE="${IMAGE}:glibc" TOOLBOX="toybox" ARCH="x86_64"
$DOCKER_EXEC tag "${IMAGE}:toybox" "${IMAGE}:latest";
make IMAGE="${IMAGE}:glibc" TOOLBOX="toybox" ARCH="x86_64" DOCKER_EXEC="${DOCKER_EXEC}" all > "glibc.log";

@ -0,0 +1,2 @@
#!/usr/bin/env bash
xbps-install -yR /tmp/xbps "$@" && xbps-remove -Oo && rm -rf /var/cache/xbps/* /tmp/xbps

@ -0,0 +1,2 @@
#!/usr/bin/env bash
xbps-install -Sy "$@" && xbps-remove -Oo && rm -rf /var/cache/xbps/* /tmp/xbps
Loading…
Cancel
Save