config 4.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. # vim: filetype=yaml sw=2
  2. filename: 'container-image_[% c("var/container/suite") %]-[% c("var/container/arch") %]-[% c("version") %].tar.gz'
  3. version: 2
  4. pkg_type: build
  5. var:
  6. ubuntu_version: 18.04.1
  7. container:
  8. use_container: 1
  9. # We need CAP_SYS_ADMIN for debootstrap to work
  10. CAP_SYS_ADMIN: 1
  11. pre: |
  12. #!/bin/sh
  13. set -e
  14. export DEBIAN_FRONTEND=noninteractive
  15. # Bug 29158: install fixed packages for apt vulnerability (CVE-2019-3462)
  16. dpkg -i ./apt_1.6.6ubuntu0.1_amd64.deb ./libapt-pkg5.0_1.6.6ubuntu0.1_amd64.deb
  17. apt-get update -y -q
  18. apt-get install -y -q debian-archive-keyring ubuntu-keyring debootstrap
  19. debootstrap --arch=[% c("var/container/arch") %] [% c("var/container/debootstrap_opt") %] [% c("var/container/suite") %] base-image [% c("var/container/debootstrap_mirror") %]
  20. [% IF c("var/apt_package_filename") || c("var/apt_utils_package_filename") || c("var/libapt_inst_package_filename") || c("var/libapt_pkg_package_filename") -%]
  21. mkdir ./base-image/apt-update
  22. mv [% c("var/apt_package_filename") %] [% c("var/apt_utils_package_filename") %] \
  23. [% c("var/libapt_inst_package_filename") %] [% c("var/libapt_pkg_package_filename") %] \
  24. ./base-image/apt-update
  25. mount proc ./base-image/proc -t proc
  26. mount sysfs ./base-image/sys -t sysfs
  27. chroot ./base-image dpkg -i -R /apt-update
  28. umount ./base-image/proc
  29. umount ./base-image/sys
  30. [% END -%]
  31. [% IF c("var/minimal_apt_version") -%]
  32. apt_version=$(dpkg --admindir=$(pwd)/base-image/var/lib/dpkg -s apt | grep '^Version: ' | cut -d ' ' -f 2)
  33. echo "apt version: $apt_version"
  34. dpkg --compare-versions "$apt_version" ge '[% c("var/minimal_apt_version") %]'
  35. [% END -%]
  36. tar -C ./base-image -czf [% dest_dir %]/[% c("filename") %] .
  37. targets:
  38. wheezy-amd64:
  39. var:
  40. minimal_apt_version: '0.9.7.9+deb7u8'
  41. # https://deb.freexian.com/extended-lts/updates/ela-76-1-apt/
  42. apt_packages_baseurl: http://deb.freexian.com/extended-lts/pool/main/a/apt
  43. apt_package_filename: apt_0.9.7.9+deb7u8_amd64.deb
  44. apt_package_sha256sum: 83dcdb3f9c11df28b30b85bbb9dec341effbf36ee881a04dece3390082080761
  45. apt_utils_package_filename: apt-utils_0.9.7.9+deb7u8_amd64.deb
  46. apt_utils_package_sha256sum: 91a4d0ec92a32f13e3acb37f71546d48c51a0df25f3b9eb6a96b73dfc93a11ed
  47. libapt_inst_package_filename: libapt-inst1.5_0.9.7.9+deb7u8_amd64.deb
  48. libapt_inst_package_sha256sum: 181c9c21e1b33496b251fc76ba8ed04acbb8e23006909d27795bbc287eddd027
  49. libapt_pkg_package_filename: libapt-pkg4.12_0.9.7.9+deb7u8_amd64.deb
  50. libapt_pkg_package_sha256sum: b360dfb5a65ac2f7b81a2551d8a520ba2265785537d6d669869a159888b81999
  51. container:
  52. suite: wheezy
  53. arch: amd64
  54. debootstrap_mirror: "http://archive.debian.org/debian/"
  55. stretch-amd64:
  56. var:
  57. minimal_apt_version: 1.4.9
  58. container:
  59. suite: stretch
  60. arch: amd64
  61. stretch-i386:
  62. var:
  63. minimal_apt_version: 1.4.9
  64. container:
  65. suite: stretch
  66. arch: i386
  67. input_files:
  68. - URL: 'http://cdimage.ubuntu.com/ubuntu-base/releases/[% c("var/ubuntu_version") %]/release/ubuntu-base-[% c("var/ubuntu_version") %]-base-amd64.tar.gz'
  69. filename: 'container-image_ubuntu-base-[% c("var/ubuntu_version") %]-base-amd64.tar.gz'
  70. sha256sum: ed76e649f65548a80b361b68011085ec4dde7bb762d667657acbef87765e1a12
  71. - URL: http://security.ubuntu.com/ubuntu/pool/main/a/apt/apt_1.6.6ubuntu0.1_amd64.deb
  72. sha256sum: df210f9e30cf9deba5fbe815203af854e5e77bdbbe0b96d0d1c0da46a6a8dd0a
  73. - URL: http://security.ubuntu.com/ubuntu/pool/main/a/apt/libapt-pkg5.0_1.6.6ubuntu0.1_amd64.deb
  74. sha256sum: 0a05a97b1e9b8d52ee8df040a14c5fabdebbb2c2235ac495db29df34f4c8cec3
  75. - URL: '[% c("var/apt_packages_baseurl") %]/[% c("var/apt_package_filename") %]'
  76. sha256sum: '[% c("var/apt_package_sha256sum") %]'
  77. enable: '[% c("var/apt_package_filename") %]'
  78. - URL: '[% c("var/apt_packages_baseurl") %]/[% c("var/apt_utils_package_filename") %]'
  79. sha256sum: '[% c("var/apt_utils_package_sha256sum") %]'
  80. enable: '[% c("var/apt_utils_package_filename") %]'
  81. - URL: '[% c("var/apt_packages_baseurl") %]/[% c("var/libapt_inst_package_filename") %]'
  82. sha256sum: '[% c("var/libapt_inst_package_sha256sum") %]'
  83. enable: '[% c("var/libapt_inst_package_filename") %]'
  84. - URL: '[% c("var/apt_packages_baseurl") %]/[% c("var/libapt_pkg_package_filename") %]'
  85. sha256sum: '[% c("var/libapt_pkg_package_sha256sum") %]'
  86. enable: '[% c("var/libapt_pkg_package_filename") %]'