burrow-pi-img/stage0/01-configure-apt/00-run.sh

25 lines
612 B
Bash
Raw Normal View History

2016-04-11 06:29:41 +00:00
#!/bin/bash -e
2016-05-02 19:16:52 +00:00
# Install source lists
2016-04-11 06:29:41 +00:00
install -m 644 files/sources.list ${ROOTFS_DIR}/etc/apt/
install -m 644 files/raspi.list ${ROOTFS_DIR}/etc/apt/sources.list.d/
2016-05-02 19:16:52 +00:00
# Set up proxy, if it exists
2016-04-11 06:29:41 +00:00
if [ -n "$APT_PROXY" ]; then
install -m 644 files/51cache ${ROOTFS_DIR}/etc/apt/apt.conf.d/51cache
sed ${ROOTFS_DIR}/etc/apt/apt.conf.d/51cache -i -e "s|APT_PROXY|${APT_PROXY}|"
else
rm -f ${ROOTFS_DIR}/etc/apt/apt.conf.d/51cache
fi
2016-05-02 19:16:52 +00:00
# Add the raspberry pi gpg key
2016-04-11 06:29:41 +00:00
on_chroot apt-key add - < files/raspberrypi.gpg.key
2016-05-02 19:16:52 +00:00
# Update and dist upgrade
2016-05-05 22:09:35 +00:00
on_chroot sh -e - <<EOF
2016-05-02 19:16:52 +00:00
2016-04-11 06:29:41 +00:00
apt-get update
apt-get dist-upgrade -y
2016-05-02 19:16:52 +00:00
2016-04-11 06:29:41 +00:00
EOF