From 43f4d5c3cd8838ae87660813abc999f85612a33f Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Wed, 7 Jul 2021 05:03:38 -0500 Subject: T3664: Eliminate obsolete build flavours --- scripts/build-GCE-image | 165 ----------------------------- scripts/build-azure-image | 151 -------------------------- scripts/build-hyperv-image | 32 ------ scripts/build-oracle-image | 154 --------------------------- scripts/build-qemu-image | 34 ------ scripts/build-vmware-image | 210 ------------------------------------ scripts/packer-scripts/vmware.sh | 29 ----- scripts/packer.json | 61 ----------- scripts/template.ovf | 223 --------------------------------------- scripts/vhd.py | 90 ---------------- 10 files changed, 1149 deletions(-) delete mode 100755 scripts/build-GCE-image delete mode 100755 scripts/build-azure-image delete mode 100755 scripts/build-hyperv-image delete mode 100755 scripts/build-oracle-image delete mode 100755 scripts/build-qemu-image delete mode 100755 scripts/build-vmware-image delete mode 100644 scripts/packer-scripts/vmware.sh delete mode 100644 scripts/packer.json delete mode 100644 scripts/template.ovf delete mode 100755 scripts/vhd.py (limited to 'scripts') diff --git a/scripts/build-GCE-image b/scripts/build-GCE-image deleted file mode 100755 index f9273874..00000000 --- a/scripts/build-GCE-image +++ /dev/null @@ -1,165 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2018 VyOS maintainers and contributors -# -# This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 or later as published by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -# File: build-GCE-image -# Purpose: -# Build VyOS image for Google cloud. - -lb bootstrap - -lb chroot -lb installer -lb binary_chroot -lb chroot_devpts install -lb chroot_proc install -lb chroot_selinuxfs install -lb chroot_sysfs install -lb chroot_hosts install -lb chroot_resolv install -lb chroot_hostname install -lb chroot_sysv-rc install -lb chroot_upstart install -lb chroot_apt install-binary -lb chroot_archives chroot install -lb binary_rootfs -lb binary_manifest -lb binary_package-lists -lb binary_linux-image -lb binary_memtest -lb binary_grub -lb binary_grub2 -lb binary_syslinux -lb binary_disk -lb binary_loadlin -lb binary_win32-loader -lb binary_includes -lb binary_hooks -lb binary_checksums - -# get vyos build version -version=$(cat version) -dateymd=$(date +%Y%m%d) - -###################################### -### Prepare the HDD (format, ext.) ### -###################################### -PARTED=/sbin/parted -OUTPUT=disk.raw -OUTPUTGZ=VyOS-"$dateymd".tar.gz -IMAGE_SIZE=10 -qemu-img create -f raw ${OUTPUT} ${IMAGE_SIZE}G - -LOOPNAME=`losetup -f` -LOOPMINOR=${LOOPNAME//[^0-9]} -if [ ! -e $LOOPNAME ]; then - mknod $LOOPNAME b 7 $LOOPMINOR -fi - -${PARTED} -s ${OUTPUT} mktable msdos -${PARTED} -s -a optimal ${OUTPUT} mkpart primary ext4 1Mi 100% -${PARTED} -s ${OUTPUT} set 1 boot on -RESULT_KPARTX=`kpartx -asv ${OUTPUT} 2>&1` - -if echo "${RESULT_KPARTX}" | grep "^add map" ; then - LOOP_DEVICE=$(echo ${RESULT_KPARTX} | cut -d" " -f3) - LOOPRAW_DEVICE=${LOOP_DEVICE%p*} - echo "kpartx mounted using: ${LOOP_DEVICE} via ${LOOPRAW_DEVICE}" -else - echo "It seems kpartx didn't mount the image correctly: exiting." - exit 1 -fi - -cleanup(){ - error=$? - [ ! -d "${MOUNT_DIR}" ] && return - if [ "$error" -gt 0 ]; then - echo - echo "Error $error" - else - echo "Finished." - fi - - set +e - - sync - umount -l ${MOUNT_DIR} - rmdir ${MOUNT_DIR} - - umount devpts-live - umount proc-live - umount sysfs-live - - dmsetup remove --deferred ${LOOP_DEVICE} - losetup -d /dev/${LOOPRAW_DEVICE} - exit $error -} -trap "cleanup" EXIT TERM INT - -mkfs.ext4 /dev/mapper/${LOOP_DEVICE} -L persistence -UUID=$(blkid -o value -s UUID /dev/mapper/${LOOP_DEVICE}) - -# No fsck because of X days without checks -tune2fs -i 0 /dev/mapper/${LOOP_DEVICE} - -MOUNT_DIR=`mktemp -d -t build-debimg.XXXXXX` -mount /dev/mapper/${LOOP_DEVICE} ${MOUNT_DIR} - -######################## -### Setting-up files ### -######################## -mkdir -p ${MOUNT_DIR}/boot/grub -mkdir -p ${MOUNT_DIR}/boot/"$version"/rw - -echo "/ union" > ${MOUNT_DIR}/persistence.conf -cp binary/live/filesystem.squashfs ${MOUNT_DIR}/boot/"$version"/"$version.squashfs" -cp binary/live/initrd.img ${MOUNT_DIR}/boot/"$version"/initrd.img -cp binary/live/vmlinuz ${MOUNT_DIR}/boot/"$version"/vmlinuz - -######################## -### Create grub menu ### -######################## -cat > ${MOUNT_DIR}/boot/grub/grub.cfg << EOF -set timeout=5 -set default=0 - -serial --speed=38400 --unit=0 --word=8 --parity=no --stop=1 -terminal_input serial -terminal_output serial - -menuentry "VyOS $version (Serial console)" { - linux /boot/"$version"/vmlinuz boot=live vyos-union=/boot/"$version" console=tty0 console=ttyS0,38400n8d earlyprintk=ttyS0,38400 consoleblank=0 systemd.show_status=true - initrd /boot/"$version"/initrd.img -} - -menuentry "Lost password change $version (Serial console)" { - linux /boot/"$version"/vmlinuz boot=live vyos-union=/boot/"$version" console=tty0 console=ttyS0,38400n8d earlyprintk=ttyS0,38400 consoleblank=0 systemd.show_status=true init=/opt/vyatta/sbin/standalone_root_pw_reset - initrd /boot/"$version"/initrd.img -} -EOF - - -############################# -### Setting-up bootloader ### -############################# -grub-install --boot-directory ${MOUNT_DIR}/boot --force --no-floppy --skip-fs-probe /dev/${LOOPRAW_DEVICE} - -################### -### HOOK SCRIPT ### -################### - -fstrim ${MOUNT_DIR} -umount ${MOUNT_DIR} && { - tar -Sczf ${OUTPUTGZ} ${OUTPUT} - mount /dev/mapper/${LOOP_DEVICE} ${MOUNT_DIR} -} diff --git a/scripts/build-azure-image b/scripts/build-azure-image deleted file mode 100755 index 48590cb4..00000000 --- a/scripts/build-azure-image +++ /dev/null @@ -1,151 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2018 VyOS maintainers and contributors -# -# This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 or later as published by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -# File: build-azure-image -# Purpose: -# Build VyOS image for Azure. - -lb bootstrap - -lb chroot -lb installer -lb binary_chroot -lb chroot_devpts install -lb chroot_proc install -lb chroot_selinuxfs install -lb chroot_sysfs install -lb chroot_hosts install -lb chroot_resolv install -lb chroot_hostname install -lb chroot_sysv-rc install -lb chroot_upstart install -lb chroot_apt install-binary -lb chroot_archives chroot install -lb binary_rootfs -lb binary_manifest -lb binary_package-lists -lb binary_linux-image -lb binary_memtest -lb binary_grub -lb binary_grub2 -lb binary_syslinux -lb binary_disk -lb binary_loadlin -lb binary_win32-loader -lb binary_includes -lb binary_hooks -lb binary_checksums - -# get vyos build version -version=$(cat version) -dateymd=$(date +%Y%m%d) - -###################################### -### Prepare the HDD (format, ext.) ### -###################################### -PARTED=/sbin/parted -OUTPUT=VyOS-"$dateymd".vhd -IMAGE_SIZE=10 -qemu-img create ${OUTPUT} ${IMAGE_SIZE}G - -${PARTED} -s ${OUTPUT} mktable msdos -${PARTED} -s -a optimal ${OUTPUT} mkpart primary ext4 1Mi 100% -${PARTED} -s ${OUTPUT} set 1 boot on -RESULT_KPARTX=`kpartx -asv ${OUTPUT} 2>&1` - -if echo "${RESULT_KPARTX}" | grep "^add map" ; then - LOOP_DEVICE=$(echo ${RESULT_KPARTX} | cut -d" " -f3) - LOOPRAW_DEVICE=${LOOP_DEVICE%p*} - echo "kpartx mounted using: ${LOOP_DEVICE} via ${LOOPRAW_DEVICE}" -else - echo "It seems kpartx didn't mount the image correctly: exiting." - exit 1 -fi - -cleanup(){ - error=$? - [ ! -d "${MOUNT_DIR}" ] && return - if [ "$error" -gt 0 ]; then - echo - echo "Error $error" - else - echo "Finished." - fi - - set +e - - sync - umount -l ${MOUNT_DIR} - rmdir ${MOUNT_DIR} - - umount devpts-live - umount proc-live - umount sysfs-live - - dmsetup remove --deferred ${LOOP_DEVICE} - losetup -d /dev/${LOOPRAW_DEVICE} - exit $error -} -trap "cleanup" EXIT TERM INT - -mkfs.ext4 /dev/mapper/${LOOP_DEVICE} -L persistence -UUID=$(blkid -o value -s UUID /dev/mapper/${LOOP_DEVICE}) - -# No fsck because of X days without checks -tune2fs -i 0 /dev/mapper/${LOOP_DEVICE} - -MOUNT_DIR=`mktemp -d -t build-debimg.XXXXXX` -mount /dev/mapper/${LOOP_DEVICE} ${MOUNT_DIR} - -######################## -### Setting-up files ### -######################## -mkdir -p ${MOUNT_DIR}/boot/grub -mkdir -p ${MOUNT_DIR}/boot/"$version"/rw - -echo "/ union" > ${MOUNT_DIR}/persistence.conf -cp binary/live/filesystem.squashfs ${MOUNT_DIR}/boot/"$version"/"$version.squashfs" -cp binary/live/initrd.img ${MOUNT_DIR}/boot/"$version"/initrd.img -cp binary/live/vmlinuz ${MOUNT_DIR}/boot/"$version"/vmlinuz - -######################## -### Create grub menu ### -######################## -cat > ${MOUNT_DIR}/boot/grub/grub.cfg << EOF -set timeout=5 -set default=0 - -menuentry "VyOS $version (Serial console)" { - linux /boot/"$version"/vmlinuz boot=live quiet vyos-union=/boot/"$version" console=tty0 console=ttyS0,115200n8 earlyprintk=ttyS0,115200 consoleblank=0 systemd.show_status=true - initrd /boot/"$version"/initrd.img -} - -menuentry "Lost password change $version (Serial console)" { - linux /boot/"$version"/vmlinuz boot=live quiet vyos-union=/boot/"$version" console=tty0 console=ttyS0,115200n8 earlyprintk=ttyS0,115200 consoleblank=0 systemd.show_status=true init=/opt/vyatta/sbin/standalone_root_pw_reset - initrd /boot/"$version"/initrd.img -} -EOF - - -############################# -### Setting-up bootloader ### -############################# -grub-install --boot-directory ${MOUNT_DIR}/boot --force --no-floppy --skip-fs-probe /dev/${LOOPRAW_DEVICE} - -################### -### HOOK SCRIPT ### -################### -fstrim ${MOUNT_DIR} - -../scripts/vhd.py ${OUTPUT} diff --git a/scripts/build-hyperv-image b/scripts/build-hyperv-image deleted file mode 100755 index 40c0c828..00000000 --- a/scripts/build-hyperv-image +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2016 VyOS maintainers and contributors -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 2 or later as -# published by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -# File: build-hyperv-image -# Purpose: -# Build VyOS image for Hyper-V. - -export PACKER_BUILD_DIR=packer_build - -DST_DIR=${PACKER_BUILD_DIR}/hyperv -mkdir -p ${DST_DIR} - -# Convert raw image to VHD -source_image=${PACKER_BUILD_DIR}/qemu/vyos_qemu_image.img -vhd=${DST_DIR}/vyos_hyperv_image.vhd -qemu-img convert -f raw ${source_image} -O vpc ${vhd} -if [ "$?" = "0" ]; then - echo "Hyper-V image successfully created to ./${vhd}" -fi diff --git a/scripts/build-oracle-image b/scripts/build-oracle-image deleted file mode 100755 index e2066fc7..00000000 --- a/scripts/build-oracle-image +++ /dev/null @@ -1,154 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2018 VyOS maintainers and contributors -# -# This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 or later as published by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -# File: build-oracle-image -# Purpose: -# Build VyOS image for Oracle cloud. - -lb bootstrap - -lb chroot -lb installer -lb binary_chroot -lb chroot_devpts install -lb chroot_proc install -lb chroot_selinuxfs install -lb chroot_sysfs install -lb chroot_hosts install -lb chroot_resolv install -lb chroot_hostname install -lb chroot_sysv-rc install -lb chroot_upstart install -lb chroot_apt install-binary -lb chroot_archives chroot install -lb binary_rootfs -lb binary_manifest -lb binary_package-lists -lb binary_linux-image -lb binary_memtest -lb binary_grub -lb binary_grub2 -lb binary_syslinux -lb binary_disk -lb binary_loadlin -lb binary_win32-loader -lb binary_includes -lb binary_hooks -lb binary_checksums - -# get vyos build version -version=$(cat version) -dateymd=$(date +%Y%m%d) - -###################################### -### Prepare the HDD (format, ext.) ### -###################################### -PARTED=/sbin/parted -OUTPUT=disk.raw -OUTPUTQCOW2=VyOS-"$dateymd".qcow2 -IMAGE_SIZE=10 -qemu-img create -f raw ${OUTPUT} ${IMAGE_SIZE}G - -${PARTED} -s ${OUTPUT} mktable msdos -${PARTED} -s -a optimal ${OUTPUT} mkpart primary ext4 1Mi 100% -${PARTED} -s ${OUTPUT} set 1 boot on -RESULT_KPARTX=`kpartx -asv ${OUTPUT} 2>&1` - -if echo "${RESULT_KPARTX}" | grep "^add map" ; then - LOOP_DEVICE=$(echo ${RESULT_KPARTX} | cut -d" " -f3) - LOOPRAW_DEVICE=${LOOP_DEVICE%p*} - echo "kpartx mounted using: ${LOOP_DEVICE} via ${LOOPRAW_DEVICE}" -else - echo "It seems kpartx didn't mount the image correctly: exiting." - exit 1 -fi - -cleanup(){ - error=$? - [ ! -d "${MOUNT_DIR}" ] && return - if [ "$error" -gt 0 ]; then - echo - echo "Error $error" - else - echo "Finished." - fi - - set +e - - sync - umount -l ${MOUNT_DIR} - rmdir ${MOUNT_DIR} - - umount devpts-live - umount proc-live - umount sysfs-live - - dmsetup remove --deferred ${LOOP_DEVICE} - losetup -d /dev/${LOOPRAW_DEVICE} - exit $error -} -trap "cleanup" EXIT TERM INT - -mkfs.ext4 /dev/mapper/${LOOP_DEVICE} -L persistence -UUID=$(blkid -o value -s UUID /dev/mapper/${LOOP_DEVICE}) - -# No fsck because of X days without checks -tune2fs -i 0 /dev/mapper/${LOOP_DEVICE} - -MOUNT_DIR=`mktemp -d -t build-debimg.XXXXXX` -mount /dev/mapper/${LOOP_DEVICE} ${MOUNT_DIR} - -######################## -### Setting-up files ### -######################## -mkdir -p ${MOUNT_DIR}/boot/grub -mkdir -p ${MOUNT_DIR}/boot/"$version"/rw - -echo "/ union" > ${MOUNT_DIR}/persistence.conf -cp binary/live/filesystem.squashfs ${MOUNT_DIR}/boot/"$version"/"$version.squashfs" -cp binary/live/initrd.img ${MOUNT_DIR}/boot/"$version"/initrd.img -cp binary/live/vmlinuz ${MOUNT_DIR}/boot/"$version"/vmlinuz - -######################## -### Create grub menu ### -######################## -cat > ${MOUNT_DIR}/boot/grub/grub.cfg << EOF -set timeout=5 -set default=0 - -menuentry "VyOS $version (Serial console)" { - linux /boot/"$version"/vmlinuz boot=live vyos-union=/boot/"$version" console=tty0 console=ttyS0,38400n8d earlyprintk=ttyS0,38400 consoleblank=0 systemd.show_status=true - initrd /boot/"$version"/initrd.img -} - -menuentry "Lost password change $version (Serial console)" { - linux /boot/"$version"/vmlinuz boot=live vyos-union=/boot/"$version" console=tty0 console=ttyS0,38400n8d earlyprintk=ttyS0,38400 consoleblank=0 systemd.show_status=true init=/opt/vyatta/sbin/standalone_root_pw_reset - initrd /boot/"$version"/initrd.img -} -EOF - - -############################# -### Setting-up bootloader ### -############################# -grub-install --boot-directory ${MOUNT_DIR}/boot --force --no-floppy --skip-fs-probe /dev/${LOOPRAW_DEVICE} - -################### -### HOOK SCRIPT ### -################### -fstrim ${MOUNT_DIR} -sync - -qemu-img convert -f raw -O qcow2 ${OUTPUT} ${OUTPUTQCOW2} -rm $OUTPUT diff --git a/scripts/build-qemu-image b/scripts/build-qemu-image deleted file mode 100755 index 349f4a5d..00000000 --- a/scripts/build-qemu-image +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2016-2021 VyOS maintainers and contributors -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 2 or later as -# published by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -# File: build-qemu-image -# Purpose: -# Build VyOS raw image for qemu. - -BUILD_DIR="$(scripts/query-json build/build-config.json build_dir)" -BUILD_ARCH="$(scripts/query-json build/build-config.json architecture)" -export VERSION="$(cat $BUILD_DIR/version)" - -export ISO_IMAGE="${BUILD_DIR}/live-image-$BUILD_ARCH.hybrid.iso" -export ISO_MD5_SUM="$(md5sum ${ISO_IMAGE} | awk '{print $1}')" -export PACKER_BUILD_DIR=packer_build -export PACKER_LOG_PATH="${PACKER_BUILD_DIR}/build.log" -export PACKER_LOG=1 - -mkdir -p "${PACKER_BUILD_DIR}" - -packer build -only=qemu-image scripts/packer.json -cp "${PACKER_BUILD_DIR}/qemu/vyos_qemu_image.img" "$BUILD_DIR/vyos-$VERSION-$BUILD_ARCH.qcow2" diff --git a/scripts/build-vmware-image b/scripts/build-vmware-image deleted file mode 100755 index e56ce137..00000000 --- a/scripts/build-vmware-image +++ /dev/null @@ -1,210 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2019 VyOS maintainers and contributors -# -# This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 or later as published by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -# File: build-vmware-image -# Purpose: -# Build VyOS image for VMWARE. - -if [ ! $(which vmdk-convert) ]; then - echo "Your system doesn't have vmdk-convert. Please install it from https://github.com/vmware/open-vmdk." - exit 1 -else - echo "Your system has vmdk-convert." -fi - -if [ ! $(which ovftool) ]; then - echo "Your system doesn't have ovftool. Please install it from https://www.vmware.com/support/developer/ovf/." - exit 1 -else - echo "Your system has ovftool." -fi - -lb bootstrap - -lb chroot -lb installer -lb binary_chroot -lb chroot_devpts install -lb chroot_proc install -lb chroot_selinuxfs install -lb chroot_sysfs install -lb chroot_hosts install -lb chroot_resolv install -lb chroot_hostname install -lb chroot_sysv-rc install -lb chroot_upstart install -lb chroot_apt install-binary -lb chroot_archives chroot install -lb binary_rootfs -lb binary_manifest -lb binary_package-lists -lb binary_linux-image -lb binary_memtest -lb binary_grub -lb binary_grub2 -lb binary_syslinux -lb binary_disk -lb binary_loadlin -lb binary_win32-loader -lb binary_includes -lb binary_hooks -lb binary_checksums - -# get vyos build version -version=$(cat version) -dateymd=$(date +%Y%m%d) - -###################################### -### Prepare the HDD (format, ext.) ### -###################################### -PARTED=/sbin/parted -OUTPUT=disk.raw -OUTPUTVMDK=VyOS-"$dateymd".vmdk -IMAGE_SIZE=2 -qemu-img create -f raw ${OUTPUT} ${IMAGE_SIZE}G - -${PARTED} -s ${OUTPUT} mktable msdos -${PARTED} -s -a optimal ${OUTPUT} mkpart primary ext4 1Mi 100% -${PARTED} -s ${OUTPUT} set 1 boot on -RESULT_KPARTX=`kpartx -asv ${OUTPUT} 2>&1` - -if echo "${RESULT_KPARTX}" | grep "^add map" ; then - LOOP_DEVICE=$(echo ${RESULT_KPARTX} | cut -d" " -f3) - LOOPRAW_DEVICE=${LOOP_DEVICE%p*} - echo "kpartx mounted using: ${LOOP_DEVICE} via ${LOOPRAW_DEVICE}" -else - echo "It seems kpartx didn't mount the image correctly: exiting." - exit 1 -fi - -cleanup(){ - error=$? - [ ! -d "${MOUNT_DIR}" ] && return - if [ "$error" -gt 0 ]; then - echo - echo "Error $error" - else - echo "Finished." - fi - - set +e - - sync - umount -l ${MOUNT_DIR} - rmdir ${MOUNT_DIR} - - umount devpts-live - umount proc-live - umount sysfs-live - - dmsetup remove --deferred ${LOOP_DEVICE} - losetup -d /dev/${LOOPRAW_DEVICE} - exit $error -} -trap "cleanup" EXIT TERM INT - -mkfs.ext4 /dev/mapper/${LOOP_DEVICE} -L persistence -UUID=$(blkid -o value -s UUID /dev/mapper/${LOOP_DEVICE}) - -# No fsck because of X days without checks -tune2fs -i 0 /dev/mapper/${LOOP_DEVICE} - -MOUNT_DIR=`mktemp -d -t build-debimg.XXXXXX` -mount /dev/mapper/${LOOP_DEVICE} ${MOUNT_DIR} - -######################## -### Setting-up files ### -######################## -mkdir -p ${MOUNT_DIR}/boot/grub -mkdir -p ${MOUNT_DIR}/boot/"$version"/rw - -echo "/ union" > ${MOUNT_DIR}/persistence.conf -cp binary/live/filesystem.squashfs ${MOUNT_DIR}/boot/"$version"/"$version.squashfs" -cp binary/live/initrd.img ${MOUNT_DIR}/boot/"$version"/initrd.img -cp binary/live/vmlinuz ${MOUNT_DIR}/boot/"$version"/vmlinuz - -######################## -### Create grub menu ### -######################## -cat > ${MOUNT_DIR}/boot/grub/grub.cfg << EOF -set timeout=5 -set default=0 - -menuentry "VyOS (KVM console)" { - linux /boot/"$version"/vmlinuz boot=live quiet vyos-union=/boot/"$version" console=ttyS0,115200 console=tty0 systemd.show_status=true - initrd /boot/"$version"/initrd.img -} - -menuentry "Lost password change (KVM console)" { - linux /boot/"$version"/vmlinuz boot=live vyos-union=/boot/"$version" console=ttyS0,115200 console=tty0 systemd.show_status=true init=/opt/vyatta/sbin/standalone_root_pw_reset - initrd /boot/"$version"/initrd.img -} - -menuentry "VyOS $version (Serial console)" { - linux /boot/"$version"/vmlinuz boot=live vyos-union=/boot/"$version" console=tty0 console=ttyS0,115200n8d consoleblank=0 systemd.show_status=true - initrd /boot/"$version"/initrd.img -} - -menuentry "Lost password change $version (Serial console)" { - linux /boot/"$version"/vmlinuz boot=live vyos-union=/boot/"$version" console=tty0 console=ttyS0,115200n8d consoleblank=0 systemd.show_status=true init=/opt/vyatta/sbin/standalone_root_pw_reset - initrd /boot/"$version"/initrd.img -} -EOF - - -############################# -### Setting-up bootloader ### -############################# -grub-install --boot-directory ${MOUNT_DIR}/boot --force --no-floppy --skip-fs-probe /dev/${LOOPRAW_DEVICE} - -################### -### HOOK SCRIPT ### -################### -fstrim ${MOUNT_DIR} -sync - -qemu-img convert -f raw ${OUTPUT} -O vmdk -o adapter_type=lsilogic ${OUTPUTVMDK} -rm ${OUTPUT} - -vmdk=vyos_vmware_image.vmdk -ovf=vyos_vmware_image.ovf -vmdk-convert ${OUTPUTVMDK} ${vmdk} - -# Generate OVF -echo 'Generating OVF file...' -vmdk_file_size=$(du --bytes ${vmdk} | cut -f1) -vmdk_populated_size=$(vmdk-convert -i ${vmdk} | jq .used) -sed ../scripts/template.ovf \ - -e "s/{{vmdk_file_size}}/${vmdk_file_size}/" \ - -e "s/{{vmdk_populated_size}}/${vmdk_populated_size}/" \ - -e "s/{{version}}/${version}/" \ - > ${ovf} - -# Generate manifest file -openssl sha1 *.vmdk *.ovf > vyos_vmware_image.mf - -# Convert the OVF to signed OVA... -echo 'Converting the OVF to signed OVA...' -private_key=${PRIVATE_KEY_PATH:-"../key/privatekey.pem"} -if [ ! -f ${private_key} ]; then - echo 'Please put your key to "key/privatekey.pem" in repository root, or set PRIVATE_KEY_PATH to environment variables.' - exit 1 -fi -ovftool --privateKey=${private_key} vyos_vmware_image.ovf vyos_vmware_image-signed.ova -#ovftool vyos_vmware_image.ovf vyos_vmware_image-signed.ova - -# Convert the OVF to signed OVF... -echo 'Converting the OVF to signed OVF...' -ovftool --privateKey=${private_key} vyos_vmware_image.ovf vyos_vmware_image-signed.ovf -#ovftool vyos_vmware_image.ovf vyos_vmware_image-signed.ovf diff --git a/scripts/packer-scripts/vmware.sh b/scripts/packer-scripts/vmware.sh deleted file mode 100644 index 60c4db7e..00000000 --- a/scripts/packer-scripts/vmware.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/vbash -source /opt/vyatta/etc/functions/script-template - -# Add Debian Jessie repository -set system package repository jessie url 'http://ftp.nl.debian.org/debian/' -set system package repository jessie distribution 'jessie' -set system package repository jessie components 'main contrib non-free' -commit -save - -# Install open-vm-tools -sudo apt-get update -sudo apt-get -y install open-vm-tools - -# Delete Debian Jessie repository -delete system package repository jessie -commit -save - -# Removing leftover leases and persistent rules -sudo rm -f /var/lib/dhcp3/* - -# Removing apt caches -sudo rm -rf /var/cache/apt/* - -# Removing hw-id -delete interfaces ethernet eth0 hw-id -commit -save diff --git a/scripts/packer.json b/scripts/packer.json deleted file mode 100644 index f1e49798..00000000 --- a/scripts/packer.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "variables": { - "iso_url": "{{env `ISO_IMAGE`}}", - "iso_checksum": "{{env `ISO_MD5_SUM`}}", - "output_directory": "{{env `PACKER_BUILD_DIR`}}" - }, - "builders": - [ - { - "name": "qemu-image", - "type": "qemu", - "iso_url": "{{user `iso_url`}}", - "iso_checksum": "md5:{{user `iso_checksum`}}", - "output_directory": "{{user `output_directory`}}/qemu", - "shutdown_command": "sudo halt -p", - "disk_size": 4096, - "format": "qcow2", - "headless": true, - "host_port_min": 2222, - "host_port_max": 2229, - "ssh_username": "vyos", - "ssh_password": "vyos", - "ssh_port": 22, - "ssh_wait_timeout": "300s", - "vm_name": "vyos_qemu_image.img", - "net_device": "virtio-net", - "disk_interface": "virtio", - "boot_wait": "5s", - "boot_command": - [ - "", - "vyos", - "vyos", - "install image", - "", - "", - "", - "Yes", - "", - "", - "", - "vyos", - "vyos", - "", - "reboot", - "Yes", - "vyos", - "vyos", - "configure", - "set interface ethernet eth0 address dhcp", - "set service ssh", - "commit", - "save", - "delete interface ethernet eth0 hw-id", - "commit", - "save", - "exit" - ] - } - ] -} diff --git a/scripts/template.ovf b/scripts/template.ovf deleted file mode 100644 index 26d6cc62..00000000 --- a/scripts/template.ovf +++ /dev/null @@ -1,223 +0,0 @@ - - - - - - - The list of logical networks - - WAN network - - - LAN network - - - - List of profiles - - - Minimal hardware profile - 1 vCPU, 512 MB RAM - - - - Medium hardware profile - 4 vCPUs, 16 GB RAM - - - - Large hardware profile - 8 vCPUs, 32 GB RAM - - - - Supported IP assignment schemes - - - Virtual disk information - - - - A virtual machine - - VyOS is a Linux-based network operating system that provides software-based network routing, firewall, and VPN functionality. - VyOS - Sentrium S.L. - {{version}} - https://www.vyos.io - https://sentrium.io/ - - Appliance user Settings - - - The password for the appliance 'vyos' account. Passwords must be at least 8 characters in length. - - - - The public ssh key for the appliance 'vyos' account. - - Appliance IPv4 Network Settings (WAN interface) - - - The host name for this virtual machine. - - - - The IPv4 address. Leave blank if DHCP is desired. - - - - The IPv4 netmask or prefix for this interface. Leave blank if DHCP is desired. - - - - Default gateway address. Leave blank if DHCP is desired. - - - - The domain name server IP Addresses for this VM (comma separated). Leave blank if DHCP is desired. - - - - NTP servers for this VM (comma separated). Leave blank if DHCP is desired. - - Appliance API Settings - - - API key to access the VyOS api. If left blank the api wil not be enabled. - - - - API port to listen on for calls. Leave blank to keep it default '443'. - - - - Enable API debug logging - - - - User-Data, encoded with base64. - - - - VM specific properties - - - - - VyOS - - - The operating system installed - Debian GNU/Linux 8 (64-bit) - - - Virtual Hardware Requirements - - Virtual Hardware Family - 0 - vmx-11 - - - hertz * 10^6 - Number of virtual CPUs - 1 virtual CPU - 1 - 3 - 1 - - - hertz * 10^6 - Number of virtual CPUs - 4 virtual CPUs - 1 - 3 - 4 - - - hertz * 10^6 - Number of virtual CPUs - 8 virtual CPUs - 1 - 3 - 8 - - - byte * 2^20 - Memory Size - 512 MB of memory - 2 - 512 - 4 - 512 - - - byte * 2^20 - Memory Size - 16 GB of memory - 2 - 16384 - 4 - 16384 - - - byte * 2^20 - Memory Size - 32 GB of memory - 2 - 32768 - 4 - 32768 - - - 0 - SCSI Controller 0 - VMware Paravirtual SCSI - 3 - VirtualSCSI - 6 - - - 0 - disk0 - ovf:/disk/vmdisk1 - 4 - 3 - 17 - - - 0 - IDE Controller 0 - 5 - 5 - - - 0 - false - CD/DVD Drive 1 - 6 - 5 - 15 - - - 7 - true - WAN - NIC representing WAN - WAN - 7 - vmxnet3 - 10 - - - 8 - true - LAN - NIC representing LAN - LAN - 8 - vmxnet3 - 10 - - - - - - - diff --git a/scripts/vhd.py b/scripts/vhd.py deleted file mode 100755 index 6a268924..00000000 --- a/scripts/vhd.py +++ /dev/null @@ -1,90 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright: 2015 Bastian Blank -# License: MIT, see LICENSE.txt for details. - -import array -import struct -import time -import sys -import os - -from uuid import uuid4 - - -class VHDFooter: - _struct = struct.Struct('>8sLLQL4sL4sQQ4sLL16sB427x') - size = _struct.size - - vhd_timestamp_base = 946684800 - - def __init__(self, size, uuid=None, timestamp=None): - self.size = size - self.timestamp = timestamp or (int(time.time()) - self.vhd_timestamp_base) - self.uuid = uuid or uuid4() - - @staticmethod - def _checksum(msg): - return 0x100000000 + ~sum(array.array("B", msg)) - - def _pack_geometry(self): - sectors = self.size // 512 - - if sectors > 65535 * 16 * 255: - sectors = 65535 * 16 * 255 - - if sectors >= 65535 * 16 * 63: - sectorsPerTrack = 255 - heads = 16 - cylinderTimesHeads = sectors // sectorsPerTrack - - else: - sectorsPerTrack = 17 - cylinderTimesHeads = sectors // sectorsPerTrack - - heads = (cylinderTimesHeads + 1023) // 1024 - - if heads < 4: - heads = 4 - if cylinderTimesHeads >= (heads * 1024) or heads > 16: - sectorsPerTrack = 31 - heads = 16 - cylinderTimesHeads = sectors // sectorsPerTrack - if cylinderTimesHeads >= (heads * 1024): - sectorsPerTrack = 63 - heads = 16 - cylinderTimesHeads = sectors // sectorsPerTrack - - cylinders = cylinderTimesHeads // heads - - return struct.pack('>HBB', cylinders, heads, sectorsPerTrack) - - def _pack(self, checksum): - return self._struct.pack( - b'conectix', # Cookie - 0x00000002, # Features - 0x00010000, # File Format Version - 0xffffffffffffffff, # Data Offset - self.timestamp, # Time Stamp - b'qemu', # Creator Application - 0x00010000, # Creator Version - b'Wi2k', # Creator Host OS - self.size, # Original Size - self.size, # Current Size - self._pack_geometry(), # Disk Geometry - 2, # Disk Type - checksum, # Checksum - self.uuid.bytes, # Unique Id - 0, # Saved State - ) - - def pack(self): - c = self._checksum(self._pack(0)) - return self._pack(c) - -with open(sys.argv[1], 'rb+') as f: - f.seek(0, 2) - image_size = f.tell() - image_size_complete = image_size + VHDFooter.size - footer = VHDFooter(image_size) - f.write(footer.pack()) -- cgit v1.2.3 From 7afee1ae93a9055bb7af168d731ab8666f81ca93 Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Wed, 7 Jul 2021 05:22:28 -0500 Subject: T3664: remove vagrant build --- Makefile | 14 ---- scripts/Vagrantfile | 12 --- scripts/build-clearfog-image | 158 -------------------------------------- scripts/build-vagrant-libvirt-box | 74 ------------------ scripts/check-vm-build-env | 51 ------------ 5 files changed, 309 deletions(-) delete mode 100644 scripts/Vagrantfile delete mode 100755 scripts/build-clearfog-image delete mode 100755 scripts/build-vagrant-libvirt-box delete mode 100755 scripts/check-vm-build-env (limited to 'scripts') diff --git a/Makefile b/Makefile index 0b672364..3defd020 100644 --- a/Makefile +++ b/Makefile @@ -44,20 +44,6 @@ prepare-package-env: @scripts/pbuilder-config @scripts/pbuilder-setup -.PHONY: vagrant-libvirt -.ONESHELL: -vagrant-libvirt: - @set -e - @scripts/check-vm-build-env - @scripts/build-vagrant-libvirt-box - -.PHONY: hyperv -.ONESHELL: -hyperv: - @set -e - @scripts/check-vm-build-env - @scripts/build-hyperv-image - .PHONY: AWS .ONESHELL: AWS: clean prepare diff --git a/scripts/Vagrantfile b/scripts/Vagrantfile deleted file mode 100644 index 7c89422d..00000000 --- a/scripts/Vagrantfile +++ /dev/null @@ -1,12 +0,0 @@ -Vagrant.configure("2") do |config| - config.vm.synced_folder './', '/vagrant', - type: "rsync", - owner: 'vyos', - group: 'users', - mount_options: ['dmode=775,fmode=775'] - config.ssh.username = "vyos" - config.ssh.password = "vyos" - config.vm.provider :libvirt do |libvirt| - libvirt.driver = "kvm" - end -end diff --git a/scripts/build-clearfog-image b/scripts/build-clearfog-image deleted file mode 100755 index 0ef6d323..00000000 --- a/scripts/build-clearfog-image +++ /dev/null @@ -1,158 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2016 VyOS maintainers and contributors -# -# This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 or later as published by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -# File: build-clearfog-image -# Purpose: -# Build VyOS image for for Solidrun clearfog. - -lb bootstrap -lb chroot -lb installer -lb binary_chroot -lb chroot_devpts install -lb chroot_proc install -lb chroot_selinuxfs install -lb chroot_sysfs install -lb chroot_hosts install -lb chroot_resolv install -lb chroot_hostname install -lb chroot_sysv-rc install -lb chroot_upstart install -lb chroot_apt install-binary -lb chroot_archives chroot install -lb binary_rootfs -lb binary_manifest -lb binary_package-lists -lb binary_linux-image -lb binary_memtest -lb binary_grub -lb binary_grub2 -lb binary_syslinux -lb binary_disk -lb binary_loadlin -lb binary_win32-loader -lb binary_includes -lb binary_hooks -lb binary_checksums - -# get vyos build version -version=$(cat version) -dateymd=$(date +%Y%m%d) - -# create sd-card image and partition it -qemu-img create -f raw sr-a38x-cf-vyos-"$dateymd"-testing.img 1.8G -parted --script sr-a38x-cf-vyos-"$dateymd"-testing.img mklabel msdos -parted --script sr-a38x-cf-vyos-"$dateymd"-testing.img mkpart primary fat16 8192s 60 -parted --script sr-a38x-cf-vyos-"$dateymd"-testing.img mkpart primary ext2 60 1900 -parted --script sr-a38x-cf-vyos-"$dateymd"-testing.img set 1 boot on - -# mount image and create filesystems -losetup /dev/loop0 sr-a38x-cf-vyos-"$dateymd"-testing.img -partprobe /dev/loop0 -mkfs.vfat -n EFI -F 16 -I /dev/loop0p1 -mkfs.ext2 -L persistence /dev/loop0p2 - -# mount image partitions -mkdir -p /boot/efi -mount /dev/loop0p1 /boot/efi -mkdir -p /mnt -mount /dev/loop0p2 /mnt - -# setup files on image -mkdir -p /mnt/boot/grub -mkdir -p /mnt/boot/"$version"/rw -echo "/ union" > /mnt/persistence.conf -cp binary/live/filesystem.squashfs /mnt/boot/"$version"/"$version.squashfs" -cp binary/live/initrd.img-* /mnt/boot/"$version"/initrd.img -cp binary/live/vmlinuz-* /mnt/boot/"$version"/vmlinuz -cp ../tools/armada-388-clearfog.dtb /boot/efi/armada-388-clearfog.dtb - -# create boot script -cat > /boot/efi/boot.script << EOF -# load DTB -echo "Loading armada-388-clearfog.dtb" -load mmc 0:1 \$fdt_addr_r armada-388-clearfog.dtb -fdt addr \$fdt_addr_r 20000 - -# load efi -echo "Loading EFI image ..." -load mmc 0:1 \$loadaddr EFI/debian/grubarm.efi - -# Sleep a while so the MMC driver can settle down -echo "Sleeping 5 seconds ..." -sleep 5 - -# boot -echo "Booting ..." -bootefi \$loadaddr -EOF - -# compile boot script for u-boot -mkimage -A arm -O linux -T script -C none -a 0 -e 0 -d /boot/efi/boot.script /boot/efi/boot.scr - -# create grub config file to include -cat > load.cfg << EOF -set root=(hd0,msdos2) -set prefix=(hd0,msdos2)/boot/grub -devicetree (hd0,msdos1)/armada-388-clearfog.dtb -insmod normal -normal -EOF - -# create grub menu -cat > /mnt/boot/grub/grub.cfg << EOF -set default=0 -set timeout=5 - -echo -n Press ESC to enter the Grub menu... -if sleep --verbose --interruptible 5 ; then - terminal_input console serial -fi - - -menuentry "VyOS $version (Serial console)" { - linux /boot/"$version"/vmlinuz boot=live quiet vyos-union=/boot/"$version" console=ttyS0,115200n8 - initrd /boot/"$version"/initrd.img -} - -menuentry "Lost password change $version (Serial console)" { - linux /boot/"$version"/vmlinuz boot=live quiet vyos-union=/boot/"$version" console=ttyS0,115200n8 init=/opt/vyatta/sbin/standalone_root_pw_reset - initrd /boot/"$version"/initrd.img -} -EOF - -# install efi grub to image -grub-install --efi-directory /boot/efi --boot-directory /mnt/boot -d /usr/lib/grub/arm-efi /dev/loop0 - -# create grub efi executable -grub-mkimage -O arm-efi -p /boot/grub -d /usr/lib/grub/arm-efi -c load.cfg \ -ext2 iso9660 linux echo configfile \ -search_label search_fs_file search \ -search_fs_uuid ls normal gzio \ -png fat gettext font minicmd \ -gfxterm gfxmenu video video_fb \ -part_msdos part_gpt > /boot/efi/EFI/debian/grubarm.efi - -# unmount image partitions -umount /mnt -umount /boot/efi - -# write u-boot to image -dd if=../tools/u-boot-spl.kwb of=/dev/loop0 bs=512 seek=1 - -# unmount image -sudo losetup -D - -# compress image -xz -v sr-a38x-cf-vyos-"$dateymd"-testing.img diff --git a/scripts/build-vagrant-libvirt-box b/scripts/build-vagrant-libvirt-box deleted file mode 100755 index 6db77c2a..00000000 --- a/scripts/build-vagrant-libvirt-box +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2016 VyOS maintainers and contributors -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 2 or later as -# published by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -# File: build-vagrant-libvirt-box -# Purpose: -# Build VyOS Vagrant libvirt box. - -export PACKER_BUILD_DIR=packer_build - -DST_DIR=${PACKER_BUILD_DIR}/vagrant-libvirt -BOX_DIR=${DST_DIR}/box -mkdir -p ${BOX_DIR} - -# Copy qcow2 image -cp -p packer_build/qemu/vyos_qemu_image.img ${BOX_DIR}/box.img - -# Put metadata.json and Vagrantfile -echo '{"format":"qcow2","provider":"libvirt","virtual_size":4}' > ${BOX_DIR}/metadata.json -cat < ${BOX_DIR}/Vagrantfile -Vagrant.configure("2") do |config| - config.vm.synced_folder './', '/vagrant', - type: "rsync", - owner: 'vyos', - group: 'users', - mount_options: ['dmode=775,fmode=775'] - config.ssh.username = "vyos" - config.ssh.password = "vyos" - config.vm.provider :libvirt do |libvirt| - libvirt.driver = "kvm" - end -end -EOF - -# Create box -box=${DST_DIR}/vyos_vagrant_libvirt.box -tar -C ${BOX_DIR} -czvf ${box} metadata.json Vagrantfile box.img -if [ "$?" = "0" ]; then - echo "Vagrant libvirt box successfully created to ./${box}" -fi - -PROVIDER=libvirt - -# Create version -major=$(cat build/version | cut -d'+' -f2 | cut -d'-' -f1 | rev | cut -c 5- | rev) -sub=$(cat build/version | cut -d'+' -f2 | cut -d'-' -f1 | rev | cut -c 3-4 | rev) -minor=$(cat build/version | cut -d'+' -f2 | cut -d'-' -f1 | rev | cut -c 1-2 | rev) -version=$(echo "$major.$sub.$minor") -curl -XPOST -d "version[version]=${version}" \ - https://app.vagrantup.com/api/v1/box/${VAGRANT_BOX_NAME}/versions?access_token=${VAGRANT_CLOUD_ACCESS_TOKEN} -echo - -# Create provider -urlencoded_version=$(cat build/version | sed 's/+/%2B/') -curl -XPOST -d "provider[name]=${PROVIDER}" -d "provider[url]=${VAGRANT_BOX_BASE_URL}/vyos-${urlencoded_version}-vagrant-${PROVIDER}.box" \ - https://app.vagrantup.com/api/v1/box/${VAGRANT_BOX_NAME}/version/${version}/providers?access_token=${VAGRANT_CLOUD_ACCESS_TOKEN} -echo - -# Release version -curl -XPUT \ - https://app.vagrantup.com/api/v1/box/${VAGRANT_BOX_NAME}/version/${version}/release?access_token=${VAGRANT_CLOUD_ACCESS_TOKEN} -echo diff --git a/scripts/check-vm-build-env b/scripts/check-vm-build-env deleted file mode 100755 index 8efab848..00000000 --- a/scripts/check-vm-build-env +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env python3 -# -# Copyright (C) 2016 VyOS maintainers and contributors -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 2 or later as -# published by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -# File: check-vm-build-env -# Purpose: -# Checks if packages required for VM image build are installed. - - -import os -import sys - -import util - -deps = { - 'packages': [ - 'jq', - 'qemu-system-x86', - 'qemu-utils' - ], - 'binaries': ['packer'] -} - -print("Checking if packages required for VyOS image build are installed") - -checker = util.DependencyChecker(deps) - -missing = checker.get_missing_dependencies() -if not missing: - print("All dependencies are installed") - sys.exit(0) -else: - checker.print_missing_deps() - if 'packer' in missing['binaries']: - print("Your system does not have Packer.") - print("Please install Packer from https://www.packer.io/downloads.html.") - sys.exit(1) - -sys.exit(0) -- cgit v1.2.3