portable-services/alpine/matrix/build.sh

25 lines
714 B
Bash
Raw Normal View History

#!/bin/sh
ROOTFS=/tmp/matrix
2019-03-05 22:53:52 +01:00
ALPINE_TARBALL=alpine-minirootfs-3.9.2-x86_64.tar.gz
2019-03-05 22:53:52 +01:00
wget http://dl-cdn.alpinelinux.org/alpine/v3.9/releases/x86_64/$ALPINE_TARBALL
mkdir -p $ROOTFS
2019-03-05 22:53:52 +01:00
tar xf $ALPINE_TARBALL -C $ROOTFS/ \
./etc/apk ./etc/os-release ./usr ./lib ./bin ./sbin ./var
2019-07-09 18:30:30 +02:00
mkdir -p \
$ROOTFS/etc/systemd/system \
$ROOTFS/var/{lib,run,tmp} \
$ROOTFS/{dev,tmp,proc,root,run,sys} \
$ROOTFS/etc/matrix \
$ROOTFS/var/lib/matrix-{synapse,appservice-irc}
touch $ROOTFS/etc/machine-id $ROOTFS/etc/resolv.conf
cp systemd/* $ROOTFS/etc/systemd/system/
sudo systemd-nspawn --bind=$PWD/scripts/install.sh:/root/install.sh -D $ROOTFS/ /bin/sh /root/install.sh
mksquashfs $ROOTFS/ /tmp/matrix.raw