From 43dcf1b4db0f5bd92440d5c073e16907a3c0d82a Mon Sep 17 00:00:00 2001 From: Jan-Simon Möller Date: Wed, 2 Dec 2020 18:32:04 +0100 Subject: Uprev builder configuration to 18.04 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I93101d81827d9751797a96b130db979f05da86d0 Signed-off-by: Jan-Simon Möller --- packer/local_packer_run.sh | 4 +- packer/provision/agl_dependencies.sh | 28 +++----- packer/provision/baseline.sh | 7 ++ packer/templates/basebuild-local-kvm.json | 116 ++++++++++++++---------------- 4 files changed, 72 insertions(+), 83 deletions(-) (limited to 'packer') diff --git a/packer/local_packer_run.sh b/packer/local_packer_run.sh index d947c3cf..b5e9a160 100755 --- a/packer/local_packer_run.sh +++ b/packer/local_packer_run.sh @@ -1,2 +1,4 @@ #!/bin/bash -packer build -var-file=vars/lava-env.json -var-file=vars/ubuntu-16.04.json -var-file=vars/cloud-env.json templates/basebuild-local-kvm.json +packer fix -var-file=vars/ubuntu-16.04.json -var-file=vars/cloud-env.json templates/basebuild-local-kvm.json > templates/basebuild-local-kvm-new.json +mv templates/basebuild-local-kvm-new.json templates/basebuild-local-kvm.json +packer build -var-file=vars/ubuntu-16.04.json -var-file=vars/cloud-env.json templates/basebuild-local-kvm.json diff --git a/packer/provision/agl_dependencies.sh b/packer/provision/agl_dependencies.sh index 433ab7fd..251d5b2c 100644 --- a/packer/provision/agl_dependencies.sh +++ b/packer/provision/agl_dependencies.sh @@ -24,6 +24,8 @@ cat /etc/apt/sources.list DEBIAN_FRONTEND=noninteractive apt-get update && apt-get -y -u dist-upgrade +DEBIAN_FRONTEND=noninteractive dpkg --configure -a + DEBIAN_FRONTEND=noninteractive apt-get update && \ apt-get -y install gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential chrpath socat \ libsdl1.2-dev xterm make xsltproc docbook-utils fop dblatex xmlto autoconf automake \ @@ -31,7 +33,7 @@ DEBIAN_FRONTEND=noninteractive apt-get update && \ tree rsync python-yaml python-requests curl tar docker.io pandoc python3 \ ruby-all-dev ruby-ffi ruby-ffi-* jekyll ruby-redcarpet mkdocs \ python-pip python-simplejson g++-multilib make zip unzip iperf3 \ - debian-keyring debian-archive-keyring python3-yaml python3-pip + debian-keyring debian-archive-keyring python3-yaml python3-pip python-pip # Adding stretch-backports for lavacli echo "deb https://apt.lavasoftware.org/release stretch-backports main" >> /etc/apt/sources.list @@ -97,28 +99,16 @@ gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB8 mkdir -p /opt/AGL cd /opt/AGL/ -#mkdir webdocs -#cd webdocs -#git clone http://github.com/iotbzh/webdocs-tools -#git clone http://github.com/iotbzh/webdocs-sample -git clone https://github.com/automotive-grade-linux/docs-agl - -cd ./docs-agl/doctools/webdocs/ -npm install -#gem install --no-user-install -V kramdown -#gem install --no-user-install -V jekyll-plantuml - -#gem install --no-user-install -V --version 3.1.6 jekyll -#gem install --no-user-install -V --version 1.13.1 kramdown -### hope that is enough -################### SDX181207 } - (closing brace) +git clone https://git.automotivelinux.org/AGL/documentation +cd documentation +sudo pip3 install -r requirements.txt # ruby markdown linter -sudo gem install mdl +#sudo gem install mdl # python markdown linter -sudo pip install mdlint +sudo pip3 install mdlint # releng-scripts needs latest (stable v2.9) jinja2 sudo pip install --force-reinstall --ignore-installed jinja2 @@ -136,7 +126,7 @@ sudo pip3 show jinja2 . /etc/os-release wget -O - "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x52B59B1571A79DBC054901C0F6BC817356A3D45E" | sudo apt-key add - sudo bash -c "cat >> /etc/apt/sources.list.d/golang.list < printing sources.list <---" + sed -i -e "s#xenial#bionic#g" /etc/apt/sources.list + + echo "---> printing sources.list <---" + cat /etc/apt/sources.list + echo "---> printing sources.list <---" + + echo "---> printing resolv.conf <---" cat /etc/resolv.conf || true echo "---> printing resolv.conf <---" diff --git a/packer/templates/basebuild-local-kvm.json b/packer/templates/basebuild-local-kvm.json index 2f77dd44..83875cdc 100644 --- a/packer/templates/basebuild-local-kvm.json +++ b/packer/templates/basebuild-local-kvm.json @@ -1,88 +1,78 @@ { - "variables": { - "stack_tenant": "ubuntu", - "stack_user": "ubuntu", - "stack_pass": "ubuntu", - "stack_network": "none", - - "base_image": null, - "cloud_user": "ubuntu", - "distro": null, - "cloud_user_data": null - }, "builders": [ -{ - "type": "qemu", - "iso_url": "http://releases.ubuntu.com/16.04/ubuntu-16.04.6-server-amd64.iso", - "iso_checksum": "ac8a79a86a905ebdc3ef3f5dd16b7360", - "iso_checksum_type": "md5", - - "output_directory": "output_ubuntu", - - "disk_size": 20000, + { + "accelerator": "kvm", + "boot_command": [ + "", + "/install/vmlinuz url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ", + "debian-installer=en_US auto locale=en_US kbd-chooser/method=us ", + "hostname=jenkinstest ", + "keyboard-configuration/modelcode=SKIP ", + "keyboard-configuration/layout=USA ", + "keyboard-configuration/variant=USA ", + "passwd/user-fullname=ubuntu ", + "passwd/user-password-again=ubuntu ", + "passwd/user-password=ubuntu ", + "passwd/username=ubuntu ", + "initrd=/install/initrd.gz -- " + ], + "boot_wait": "5s", + "disk_interface": "virtio", "format": "qcow2", "headless": true, - "accelerator": "kvm", - + "disk_size": "20480", "http_directory": "httpdir", - "http_port_min": 10082, "http_port_max": 10089, - "ssh_host_port_min": 2222, - "ssh_host_port_max": 2229, - "ssh_username": "ubuntu", + "http_port_min": 10082, + "iso_checksum": "md5:9bb30a2ea6466b0c02aacfa96f6e3516", + "iso_url": "http://releases.ubuntu.com/16.04/ubuntu-16.04.7-server-amd64.iso", + "net_device": "virtio-net", + "output_directory": "output_ubuntu", "ssh_password": "ubuntu", "ssh_port": 22, - "ssh_wait_timeout": "11m", - - "vm_name": "jenkins-new-test", - "net_device": "virtio-net", - "disk_interface": "virtio", - "boot_wait": "5s", - - "boot_command": [ - "", - "/install/vmlinuz url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ", - "debian-installer=en_US auto locale=en_US kbd-chooser/method=us ", - "hostname=jenkinstest ", - - "keyboard-configuration/modelcode=SKIP ", - "keyboard-configuration/layout=USA ", - "keyboard-configuration/variant=USA ", - - "passwd/user-fullname=ubuntu ", - "passwd/user-password-again=ubuntu ", - "passwd/user-password=ubuntu ", - "passwd/username=ubuntu ", - - "initrd=/install/initrd.gz -- " - ] - + "ssh_timeout": "11m", + "ssh_username": "ubuntu", + "type": "qemu", + "vm_name": "jenkins-new-test" } ], "provisioners": [ { - "type": "shell", - "inline": ["mkdir -p /tmp/packer"] + "inline": [ + "mkdir -p /tmp/packer" + ], + "type": "shell" }, { - "type": "file", + "destination": "/tmp/packer", "source": "provision/basebuild/", - "destination": "/tmp/packer" + "type": "file" }, { - "type": "shell", + "environment_vars": [ + "LAVAHOST={{user `lavahost`}}", + "LAVAUSER={{user `lavauser`}}", + "LAVATOKEN={{user `lavatoken`}}" + ], + "execute_command": "chmod +x {{ .Path }}; if [ \"$UID\" == \"0\" ]; then {{ .Vars }} '{{ .Path }}'; else echo 'ubuntu' | {{ .Vars }} sudo -S -E sh '{{ .Path }}'; fi", "scripts": [ "provision/baseline.sh", "provision/basebuild.sh", "provision/agl_dependencies.sh", "provision/system_reseal.sh" ], - "environment_vars": [ - "LAVAHOST={{user `lavahost`}}", - "LAVAUSER={{user `lavauser`}}", - "LAVATOKEN={{user `lavatoken`}}" - ], - "execute_command": "chmod +x {{ .Path }}; if [ \"$UID\" == \"0\" ]; then {{ .Vars }} '{{ .Path }}'; else echo 'ubuntu' | {{ .Vars }} sudo -S -E sh '{{ .Path }}'; fi" + "type": "shell" } - ] + ], + "variables": { + "base_image": null, + "cloud_user": "ubuntu", + "cloud_user_data": null, + "distro": null, + "stack_network": "none", + "stack_pass": "ubuntu", + "stack_tenant": "ubuntu", + "stack_user": "ubuntu" + } } + -- cgit 1.2.3-korg