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