Unverified Commit 0afc2ce2 authored by Santiago Torres's avatar Santiago Torres
Browse files

ENH: update root-less build

This commit adds:

- Systemd sysusers hook is ran on the dockerfile
- The dockerfile also populates the archlinux keyring
- Remove the libalpm hooks as they are uneccessary now
- Moved the package cleanup before the tar step on the makefile
parent 6b583c70
...@@ -3,5 +3,6 @@ ADD archlinux.tar / ...@@ -3,5 +3,6 @@ ADD archlinux.tar /
RUN update-ca-certs RUN update-ca-certs
RUN locale-gen RUN locale-gen
RUN pacman-key --init && pacman-key --populate archlinux RUN pacman-key --init && pacman-key --populate archlinux
RUN /usr/share/libalpm/scripts/systemd-hook sysusers
ENV LANG=en_US.UTF-8 ENV LANG=en_US.UTF-8
CMD ["/usr/bin/bash"] CMD ["/usr/bin/bash"]
...@@ -3,17 +3,21 @@ DOCKER_ORGANIZATION=archlinux ...@@ -3,17 +3,21 @@ DOCKER_ORGANIZATION=archlinux
DOCKER_IMAGE:=base DOCKER_IMAGE:=base
BUILDDIR=build BUILDDIR=build
rootfs: hooks:
mkdir -p alpm-hooks/usr/share/libalpm/hooks
find /usr/share/libalpm/hooks -exec ln -s /dev/null $(PWD)/alpm-hooks{} \;
rootfs: hooks
mkdir -vp $(BUILDDIR)/var/lib/pacman/ mkdir -vp $(BUILDDIR)/var/lib/pacman/
fakechroot -- fakeroot -- pacman -Syu -r $(BUILDDIR) \ fakechroot -- fakeroot -- pacman -Sy -r $(BUILDDIR) \
--noconfirm --dbpath $(PWD)/$(BUILDDIR)/var/lib/pacman \ --noconfirm --dbpath $(PWD)/$(BUILDDIR)/var/lib/pacman \
--config rootfs/etc/pacman.conf \ --config rootfs/etc/pacman.conf \
--noscriptlet \ --noscriptlet \
--hookdir $(PWD)/rootfs/usr/share/libalpm/hooks/ $(shell cat packages) --hookdir $(PWD)/alpm-hooks/usr/share/libalpm/hooks/ $(shell cat packages)
cp --recursive --preserve=timestamps --backup --suffix=.pacnew rootfs/* $(BUILDDIR)/ cp --recursive --preserve=timestamps --backup --suffix=.pacnew rootfs/* $(BUILDDIR)/
rm -r build/var/cache/pacman/pkg rm -r build/var/cache/pacman/pkg
tar --numeric-owner --xattrs --acls --exclude-from=exclude -C $(BUILDDIR) -c . -f archlinux.tar tar --numeric-owner --xattrs --acls --exclude-from=exclude -C $(BUILDDIR) -c . -f archlinux.tar
rm -rf $(BUILDDIR) rm -rf $(BUILDDIR) alpm-hooks
docker-image: rootfs docker-image: rootfs
docker build -t $(DOCKER_ORGANIZATION)/$(DOCKER_IMAGE) . docker build -t $(DOCKER_ORGANIZATION)/$(DOCKER_IMAGE) .
......
[Trigger]
Operation = Install
Operation = Upgrade
Type = Package
Target = *
[Action]
Description = Cleaning up package cache...
Depends = coreutils
When = PostTransaction
Exec = /usr/bin/rm -rf /var/cache/pacman/pkg
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment