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.
- data/.editorconfig +0 -0
- data/.env +2 -6
- data/CHANGELOG.rst +74 -1
- data/Gemfile +20 -2
- data/README.rst +35 -25
- data/Thorfile +29 -0
- data/contrib/kameleon_bashrc.sh +61 -0
- data/contrib/polipo_env.sh +3 -2
- data/kameleon-builder.gemspec +3 -10
- data/lib/kameleon.rb +10 -14
- data/lib/kameleon/cli.rb +92 -105
- data/lib/kameleon/context.rb +76 -43
- data/lib/kameleon/engine.rb +147 -103
- data/lib/kameleon/environment.rb +10 -5
- data/lib/kameleon/error.rb +1 -32
- data/lib/kameleon/persistent_cache.rb +127 -29
- data/lib/kameleon/recipe.rb +63 -106
- data/lib/kameleon/shell.rb +32 -17
- data/lib/kameleon/step.rb +18 -1
- data/lib/kameleon/ui.rb +141 -0
- data/lib/kameleon/utils.rb +9 -0
- data/templates/{debian7-chroot.yaml → chroot/debian7-amd64.yaml} +29 -21
- data/templates/{docker-debian7.yaml → docker/debian7.yaml} +5 -5
- data/templates/extend.erb +2 -2
- data/templates/{debian7-g5k.yaml → grid5000/debian7.yaml} +1 -1
- data/templates/{archlinux-desktop.yaml → qemu/archlinux-desktop-i686.yaml} +2 -2
- data/templates/qemu/archlinux-desktop-x86_64.yaml +25 -0
- data/templates/qemu/archlinux-i686.yaml +25 -0
- data/templates/{archlinux.yaml → qemu/archlinux-x86_64.yaml} +37 -34
- data/templates/qemu/centos6.5-x86_64.yaml +113 -0
- data/templates/qemu/centos7-x86_64.yaml +119 -0
- data/templates/{debian7.yaml → qemu/debian7-amd64.yaml} +45 -40
- data/templates/{debian7-desktop.yaml → qemu/debian7-desktop-amd64.yaml} +2 -3
- data/templates/{debian7-kameleon.yaml → qemu/debian7-kameleon-amd64.yaml} +3 -6
- data/templates/{debian7-oar-dev.yaml → qemu/debian7-oar-amd64.yaml} +2 -2
- data/templates/qemu/debian8-amd64.yaml +25 -0
- data/templates/{fedora20-desktop.yaml → qemu/fedora20-desktop-x86_64.yaml} +2 -2
- data/templates/qemu/fedora20-x86_64.yaml +116 -0
- data/templates/{ubuntu-12.04.yaml → qemu/ubuntu-12.04-amd64.yaml} +42 -38
- data/templates/{ubuntu-12.04-desktop.yaml → qemu/ubuntu-12.04-desktop-amd64.yaml} +3 -3
- data/templates/{ubuntu-14.04.yaml → qemu/ubuntu-14.04-amd64.yaml} +2 -2
- data/templates/{ubuntu-14.04-desktop.yaml → qemu/ubuntu-14.04-desktop-amd64.yaml} +2 -2
- data/templates/steps/aliases/defaults.yaml +19 -13
- data/templates/steps/bootstrap/archlinux/arch_bootstrap.yaml +11 -19
- data/templates/steps/bootstrap/debian/debootstrap.yaml +10 -11
- data/templates/steps/bootstrap/debian/debootstrap_arm.yaml +11 -19
- data/templates/steps/bootstrap/fedora/init_pxeboot.yaml +13 -0
- data/templates/steps/bootstrap/fedora/yum_bootstrap.yaml +45 -0
- data/templates/steps/bootstrap/initialize_disk.yaml +16 -0
- data/templates/steps/bootstrap/initialize_disk_chroot.yaml +10 -14
- data/templates/steps/bootstrap/install_requirements.yaml +3 -0
- data/templates/steps/bootstrap/prepare_docker.yaml +7 -7
- data/templates/steps/bootstrap/prepare_qemu.yaml +20 -26
- data/templates/steps/bootstrap/prepare_virtualbox.yaml +63 -0
- data/templates/steps/bootstrap/start_chroot.yaml +2 -13
- data/templates/steps/bootstrap/start_qemu.yaml +50 -53
- data/templates/steps/bootstrap/start_virtualbox.yaml +37 -0
- data/templates/steps/bootstrap/switch_context_qemu.yaml +64 -0
- data/templates/steps/bootstrap/switch_context_virtualbox.yaml +66 -0
- data/templates/steps/breakpoint.yaml +2 -1
- data/templates/steps/checkpoints/docker.yaml +14 -11
- data/templates/steps/checkpoints/qcow2.yaml +26 -24
- data/templates/steps/checkpoints/qemu.yaml +30 -36
- data/templates/steps/checkpoints/virtualbox.yaml +21 -0
- data/templates/steps/disable_checkpoint.yaml +3 -0
- data/templates/steps/enable_checkpoint.yaml +5 -0
- data/templates/steps/export/qemu_save_appliance.yaml +52 -0
- data/templates/steps/export/virtualbox_save_appliance.yaml +67 -0
- data/templates/steps/setup/archlinux/install_bootloader.yaml +23 -0
- data/templates/steps/setup/centos/6.5/configure_network.yaml +31 -0
- data/templates/steps/setup/centos/6.5/configure_system.yaml +27 -0
- data/templates/steps/setup/debian/configure_apt.yaml +1 -6
- data/templates/steps/setup/debian/configure_kernel.yaml +0 -5
- data/templates/steps/setup/debian/install_bootloader.yaml +36 -0
- data/templates/steps/setup/debian/setup_vagrant_box.yaml +48 -18
- data/templates/steps/setup/debian/upgrade_system.yaml +2 -7
- data/templates/steps/setup/fedora/configure_kernel.yaml +9 -0
- data/templates/steps/setup/fedora/configure_keyboard.yaml +12 -0
- data/templates/steps/setup/fedora/configure_network.yaml +9 -1
- data/templates/steps/setup/fedora/configure_system.yaml +20 -45
- data/templates/steps/setup/fedora/install_bootloader.yaml +58 -0
- data/templates/steps/setup/fedora/minimal_install.yaml +3 -0
- data/templates/steps/setup/fedora/update_system.yaml +13 -5
- data/templates/steps/setup/ubuntu/configure_apt.yaml +4 -9
- data/templates/vagrant/debian7-amd64.yaml +130 -0
- data/templates/virtualbox/archlinux-desktop-i686.yaml +25 -0
- data/templates/virtualbox/archlinux-desktop-x86_64.yaml +28 -0
- data/templates/virtualbox/archlinux-i686.yaml +28 -0
- data/templates/virtualbox/archlinux-x86_64.yaml +109 -0
- data/templates/virtualbox/centos6.5-i386.yaml +39 -0
- data/templates/virtualbox/centos6.5-x86_64.yaml +111 -0
- data/templates/virtualbox/centos7-x86_64.yaml +116 -0
- data/{docs/source/debian7.yaml → templates/virtualbox/debian7-amd64.yaml} +53 -52
- data/templates/virtualbox/debian7-desktop-amd64.yaml +25 -0
- data/templates/{fedora-rawhide.yaml → virtualbox/debian7-i386.yaml} +12 -11
- data/templates/virtualbox/debian7-kameleon-amd64.yaml +38 -0
- data/templates/virtualbox/debian7-oar-amd64.yaml +51 -0
- data/templates/{debian-testing.yaml → virtualbox/debian8-amd64.yaml} +3 -3
- data/templates/virtualbox/debian8-i386.yaml +31 -0
- data/templates/virtualbox/fedora20-x86_64.yaml +116 -0
- data/templates/virtualbox/ubuntu-12.04-amd64.yaml +128 -0
- data/templates/virtualbox/ubuntu-12.04-desktop-amd64.yaml +25 -0
- data/templates/virtualbox/ubuntu-14.04-amd64.yaml +25 -0
- data/templates/virtualbox/ubuntu-14.04-desktop-amd64.yaml +27 -0
- data/version.txt +1 -1
- metadata +67 -212
- data/Rakefile +0 -24
- data/docs/.gitignore +0 -1
- data/docs/Makefile +0 -181
- data/docs/README.md +0 -17
- data/docs/make.bat +0 -242
- data/docs/source/_static/.gitignore +0 -0
- data/docs/source/_static/centos.png +0 -0
- data/docs/source/_static/debian.png +0 -0
- data/docs/source/_static/kameleon-logo.png +0 -0
- data/docs/source/_static/kameleon-logo.xcf +0 -0
- data/docs/source/_static/kameleon-long.png +0 -0
- data/docs/source/_static/ubuntu.png +0 -0
- data/docs/source/_themes/sphinx_rtd_theme/__init__.py +0 -17
- data/docs/source/_themes/sphinx_rtd_theme/breadcrumbs.html +0 -19
- data/docs/source/_themes/sphinx_rtd_theme/footer.html +0 -32
- data/docs/source/_themes/sphinx_rtd_theme/layout.html +0 -160
- data/docs/source/_themes/sphinx_rtd_theme/layout_old.html +0 -205
- data/docs/source/_themes/sphinx_rtd_theme/search.html +0 -50
- data/docs/source/_themes/sphinx_rtd_theme/searchbox.html +0 -7
- data/docs/source/_themes/sphinx_rtd_theme/static/css/badge_only.css +0 -1
- data/docs/source/_themes/sphinx_rtd_theme/static/css/theme.css +0 -4
- data/docs/source/_themes/sphinx_rtd_theme/static/fonts/FontAwesome.otf +0 -0
- data/docs/source/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.eot +0 -0
- data/docs/source/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.svg +0 -414
- data/docs/source/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.ttf +0 -0
- data/docs/source/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.woff +0 -0
- data/docs/source/_themes/sphinx_rtd_theme/static/js/theme.js +0 -47
- data/docs/source/_themes/sphinx_rtd_theme/theme.conf +0 -8
- data/docs/source/_themes/sphinx_rtd_theme/versions.html +0 -37
- data/docs/source/aliases.rst +0 -31
- data/docs/source/atlas_debian_g5k.yaml +0 -36
- data/docs/source/checkpoint.rst +0 -30
- data/docs/source/commands.rst +0 -63
- data/docs/source/conf.py +0 -262
- data/docs/source/context.rst +0 -47
- data/docs/source/debian_customized.yaml +0 -28
- data/docs/source/debian_customized_g5k.yaml +0 -21
- data/docs/source/faq.rst +0 -43
- data/docs/source/getting_started.rst +0 -260
- data/docs/source/grid5000_tutorial.rst +0 -525
- data/docs/source/index.rst +0 -53
- data/docs/source/install_atlas.yaml +0 -25
- data/docs/source/install_hpl.yaml +0 -24
- data/docs/source/installation.rst +0 -51
- data/docs/source/persistent_cache.rst +0 -34
- data/docs/source/recipe.rst +0 -177
- data/docs/source/tau_install.yaml +0 -19
- data/docs/source/tau_install_g5k.yaml +0 -25
- data/docs/source/use_cases.rst +0 -93
- data/docs/source/workspace.rst +0 -13
- data/lib/kameleon/logger.rb +0 -56
- data/omnibus/.gitignore +0 -11
- data/omnibus/.kitchen.yml +0 -25
- data/omnibus/Berksfile +0 -9
- data/omnibus/Berksfile.lock +0 -25
- data/omnibus/Gemfile +0 -12
- data/omnibus/README.md +0 -94
- data/omnibus/config/projects/kameleon.rb +0 -23
- data/omnibus/config/software/kameleon.rb +0 -24
- data/omnibus/config/software/polipo.rb +0 -30
- data/omnibus/config/software/ruby.rb +0 -158
- data/omnibus/files/mac_dmg/Resources/background.png +0 -0
- data/omnibus/files/mac_dmg/Resources/icon.png +0 -0
- data/omnibus/files/mac_pkg/Resources/background.png +0 -0
- data/omnibus/files/mac_pkg/Resources/license.html +0 -1
- data/omnibus/files/mac_pkg/Resources/welcome.html +0 -9
- data/omnibus/omnibus.rb +0 -27
- data/omnibus/package-scripts/kameleon/makeselfinst +0 -27
- data/omnibus/package-scripts/kameleon/postrm +0 -9
- data/templates/fedora20.yaml +0 -105
- data/templates/steps/bootstrap/archlinux/install_bootloader.yaml +0 -46
- data/templates/steps/bootstrap/archlinux/populate_disk.yaml +0 -39
- data/templates/steps/bootstrap/fedora/liveos_bootstrap.yaml +0 -123
- data/templates/steps/bootstrap/initialize_disk_qemu.yaml +0 -72
- data/templates/steps/bootstrap/install_bootloader.yaml +0 -42
- data/templates/steps/bootstrap/ubuntu/debootstrap.yaml +0 -27
- data/templates/steps/export/save_appliance.yaml +0 -58
- data/templates/steps/export/save_vagrant_box.yaml +0 -29
- data/templates/vagrant-debian7.yaml +0 -31
Binary file
|
Binary file
|
Binary file
|
@@ -1 +0,0 @@
|
|
1
|
-
All Rights Reserved
|
@@ -1,9 +0,0 @@
|
|
1
|
-
This will install kameleon on your Mac.
|
2
|
-
|
3
|
-
--------------------------------------------------
|
4
|
-
|
5
|
-
This is a basic welcome message that is generated for every Omnibus project. You should customize this message by editing the file at files/mac_pkg/welcome.html.
|
6
|
-
|
7
|
-
If you are not the developer of kameleon, the presence of this message is likely a bug and should be reported to the creator.
|
8
|
-
|
9
|
-
Thank you for choosing Omnibus! Have a fantastic day!
|
data/omnibus/omnibus.rb
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# This file is used to configure the kameleon project. It contains
|
3
|
-
# come minimal configuration examples for working with Omnibus. For a full list
|
4
|
-
# of configurable options, please see the documentation for +omnibus/config.rb+.
|
5
|
-
#
|
6
|
-
|
7
|
-
# Build internally
|
8
|
-
# ------------------------------
|
9
|
-
# By default, Omnibus uses system folders (like +/var+ and +/opt+) to build and
|
10
|
-
# cache compontents. If you would to build everything internally, you can
|
11
|
-
# uncomment the following options. This will prevent the need for root
|
12
|
-
# permissions in most cases. You will also need to update the kameleon
|
13
|
-
# project configuration to build at +./local/omnibus/build+ instead of
|
14
|
-
# +/opt/kameleon+
|
15
|
-
#
|
16
|
-
|
17
|
-
cache_dir '/var/cache/omnibus/cache'
|
18
|
-
install_path_cache_dir '/var/cache/omnibus/cache/install_path'
|
19
|
-
source_dir '/var/cache/omnibus/src'
|
20
|
-
build_dir '/var/cache/omnibus/build'
|
21
|
-
package_dir '/var/cache/omnibus/pkg'
|
22
|
-
package_tmp '/var/cache/omnibus/pkg-tmp'
|
23
|
-
|
24
|
-
# Customize compiler bits
|
25
|
-
# ------------------------------
|
26
|
-
# solaris_compiler 'gcc'
|
27
|
-
# build_retries 5
|
@@ -1,27 +0,0 @@
|
|
1
|
-
#!/bin/bash
|
2
|
-
#
|
3
|
-
# Install a full kameleon
|
4
|
-
#
|
5
|
-
|
6
|
-
PROGNAME=`basename $0`
|
7
|
-
INSTALLER_DIR=`dirname $0`
|
8
|
-
DEST_DIR=/opt/kameleon
|
9
|
-
CONFIG_DIR=/etc/kameleon
|
10
|
-
USAGE="usage: $0"
|
11
|
-
|
12
|
-
error_exit()
|
13
|
-
{
|
14
|
-
echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2
|
15
|
-
exit 1
|
16
|
-
}
|
17
|
-
|
18
|
-
# move the actual files into place
|
19
|
-
rm -rf $DEST_DIR/* || error_exit "Cannot remove contents of $DEST_DIR"
|
20
|
-
mkdir -p $DEST_DIR || error_exit "Cannot create $DEST_DIR"
|
21
|
-
cp -R $INSTALLER_DIR $DEST_DIR || error_exit "Cannot install to $DEST_DIR"
|
22
|
-
rm -f $DEST_DIR/$PROGNAME
|
23
|
-
|
24
|
-
# You may want to symlink your packages bin files into /usr/bin
|
25
|
-
ln -sf $DEST_DIR/bin/kameleon /usr/bin || error_exit "Cannot link kameleon to /usr/bin"
|
26
|
-
|
27
|
-
exit 0
|
data/templates/fedora20.yaml
DELETED
@@ -1,105 +0,0 @@
|
|
1
|
-
#==============================================================================
|
2
|
-
# vim: softtabstop=2 shiftwidth=2 expandtab fenc=utf-8 cc=81 tw=80
|
3
|
-
#==============================================================================
|
4
|
-
#
|
5
|
-
# DESCRIPTION: Fedora 20 base system
|
6
|
-
#
|
7
|
-
#==============================================================================
|
8
|
-
|
9
|
-
---
|
10
|
-
# Loads some helpful aliases
|
11
|
-
aliases: defaults.yaml
|
12
|
-
# Enables qemu checkpoint
|
13
|
-
checkpoint: qemu.yaml
|
14
|
-
#== Global variables use by Kameleon engine and the steps
|
15
|
-
global:
|
16
|
-
## User varibales : used by the recipe
|
17
|
-
user_name: kameleon
|
18
|
-
user_password: $$user_name
|
19
|
-
|
20
|
-
# Distribution
|
21
|
-
distrib: fedora
|
22
|
-
release: 20
|
23
|
-
arch: x86_64
|
24
|
-
|
25
|
-
## QEMU options
|
26
|
-
qemu_enable_kvm: true
|
27
|
-
qemu_cpu: 2
|
28
|
-
qemu_memory_size: 512
|
29
|
-
qemu_monitor_port: 10023
|
30
|
-
qemu_ssh_port: 55423
|
31
|
-
qemu_arch: $$arch
|
32
|
-
|
33
|
-
## Disk options
|
34
|
-
nbd_device: /dev/nbd1
|
35
|
-
image_disk: $$kameleon_cwd/base_$$kameleon_recipe_name.qcow2
|
36
|
-
image_size: 10G
|
37
|
-
filesystem_type: ext4
|
38
|
-
|
39
|
-
# rootfs options
|
40
|
-
rootfs: $$kameleon_cwd/rootfs
|
41
|
-
rootfs_download_path: /var/cache/kameleon/$$distrib/$$release/$$arch/rootfs
|
42
|
-
|
43
|
-
## System variables. Required by kameleon engine
|
44
|
-
# Include specific steps
|
45
|
-
include_steps:
|
46
|
-
- $$distrib/$$release
|
47
|
-
- $$distrib
|
48
|
-
- ""
|
49
|
-
- "archlinux"
|
50
|
-
|
51
|
-
# Shell session from where we launch exec_out commands. There is often a
|
52
|
-
# local bash session, but it can be a remote shell on other machines or on
|
53
|
-
# any shell. (eg. bash, chroot, fakechroot, ssh, tmux, lxc...)
|
54
|
-
out_context:
|
55
|
-
cmd: bash
|
56
|
-
workdir: $$kameleon_cwd
|
57
|
-
|
58
|
-
# Shell session that allows us to connect to the building machine in order to
|
59
|
-
# configure it and setup additional programs
|
60
|
-
ssh_config_file: $$kameleon_cwd/ssh_config
|
61
|
-
in_context:
|
62
|
-
cmd: LC_ALL=POSIX ssh -F $$ssh_config_file $$kameleon_recipe_name -t /bin/bash
|
63
|
-
workdir: /root/kameleon_workdir
|
64
|
-
|
65
|
-
#== Bootstrap the new system and create the 'in_context'
|
66
|
-
bootstrap:
|
67
|
-
- liveos_bootstrap
|
68
|
-
- initialize_disk_qemu
|
69
|
-
- prepare_qemu
|
70
|
-
- install_bootloader
|
71
|
-
- start_qemu
|
72
|
-
|
73
|
-
|
74
|
-
#== Install and configuration steps
|
75
|
-
# WARNING: this part should be independante from the out context (whenever
|
76
|
-
# possible...)
|
77
|
-
setup:
|
78
|
-
- update_system
|
79
|
-
- install_software:
|
80
|
-
- packages: >
|
81
|
-
ntp zip unzip rsync sudo less vim bash-completion wget kernel kernel-devel
|
82
|
-
- configure_system:
|
83
|
-
- locales: POSIX C en_US fr_FR de_DE
|
84
|
-
- lang: en_US.UTF-8
|
85
|
-
- timezone: UTC
|
86
|
-
- configure_keyboard:
|
87
|
-
- layout: "us"
|
88
|
-
- configure_network:
|
89
|
-
- hostname: kameleon-$$distrib
|
90
|
-
- create_user:
|
91
|
-
- name: $$user_name
|
92
|
-
- groups: wheel
|
93
|
-
- password: $$user_password
|
94
|
-
|
95
|
-
# == Export the generated appliance in the format of your choice
|
96
|
-
export:
|
97
|
-
- save_appliance:
|
98
|
-
- input: $$image_disk
|
99
|
-
- output: $$kameleon_cwd/$$kameleon_recipe_name
|
100
|
-
- save_as_qcow2
|
101
|
-
# - save_as_qed
|
102
|
-
# - save_as_tgz
|
103
|
-
# - save_as_raw
|
104
|
-
# - save_as_vmdk
|
105
|
-
# - save_as_vdi
|
@@ -1,46 +0,0 @@
|
|
1
|
-
# Install extlinux bootloader
|
2
|
-
|
3
|
-
- install_bootloader:
|
4
|
-
- rescue:
|
5
|
-
- exec_out: LC_ALL=POSIX chroot $$rootfs bash -c "command -V extlinux 2> /dev/null"
|
6
|
-
- breakpoint: "extlinux is missing"
|
7
|
-
- exec_out: cp -r $$rootfs/usr/lib/syslinux/bios/*.c32 $$rootfs/boot/syslinux/
|
8
|
-
- exec_out: LC_ALL=POSIX chroot $$rootfs extlinux --install /boot/syslinux 2>&1
|
9
|
-
- exec_out: |
|
10
|
-
MBR_PATH=
|
11
|
-
PATHS=("$$rootfs/usr/share/syslinux/mbr.bin"
|
12
|
-
"$$rootfs/usr/lib/bios/syslinux/mbr.bin"
|
13
|
-
"$$rootfs/usr/lib/syslinux/bios/mbr.bin"
|
14
|
-
"$$rootfs/usr/lib/extlinux/mbr.bin"
|
15
|
-
"$$rootfs/usr/lib/syslinux/mbr.bin")
|
16
|
-
for element in "${PATHS[@]}"
|
17
|
-
do
|
18
|
-
if [ -f "$element" ]; then
|
19
|
-
MBR_PATH="$element"
|
20
|
-
break
|
21
|
-
fi
|
22
|
-
done
|
23
|
-
if [ "$MBR_PATH" == "" ]; then
|
24
|
-
fail "unable to locate the extlinux mbr"
|
25
|
-
else
|
26
|
-
dd if="$MBR_PATH" of="$$nbd_device" bs=440 2>&1
|
27
|
-
fi
|
28
|
-
- exec_out: echo " sync..." ; sync
|
29
|
-
- write_out:
|
30
|
-
- $$rootfs/boot/syslinux/syslinux.cfg
|
31
|
-
- |
|
32
|
-
default kameleon
|
33
|
-
timeout 5
|
34
|
-
|
35
|
-
label kameleon
|
36
|
-
kernel ../`basename $$rootfs/boot/vmlinuz*`
|
37
|
-
initrd ../`basename $$rootfs/boot/init*`
|
38
|
-
# the net.ifnames option is disable to get default net interface
|
39
|
-
# names according to this page:
|
40
|
-
# https://wiki.archlinux.org/index.php/Network_Configuration#Device_names
|
41
|
-
append root=UUID=`blkid -s UUID -o value $${nbd_device}p1` rw net.ifnames=0
|
42
|
-
- exec_out: echo " sync..." ; sync
|
43
|
-
- on_bootstrap_clean:
|
44
|
-
- exec_out: |
|
45
|
-
dir=$$rootfs/var/lib/os-prober/mount
|
46
|
-
test ! -d "$dir" || (umount -f -l "$dir" && rmdir "$dir")
|
@@ -1,39 +0,0 @@
|
|
1
|
-
# Populate disk
|
2
|
-
#
|
3
|
-
# This step is partionning and populating the disk
|
4
|
-
|
5
|
-
- partition_disk:
|
6
|
-
- check_cmd_out: parted
|
7
|
-
- exec_out: |
|
8
|
-
echo "Partitioning disk..."
|
9
|
-
parted $${device} mklabel msdos
|
10
|
-
parted $${device} mkpart primary 0% 100%
|
11
|
-
parted $${device} set 1 boot on
|
12
|
-
- exec_out: |
|
13
|
-
echo Creating root partition...
|
14
|
-
mkfs.$$filesystem_type -q $${device}p1 || fail cannot create / ext4
|
15
|
-
|
16
|
-
- mount_mountdir:
|
17
|
-
- on_checkpoint: redo
|
18
|
-
- exec_out: mkdir -p $$mountdir
|
19
|
-
- exec_out: "echo Mounting root partition... ; mount $${device}p1 $$mountdir || fail cannot mount /"
|
20
|
-
- on_export_clean:
|
21
|
-
- exec_out: "echo try umount $$mountdir... ; mountpoint -q $$mountdir && umount -f -l $$mountdir || true"
|
22
|
-
|
23
|
-
- copy_rootfs:
|
24
|
-
- check_cmd_out: rsync
|
25
|
-
- exec_out: rsync -aAX $$rootfs_cache/* $$rootfs
|
26
|
-
- exec_out: echo "sync..." ; sync
|
27
|
-
|
28
|
-
- create_fstab:
|
29
|
-
- write_out:
|
30
|
-
- $$mountdir/etc/fstab
|
31
|
-
- |
|
32
|
-
# /etc/fstab: static file system information.
|
33
|
-
#
|
34
|
-
# Use 'blkid' to print the universally unique identifier for a
|
35
|
-
# device; this may be used with UUID= as a more robust way to name devices
|
36
|
-
# that works even if disks are added and removed. See fstab(5).
|
37
|
-
#
|
38
|
-
# <file system> <mount point> <type> <options> <dump> <pass>
|
39
|
-
UUID=`blkid -s UUID -o value $${device}p1` / $$filesystem_type errors=remount-ro 0 1
|
@@ -1,123 +0,0 @@
|
|
1
|
-
# # Bootstrap
|
2
|
-
- include: >
|
3
|
-
python yum rpm initscripts passwd rsyslog vim-minimal dhclient chkconfig
|
4
|
-
rootfiles policycoreutils fedora-release openssh-server net-tools nc
|
5
|
-
traceroute kernel syslinux-extlinux systemd procps-ng console-setup
|
6
|
-
bash grep coreutils findutils sed cpio cyrus-sasl file-libs gawk xz
|
7
|
-
|
8
|
-
- mirrorlist_server: mirrors.kernel.org
|
9
|
-
- mirror_distrib_path: fedora/releases/$${release}/Fedora/$$arch/os
|
10
|
-
- mirrorlist_url_rsync: $$mirrorlist_server::$$mirror_distrib_path
|
11
|
-
|
12
|
-
- download_live_os:
|
13
|
-
- check_cmd_out: rsync
|
14
|
-
- exec_out: |
|
15
|
-
if [ ! -d "$$rootfs_download_path" ]; then
|
16
|
-
if [ ! -f "./LiveOS/squashfs.img" ]; then
|
17
|
-
echo "Downloading LiveOS squashfs file system from $$mirrorlist_url_rsync ..."
|
18
|
-
rsync -avh --progress $$mirrorlist_url_rsync/LiveOS .
|
19
|
-
echo "Download of squashfs image complete."
|
20
|
-
else
|
21
|
-
echo "Using cached LiveOS squashfs file system."
|
22
|
-
fi
|
23
|
-
fi
|
24
|
-
|
25
|
-
- copy_ro_to_rw:
|
26
|
-
- exec_out: |
|
27
|
-
if [ ! -d "$$rootfs_download_path" ]; then
|
28
|
-
mkdir -p squashfs readonlyfs partial
|
29
|
-
mount -o loop ./LiveOS/squashfs.img squashfs || \
|
30
|
-
fail Mount of LiveOS squashfs image failed! You mush have squashfs support available to mount image.
|
31
|
-
mount -o loop squashfs/LiveOS/rootfs.img readonlyfs
|
32
|
-
rsync -aAHS readonlyfs/ partial/
|
33
|
-
fi
|
34
|
-
- umount_out: readonlyfs
|
35
|
-
- umount_out: squashfs
|
36
|
-
|
37
|
-
- bootstrap_partial:
|
38
|
-
- exec_out: |
|
39
|
-
if [ ! -d "$$rootfs_download_path" ]; then
|
40
|
-
mount -o bind /dev partial/dev
|
41
|
-
mount -o bind /dev/pts partial/dev/pts
|
42
|
-
mount -t proc /proc partial/proc
|
43
|
-
mount -t sysfs /sys partial/sys
|
44
|
-
test -f partial/etc/mtab || cat /proc/mounts > partial/etc/mtab
|
45
|
-
cp /etc/resolv.conf partial/etc/
|
46
|
-
rsync -av $$mirrorlist_url_rsync/Packages/r/rpm-[0-9]* $$mirrorlist_url_rsync//Packages/y/yum-[0-9]* partial
|
47
|
-
chroot partial rpm -ivh --nodeps --replacepkgs rpm-* yum-* > /dev/null
|
48
|
-
rsync -av $$mirrorlist_url_rsync/Packages/f/fedora-release-$${release}* partial
|
49
|
-
mkdir -p partial/run/install
|
50
|
-
chroot partial rpm --nodeps -ivh fedora-release-*
|
51
|
-
sed -i "s|\$basearch|$$arch|" partial/etc/yum.repos.d/*
|
52
|
-
chroot partial rpm --root /run/install --nodeps -ivh fedora-release-*
|
53
|
-
sed -i "s|\$basearch|$$arch|" partial/run/install/etc/yum.repos.d/*
|
54
|
-
chroot partial yum --installroot /run/install -y --nogpgcheck install $$include
|
55
|
-
fi
|
56
|
-
- umount_out: partial/dev/pts
|
57
|
-
- umount_out: partial/dev
|
58
|
-
- umount_out: partial/proc
|
59
|
-
- umount_out: partial/sys
|
60
|
-
|
61
|
-
- create_rootfs:
|
62
|
-
- exec_out: |
|
63
|
-
if [ ! -d "$$rootfs_download_path" ]; then
|
64
|
-
mkdir -p $$rootfs_download_path
|
65
|
-
rsync -aAX --delete --one-file-system \
|
66
|
-
--exclude '/.kameleon_timestamp' \
|
67
|
-
--exclude '/dev/*' \
|
68
|
-
--exclude '/proc/*' \
|
69
|
-
--exclude '/sys/*' \
|
70
|
-
partial/run/install/* $$rootfs_download_path
|
71
|
-
fi
|
72
|
-
|
73
|
-
- download_pxeboot_initrd:
|
74
|
-
- exec_out: |
|
75
|
-
wget -c -O $$rootfs_download_path/boot/initrd.img \
|
76
|
-
http://$$mirrorlist_server/$$mirror_distrib_path/images/pxeboot/initrd.img \
|
77
|
-
2>&1 | tail -f
|
78
|
-
|
79
|
-
- download_pxeboot_vmlinuz:
|
80
|
-
- exec_out: |
|
81
|
-
wget -c -O $$rootfs_download_path/boot/vmlinuz \
|
82
|
-
http://$$mirrorlist_server/$$mirror_distrib_path/images/pxeboot/vmlinuz \
|
83
|
-
2>&1 | tail -f
|
84
|
-
|
85
|
-
- enable_sshd_service:
|
86
|
-
- exec_out: |
|
87
|
-
chroot $$rootfs_download_path \
|
88
|
-
ln -sf \
|
89
|
-
'/usr/lib/systemd/system/sshd.service' \
|
90
|
-
'/etc/systemd/system/multi-user.target.wants/sshd.service'
|
91
|
-
|
92
|
-
- enable_dhcp_service:
|
93
|
-
- exec_out: |
|
94
|
-
echo -n 'root:root' | chroot $$rootfs_download_path chpasswd
|
95
|
-
chroot $$rootfs_download_path \
|
96
|
-
ln -sf \
|
97
|
-
'/usr/lib/systemd/system/network.service' \
|
98
|
-
'/etc/systemd/system/multi-user.target.wants/network.service'
|
99
|
-
|
100
|
-
- enable_networking:
|
101
|
-
- write_out:
|
102
|
-
- $$rootfs_download_path/etc/sysconfig/network-scripts/ifcfg-eth0
|
103
|
-
- |
|
104
|
-
DEVICE=eth0
|
105
|
-
BOOTPROTO=dhcp
|
106
|
-
ONBOOT=yes
|
107
|
-
HOSTNAME=fedora-$${release}
|
108
|
-
NM_CONTROLLED=no
|
109
|
-
TYPE=Ethernet
|
110
|
-
- write_out:
|
111
|
-
- $$rootfs_download_path/etc/sysconfig/network
|
112
|
-
- |
|
113
|
-
NETWORKING=yes
|
114
|
-
HOSTNAME=fedora-$${release}
|
115
|
-
|
116
|
-
- clean:
|
117
|
-
- on_bootstrap_clean:
|
118
|
-
- umount_out: partial/dev/pts
|
119
|
-
- umount_out: partial/dev
|
120
|
-
- umount_out: partial/proc
|
121
|
-
- umount_out: partial/sys
|
122
|
-
- umount_out: readonlyfs
|
123
|
-
- umount_out: squashfs
|
@@ -1,72 +0,0 @@
|
|
1
|
-
# Initialize disk
|
2
|
-
|
3
|
-
# this step create the appliance disk and initialize the
|
4
|
-
# checkpoint mechanism with Qemu Network Block Device (NBD)
|
5
|
-
|
6
|
-
- create_initial_image:
|
7
|
-
- check_cmd_out: qemu-img
|
8
|
-
- exec_out: |
|
9
|
-
rm -f $$image_disk
|
10
|
-
qemu-img create -f qcow2 $$image_disk $$image_size
|
11
|
-
|
12
|
-
- load_nbd_module:
|
13
|
-
- on_checkpoint: redo
|
14
|
-
- on_bootstrap_init:
|
15
|
-
- exec_out: |
|
16
|
-
lsmod | grep nbd >/dev/null \
|
17
|
-
|| modprobe nbd max_part=63 \
|
18
|
-
|| fail failed to load nbd module into kernel
|
19
|
-
|
20
|
-
- attach_nbd_device:
|
21
|
-
# this microstep must be skipped because it is already done by the
|
22
|
-
# checkpoint restore function
|
23
|
-
- on_checkpoint: redo
|
24
|
-
- check_cmd_out: qemu-nbd
|
25
|
-
- exec_out: echo Connecting $$image_disk to nbd device $$nbd_device
|
26
|
-
- exec_out: qemu-nbd -c $$nbd_device $$image_disk -n || fail nbd device $$nbd_device is unavailable
|
27
|
-
|
28
|
-
- detach_nbd_device:
|
29
|
-
# this miscrostep must be done again ensure that the nbd device is
|
30
|
-
# detached
|
31
|
-
- on_checkpoint: redo
|
32
|
-
- on_bootstrap_clean:
|
33
|
-
- exec_out: echo "sync" ; sync
|
34
|
-
- exec_out: qemu-nbd -d $$nbd_device
|
35
|
-
- exec_out: "pgrep qemu-nbd | xargs -I {} kill -9 {} || true"
|
36
|
-
|
37
|
-
- partition_disk:
|
38
|
-
- check_cmd_out: parted
|
39
|
-
- exec_out: |
|
40
|
-
echo "Partitioning disk..."
|
41
|
-
parted $${nbd_device} mklabel msdos
|
42
|
-
parted $${nbd_device} mkpart primary 0% 100%
|
43
|
-
parted $${nbd_device} set 1 boot on
|
44
|
-
- exec_out: |
|
45
|
-
echo Creating root partition...
|
46
|
-
mkfs.$$filesystem_type -q $${nbd_device}p1 || fail cannot create / ext4
|
47
|
-
|
48
|
-
- mount_mountdir:
|
49
|
-
- on_checkpoint: redo
|
50
|
-
- exec_out: mkdir -p $$rootfs
|
51
|
-
- exec_out: "echo Mounting root partition... ; mount $${nbd_device}p1 $$rootfs || fail cannot mount /"
|
52
|
-
- on_bootstrap_clean:
|
53
|
-
- exec_out: "echo try umount $$rootfs... ; mountpoint -q $$rootfs && umount -f -l $$rootfs || true"
|
54
|
-
|
55
|
-
- copy_rootfs:
|
56
|
-
- check_cmd_out: rsync
|
57
|
-
- exec_out: echo "Copying rootfs to $$rootfs..."
|
58
|
-
- exec_out: rsync -aAX --exclude '/.kameleon_timestamp' $$rootfs_download_path/* $$rootfs
|
59
|
-
- exec_out: echo "sync..." ; sync
|
60
|
-
|
61
|
-
- create_fstab:
|
62
|
-
- write_out:
|
63
|
-
- $$rootfs/etc/fstab
|
64
|
-
- |
|
65
|
-
# /etc/fstab: static file system information.
|
66
|
-
#
|
67
|
-
# Use 'blkid' to print the universally unique identifier for a
|
68
|
-
# nbd_device; this may be used with UUID= as a more robust way to name nbd_devices
|
69
|
-
# that works even if disks are added and removed. See fstab(5).
|
70
|
-
#
|
71
|
-
# <file system> <mount point> <type> <options> <dump> <pass>
|
72
|
-
UUID=`blkid -s UUID -o value $${nbd_device}p1` / $$filesystem_type errors=remount-ro 0 1
|