Bump the Alpine VM to 3.11

This commit is contained in:
Disassembler 2020-02-04 16:09:48 +01:00
parent d7d89b9db6
commit 28a70e878e
Signed by: Disassembler
GPG Key ID: 524BD33A0EE29499
6 changed files with 15 additions and 15 deletions

13
vm.sh
View File

@ -14,8 +14,8 @@ echo
# Set up repositories # Set up repositories
cat <<EOF >/etc/apk/repositories cat <<EOF >/etc/apk/repositories
http://dl-cdn.alpinelinux.org/alpine/v3.9/main http://dl-cdn.alpinelinux.org/alpine/v3.11/main
http://dl-cdn.alpinelinux.org/alpine/v3.9/community http://dl-cdn.alpinelinux.org/alpine/v3.11/community
EOF EOF
# Install disk management tools # Install disk management tools
@ -63,8 +63,8 @@ mount -t ext4 /dev/sda1 /mnt/boot
setup-disk -m sys /mnt setup-disk -m sys /mnt
# Update boot-time volume information # Update boot-time volume information
export BOOT_UUID=$(blkid -o value /dev/sda1 | head -1) export BOOT_UUID=$(blkid -s UUID -o value /dev/sda1)
export CRYPT_UUID=$(blkid -o value /dev/sda2 | head -1) export CRYPT_UUID=$(blkid -s UUID -o value /dev/sda2)
cat <<EOF >/mnt/etc/fstab cat <<EOF >/mnt/etc/fstab
/dev/vg0/root / ext4 rw,noatime,data=ordered 0 1 /dev/vg0/root / ext4 rw,noatime,data=ordered 0 1
UUID=${BOOT_UUID} /boot ext4 rw,noatime,data=ordered 0 2 UUID=${BOOT_UUID} /boot ext4 rw,noatime,data=ordered 0 2
@ -88,10 +88,9 @@ chroot /mnt setup-timezone -z Europe/Prague
apk --no-cache add apache2-utils gettext apk --no-cache add apache2-utils gettext
wget https://repo.spotter.cz/vm.tar -O - | tar xf - -C /mnt wget https://repo.spotter.cz/vm.tar -O - | tar xf - -C /mnt
envsubst </mnt/boot/extlinux.conf.old >/mnt/boot/extlinux.conf envsubst </mnt/boot/extlinux.conf.old >/mnt/boot/extlinux.conf
chroot /mnt apk --no-cache add bridge ca-certificates curl e2fsprogs-extra gettext iptables kbd-misc libressl logrotate lxc postfix nginx openssh-server openssh-sftp-server util-linux wireguard-virt@vm wireguard-tools-wg@vm acme-sh@vm vmmgr@vm chroot /mnt apk --no-cache add bridge ca-certificates curl e2fsprogs-extra gettext iptables kbd-misc libressl logrotate postfix nginx openssh-server openssh-sftp-server util-linux wireguard-virt wireguard-tools-wg acme-sh@vm spoc@vm vmmgr@vm
chroot /mnt newaliases chroot /mnt newaliases
mkdir -p /mnt/var/log/lxc for SERVICE in consolefont crond iptables networking nginx ntpd postfix spoc swap urandom vmmgr; do
for SERVICE in cgroups consolefont crond iptables networking nginx ntpd postfix swap urandom vmmgr; do
ln -s /etc/init.d/${SERVICE} /mnt/etc/runlevels/boot ln -s /etc/init.d/${SERVICE} /mnt/etc/runlevels/boot
done done
ADMINPWD=$(htpasswd -bnBC 10 '' "${ENCPWD}" | tr -d ':\n' | sed 's/$2y/$2b/') envsubst </mnt/etc/vmmgr/config.default.json >/mnt/etc/vmmgr/config.json ADMINPWD=$(htpasswd -bnBC 10 '' "${ENCPWD}" | tr -d ':\n' | sed 's/$2y/$2b/') envsubst </mnt/etc/vmmgr/config.default.json >/mnt/etc/vmmgr/config.json

View File

@ -1,3 +1,3 @@
http://dl-cdn.alpinelinux.org/alpine/v3.9/main http://dl-cdn.alpinelinux.org/alpine/v3.11/main
http://dl-cdn.alpinelinux.org/alpine/v3.9/community http://dl-cdn.alpinelinux.org/alpine/v3.11/community
@vm https://repo.spotter.cz/alpine/v3.9/apk @vm https://repo.spotter.cz/alpine/v3.11/apk

View File

@ -8,7 +8,7 @@ IPTABLES_SAVE="/etc/iptables/rules-save"
SAVE_RESTORE_OPTIONS="-c" SAVE_RESTORE_OPTIONS="-c"
# Save state on stopping iptables # Save state on stopping iptables
SAVE_ON_STOP="yes" SAVE_ON_STOP="no"
# Enable/disable IPv4 forwarding with the rules # Enable/disable IPv4 forwarding with the rules
IPFORWARD="yes" IPFORWARD="yes"

View File

@ -3,5 +3,5 @@
:INPUT ACCEPT [0:0] :INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [0:0] :OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0] :POSTROUTING ACCEPT [0:0]
[0:0] -A POSTROUTING -o eth0 -j MASQUERADE [0:0] -A POSTROUTING -o spocbr0 -j MASQUERADE
COMMIT COMMIT

View File

@ -4,8 +4,8 @@ iface lo inet loopback
auto eth0 auto eth0
iface eth0 inet dhcp iface eth0 inet dhcp
auto lxcbr0 auto spocbr0
iface lxcbr0 inet static iface spocbr0 inet static
address 172.17.0.1 address 172.17.0.1
netmask 255.255.0.0 netmask 255.255.0.0
bridge_fd 0 bridge_fd 0

View File

@ -1,2 +1,3 @@
unicode="YES" rc_cgroup_mode=unified
rc_tty_number=1 rc_tty_number=1
unicode="YES"