From b0fbefc7b96ee0d939cf82aef4e51bfb67bd39c7 Mon Sep 17 00:00:00 2001 From: Yuya Kusakabe Date: Sat, 5 Mar 2016 22:43:57 +0900 Subject: Change accelerator to tcg from kvm and ajust boot command in packer.json (ref T12) --- scripts/packer.json | 50 ++++++++++++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/scripts/packer.json b/scripts/packer.json index 5d5f201e..a390968a 100644 --- a/scripts/packer.json +++ b/scripts/packer.json @@ -16,46 +16,52 @@ "disk_size": 4096, "format": "raw", "headless": true, - "accelerator": "kvm", + "accelerator": "tcg", "ssh_host_port_min": 2222, "ssh_host_port_max": 2229, "ssh_username": "vyos", "ssh_password": "vyos", "ssh_port": 22, - "ssh_wait_timeout": "30s", + "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", + "install image", + "", + "", + "", + "Yes", "", - "", - "", - "vyos", + "", + "", "vyos", - "", - "reboot", + "vyos", + "", + "reboot", "Yes", + "", + "", + "", + "", + "", "vyos", - "vyos", - "configure", - "delete system console", + "vyos", + "configure", "set interface ethernet eth0 address dhcp", "set service ssh", - "commit", - "save", - "exit", - "reboot", - "Yes" + "commit", + "save", + "exit" ] } ] -- cgit v1.2.3 From c3a238ff2000ba4c27c791e66a9a4aaba9576a8f Mon Sep 17 00:00:00 2001 From: Yuya Kusakabe Date: Sun, 6 Mar 2016 17:23:23 +0900 Subject: Fix qemu image cannot get IP address. (ref T12) --- scripts/packer.json | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/scripts/packer.json b/scripts/packer.json index a390968a..6d487353 100644 --- a/scripts/packer.json +++ b/scripts/packer.json @@ -15,7 +15,7 @@ "shutdown_command": "sudo halt -p", "disk_size": 4096, "format": "raw", - "headless": true, + "headless": false, "accelerator": "tcg", "ssh_host_port_min": 2222, "ssh_host_port_max": 2229, @@ -29,13 +29,9 @@ "boot_wait": "5s", "boot_command": [ - "", - "", - "", - "", - "", - "vyos", - "vyos", + "", + "vyos", + "vyos", "install image", "", "", @@ -44,21 +40,19 @@ "", "", "", - "vyos", "vyos", + "vyos", "", "reboot", - "Yes", - "", - "", - "", - "", - "", + "Yes", "vyos", "vyos", "configure", - "set interface ethernet eth0 address dhcp", - "set service ssh", + "set interface ethernet eth0 address dhcp", + "set service ssh", + "commit", + "save", + "delete interface ethernet eth0 hw-id", "commit", "save", "exit" -- cgit v1.2.3 From 7ba48ff801e98f25053b048e834b8b073fe21ad3 Mon Sep 17 00:00:00 2001 From: Yuya Kusakabe Date: Mon, 7 Mar 2016 00:00:33 +0900 Subject: Add build scripts for VMware OVF (ref T14) --- Makefile | 7 +++ scripts/build-qemu-image | 2 +- scripts/build-vmware-ovf | 45 ++++++++++++++ scripts/packer-scripts/vmware.sh | 29 +++++++++ scripts/packer.json | 33 ++++++++++ scripts/template.ovf | 131 +++++++++++++++++++++++++++++++++++++++ 6 files changed, 246 insertions(+), 1 deletion(-) create mode 100755 scripts/build-vmware-ovf create mode 100644 scripts/packer-scripts/vmware.sh create mode 100644 scripts/template.ovf diff --git a/Makefile b/Makefile index 86f0c27d..adce002c 100644 --- a/Makefile +++ b/Makefile @@ -44,6 +44,13 @@ qemu: @scripts/check-vm-build-env @scripts/build-qemu-image +.PHONY: vmware-ovf +.ONESHELL: +vmware-ovf: + @set -e + @scripts/check-vm-build-env + @scripts/build-vmware-ovf + .PHONY: clean .ONESHELL: clean: diff --git a/scripts/build-qemu-image b/scripts/build-qemu-image index 8643508a..4a67f0f3 100755 --- a/scripts/build-qemu-image +++ b/scripts/build-qemu-image @@ -27,4 +27,4 @@ export PACKER_LOG=1 mkdir -p ${PACKER_BUILD_DIR} -packer build -only=qemu scripts/packer.json +packer build -only=qemu-image scripts/packer.json diff --git a/scripts/build-vmware-ovf b/scripts/build-vmware-ovf new file mode 100755 index 00000000..ff2a5464 --- /dev/null +++ b/scripts/build-vmware-ovf @@ -0,0 +1,45 @@ +#!/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-vmware-ovf +# Purpose: +# Build VyOS OVF 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 + +export PACKER_BUILD_DIR=packer_build +export PACKER_LOG_PATH=${PACKER_BUILD_DIR}/build_vmware_ovf.log +export PACKER_LOG=1 + +mkdir -p ${PACKER_BUILD_DIR} + +packer build -only=vmware-image scripts/packer.json + +# Convert raw image to VMDK +source_image=${PACKER_BUILD_DIR}/vmware/vyos_vmware_image.img +tmp_vmdk=${PACKER_BUILD_DIR}/vmware/tmp.vmdk +vmdk=${PACKER_BUILD_DIR}/vmware/vyos_vmware_image.vmdk +qemu-img convert -f raw ${source_image} -O vmdk -o adapter_type=lsilogic ${tmp_vmdk} +vmdk-convert ${tmp_vmdk} ${vmdk} + +# Generate OVF +vmdk_file_size=$(du --bytes ${vmdk} | awk '{print $1}') +cat scripts/template.ovf | sed "s/{{vmdk_file_size}}/${vmdk_file_size}/" > packer_build/vmware/vyos_vmware_image.ovf diff --git a/scripts/packer-scripts/vmware.sh b/scripts/packer-scripts/vmware.sh new file mode 100644 index 00000000..60c4db7e --- /dev/null +++ b/scripts/packer-scripts/vmware.sh @@ -0,0 +1,29 @@ +#!/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 index 6d487353..e54dc74e 100644 --- a/scripts/packer.json +++ b/scripts/packer.json @@ -7,6 +7,7 @@ "builders": [ { + "name": "qemu-image", "type": "qemu", "iso_url": "{{user `iso_url`}}", "iso_checksum": "{{user `iso_checksum`}}", @@ -57,6 +58,38 @@ "save", "exit" ] + }, + { + "name": "vmware-image", + "type": "qemu", + "iso_url": "{{user `output_directory`}}/qemu/vyos_qemu_image.img", + "iso_checksum_type": "none", + "output_directory": "{{user `output_directory`}}/vmware", + "shutdown_command": "sudo halt -p", + "disk_image": true, + "disk_size": 4096, + "format": "raw", + "headless": false, + "accelerator": "tcg", + "ssh_host_port_min": 2222, + "ssh_host_port_max": 2229, + "ssh_username": "vyos", + "ssh_password": "vyos", + "ssh_port": 22, + "ssh_wait_timeout": "300s", + "vm_name": "vyos_vmware_image.img", + "net_device": "virtio-net", + "disk_interface": "virtio", + "boot_wait": "5s" + } + ], + "provisioners": [ + { + "type": "shell", + "only": ["vmware-image"], + "scripts": [ + "scripts/packer-scripts/vmware.sh" + ] } ] } diff --git a/scripts/template.ovf b/scripts/template.ovf new file mode 100644 index 00000000..2250eb55 --- /dev/null +++ b/scripts/template.ovf @@ -0,0 +1,131 @@ + + + + + + + Virtual disk information + + + + The list of logical networks + + The VM Network network + + + + A virtual machine + vyos + + The kind of installed guest operating system + + + Virtual hardware requirements + + Virtual Hardware Family + 0 + vyos + vmx-08 + + + hertz * 10^6 + Number of Virtual CPUs + 1 virtual CPU(s) + 1 + 3 + 1 + + + byte * 2^20 + Memory Size + 512MB of memory + 2 + 4 + 512 + + + 0 + USB Controller (EHCI) + usb + 3 + vmware.usb.ehci + 23 + + + + 0 + SCSI Controller + scsiController0 + 4 + lsilogic + 6 + + + 1 + IDE Controller + ideController1 + 5 + 5 + + + true + serial0 + 6 + 21 + + + + 0 + false + cdrom0 + 7 + 5 + 15 + + + 0 + disk0 + ovf:/disk/vmdisk1 + 8 + 4 + 17 + + + 2 + true + VM Network + VMXNET3 ethernet adapter on "nat" + ethernet0 + 9 + VMXNET3 + 10 + + + + false + sound + 10 + vmware.soundcard.ensoniq1371 + 1 + + + false + video + 11 + 24 + + + false + vmci + 12 + vmware.vmci + 1 + + + + + + + + + -- cgit v1.2.3 From 9c6086925e0f191dfe54b1081c6e904ace4d236d Mon Sep 17 00:00:00 2001 From: Yuya Kusakabe Date: Mon, 7 Mar 2016 00:44:27 +0900 Subject: Disable GUI in packer build (ref T14). --- scripts/packer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/packer.json b/scripts/packer.json index e54dc74e..52b0b284 100644 --- a/scripts/packer.json +++ b/scripts/packer.json @@ -16,7 +16,7 @@ "shutdown_command": "sudo halt -p", "disk_size": 4096, "format": "raw", - "headless": false, + "headless": true, "accelerator": "tcg", "ssh_host_port_min": 2222, "ssh_host_port_max": 2229, @@ -69,7 +69,7 @@ "disk_image": true, "disk_size": 4096, "format": "raw", - "headless": false, + "headless": true, "accelerator": "tcg", "ssh_host_port_min": 2222, "ssh_host_port_max": 2229, -- cgit v1.2.3 From 0a89aa830aaf151df6d68192a1699dfcb9c8fe05 Mon Sep 17 00:00:00 2001 From: Yuya Kusakabe Date: Mon, 7 Mar 2016 10:31:23 +0900 Subject: Small fixes for scripts/template.ovf (ref T14). --- scripts/template.ovf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/template.ovf b/scripts/template.ovf index 2250eb55..7a67b82c 100644 --- a/scripts/template.ovf +++ b/scripts/template.ovf @@ -16,7 +16,7 @@ A virtual machine vyos - + The kind of installed guest operating system @@ -94,10 +94,10 @@ 2 true VM Network - VMXNET3 ethernet adapter on "nat" + VmxNet3 ethernet adapter on "VM Network" ethernet0 9 - VMXNET3 + VmxNet3 10 -- cgit v1.2.3 From 2a41a6b34f78fc7e81c5959cbefc88f1c9719040 Mon Sep 17 00:00:00 2001 From: Yuya Kusakabe Date: Mon, 7 Mar 2016 15:38:41 +0900 Subject: vmware-ovf: Increase memory size and remove unnecessary devices (ref T14). --- scripts/template.ovf | 40 ++++++++++++---------------------------- 1 file changed, 12 insertions(+), 28 deletions(-) diff --git a/scripts/template.ovf b/scripts/template.ovf index 7a67b82c..7e341c3e 100644 --- a/scripts/template.ovf +++ b/scripts/template.ovf @@ -25,7 +25,7 @@ Virtual Hardware Family 0 vyos - vmx-08 + vmx-09 hertz * 10^6 @@ -36,27 +36,18 @@ 1 - byte * 2^20 + byte * 2^30 Memory Size - 512MB of memory + 1GB of memory 2 4 - 512 - - - 0 - USB Controller (EHCI) - usb - 3 - vmware.usb.ehci - 23 - + 1 0 SCSI Controller scsiController0 - 4 + 3 lsilogic 6 @@ -64,13 +55,13 @@ 1 IDE Controller ideController1 - 5 + 4 5 true serial0 - 6 + 5 21 @@ -78,7 +69,7 @@ 0 false cdrom0 - 7 + 6 5 15 @@ -86,7 +77,7 @@ 0 disk0 ovf:/disk/vmdisk1 - 8 + 7 4 17 @@ -96,28 +87,21 @@ VM Network VmxNet3 ethernet adapter on "VM Network" ethernet0 - 9 + 8 VmxNet3 10 - - false - sound - 10 - vmware.soundcard.ensoniq1371 - 1 - false video - 11 + 9 24 false vmci - 12 + 10 vmware.vmci 1 -- cgit v1.2.3 From df70d5d1779d6a5c5cc027a80d2e9440d517eff2 Mon Sep 17 00:00:00 2001 From: Yuya Kusakabe Date: Mon, 7 Mar 2016 15:39:31 +0900 Subject: vmware-ovf: Generate manifest file (T14). --- scripts/build-vmware-ovf | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/build-vmware-ovf b/scripts/build-vmware-ovf index ff2a5464..f3424a03 100755 --- a/scripts/build-vmware-ovf +++ b/scripts/build-vmware-ovf @@ -30,16 +30,22 @@ export PACKER_LOG_PATH=${PACKER_BUILD_DIR}/build_vmware_ovf.log export PACKER_LOG=1 mkdir -p ${PACKER_BUILD_DIR} +DST_DIR=${PACKER_BUILD_DIR}/vmware packer build -only=vmware-image scripts/packer.json # Convert raw image to VMDK -source_image=${PACKER_BUILD_DIR}/vmware/vyos_vmware_image.img -tmp_vmdk=${PACKER_BUILD_DIR}/vmware/tmp.vmdk -vmdk=${PACKER_BUILD_DIR}/vmware/vyos_vmware_image.vmdk +source_image=${DST_DIR}/vyos_vmware_image.img +tmp_vmdk=${DST_DIR}/tmp.vmdk +vmdk=${DST_DIR}/vyos_vmware_image.vmdk +ovf=${DST_DIR}/vyos_vmware_image.ovf qemu-img convert -f raw ${source_image} -O vmdk -o adapter_type=lsilogic ${tmp_vmdk} vmdk-convert ${tmp_vmdk} ${vmdk} # Generate OVF vmdk_file_size=$(du --bytes ${vmdk} | awk '{print $1}') -cat scripts/template.ovf | sed "s/{{vmdk_file_size}}/${vmdk_file_size}/" > packer_build/vmware/vyos_vmware_image.ovf +cat scripts/template.ovf | sed "s/{{vmdk_file_size}}/${vmdk_file_size}/" > ${ovf} + +# Generate manifest file +cd ${DST_DIR} +openssl sha1 *.vmdk *.ovf > vyos_vmware_image.mf -- cgit v1.2.3 From 01083886e1e861378ce16195c9ad76c1d5ce3e4a Mon Sep 17 00:00:00 2001 From: Yuya Kusakabe Date: Mon, 7 Mar 2016 23:47:39 +0900 Subject: Add product section to VMware OVF (ref T14). --- scripts/build-vmware-ovf | 8 ++++++-- scripts/check-vm-build-env | 2 +- scripts/template.ovf | 8 +++++++- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/scripts/build-vmware-ovf b/scripts/build-vmware-ovf index f3424a03..8890ba69 100755 --- a/scripts/build-vmware-ovf +++ b/scripts/build-vmware-ovf @@ -43,8 +43,12 @@ qemu-img convert -f raw ${source_image} -O vmdk -o adapter_type=lsilogic ${tmp_v vmdk-convert ${tmp_vmdk} ${vmdk} # Generate OVF -vmdk_file_size=$(du --bytes ${vmdk} | awk '{print $1}') -cat scripts/template.ovf | sed "s/{{vmdk_file_size}}/${vmdk_file_size}/" > ${ovf} +vmdk_file_size=$(vmdk-convert -i ${vmdk} | jq .capacity) +vmdk_populated_size=$(vmdk-convert -i ${vmdk} | jq .used) +version=$(cat build/version) +cat scripts/template.ovf | sed "s/{{vmdk_file_size}}/${vmdk_file_size}/" > ${ovf} +sed -i "s/{{vmdk_populated_size}}/${vmdk_populated_size}/" ${ovf} +sed -i "s/{{version}}/${version}/" ${ovf} # Generate manifest file cd ${DST_DIR} diff --git a/scripts/check-vm-build-env b/scripts/check-vm-build-env index 47ec5922..c32f2b13 100755 --- a/scripts/check-vm-build-env +++ b/scripts/check-vm-build-env @@ -26,7 +26,7 @@ import util deps = { 'packages': [ - 'make', + 'jq', 'qemu-system-x86', 'qemu-utils' ], diff --git a/scripts/template.ovf b/scripts/template.ovf index 7e341c3e..b7c9aa32 100644 --- a/scripts/template.ovf +++ b/scripts/template.ovf @@ -5,7 +5,7 @@ Virtual disk information - + The list of logical networks @@ -111,5 +111,11 @@ + + VyOS is a Linux-based network operating system that provides software-based network routing, firewall, and VPN functionality. + VyOS + VyOS maintainers and contributors + {{version}} + -- cgit v1.2.3 From c5df2dd17dffda133a0c0bb68d6a9a16c10f1c2e Mon Sep 17 00:00:00 2001 From: Yuya Kusakabe Date: Tue, 8 Mar 2016 09:08:36 +0900 Subject: Add support for signed VMware OVA (ref T14). --- Makefile | 6 ++-- scripts/build-vmware-ova | 74 ++++++++++++++++++++++++++++++++++++++++++++++++ scripts/build-vmware-ovf | 55 ----------------------------------- 3 files changed, 77 insertions(+), 58 deletions(-) create mode 100755 scripts/build-vmware-ova delete mode 100755 scripts/build-vmware-ovf diff --git a/Makefile b/Makefile index adce002c..6c401e2c 100644 --- a/Makefile +++ b/Makefile @@ -44,12 +44,12 @@ qemu: @scripts/check-vm-build-env @scripts/build-qemu-image -.PHONY: vmware-ovf +.PHONY: vmware-ova .ONESHELL: -vmware-ovf: +vmware-ova: @set -e @scripts/check-vm-build-env - @scripts/build-vmware-ovf + @scripts/build-vmware-ova .PHONY: clean .ONESHELL: diff --git a/scripts/build-vmware-ova b/scripts/build-vmware-ova new file mode 100755 index 00000000..c0e85cdc --- /dev/null +++ b/scripts/build-vmware-ova @@ -0,0 +1,74 @@ +#!/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-vmware-ovf +# Purpose: +# Build VyOS OVF 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 + +export PACKER_BUILD_DIR=packer_build +export PACKER_LOG_PATH=${PACKER_BUILD_DIR}/build_vmware_ovf.log +export PACKER_LOG=1 + +mkdir -p ${PACKER_BUILD_DIR} +DST_DIR=${PACKER_BUILD_DIR}/vmware + +packer build -only=vmware-image scripts/packer.json + +# Convert raw image to VMDK +source_image=${DST_DIR}/vyos_vmware_image.img +tmp_vmdk=${DST_DIR}/tmp.vmdk +vmdk=${DST_DIR}/vyos_vmware_image.vmdk +ovf=${DST_DIR}/vyos_vmware_image.ovf +qemu-img convert -f raw ${source_image} -O vmdk -o adapter_type=lsilogic ${tmp_vmdk} +vmdk-convert ${tmp_vmdk} ${vmdk} + +# Generate OVF +echo 'Generating OVF file...' +vmdk_file_size=$(du --bytes ${vmdk} | cut -f1) +vmdk_populated_size=$(vmdk-convert -i ${vmdk} | jq .used) +version=$(cat build/version) +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 +cd ${DST_DIR} +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" directory in repository root, or set PRIVATE_KEY_PATH to environment variables.' + exit 1 +fi +ovftool --privateKey=${PRIVATE_KEY_PATH} vyos_vmware_image.ovf vyos_vmware_image.ova diff --git a/scripts/build-vmware-ovf b/scripts/build-vmware-ovf deleted file mode 100755 index 8890ba69..00000000 --- a/scripts/build-vmware-ovf +++ /dev/null @@ -1,55 +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-vmware-ovf -# Purpose: -# Build VyOS OVF 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 - -export PACKER_BUILD_DIR=packer_build -export PACKER_LOG_PATH=${PACKER_BUILD_DIR}/build_vmware_ovf.log -export PACKER_LOG=1 - -mkdir -p ${PACKER_BUILD_DIR} -DST_DIR=${PACKER_BUILD_DIR}/vmware - -packer build -only=vmware-image scripts/packer.json - -# Convert raw image to VMDK -source_image=${DST_DIR}/vyos_vmware_image.img -tmp_vmdk=${DST_DIR}/tmp.vmdk -vmdk=${DST_DIR}/vyos_vmware_image.vmdk -ovf=${DST_DIR}/vyos_vmware_image.ovf -qemu-img convert -f raw ${source_image} -O vmdk -o adapter_type=lsilogic ${tmp_vmdk} -vmdk-convert ${tmp_vmdk} ${vmdk} - -# Generate OVF -vmdk_file_size=$(vmdk-convert -i ${vmdk} | jq .capacity) -vmdk_populated_size=$(vmdk-convert -i ${vmdk} | jq .used) -version=$(cat build/version) -cat scripts/template.ovf | sed "s/{{vmdk_file_size}}/${vmdk_file_size}/" > ${ovf} -sed -i "s/{{vmdk_populated_size}}/${vmdk_populated_size}/" ${ovf} -sed -i "s/{{version}}/${version}/" ${ovf} - -# Generate manifest file -cd ${DST_DIR} -openssl sha1 *.vmdk *.ovf > vyos_vmware_image.mf -- cgit v1.2.3 From a0a10a1057ceafe7abf6a8da30894c97e5a90a1a Mon Sep 17 00:00:00 2001 From: Yuya Kusakabe Date: Tue, 8 Mar 2016 11:17:56 +0900 Subject: Add support for signed VMware OVF (ref T14). --- Makefile | 6 ++-- scripts/build-vmware-image | 78 ++++++++++++++++++++++++++++++++++++++++++++++ scripts/build-vmware-ova | 74 ------------------------------------------- 3 files changed, 81 insertions(+), 77 deletions(-) create mode 100755 scripts/build-vmware-image delete mode 100755 scripts/build-vmware-ova diff --git a/Makefile b/Makefile index 6c401e2c..2e6dd9ad 100644 --- a/Makefile +++ b/Makefile @@ -44,12 +44,12 @@ qemu: @scripts/check-vm-build-env @scripts/build-qemu-image -.PHONY: vmware-ova +.PHONY: vmware .ONESHELL: -vmware-ova: +vmware: @set -e @scripts/check-vm-build-env - @scripts/build-vmware-ova + @scripts/build-vmware-image .PHONY: clean .ONESHELL: diff --git a/scripts/build-vmware-image b/scripts/build-vmware-image new file mode 100755 index 00000000..189461eb --- /dev/null +++ b/scripts/build-vmware-image @@ -0,0 +1,78 @@ +#!/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-vmware-ovf +# Purpose: +# Build VyOS OVF 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 + +export PACKER_BUILD_DIR=packer_build +export PACKER_LOG_PATH=${PACKER_BUILD_DIR}/build_vmware_ovf.log +export PACKER_LOG=1 + +mkdir -p ${PACKER_BUILD_DIR} +DST_DIR=${PACKER_BUILD_DIR}/vmware + +packer build -only=vmware-image scripts/packer.json + +# Convert raw image to VMDK +source_image=${DST_DIR}/vyos_vmware_image.img +tmp_vmdk=${DST_DIR}/tmp.vmdk +vmdk=${DST_DIR}/vyos_vmware_image.vmdk +ovf=${DST_DIR}/vyos_vmware_image.ovf +qemu-img convert -f raw ${source_image} -O vmdk -o adapter_type=lsilogic ${tmp_vmdk} +vmdk-convert ${tmp_vmdk} ${vmdk} + +# Generate OVF +echo 'Generating OVF file...' +vmdk_file_size=$(du --bytes ${vmdk} | cut -f1) +vmdk_populated_size=$(vmdk-convert -i ${vmdk} | jq .used) +version=$(cat build/version) +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 +cd ${DST_DIR} +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_PATH} 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_PATH} vyos_vmware_image.ovf vyos_vmware_image-signed.ovf diff --git a/scripts/build-vmware-ova b/scripts/build-vmware-ova deleted file mode 100755 index c0e85cdc..00000000 --- a/scripts/build-vmware-ova +++ /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-vmware-ovf -# Purpose: -# Build VyOS OVF 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 - -export PACKER_BUILD_DIR=packer_build -export PACKER_LOG_PATH=${PACKER_BUILD_DIR}/build_vmware_ovf.log -export PACKER_LOG=1 - -mkdir -p ${PACKER_BUILD_DIR} -DST_DIR=${PACKER_BUILD_DIR}/vmware - -packer build -only=vmware-image scripts/packer.json - -# Convert raw image to VMDK -source_image=${DST_DIR}/vyos_vmware_image.img -tmp_vmdk=${DST_DIR}/tmp.vmdk -vmdk=${DST_DIR}/vyos_vmware_image.vmdk -ovf=${DST_DIR}/vyos_vmware_image.ovf -qemu-img convert -f raw ${source_image} -O vmdk -o adapter_type=lsilogic ${tmp_vmdk} -vmdk-convert ${tmp_vmdk} ${vmdk} - -# Generate OVF -echo 'Generating OVF file...' -vmdk_file_size=$(du --bytes ${vmdk} | cut -f1) -vmdk_populated_size=$(vmdk-convert -i ${vmdk} | jq .used) -version=$(cat build/version) -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 -cd ${DST_DIR} -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" directory in repository root, or set PRIVATE_KEY_PATH to environment variables.' - exit 1 -fi -ovftool --privateKey=${PRIVATE_KEY_PATH} vyos_vmware_image.ovf vyos_vmware_image.ova -- cgit v1.2.3 From 6b9627e678f587a556a578b6f7b838e3f193ffdb Mon Sep 17 00:00:00 2001 From: Yuya Kusakabe Date: Tue, 8 Mar 2016 13:46:08 +0900 Subject: Add how to build VM images to README.md (ref T14). --- README.md | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ea88d028..32b44a98 100644 --- a/README.md +++ b/README.md @@ -52,11 +52,32 @@ Individual packages may have other build dependencies. If some packages are miss Before you can build an image, you need to configure your build. To build an image, use the following commands: - ./configure - make iso + +``` +./configure +make iso +``` The ./configure script has a number of options that you can see by calling it with --help +## Building the images for virtualization platforms + +* QEMU + +Run following command after building the ISO image. + +``` +make qemu +``` + +* VMware + +Run following command after building the QEMU image. + +``` +make vmware +``` + # Development process ## git branches -- cgit v1.2.3 From dfd4089b97cdd767b4fb0ccc53aac95cb61fa087 Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Fri, 11 Mar 2016 06:02:56 -0500 Subject: Include non-free firmware in the image (ref T15). --- .../hooks/13-firmware-linux-nonfree.chroot | 6 +++++ .../live-build-config/hooks/13-sources_list.chroot | 4 ---- data/live-build-config/hooks/14-fuse.chroot | 4 ---- .../live-build-config/hooks/14-sources_list.chroot | 4 ++++ data/live-build-config/hooks/15-fuse.chroot | 4 ++++ .../hooks/15-gen_initramfs.chroot | 4 ---- .../hooks/16-disable_services.chroot | 27 ---------------------- .../hooks/16-gen_initramfs.chroot | 4 ++++ .../hooks/17-disable_services.chroot | 27 ++++++++++++++++++++++ .../hooks/17-kernel_symlinks.chroot | 6 ----- .../hooks/18-kernel_symlinks.chroot | 6 +++++ 11 files changed, 51 insertions(+), 45 deletions(-) create mode 100755 data/live-build-config/hooks/13-firmware-linux-nonfree.chroot delete mode 100755 data/live-build-config/hooks/13-sources_list.chroot delete mode 100755 data/live-build-config/hooks/14-fuse.chroot create mode 100755 data/live-build-config/hooks/14-sources_list.chroot create mode 100755 data/live-build-config/hooks/15-fuse.chroot delete mode 100755 data/live-build-config/hooks/15-gen_initramfs.chroot delete mode 100755 data/live-build-config/hooks/16-disable_services.chroot create mode 100755 data/live-build-config/hooks/16-gen_initramfs.chroot create mode 100755 data/live-build-config/hooks/17-disable_services.chroot delete mode 100755 data/live-build-config/hooks/17-kernel_symlinks.chroot create mode 100755 data/live-build-config/hooks/18-kernel_symlinks.chroot diff --git a/data/live-build-config/hooks/13-firmware-linux-nonfree.chroot b/data/live-build-config/hooks/13-firmware-linux-nonfree.chroot new file mode 100755 index 00000000..3cb7dc6b --- /dev/null +++ b/data/live-build-config/hooks/13-firmware-linux-nonfree.chroot @@ -0,0 +1,6 @@ +#!/bin/sh + +cp /etc/apt/sources.list /etc/apt/sources.list.d/non-free.list +sed -i 's/main/non-free/g' /etc/apt/sources.list.d/non-free.list +apt-get update +apt-get -y install firmware-linux-nonfree diff --git a/data/live-build-config/hooks/13-sources_list.chroot b/data/live-build-config/hooks/13-sources_list.chroot deleted file mode 100755 index 956f9bba..00000000 --- a/data/live-build-config/hooks/13-sources_list.chroot +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -rm -f /etc/apt/sources.list.d/*.list >/dev/null 2>&1 || true - diff --git a/data/live-build-config/hooks/14-fuse.chroot b/data/live-build-config/hooks/14-fuse.chroot deleted file mode 100755 index 126dc626..00000000 --- a/data/live-build-config/hooks/14-fuse.chroot +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -sed -i 's/#user_allow_other/user_allow_other/g' /etc/fuse.conf -chmod a+r /etc/fuse.conf diff --git a/data/live-build-config/hooks/14-sources_list.chroot b/data/live-build-config/hooks/14-sources_list.chroot new file mode 100755 index 00000000..956f9bba --- /dev/null +++ b/data/live-build-config/hooks/14-sources_list.chroot @@ -0,0 +1,4 @@ +#!/bin/sh + +rm -f /etc/apt/sources.list.d/*.list >/dev/null 2>&1 || true + diff --git a/data/live-build-config/hooks/15-fuse.chroot b/data/live-build-config/hooks/15-fuse.chroot new file mode 100755 index 00000000..126dc626 --- /dev/null +++ b/data/live-build-config/hooks/15-fuse.chroot @@ -0,0 +1,4 @@ +#!/bin/sh + +sed -i 's/#user_allow_other/user_allow_other/g' /etc/fuse.conf +chmod a+r /etc/fuse.conf diff --git a/data/live-build-config/hooks/15-gen_initramfs.chroot b/data/live-build-config/hooks/15-gen_initramfs.chroot deleted file mode 100755 index aced728a..00000000 --- a/data/live-build-config/hooks/15-gen_initramfs.chroot +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -echo I: Create initramfs if it does not exist. -update-initramfs -c -k `ls /boot | grep vmlinuz- | sed 's/vmlinuz-//g'` diff --git a/data/live-build-config/hooks/16-disable_services.chroot b/data/live-build-config/hooks/16-disable_services.chroot deleted file mode 100755 index c68a6b3d..00000000 --- a/data/live-build-config/hooks/16-disable_services.chroot +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh - -echo I: Disabling services. -systemctl disable exim4 -/usr/sbin/update-rc.d -f exim4 remove -systemctl disable isc-dhcp-server -/usr/sbin/update-rc.d -f isc-dhcp-server remove -systemctl disable isc-dhcp-relay -/usr/sbin/update-rc.d -f isc-dhcp-relay remove -systemctl disable nfacctd -/usr/sbin/update-rc.d -f nfacctd remove -systemctl disable pmacctd -/usr/sbin/update-rc.d -f pmacctd remove -systemctl disable sfacctd -/usr/sbin/update-rc.d -f sfacctd remove -systemctl disable uacctd -/usr/sbin/update-rc.d -f uacctd remove -systemctl disable lighttpd -/usr/sbin/update-rc.d -f lighttpd remove -systemctl disable ssh -/usr/sbin/update-rc.d -f ssh remove -systemctl disable openvpn -/usr/sbin/update-rc.d -f openvpn remove -systemctl disable dnsmasq -/usr/sbin/update-rc.d -f dnsmasq remove -systemctl disable lldpd -/usr/sbin/update-rc.d -f lldpd remove diff --git a/data/live-build-config/hooks/16-gen_initramfs.chroot b/data/live-build-config/hooks/16-gen_initramfs.chroot new file mode 100755 index 00000000..aced728a --- /dev/null +++ b/data/live-build-config/hooks/16-gen_initramfs.chroot @@ -0,0 +1,4 @@ +#!/bin/sh + +echo I: Create initramfs if it does not exist. +update-initramfs -c -k `ls /boot | grep vmlinuz- | sed 's/vmlinuz-//g'` diff --git a/data/live-build-config/hooks/17-disable_services.chroot b/data/live-build-config/hooks/17-disable_services.chroot new file mode 100755 index 00000000..c68a6b3d --- /dev/null +++ b/data/live-build-config/hooks/17-disable_services.chroot @@ -0,0 +1,27 @@ +#!/bin/sh + +echo I: Disabling services. +systemctl disable exim4 +/usr/sbin/update-rc.d -f exim4 remove +systemctl disable isc-dhcp-server +/usr/sbin/update-rc.d -f isc-dhcp-server remove +systemctl disable isc-dhcp-relay +/usr/sbin/update-rc.d -f isc-dhcp-relay remove +systemctl disable nfacctd +/usr/sbin/update-rc.d -f nfacctd remove +systemctl disable pmacctd +/usr/sbin/update-rc.d -f pmacctd remove +systemctl disable sfacctd +/usr/sbin/update-rc.d -f sfacctd remove +systemctl disable uacctd +/usr/sbin/update-rc.d -f uacctd remove +systemctl disable lighttpd +/usr/sbin/update-rc.d -f lighttpd remove +systemctl disable ssh +/usr/sbin/update-rc.d -f ssh remove +systemctl disable openvpn +/usr/sbin/update-rc.d -f openvpn remove +systemctl disable dnsmasq +/usr/sbin/update-rc.d -f dnsmasq remove +systemctl disable lldpd +/usr/sbin/update-rc.d -f lldpd remove diff --git a/data/live-build-config/hooks/17-kernel_symlinks.chroot b/data/live-build-config/hooks/17-kernel_symlinks.chroot deleted file mode 100755 index e63ca263..00000000 --- a/data/live-build-config/hooks/17-kernel_symlinks.chroot +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -echo I: Creating kernel symlinks. -cd /boot -ln -s initrd.img-* initrd.img -ln -s vmlinuz-* vmlinuz diff --git a/data/live-build-config/hooks/18-kernel_symlinks.chroot b/data/live-build-config/hooks/18-kernel_symlinks.chroot new file mode 100755 index 00000000..e63ca263 --- /dev/null +++ b/data/live-build-config/hooks/18-kernel_symlinks.chroot @@ -0,0 +1,6 @@ +#!/bin/sh + +echo I: Creating kernel symlinks. +cd /boot +ln -s initrd.img-* initrd.img +ln -s vmlinuz-* vmlinuz -- cgit v1.2.3 From 95a28fe8b63ea97409ff6336f1b3ca419bac9961 Mon Sep 17 00:00:00 2001 From: Kim Date: Mon, 21 Mar 2016 11:54:39 +0100 Subject: update kernel package version --- scripts/live-build-config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/live-build-config b/scripts/live-build-config index dac8c27c..52660571 100755 --- a/scripts/live-build-config +++ b/scripts/live-build-config @@ -36,7 +36,7 @@ lb config noauto \ --architectures {{architecture}} \ --bootappend-live "boot=live components hostname=vyos username=live nopersistence noautologin nonetworking union=overlay" \ --linux-flavours {{architecture}}-vyos \ - --linux-packages linux-image-4.4.1 \ + --linux-packages linux-image-4.4.5 \ --bootloader syslinux \ --binary-images iso-hybrid \ --debian-installer false \ -- cgit v1.2.3 From b1e716208f9fb92966bda9b7425d6f67911105e4 Mon Sep 17 00:00:00 2001 From: Yuya Kusakabe Date: Sat, 26 Mar 2016 23:23:36 +0900 Subject: remove installing open-vm-tools process from build-vmware-image --- scripts/build-vmware-image | 12 ++++-------- scripts/packer.json | 2 +- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/scripts/build-vmware-image b/scripts/build-vmware-image index 189461eb..e665e0b5 100755 --- a/scripts/build-vmware-image +++ b/scripts/build-vmware-image @@ -14,9 +14,9 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . # -# File: build-vmware-ovf +# File: build-vmware-image # Purpose: -# Build VyOS OVF for VMware. +# Build VyOS OVA and OVF 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." @@ -33,16 +33,12 @@ else fi export PACKER_BUILD_DIR=packer_build -export PACKER_LOG_PATH=${PACKER_BUILD_DIR}/build_vmware_ovf.log -export PACKER_LOG=1 -mkdir -p ${PACKER_BUILD_DIR} DST_DIR=${PACKER_BUILD_DIR}/vmware - -packer build -only=vmware-image scripts/packer.json +mkdir -p ${DST_DIR} # Convert raw image to VMDK -source_image=${DST_DIR}/vyos_vmware_image.img +source_image=${PACKER_BUILD_DIR}/qemu/vyos_qemu_image.img tmp_vmdk=${DST_DIR}/tmp.vmdk vmdk=${DST_DIR}/vyos_vmware_image.vmdk ovf=${DST_DIR}/vyos_vmware_image.ovf diff --git a/scripts/packer.json b/scripts/packer.json index 52b0b284..b09b9834 100644 --- a/scripts/packer.json +++ b/scripts/packer.json @@ -46,7 +46,7 @@ "", "reboot", "Yes", - "vyos", + "vyos", "vyos", "configure", "set interface ethernet eth0 address dhcp", -- cgit v1.2.3 From f349c98d9a5d66fd9f39d59af159e994fc48c8f4 Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Sun, 27 Mar 2016 16:16:11 -0400 Subject: add vyos-remove package and remove ddclient dhclient hook --- .../hooks/13-firmware-linux-nonfree.chroot | 6 ----- .../live-build-config/hooks/13-vyos_replace.chroot | 3 +++ .../hooks/14-firmware-linux-nonfree.chroot | 6 +++++ .../live-build-config/hooks/14-sources_list.chroot | 4 ---- data/live-build-config/hooks/15-fuse.chroot | 4 ---- .../live-build-config/hooks/15-sources_list.chroot | 4 ++++ data/live-build-config/hooks/16-fuse.chroot | 4 ++++ .../hooks/16-gen_initramfs.chroot | 4 ---- .../hooks/17-disable_services.chroot | 27 ---------------------- .../hooks/17-gen_initramfs.chroot | 4 ++++ .../hooks/18-disable_services.chroot | 27 ++++++++++++++++++++++ .../hooks/18-kernel_symlinks.chroot | 6 ----- .../hooks/19-kernel_symlinks.chroot | 6 +++++ .../hooks/20-rm_ddclient_hook.chroot | 3 +++ 14 files changed, 57 insertions(+), 51 deletions(-) delete mode 100755 data/live-build-config/hooks/13-firmware-linux-nonfree.chroot create mode 100755 data/live-build-config/hooks/13-vyos_replace.chroot create mode 100755 data/live-build-config/hooks/14-firmware-linux-nonfree.chroot delete mode 100755 data/live-build-config/hooks/14-sources_list.chroot delete mode 100755 data/live-build-config/hooks/15-fuse.chroot create mode 100755 data/live-build-config/hooks/15-sources_list.chroot create mode 100755 data/live-build-config/hooks/16-fuse.chroot delete mode 100755 data/live-build-config/hooks/16-gen_initramfs.chroot delete mode 100755 data/live-build-config/hooks/17-disable_services.chroot create mode 100755 data/live-build-config/hooks/17-gen_initramfs.chroot create mode 100755 data/live-build-config/hooks/18-disable_services.chroot delete mode 100755 data/live-build-config/hooks/18-kernel_symlinks.chroot create mode 100755 data/live-build-config/hooks/19-kernel_symlinks.chroot create mode 100755 data/live-build-config/hooks/20-rm_ddclient_hook.chroot diff --git a/data/live-build-config/hooks/13-firmware-linux-nonfree.chroot b/data/live-build-config/hooks/13-firmware-linux-nonfree.chroot deleted file mode 100755 index 3cb7dc6b..00000000 --- a/data/live-build-config/hooks/13-firmware-linux-nonfree.chroot +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -cp /etc/apt/sources.list /etc/apt/sources.list.d/non-free.list -sed -i 's/main/non-free/g' /etc/apt/sources.list.d/non-free.list -apt-get update -apt-get -y install firmware-linux-nonfree diff --git a/data/live-build-config/hooks/13-vyos_replace.chroot b/data/live-build-config/hooks/13-vyos_replace.chroot new file mode 100755 index 00000000..dcb00ff6 --- /dev/null +++ b/data/live-build-config/hooks/13-vyos_replace.chroot @@ -0,0 +1,3 @@ +#!/bin/sh + +apt-get -y install vyos-replace diff --git a/data/live-build-config/hooks/14-firmware-linux-nonfree.chroot b/data/live-build-config/hooks/14-firmware-linux-nonfree.chroot new file mode 100755 index 00000000..3cb7dc6b --- /dev/null +++ b/data/live-build-config/hooks/14-firmware-linux-nonfree.chroot @@ -0,0 +1,6 @@ +#!/bin/sh + +cp /etc/apt/sources.list /etc/apt/sources.list.d/non-free.list +sed -i 's/main/non-free/g' /etc/apt/sources.list.d/non-free.list +apt-get update +apt-get -y install firmware-linux-nonfree diff --git a/data/live-build-config/hooks/14-sources_list.chroot b/data/live-build-config/hooks/14-sources_list.chroot deleted file mode 100755 index 956f9bba..00000000 --- a/data/live-build-config/hooks/14-sources_list.chroot +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -rm -f /etc/apt/sources.list.d/*.list >/dev/null 2>&1 || true - diff --git a/data/live-build-config/hooks/15-fuse.chroot b/data/live-build-config/hooks/15-fuse.chroot deleted file mode 100755 index 126dc626..00000000 --- a/data/live-build-config/hooks/15-fuse.chroot +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -sed -i 's/#user_allow_other/user_allow_other/g' /etc/fuse.conf -chmod a+r /etc/fuse.conf diff --git a/data/live-build-config/hooks/15-sources_list.chroot b/data/live-build-config/hooks/15-sources_list.chroot new file mode 100755 index 00000000..956f9bba --- /dev/null +++ b/data/live-build-config/hooks/15-sources_list.chroot @@ -0,0 +1,4 @@ +#!/bin/sh + +rm -f /etc/apt/sources.list.d/*.list >/dev/null 2>&1 || true + diff --git a/data/live-build-config/hooks/16-fuse.chroot b/data/live-build-config/hooks/16-fuse.chroot new file mode 100755 index 00000000..126dc626 --- /dev/null +++ b/data/live-build-config/hooks/16-fuse.chroot @@ -0,0 +1,4 @@ +#!/bin/sh + +sed -i 's/#user_allow_other/user_allow_other/g' /etc/fuse.conf +chmod a+r /etc/fuse.conf diff --git a/data/live-build-config/hooks/16-gen_initramfs.chroot b/data/live-build-config/hooks/16-gen_initramfs.chroot deleted file mode 100755 index aced728a..00000000 --- a/data/live-build-config/hooks/16-gen_initramfs.chroot +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -echo I: Create initramfs if it does not exist. -update-initramfs -c -k `ls /boot | grep vmlinuz- | sed 's/vmlinuz-//g'` diff --git a/data/live-build-config/hooks/17-disable_services.chroot b/data/live-build-config/hooks/17-disable_services.chroot deleted file mode 100755 index c68a6b3d..00000000 --- a/data/live-build-config/hooks/17-disable_services.chroot +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh - -echo I: Disabling services. -systemctl disable exim4 -/usr/sbin/update-rc.d -f exim4 remove -systemctl disable isc-dhcp-server -/usr/sbin/update-rc.d -f isc-dhcp-server remove -systemctl disable isc-dhcp-relay -/usr/sbin/update-rc.d -f isc-dhcp-relay remove -systemctl disable nfacctd -/usr/sbin/update-rc.d -f nfacctd remove -systemctl disable pmacctd -/usr/sbin/update-rc.d -f pmacctd remove -systemctl disable sfacctd -/usr/sbin/update-rc.d -f sfacctd remove -systemctl disable uacctd -/usr/sbin/update-rc.d -f uacctd remove -systemctl disable lighttpd -/usr/sbin/update-rc.d -f lighttpd remove -systemctl disable ssh -/usr/sbin/update-rc.d -f ssh remove -systemctl disable openvpn -/usr/sbin/update-rc.d -f openvpn remove -systemctl disable dnsmasq -/usr/sbin/update-rc.d -f dnsmasq remove -systemctl disable lldpd -/usr/sbin/update-rc.d -f lldpd remove diff --git a/data/live-build-config/hooks/17-gen_initramfs.chroot b/data/live-build-config/hooks/17-gen_initramfs.chroot new file mode 100755 index 00000000..aced728a --- /dev/null +++ b/data/live-build-config/hooks/17-gen_initramfs.chroot @@ -0,0 +1,4 @@ +#!/bin/sh + +echo I: Create initramfs if it does not exist. +update-initramfs -c -k `ls /boot | grep vmlinuz- | sed 's/vmlinuz-//g'` diff --git a/data/live-build-config/hooks/18-disable_services.chroot b/data/live-build-config/hooks/18-disable_services.chroot new file mode 100755 index 00000000..c68a6b3d --- /dev/null +++ b/data/live-build-config/hooks/18-disable_services.chroot @@ -0,0 +1,27 @@ +#!/bin/sh + +echo I: Disabling services. +systemctl disable exim4 +/usr/sbin/update-rc.d -f exim4 remove +systemctl disable isc-dhcp-server +/usr/sbin/update-rc.d -f isc-dhcp-server remove +systemctl disable isc-dhcp-relay +/usr/sbin/update-rc.d -f isc-dhcp-relay remove +systemctl disable nfacctd +/usr/sbin/update-rc.d -f nfacctd remove +systemctl disable pmacctd +/usr/sbin/update-rc.d -f pmacctd remove +systemctl disable sfacctd +/usr/sbin/update-rc.d -f sfacctd remove +systemctl disable uacctd +/usr/sbin/update-rc.d -f uacctd remove +systemctl disable lighttpd +/usr/sbin/update-rc.d -f lighttpd remove +systemctl disable ssh +/usr/sbin/update-rc.d -f ssh remove +systemctl disable openvpn +/usr/sbin/update-rc.d -f openvpn remove +systemctl disable dnsmasq +/usr/sbin/update-rc.d -f dnsmasq remove +systemctl disable lldpd +/usr/sbin/update-rc.d -f lldpd remove diff --git a/data/live-build-config/hooks/18-kernel_symlinks.chroot b/data/live-build-config/hooks/18-kernel_symlinks.chroot deleted file mode 100755 index e63ca263..00000000 --- a/data/live-build-config/hooks/18-kernel_symlinks.chroot +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -echo I: Creating kernel symlinks. -cd /boot -ln -s initrd.img-* initrd.img -ln -s vmlinuz-* vmlinuz diff --git a/data/live-build-config/hooks/19-kernel_symlinks.chroot b/data/live-build-config/hooks/19-kernel_symlinks.chroot new file mode 100755 index 00000000..e63ca263 --- /dev/null +++ b/data/live-build-config/hooks/19-kernel_symlinks.chroot @@ -0,0 +1,6 @@ +#!/bin/sh + +echo I: Creating kernel symlinks. +cd /boot +ln -s initrd.img-* initrd.img +ln -s vmlinuz-* vmlinuz diff --git a/data/live-build-config/hooks/20-rm_ddclient_hook.chroot b/data/live-build-config/hooks/20-rm_ddclient_hook.chroot new file mode 100755 index 00000000..173b4e5c --- /dev/null +++ b/data/live-build-config/hooks/20-rm_ddclient_hook.chroot @@ -0,0 +1,3 @@ +#!/bin/sh + +rm -f /etc/dhcp/dhclient-exit-hooks.d/ddclient -- cgit v1.2.3 From 6686f05a1cda18c70525837a2dc95431ad5306cd Mon Sep 17 00:00:00 2001 From: Yuya Kusakabe Date: Thu, 31 Mar 2016 14:12:00 +0900 Subject: Change vm disk type from IDE to SCSI (ref T14). --- scripts/template.ovf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/template.ovf b/scripts/template.ovf index b7c9aa32..f3624339 100644 --- a/scripts/template.ovf +++ b/scripts/template.ovf @@ -78,7 +78,7 @@ disk0 ovf:/disk/vmdisk1 7 - 4 + 3 17 -- cgit v1.2.3