#!/bin/bash -e
install -m 644 files/ipv6.conf "$ROOTFS_DIR/etc/modprobe.d/ipv6.conf"
install -m 644 files/interfaces "$ROOTFS_DIR/etc/network/interfaces"
echo $HOSTNAME > "$ROOTFS_DIR/etc/hostname"
chmod 644 "$ROOTFS_DIR/etc/hostname"
echo "127.0.1.1 $HOSTNAME" >>/etc/hosts
on_chroot << EOF
dpkg-divert --add --local /lib/udev/rules.d/75-persistent-net-generator.rules
EOF
apt-get install -y \
libraspberrypi-bin \
libraspberrypi0 \
raspi-config
touch ${ROOTFS_DIR}/spindle_install
apt-get install -y raspi-copies-and-fills
rm -f ${ROOTFS_DIR}/spindle_install