kameleon-builder 2.1.3 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (185) hide show
  1. data/.editorconfig +0 -0
  2. data/.env +2 -6
  3. data/CHANGELOG.rst +74 -1
  4. data/Gemfile +20 -2
  5. data/README.rst +35 -25
  6. data/Thorfile +29 -0
  7. data/contrib/kameleon_bashrc.sh +61 -0
  8. data/contrib/polipo_env.sh +3 -2
  9. data/kameleon-builder.gemspec +3 -10
  10. data/lib/kameleon.rb +10 -14
  11. data/lib/kameleon/cli.rb +92 -105
  12. data/lib/kameleon/context.rb +76 -43
  13. data/lib/kameleon/engine.rb +147 -103
  14. data/lib/kameleon/environment.rb +10 -5
  15. data/lib/kameleon/error.rb +1 -32
  16. data/lib/kameleon/persistent_cache.rb +127 -29
  17. data/lib/kameleon/recipe.rb +63 -106
  18. data/lib/kameleon/shell.rb +32 -17
  19. data/lib/kameleon/step.rb +18 -1
  20. data/lib/kameleon/ui.rb +141 -0
  21. data/lib/kameleon/utils.rb +9 -0
  22. data/templates/{debian7-chroot.yaml → chroot/debian7-amd64.yaml} +29 -21
  23. data/templates/{docker-debian7.yaml → docker/debian7.yaml} +5 -5
  24. data/templates/extend.erb +2 -2
  25. data/templates/{debian7-g5k.yaml → grid5000/debian7.yaml} +1 -1
  26. data/templates/{archlinux-desktop.yaml → qemu/archlinux-desktop-i686.yaml} +2 -2
  27. data/templates/qemu/archlinux-desktop-x86_64.yaml +25 -0
  28. data/templates/qemu/archlinux-i686.yaml +25 -0
  29. data/templates/{archlinux.yaml → qemu/archlinux-x86_64.yaml} +37 -34
  30. data/templates/qemu/centos6.5-x86_64.yaml +113 -0
  31. data/templates/qemu/centos7-x86_64.yaml +119 -0
  32. data/templates/{debian7.yaml → qemu/debian7-amd64.yaml} +45 -40
  33. data/templates/{debian7-desktop.yaml → qemu/debian7-desktop-amd64.yaml} +2 -3
  34. data/templates/{debian7-kameleon.yaml → qemu/debian7-kameleon-amd64.yaml} +3 -6
  35. data/templates/{debian7-oar-dev.yaml → qemu/debian7-oar-amd64.yaml} +2 -2
  36. data/templates/qemu/debian8-amd64.yaml +25 -0
  37. data/templates/{fedora20-desktop.yaml → qemu/fedora20-desktop-x86_64.yaml} +2 -2
  38. data/templates/qemu/fedora20-x86_64.yaml +116 -0
  39. data/templates/{ubuntu-12.04.yaml → qemu/ubuntu-12.04-amd64.yaml} +42 -38
  40. data/templates/{ubuntu-12.04-desktop.yaml → qemu/ubuntu-12.04-desktop-amd64.yaml} +3 -3
  41. data/templates/{ubuntu-14.04.yaml → qemu/ubuntu-14.04-amd64.yaml} +2 -2
  42. data/templates/{ubuntu-14.04-desktop.yaml → qemu/ubuntu-14.04-desktop-amd64.yaml} +2 -2
  43. data/templates/steps/aliases/defaults.yaml +19 -13
  44. data/templates/steps/bootstrap/archlinux/arch_bootstrap.yaml +11 -19
  45. data/templates/steps/bootstrap/debian/debootstrap.yaml +10 -11
  46. data/templates/steps/bootstrap/debian/debootstrap_arm.yaml +11 -19
  47. data/templates/steps/bootstrap/fedora/init_pxeboot.yaml +13 -0
  48. data/templates/steps/bootstrap/fedora/yum_bootstrap.yaml +45 -0
  49. data/templates/steps/bootstrap/initialize_disk.yaml +16 -0
  50. data/templates/steps/bootstrap/initialize_disk_chroot.yaml +10 -14
  51. data/templates/steps/bootstrap/install_requirements.yaml +3 -0
  52. data/templates/steps/bootstrap/prepare_docker.yaml +7 -7
  53. data/templates/steps/bootstrap/prepare_qemu.yaml +20 -26
  54. data/templates/steps/bootstrap/prepare_virtualbox.yaml +63 -0
  55. data/templates/steps/bootstrap/start_chroot.yaml +2 -13
  56. data/templates/steps/bootstrap/start_qemu.yaml +50 -53
  57. data/templates/steps/bootstrap/start_virtualbox.yaml +37 -0
  58. data/templates/steps/bootstrap/switch_context_qemu.yaml +64 -0
  59. data/templates/steps/bootstrap/switch_context_virtualbox.yaml +66 -0
  60. data/templates/steps/breakpoint.yaml +2 -1
  61. data/templates/steps/checkpoints/docker.yaml +14 -11
  62. data/templates/steps/checkpoints/qcow2.yaml +26 -24
  63. data/templates/steps/checkpoints/qemu.yaml +30 -36
  64. data/templates/steps/checkpoints/virtualbox.yaml +21 -0
  65. data/templates/steps/disable_checkpoint.yaml +3 -0
  66. data/templates/steps/enable_checkpoint.yaml +5 -0
  67. data/templates/steps/export/qemu_save_appliance.yaml +52 -0
  68. data/templates/steps/export/virtualbox_save_appliance.yaml +67 -0
  69. data/templates/steps/setup/archlinux/install_bootloader.yaml +23 -0
  70. data/templates/steps/setup/centos/6.5/configure_network.yaml +31 -0
  71. data/templates/steps/setup/centos/6.5/configure_system.yaml +27 -0
  72. data/templates/steps/setup/debian/configure_apt.yaml +1 -6
  73. data/templates/steps/setup/debian/configure_kernel.yaml +0 -5
  74. data/templates/steps/setup/debian/install_bootloader.yaml +36 -0
  75. data/templates/steps/setup/debian/setup_vagrant_box.yaml +48 -18
  76. data/templates/steps/setup/debian/upgrade_system.yaml +2 -7
  77. data/templates/steps/setup/fedora/configure_kernel.yaml +9 -0
  78. data/templates/steps/setup/fedora/configure_keyboard.yaml +12 -0
  79. data/templates/steps/setup/fedora/configure_network.yaml +9 -1
  80. data/templates/steps/setup/fedora/configure_system.yaml +20 -45
  81. data/templates/steps/setup/fedora/install_bootloader.yaml +58 -0
  82. data/templates/steps/setup/fedora/minimal_install.yaml +3 -0
  83. data/templates/steps/setup/fedora/update_system.yaml +13 -5
  84. data/templates/steps/setup/ubuntu/configure_apt.yaml +4 -9
  85. data/templates/vagrant/debian7-amd64.yaml +130 -0
  86. data/templates/virtualbox/archlinux-desktop-i686.yaml +25 -0
  87. data/templates/virtualbox/archlinux-desktop-x86_64.yaml +28 -0
  88. data/templates/virtualbox/archlinux-i686.yaml +28 -0
  89. data/templates/virtualbox/archlinux-x86_64.yaml +109 -0
  90. data/templates/virtualbox/centos6.5-i386.yaml +39 -0
  91. data/templates/virtualbox/centos6.5-x86_64.yaml +111 -0
  92. data/templates/virtualbox/centos7-x86_64.yaml +116 -0
  93. data/{docs/source/debian7.yaml → templates/virtualbox/debian7-amd64.yaml} +53 -52
  94. data/templates/virtualbox/debian7-desktop-amd64.yaml +25 -0
  95. data/templates/{fedora-rawhide.yaml → virtualbox/debian7-i386.yaml} +12 -11
  96. data/templates/virtualbox/debian7-kameleon-amd64.yaml +38 -0
  97. data/templates/virtualbox/debian7-oar-amd64.yaml +51 -0
  98. data/templates/{debian-testing.yaml → virtualbox/debian8-amd64.yaml} +3 -3
  99. data/templates/virtualbox/debian8-i386.yaml +31 -0
  100. data/templates/virtualbox/fedora20-x86_64.yaml +116 -0
  101. data/templates/virtualbox/ubuntu-12.04-amd64.yaml +128 -0
  102. data/templates/virtualbox/ubuntu-12.04-desktop-amd64.yaml +25 -0
  103. data/templates/virtualbox/ubuntu-14.04-amd64.yaml +25 -0
  104. data/templates/virtualbox/ubuntu-14.04-desktop-amd64.yaml +27 -0
  105. data/version.txt +1 -1
  106. metadata +67 -212
  107. data/Rakefile +0 -24
  108. data/docs/.gitignore +0 -1
  109. data/docs/Makefile +0 -181
  110. data/docs/README.md +0 -17
  111. data/docs/make.bat +0 -242
  112. data/docs/source/_static/.gitignore +0 -0
  113. data/docs/source/_static/centos.png +0 -0
  114. data/docs/source/_static/debian.png +0 -0
  115. data/docs/source/_static/kameleon-logo.png +0 -0
  116. data/docs/source/_static/kameleon-logo.xcf +0 -0
  117. data/docs/source/_static/kameleon-long.png +0 -0
  118. data/docs/source/_static/ubuntu.png +0 -0
  119. data/docs/source/_themes/sphinx_rtd_theme/__init__.py +0 -17
  120. data/docs/source/_themes/sphinx_rtd_theme/breadcrumbs.html +0 -19
  121. data/docs/source/_themes/sphinx_rtd_theme/footer.html +0 -32
  122. data/docs/source/_themes/sphinx_rtd_theme/layout.html +0 -160
  123. data/docs/source/_themes/sphinx_rtd_theme/layout_old.html +0 -205
  124. data/docs/source/_themes/sphinx_rtd_theme/search.html +0 -50
  125. data/docs/source/_themes/sphinx_rtd_theme/searchbox.html +0 -7
  126. data/docs/source/_themes/sphinx_rtd_theme/static/css/badge_only.css +0 -1
  127. data/docs/source/_themes/sphinx_rtd_theme/static/css/theme.css +0 -4
  128. data/docs/source/_themes/sphinx_rtd_theme/static/fonts/FontAwesome.otf +0 -0
  129. data/docs/source/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.eot +0 -0
  130. data/docs/source/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.svg +0 -414
  131. data/docs/source/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.ttf +0 -0
  132. data/docs/source/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.woff +0 -0
  133. data/docs/source/_themes/sphinx_rtd_theme/static/js/theme.js +0 -47
  134. data/docs/source/_themes/sphinx_rtd_theme/theme.conf +0 -8
  135. data/docs/source/_themes/sphinx_rtd_theme/versions.html +0 -37
  136. data/docs/source/aliases.rst +0 -31
  137. data/docs/source/atlas_debian_g5k.yaml +0 -36
  138. data/docs/source/checkpoint.rst +0 -30
  139. data/docs/source/commands.rst +0 -63
  140. data/docs/source/conf.py +0 -262
  141. data/docs/source/context.rst +0 -47
  142. data/docs/source/debian_customized.yaml +0 -28
  143. data/docs/source/debian_customized_g5k.yaml +0 -21
  144. data/docs/source/faq.rst +0 -43
  145. data/docs/source/getting_started.rst +0 -260
  146. data/docs/source/grid5000_tutorial.rst +0 -525
  147. data/docs/source/index.rst +0 -53
  148. data/docs/source/install_atlas.yaml +0 -25
  149. data/docs/source/install_hpl.yaml +0 -24
  150. data/docs/source/installation.rst +0 -51
  151. data/docs/source/persistent_cache.rst +0 -34
  152. data/docs/source/recipe.rst +0 -177
  153. data/docs/source/tau_install.yaml +0 -19
  154. data/docs/source/tau_install_g5k.yaml +0 -25
  155. data/docs/source/use_cases.rst +0 -93
  156. data/docs/source/workspace.rst +0 -13
  157. data/lib/kameleon/logger.rb +0 -56
  158. data/omnibus/.gitignore +0 -11
  159. data/omnibus/.kitchen.yml +0 -25
  160. data/omnibus/Berksfile +0 -9
  161. data/omnibus/Berksfile.lock +0 -25
  162. data/omnibus/Gemfile +0 -12
  163. data/omnibus/README.md +0 -94
  164. data/omnibus/config/projects/kameleon.rb +0 -23
  165. data/omnibus/config/software/kameleon.rb +0 -24
  166. data/omnibus/config/software/polipo.rb +0 -30
  167. data/omnibus/config/software/ruby.rb +0 -158
  168. data/omnibus/files/mac_dmg/Resources/background.png +0 -0
  169. data/omnibus/files/mac_dmg/Resources/icon.png +0 -0
  170. data/omnibus/files/mac_pkg/Resources/background.png +0 -0
  171. data/omnibus/files/mac_pkg/Resources/license.html +0 -1
  172. data/omnibus/files/mac_pkg/Resources/welcome.html +0 -9
  173. data/omnibus/omnibus.rb +0 -27
  174. data/omnibus/package-scripts/kameleon/makeselfinst +0 -27
  175. data/omnibus/package-scripts/kameleon/postrm +0 -9
  176. data/templates/fedora20.yaml +0 -105
  177. data/templates/steps/bootstrap/archlinux/install_bootloader.yaml +0 -46
  178. data/templates/steps/bootstrap/archlinux/populate_disk.yaml +0 -39
  179. data/templates/steps/bootstrap/fedora/liveos_bootstrap.yaml +0 -123
  180. data/templates/steps/bootstrap/initialize_disk_qemu.yaml +0 -72
  181. data/templates/steps/bootstrap/install_bootloader.yaml +0 -42
  182. data/templates/steps/bootstrap/ubuntu/debootstrap.yaml +0 -27
  183. data/templates/steps/export/save_appliance.yaml +0 -58
  184. data/templates/steps/export/save_vagrant_box.yaml +0 -29
  185. data/templates/vagrant-debian7.yaml +0 -31
@@ -2,16 +2,16 @@
2
2
  # vim: softtabstop=2 shiftwidth=2 expandtab fenc=utf-8 cc=81 tw=80
3
3
  #==============================================================================
4
4
  #
5
- # DESCRIPTION: Ubuntu 12.04 LTS (Precise Pangolin) Desktop edition.
5
+ # DESCRIPTION: Ubuntu 12.04 LTS (Precise Pangolin) Desktop edition (amd64).
6
6
  #
7
7
  #==============================================================================
8
8
 
9
9
  ---
10
- extend: ubuntu-12.04
10
+ extend: ubuntu-12.04-amd64
11
11
 
12
12
  global:
13
13
  # Apt options
14
- apt_install_recommends: true
14
+ virtualbox_memory_size: 1024
15
15
 
16
16
  bootstrap:
17
17
  - @base
@@ -2,12 +2,12 @@
2
2
  # vim: softtabstop=2 shiftwidth=2 expandtab fenc=utf-8 cc=81 tw=80
3
3
  #==============================================================================
4
4
  #
5
- # DESCRIPTION: Ubuntu 14.04 LTS (Trusty Tahr) base system.
5
+ # DESCRIPTION: Ubuntu 14.04 LTS (Trusty Tahr) base system (amd64).
6
6
  #
7
7
  #==============================================================================
8
8
 
9
9
  ---
10
- extend: ubuntu-12.04
10
+ extend: ubuntu-12.04-amd64
11
11
 
12
12
  global:
13
13
  # Distribution
@@ -2,12 +2,12 @@
2
2
  # vim: softtabstop=2 shiftwidth=2 expandtab fenc=utf-8 cc=81 tw=80
3
3
  #==============================================================================
4
4
  #
5
- # DESCRIPTION: Ubuntu 14.04 LTS (Trusty Tahr) Desktop edition.
5
+ # DESCRIPTION: Ubuntu 14.04 LTS (Trusty Tahr) Desktop edition (amd64).
6
6
  #
7
7
  #==============================================================================
8
8
 
9
9
  ---
10
- extend: ubuntu-14.04
10
+ extend: ubuntu-14.04-amd64
11
11
 
12
12
  global:
13
13
  # Distribution
@@ -36,7 +36,7 @@ append_in:
36
36
  append_out:
37
37
  - exec_out: |
38
38
  mkdir -p $(dirname @1);
39
- cat >@1 <<EOF
39
+ cat >>@1 <<EOF
40
40
  @2
41
41
  EOF
42
42
 
@@ -78,22 +78,19 @@ in2out:
78
78
  - exec_out: cat > @2
79
79
 
80
80
  check_cmd_out:
81
- - on_bootstrap_init:
82
- - rescue:
83
- - exec_out: command -V @1 2> /dev/null
84
- - breakpoint: "@1 is missing from out_context"
81
+ - rescue:
82
+ - exec_out: command -V @1 2> /dev/null
83
+ - breakpoint: "@1 is missing from out_context"
85
84
 
86
85
  check_cmd_local:
87
- - on_bootstrap_init:
88
- - rescue:
89
- - exec_local: command -V @1 2> /dev/null
90
- - breakpoint: "@1 is missing from local_context"
86
+ - rescue:
87
+ - exec_local: command -V @1 2> /dev/null
88
+ - breakpoint: "@1 is missing from local_context"
91
89
 
92
90
  check_cmd_in:
93
- - on_bootstrap_init:
94
- - rescue:
95
- - exec_in: command -V @1 2> /dev/null
96
- - breakpoint: "@1 is missing from in_context"
91
+ - rescue:
92
+ - exec_in: command -V @1 2> /dev/null
93
+ - breakpoint: "@1 is missing from in_context"
97
94
 
98
95
  umount_out:
99
96
  - exec_out: |
@@ -106,3 +103,12 @@ umount_local:
106
103
  umount_in:
107
104
  - exec_in: |
108
105
  echo "try umount @1..." ; mountpoint -q "@1" && umount -f -l "@1" || true
106
+
107
+ download_file_in:
108
+ - exec_in: __download "@1" "@2"
109
+
110
+ download_file_out:
111
+ - exec_out: __download "@1" "@2"
112
+
113
+ download_file_local:
114
+ - exec_local: __download "@1" "@2"
@@ -8,11 +8,9 @@
8
8
 
9
9
  - pkg_group: base
10
10
 
11
- - enable_cache: true
12
-
13
11
  - import_script:
14
12
  - exec_out: |
15
- cat > $$kameleon_cwd/arch-bootstrap.sh <<'EOF'
13
+ cat > $KAMELEON_WORKDIR/arch-bootstrap.sh <<'EOF'
16
14
  #!/bin/bash
17
15
  #
18
16
  # arch-bootstrap: Bootstrap a base Arch Linux system using any GNU distribution.
@@ -39,11 +37,11 @@
39
37
  PACMAN_PACKAGES=(
40
38
  acl archlinux-keyring attr bzip2 curl expat glibc gpgme libarchive
41
39
  libassuan libgpg-error libssh2 lzo2 openssl pacman pacman-mirrorlist xz
42
- zlib krb5 e2fsprogs keyutils openssh
40
+ zlib krb5 e2fsprogs keyutils
43
41
  )
44
42
  BASIC_PACKAGES=(${PACMAN_PACKAGES[*]} filesystem)
45
43
  EXTRA_PACKAGES=(
46
- $$pkg_group haveged syslinux
44
+ $$pkg_group haveged
47
45
  )
48
46
  DEFAULT_REPO_URL="http://mirrors.kernel.org/archlinux"
49
47
  DEFAULT_ARCH=`uname -m`
@@ -180,35 +178,29 @@
180
178
  EOF
181
179
 
182
180
  - call_arch_boostrap:
183
- - exec_out: |
184
- if [ $$enable_cache = true ]; then
185
- [[ ! -f "$$rootfs_download_path/.kameleon_timestamp" ]] || CACHE_AVAILABLE=1
186
- fi
187
- [[ -n $CACHE_AVAILABLE ]] || \
188
- bash $$kameleon_cwd/arch-bootstrap.sh -a $$arch -r $$mirror $$rootfs_download_path \
189
- && date +%s > $$rootfs_download_path/.kameleon_timestamp
181
+ - exec_out: bash $KAMELEON_WORKDIR/arch-bootstrap.sh -a $$arch -r $$mirror $$rootfs
190
182
  - on_clean:
191
- - umount_out: $$rootfs_download_path/proc
192
- - umount_out: $$rootfs_download_path/dev
183
+ - umount_out: $$rootfs/proc
184
+ - umount_out: $$rootfs/dev
193
185
 
194
186
  - enable_sshd_service:
195
187
  - exec_out: |
196
- chroot $$rootfs_download_path \
188
+ chroot $$rootfs \
197
189
  ln -sf \
198
190
  '/usr/lib/systemd/system/sshd.service' \
199
191
  '/etc/systemd/system/multi-user.target.wants/sshd.service'
200
192
 
201
193
  - enable_dhcp_service:
202
194
  - exec_out: |
203
- chroot $$rootfs_download_path \
195
+ chroot $$rootfs \
204
196
  ln -sf \
205
197
  '/usr/lib/systemd/system/dhcpcd.service' \
206
198
  '/etc/systemd/system/multi-user.target.wants/dhcpcd.service'
207
199
 
208
200
  - add_nobody_user: ## To allow sshd to run correctly
209
- - exec_out: echo "nobody:x:99:99:nobody:/:/bin/false" >> $$rootfs_download_path/etc/passwd
210
- - exec_out: echo "nobody:x:99:" >> $$rootfs_download_path/etc/group
211
- - exec_out: echo "nobody:x:14871::::::" >> $$rootfs_download_path/etc/shadow
201
+ - exec_out: echo "nobody:x:99:99:nobody:/:/bin/false" >> $$rootfs/etc/passwd
202
+ - exec_out: echo "nobody:x:99:" >> $$rootfs/etc/group
203
+ - exec_out: echo "nobody:x:14871::::::" >> $$rootfs/etc/shadow
212
204
 
213
205
  - configure_pacman:
214
206
  - on_setup_init:
@@ -1,19 +1,18 @@
1
1
  # # Bootstrap
2
- - enable_cache: true
3
-
4
2
  - debootstrap:
5
3
  - check_cmd_out: debootstrap
6
- - exec_out: mkdir -p $$rootfs_download_path
4
+ - exec_out: mkdir -p $$rootfs
7
5
  - exec_out: |
8
- if [ $$enable_cache = true ]; then
9
- [[ ! -f "$$rootfs_download_path/.kameleon_timestamp" ]] || CACHE_AVAILABLE=1
10
- fi
11
- [[ -n $CACHE_AVAILABLE ]] || \
12
- debootstrap --no-check-gpg --arch=$$arch --include="$$include_pkg" $$release $$rootfs_download_path $$repository \
13
- && date +%s > $$rootfs_download_path/.kameleon_timestamp
14
- - exec_out: cat /etc/resolv.conf > $$rootfs_download_path/etc/resolv.conf
6
+ debootstrap \
7
+ --variant=$$variant \
8
+ --no-check-gpg \
9
+ --arch=$$arch \
10
+ --include="$$include_pkg" \
11
+ $$release \
12
+ $$rootfs \
13
+ $$repository
15
14
  - write_out:
16
- - $$rootfs_download_path/etc/network/interfaces
15
+ - $$rootfs/etc/network/interfaces
17
16
  - |
18
17
  auto lo
19
18
  iface lo inet loopback
@@ -4,26 +4,18 @@
4
4
  - debootstrap:
5
5
  - check_cmd_out: debootstrap
6
6
  - check_cmd_out: qemu-arm-static
7
- - exec_out: |
8
- if [ $$enable_cache = true ]; then
9
- [[ ! -f "$$rootfs_download_path/.kameleon_timestamp" ]] || CACHE_AVAILABLE=1
10
- fi
11
- if [ -n $CACHE_AVAILABLE ]; then
12
- mkdir -p $$rootfs_download_path
13
- debootstrap --no-check-gpg --foreign --variant=minbase --arch=$$arch --include="$$include_pkg" $$release $$rootfs_download_path $$repository
14
- QEMU_USER_PATH=$(which qemu-arm-static)
15
- cp $QEMU_USER_PATH $$rootfs_download_path/usr/bin/qemu-arm-static
16
- chroot $$rootfs_download_path /usr/bin/qemu-arm-static -cpu cortex-a9 /bin/sh /debootstrap/debootstrap --second-stage
17
- echo "deb $$repository wheezy main contrib non-free" > $$rootfs_download_path/etc/apt/sources.list
18
- chroot $$rootfs_download_path /usr/bin/qemu-arm-static -cpu cortex-a9 /bin/sh apt-get update
19
- chroot $$rootfs_download_path /usr/bin/qemu-arm-static -cpu cortex-a9 /bin/sh apt-get install -y --force-yes vim
20
- date +%s > $$rootfs_download_path/.kameleon_timestamp
21
- fi
22
- - exec_out: false
23
- - exec_out: date +%s > $$rootfs_download_path/.kameleon_timestamp
24
- - exec_out: cat /etc/resolv.conf > $$rootfs_download_path/etc/resolv.conf
7
+ - exec_out:|
8
+ mkdir -p $$rootfs
9
+ debootstrap --no-check-gpg --foreign --variant=minbase --arch=$$arch --include="$$include_pkg" $$release $$rootfs $$repository
10
+ QEMU_USER_PATH=$(which qemu-arm-static)
11
+ cp $QEMU_USER_PATH $$rootfs/usr/bin/qemu-arm-static
12
+ chroot $$rootfs /usr/bin/qemu-arm-static -cpu cortex-a9 /bin/sh /debootstrap/debootstrap --second-stage
13
+ echo "deb $$repository wheezy main contrib non-free" > $$rootfs/etc/apt/sources.list
14
+ chroot $$rootfs /usr/bin/qemu-arm-static -cpu cortex-a9 /bin/sh apt-get update
15
+ chroot $$rootfs /usr/bin/qemu-arm-static -cpu cortex-a9 /bin/sh apt-get install -y --force-yes vim
16
+ - exec_out: cat /etc/resolv.conf > $$rootfs/etc/resolv.conf
25
17
  - write_out:
26
- - $$rootfs_download_path/etc/network/interfaces
18
+ - $$rootfs/etc/network/interfaces
27
19
  - |
28
20
  auto lo
29
21
  iface lo inet loopback
@@ -0,0 +1,13 @@
1
+ - download_pxeboot_initrd:
2
+ - download_file_out:
3
+ - $$pxe_initrd_url
4
+ - $$rootfs/boot/initrd.img
5
+ - on_setup_init:
6
+ - exec_in: rm -f /boot/initrd.img
7
+
8
+ - download_pxeboot_vmlinuz:
9
+ - download_file_out:
10
+ - $$pxe_vmlinuz_url
11
+ - $$rootfs/boot/vmlinuz
12
+ - on_setup_init:
13
+ - exec_in: rm -f /boot/vmlinuz
@@ -0,0 +1,45 @@
1
+ - fix_yum:
2
+ - check_cmd_out: yum
3
+ - exec_out: sed -i "s/opts.ssl_verify_host/2/g" /usr/lib/pymodules/python2.7/urlgrabber/grabber.py
4
+
5
+ - init_rpm_db:
6
+ - check_cmd_out: rpm
7
+ - exec_out: mkdir -p $$rootfs/var/lib/rpm
8
+ - exec_out: rpm --root $$rootfs --initdb
9
+
10
+ - fetch_release_package:
11
+ - check_cmd_out: lynx
12
+ - exec_out: RELEASE_PACKAGE_URL=$(lynx $$mirror_packages_url -dump -listonly -nonumbers | grep $${distrib}-release | head -1)
13
+ - exec_out: |
14
+ if [ -z "${RELEASE_PACKAGE_URL-unset}" ]; then
15
+ fail "$${distrib}-release package not found!"
16
+ fi
17
+
18
+ - install_distrib_release:
19
+ - download_file_out:
20
+ - $RELEASE_PACKAGE_URL
21
+ - $KAMELEON_WORKDIR/$${distrib}-release.rpm
22
+ - exec_out: rpm --root $$rootfs -ivh --force-debian --nodeps $KAMELEON_WORKDIR/$${distrib}-release.rpm
23
+
24
+ - install_yum:
25
+ - exec_out: ln -sf $$rootfs/etc/pki/ /etc/pki
26
+ - exec_out: yum --installroot $$rootfs -y install yum
27
+ - exec_out: echo $${release} > $$rootfs/etc/yum/vars/releasever
28
+
29
+ - mount_chroot:
30
+ - exec_out: mount -o bind /dev $$rootfs/dev
31
+ - exec_out: mount -o bind /dev/pts $$rootfs/dev/pts
32
+ - exec_out: mount -t proc /proc $$rootfs/proc
33
+ - exec_out: mount -t sysfs /sys $$rootfs/sys
34
+ - exec_out: cp /etc/resolv.conf $$rootfs/etc/resolv.conf
35
+
36
+ - install_packages:
37
+ - exec_out: chroot $$rootfs yum install --releasever=$$release -y $$include_pkgs
38
+
39
+ - umount_chroot:
40
+ - on_clean:
41
+ - umount_out: $$rootfs/sys
42
+ - umount_out: $$rootfs/proc
43
+ - umount_out: $$rootfs/dev/pts
44
+ - umount_out: $$rootfs/dev
45
+ - exec_out: rm -f $$rootfs/etc/resolv.conf
@@ -0,0 +1,16 @@
1
+ # Initialize disk
2
+
3
+ - partition_disk:
4
+ - check_cmd_out: parted
5
+ - exec_out: |
6
+ echo "Partitioning disk..."
7
+ parted -s $${disk_device} mklabel msdos
8
+ parted -s -a none $${disk_device} mkpart primary 64s 100%
9
+ parted -s $${disk_device} set 1 boot on
10
+ - exec_out: |
11
+ echo Creating root partition...
12
+ mkfs.$$filesystem_type -q $${disk_device}1 || fail cannot create / ext4
13
+
14
+ - mount_mountdir:
15
+ - exec_out: mkdir -p $$rootfs
16
+ - exec_out: "echo Mounting root partition... ; mount $${disk_device}1 $$rootfs || fail cannot mount /"
@@ -35,7 +35,7 @@
35
35
  # this miscrostep must be done again ensure that the nbd device is
36
36
  # detached
37
37
  - on_checkpoint: redo
38
- - on_export_clean:
38
+ - on_setup_clean:
39
39
  - exec_out: echo "sync" ; sync
40
40
  - exec_out: qemu-nbd -d $$nbd_device
41
41
  - exec_out: "pgrep qemu-nbd | xargs -I {} kill -9 {} || true"
@@ -55,7 +55,7 @@
55
55
  - on_checkpoint: redo
56
56
  - exec_out: mkdir -p $$rootfs
57
57
  - exec_out: "echo Mounting root partition... ; mount $${nbd_device}p1 $$rootfs || fail cannot mount /"
58
- - on_export_clean:
58
+ - on_setup_clean:
59
59
  - exec_out: "echo try umount $$rootfs... ; mountpoint -q $$rootfs && umount -f -l $$rootfs || true"
60
60
 
61
61
  - copy_rootfs:
@@ -67,18 +67,14 @@
67
67
  --exclude '/dev/*' \
68
68
  --exclude '/proc/*' \
69
69
  --exclude '/sys/*' \
70
- $$rootfs_download_path/* $$rootfs
70
+ $$rootfs/* $$rootfs
71
71
  - exec_out: echo "sync..." ; sync
72
72
 
73
73
  - create_fstab:
74
- - write_out:
75
- - $$rootfs/etc/fstab
76
- - |
77
- # /etc/fstab: static file system information.
78
- #
79
- # Use 'blkid' to print the universally unique identifier for a
80
- # nbd_device; this may be used with UUID= as a more robust way to name nbd_devices
81
- # that works even if disks are added and removed. See fstab(5).
82
- #
83
- # <file system> <mount point> <type> <options> <dump> <pass>
84
- UUID=`blkid -s UUID -o value $${nbd_device}p1` / $$filesystem_type errors=remount-ro 0 1
74
+ - on_setup_init:
75
+ - write_out:
76
+ - $$rootfs/etc/fstab
77
+ - |
78
+ # /etc/fstab: static file system information.
79
+ # <file system> <mount point> <type> <options> <dump> <pass>
80
+ UUID=`blkid -s UUID -o value $${nbd_device}p1` / $$filesystem_type errors=remount-ro 0 1
@@ -0,0 +1,3 @@
1
+ - apt_install:
2
+ - exec_out: apt-get update
3
+ - exec_out: apt-get -y --force-yes install $$packages 2>&1
@@ -14,19 +14,19 @@
14
14
  - configure_ssh_access:
15
15
  - exec_out: echo -e 'y\n' | ssh-keygen -q -t dsa -f $$insecure_ssh_key -N ''
16
16
  - exec_out: cat $$insecure_ssh_key
17
- - exec_out: chroot $$rootfs_download_path mkdir -p /root/.ssh
17
+ - exec_out: chroot $$rootfs mkdir -p /root/.ssh
18
18
  - exec_out: |
19
- cat $${insecure_ssh_key}.pub > $$rootfs_download_path/root/.ssh/authorized_keys
20
- cat $${insecure_ssh_key}.pub > $$rootfs_download_path/root/.ssh/kameleon_insecure_public_key
21
- chmod 600 $$rootfs_download_path/root/.ssh/authorized_keys
22
- chmod 755 $$rootfs_download_path/root/.ssh
19
+ cat $${insecure_ssh_key}.pub > $$rootfs/root/.ssh/authorized_keys
20
+ cat $${insecure_ssh_key}.pub > $$rootfs/root/.ssh/kameleon_insecure_public_key
21
+ chmod 600 $$rootfs/root/.ssh/authorized_keys
22
+ chmod 755 $$rootfs/root/.ssh
23
23
  - on_clean:
24
- - exec_out: rm -rf $$rootfs_download_path/root/.ssh
24
+ - exec_out: rm -rf $$rootfs/root/.ssh
25
25
 
26
26
  - import_to_docker:
27
27
  - check_cmd_out: docker
28
28
  - exec_out: echo "Importing $$docker_image to docker..."
29
- - exec_out: tar -C $$rootfs_download_path -c . | $DOCKER import - $$docker_image:base
29
+ - exec_out: tar -C $$rootfs -c . | docker import - $$docker_image:base
30
30
 
31
31
  - create_ssh_config:
32
32
  - write_out:
@@ -1,35 +1,32 @@
1
1
  - insecure_ssh_key: $$kameleon_cwd/insecure_ssh_key
2
2
 
3
- - mount_chroot:
4
- - check_cmd_out: chroot
5
- - exec_out: mount -o bind /dev $$rootfs/dev
6
- - exec_out: mount -o bind /dev/pts $$rootfs/dev/pts
7
- - exec_out: mount -t proc /proc $$rootfs/proc
8
- - exec_out: mount -t sysfs /sys $$rootfs/sys
9
- - exec_out: test -f $$rootfs/etc/mtab || cat /proc/mounts > $$rootfs/etc/mtab
3
+ - download_boot2kameleon_iso:
4
+ - download_file_local:
5
+ - $$boot2kameleon_url
6
+ - $$kameleon_cwd/boot2kameleon.iso
10
7
 
11
- - umount_chroot:
12
- - on_bootstrap_clean:
13
- - exec_out: echo try umount $$rootfs/sys... ; mountpoint -q $$rootfs/sys && umount -f -l $$rootfs/sys || true
14
- - exec_out: echo try umount $$rootfs/proc... ; mountpoint -q $$rootfs/proc && umount -f -l $$rootfs/proc || true
15
- - exec_out: echo try umount $$rootfs/dev/pts... ; mountpoint -q $$rootfs/dev/pts && umount -f -l $$rootfs/dev/pts || true
16
- - exec_out: echo try umount $$rootfs/dev... ; mountpoint -q $$rootfs/dev && umount -f -l $$rootfs/dev || true
8
+ - create_initial_image:
9
+ - check_cmd_local: qemu-img
10
+ - exec_local: |
11
+ rm -f $$qemu_image_disk
12
+ qemu-img create -f qcow2 $$qemu_image_disk $$qemu_image_size
13
+
14
+ - delete_initial_image:
15
+ - on_checkpoint: skip
16
+ - on_export_clean:
17
+ - exec_local: rm -f $$qemu_image_disk
17
18
 
18
19
  - configure_ssh_access:
19
- - exec_out: echo -e 'y\n' | ssh-keygen -q -t dsa -f $$insecure_ssh_key -N ''
20
- - exec_out: cat $$insecure_ssh_key
21
- - exec_out: chroot $$rootfs mkdir -p /root/.ssh
22
- - exec_out: |
23
- cat $${insecure_ssh_key}.pub | tee -a $$rootfs/root/.ssh/authorized_keys
24
- cat $${insecure_ssh_key}.pub > $$rootfs/root/.ssh/kameleon_insecure_public_key
25
- chmod 600 $$rootfs/root/.ssh/authorized_keys
26
- chmod 755 $$rootfs/root/.ssh
20
+ - download_file_local:
21
+ - $$insecure_ssh_key_url
22
+ - $$insecure_ssh_key
23
+ - exec_local: chmod 600 $$insecure_ssh_key
27
24
 
28
25
  - create_ssh_config:
29
- - write_out:
26
+ - write_local:
30
27
  - $$ssh_config_file
31
28
  - |
32
- Host $$kameleon_recipe_name
29
+ Host $${kameleon_recipe_name}
33
30
  HostName 127.0.0.1
34
31
  Port $${qemu_ssh_port}
35
32
  User root
@@ -40,8 +37,5 @@
40
37
  IdentitiesOnly yes
41
38
  LogLevel FATAL
42
39
  ForwardAgent yes
43
- ControlPath /tmp/$${kameleon_short_uuid}%r@%h:%p
44
- ControlMaster auto
45
- ControlPersist yes
46
40
  Compression yes
47
41
  Protocol 2