diff --git a/appliances/frr.gns3a b/appliances/frr.gns3a index a909c7a..fc2ab65 100644 --- a/appliances/frr.gns3a +++ b/appliances/frr.gns3a @@ -22,6 +22,14 @@ "kvm": "allow" }, "images": [ + { + "filename": "frr-8.2.2.qcow2", + "version": "8.2.2", + "md5sum": "45cda6b991a1b9e8205a3a0ecc953640", + "filesize": 56609280, + "download_url": "https://sourceforge.net/projects/gns-3/files/Qemu%20Appliances/", + "direct_download_url": "http://downloads.sourceforge.net/project/gns-3/Qemu%20Appliances/frr-8.2.2.qcow2" + }, { "filename": "frr-8.1.0.qcow2", "version": "8.1.0", @@ -48,6 +56,12 @@ } ], "versions": [ + { + "name": "8.2.2", + "images": { + "hda_disk_image": "frr-8.2.2.qcow2" + } + }, { "name": "8.1.0", "images": { diff --git a/packer/alpine-linux/README.rst b/packer/alpine-linux/README.rst index 3a6fd5e..5db780e 100644 --- a/packer/alpine-linux/README.rst +++ b/packer/alpine-linux/README.rst @@ -6,15 +6,6 @@ For building an Alpine appliance. https://alpinelinux.org/ -Packer Version Dependency -************************* - -Packer versions 1.6.0 or later do not accept templates -that use the ``iso_checksum_type`` attribute. -To use these newer versions, you must delete the line -containing ``iso_checksum_type`` from alpine.json. - - Alpine CLI installation *********************** diff --git a/packer/alpine-linux/alpine.json b/packer/alpine-linux/alpine.json index 8e4fad5..bb21482 100644 --- a/packer/alpine-linux/alpine.json +++ b/packer/alpine-linux/alpine.json @@ -1,7 +1,7 @@ { "variables": { - "iso_url": "https://dl-cdn.alpinelinux.org/alpine/v3.15/releases/x86_64/alpine-virt-3.15.0-x86_64.iso", - "iso_checksum": "e97eaedb3bff39a081d1d7e67629d5c0e8fb39677d6a9dd1eaf2752e39061e02", + "iso_url": "https://dl-cdn.alpinelinux.org/alpine/v3.16/releases/x86_64/alpine-virt-3.16.3-x86_64.iso", + "iso_checksum": "file:https://dl-cdn.alpinelinux.org/alpine/v3.16/releases/x86_64/alpine-virt-3.16.3-x86_64.iso.sha256", "ui_mode": "cli", "vm_name": "alpine_cli.qcow2", "file_source": "README.rst", @@ -13,7 +13,6 @@ "type": "qemu", "iso_url": "{{user `iso_url`}}", "iso_checksum": "{{user `iso_checksum`}}", - "iso_checksum_type": "sha256", "shutdown_command": "poweroff", "headless": true, "ssh_username": "root", diff --git a/packer/alpine-linux/scripts/cli.sh b/packer/alpine-linux/scripts/cli.sh index f9cd3c4..1fd24de 100644 --- a/packer/alpine-linux/scripts/cli.sh +++ b/packer/alpine-linux/scripts/cli.sh @@ -1,5 +1,17 @@ -# use serial console -sed -i 's/\(APPEND .*\)/\1 console=ttyS0/' /boot/extlinux.conf +#!/bin/sh + +set -e + +# use serial console and remove quiet +sed -i 's/\(APPEND .*\)/\1 console=tty0 console=ttyS0,115200 earlyprintk=ttyS0,115200 consoleblank=0/' /boot/extlinux.conf +sed -i '/\(APPEND .*\)/s/[[:space:]]*quiet[[:space:]]*/ /g' /boot/extlinux.conf + # autologin on serial console -sed -i 's/^ttyS0.*/ttyS0::respawn:\/bin\/login -f root/' /etc/inittab +cat <<'EOF' | tee /usr/local/bin/rootlogin +#!/bin/sh +exec /bin/login -f root +EOF +chmod +x /usr/local/bin/rootlogin +#/sbin/getty -L ttyS0 115200 vt100 +sed -i 's/^ttyS0.*/ttyS0::respawn:\/sbin\/getty -n -l \/usr\/local\/bin\/rootlogin -L ttyS0 115200 vt100/' /etc/inittab diff --git a/packer/alpine-linux/scripts/frr.sh b/packer/alpine-linux/scripts/frr.sh index 99fa142..d03346b 100644 --- a/packer/alpine-linux/scripts/frr.sh +++ b/packer/alpine-linux/scripts/frr.sh @@ -1,3 +1,5 @@ +#!/bin/sh + # add community repository sed -i 's/^#\s*\(.*\/v.*\/community\)$/\1/' /etc/apk/repositories apk update @@ -42,8 +44,8 @@ sed -i -E '/zebra|bgp|ospf|rip|isis|pim|ldp|eigrp|static|bfd/ s/= *no/=yes/' /et echo "service integrated-vtysh-config" > /etc/frr/vtysh.conf chown frr:frr /etc/frr/vtysh.conf -# reset terminal modes -sed -i "$(printf '1i\e[?5l\e[?7h\e[?8h')" /etc/motd +# Remove default Alpine MOTD +truncate -s 0 /etc/motd # run vtysh in .profile cat > /root/.profile << 'EOF' diff --git a/packer/alpine-linux/scripts/install.sh b/packer/alpine-linux/scripts/install.sh index 908d4b0..0f411bd 100644 --- a/packer/alpine-linux/scripts/install.sh +++ b/packer/alpine-linux/scripts/install.sh @@ -1,28 +1,36 @@ #!/bin/sh +# shellcheck disable=SC2034 set -e -export HOSTNAMEOPTS="-n alpine" -export KEYMAPOPTS="us us" -export INTERFACESOPTS="auto lo +# Export most answers for setup-alpine +set -a +KEYMAPOPTS="us us" +HOSTNAMEOPTS="-n alpine" +INTERFACESOPTS="auto lo iface lo inet loopback auto eth0 iface eth0 inet dhcp + hostname alpine " -export TIMEZONEOPTS="-z UTC" -export PROXYOPTS="none" -export APKREPOSOPTS="-1" -export SSHDOPTS="-c openssh" -export NTPOPTS="-c none" -export BOOT_SIZE=50 -export SWAP_SIZE=0 +TIMEZONEOPTS="-z UTC" +PROXYOPTS="none" +APKREPOSOPTS="-1" +SSHDOPTS="-c openssh" +NTPOPTS="-c none" +DISKOPTS="-m sys /dev/sda" +BOOT_SIZE=50 +SWAP_SIZE=0 +set +a -# Answer to password question twice and yes to format drive +# - Answer to password question twice +# - Do not create unprivileged user +# - Select disk +# - Confirm formatting disk setup-alpine <