kameleon-builder 2.10.12 → 2.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGES +24 -0
- data/COPYING +5 -5
- data/README.rst +20 -5
- data/RELEASING.md +41 -24
- data/completion/kameleon.bash +0 -2
- data/erb/extend.yaml.erb +1 -1
- data/kameleon-builder.gemspec +11 -9
- data/lib/kameleon/cli.rb +2 -2
- data/lib/kameleon/engine.rb +1 -1
- data/lib/kameleon/persistent_cache.rb +1 -1
- data/lib/kameleon/recipe.rb +26 -21
- data/lib/kameleon/step.rb +3 -3
- data/lib/kameleon/ui.rb +1 -1
- data/lib/kameleon/utils.rb +7 -2
- data/lib/kameleon/version.rb +1 -1
- data/lib/kameleon.rb +1 -1
- metadata +23 -61
- data/.bumpversion.cfg +0 -16
- data/contrib/scripts/VirtualBox_deploy.sh +0 -12
- data/contrib/scripts/chroot_env +0 -9
- data/contrib/scripts/create_passwd.py +0 -17
- data/contrib/scripts/umount-chroot.sh +0 -290
- data/contrib/steps/bootstrap/debian/bootstrap_if_needed.yaml +0 -47
- data/contrib/steps/bootstrap/debian/bootstrap_static.yaml +0 -38
- data/contrib/steps/bootstrap/debian/debootstrap_arm.yaml +0 -23
- data/contrib/steps/export/clean_appliance.yaml +0 -9
- data/contrib/steps/export/compact_qcow_img.yaml +0 -12
- data/contrib/steps/export/save_as_g5k.yaml +0 -63
- data/contrib/steps/setup/add_timestamp.yaml +0 -6
- data/contrib/steps/setup/add_to_sudoers.yaml +0 -5
- data/contrib/steps/setup/archlinux/configure_ruby.yaml +0 -7
- data/contrib/steps/setup/archlinux/install_dev_tools.yaml +0 -18
- data/contrib/steps/setup/archlinux/install_gnome.yaml +0 -27
- data/contrib/steps/setup/archlinux/install_yaourt.yaml +0 -29
- data/contrib/steps/setup/autologin.yaml +0 -16
- data/contrib/steps/setup/centos/6.5/configure_repo.yaml +0 -9
- data/contrib/steps/setup/copy_ssh_auth_file.yaml +0 -10
- data/contrib/steps/setup/debian/add_network_interface.yaml +0 -7
- data/contrib/steps/setup/debian/cluster_tools_install.yaml +0 -16
- data/contrib/steps/setup/debian/install_gnome.yaml +0 -13
- data/contrib/steps/setup/debian/install_kde.yaml +0 -13
- data/contrib/steps/setup/debian/network_config_static.yaml +0 -17
- data/contrib/steps/setup/generate_user_ssh_key.yaml +0 -15
- data/contrib/steps/setup/install_my_ssh_key.yaml +0 -26
- data/contrib/steps/setup/make_swap_file.yaml +0 -9
- data/contrib/steps/setup/root_ssh_config.yaml +0 -18
- data/contrib/steps/setup/set_user_password.yaml +0 -7
- data/contrib/steps/setup/system_optimization.yaml +0 -8
- data/scripts/bumpversion.py +0 -184
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kameleon-builder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Salem Harrache
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2025-
|
15
|
+
date: 2025-05-04 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: childprocess
|
@@ -20,91 +20,85 @@ dependencies:
|
|
20
20
|
requirements:
|
21
21
|
- - "~>"
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: 0
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: 0.3.0
|
23
|
+
version: '4.0'
|
27
24
|
type: :runtime
|
28
25
|
prerelease: false
|
29
26
|
version_requirements: !ruby/object:Gem::Requirement
|
30
27
|
requirements:
|
31
28
|
- - "~>"
|
32
29
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0
|
34
|
-
- - ">="
|
35
|
-
- !ruby/object:Gem::Version
|
36
|
-
version: 0.3.0
|
30
|
+
version: '4.0'
|
37
31
|
- !ruby/object:Gem::Dependency
|
38
|
-
name:
|
32
|
+
name: progressbar
|
39
33
|
requirement: !ruby/object:Gem::Requirement
|
40
34
|
requirements:
|
41
35
|
- - "~>"
|
42
36
|
- !ruby/object:Gem::Version
|
43
|
-
version: '1'
|
37
|
+
version: '1.10'
|
44
38
|
type: :runtime
|
45
39
|
prerelease: false
|
46
40
|
version_requirements: !ruby/object:Gem::Requirement
|
47
41
|
requirements:
|
48
42
|
- - "~>"
|
49
43
|
- !ruby/object:Gem::Version
|
50
|
-
version: '1'
|
44
|
+
version: '1.10'
|
51
45
|
- !ruby/object:Gem::Dependency
|
52
|
-
name:
|
46
|
+
name: psych
|
53
47
|
requirement: !ruby/object:Gem::Requirement
|
54
48
|
requirements:
|
55
49
|
- - "~>"
|
56
50
|
- !ruby/object:Gem::Version
|
57
|
-
version: '
|
51
|
+
version: '5.0'
|
58
52
|
type: :runtime
|
59
53
|
prerelease: false
|
60
54
|
version_requirements: !ruby/object:Gem::Requirement
|
61
55
|
requirements:
|
62
56
|
- - "~>"
|
63
57
|
- !ruby/object:Gem::Version
|
64
|
-
version: '
|
58
|
+
version: '5.0'
|
65
59
|
- !ruby/object:Gem::Dependency
|
66
|
-
name:
|
60
|
+
name: ruby-graphviz
|
67
61
|
requirement: !ruby/object:Gem::Requirement
|
68
62
|
requirements:
|
69
63
|
- - "~>"
|
70
64
|
- !ruby/object:Gem::Version
|
71
|
-
version: '2
|
65
|
+
version: '1.2'
|
72
66
|
type: :runtime
|
73
67
|
prerelease: false
|
74
68
|
version_requirements: !ruby/object:Gem::Requirement
|
75
69
|
requirements:
|
76
70
|
- - "~>"
|
77
71
|
- !ruby/object:Gem::Version
|
78
|
-
version: '2
|
72
|
+
version: '1.2'
|
79
73
|
- !ruby/object:Gem::Dependency
|
80
|
-
name:
|
74
|
+
name: table_print
|
81
75
|
requirement: !ruby/object:Gem::Requirement
|
82
76
|
requirements:
|
83
77
|
- - "~>"
|
84
78
|
- !ruby/object:Gem::Version
|
85
|
-
version: '1.
|
79
|
+
version: '1.5'
|
86
80
|
type: :runtime
|
87
81
|
prerelease: false
|
88
82
|
version_requirements: !ruby/object:Gem::Requirement
|
89
83
|
requirements:
|
90
84
|
- - "~>"
|
91
85
|
- !ruby/object:Gem::Version
|
92
|
-
version: '1.
|
86
|
+
version: '1.5'
|
93
87
|
- !ruby/object:Gem::Dependency
|
94
|
-
name:
|
88
|
+
name: thor
|
95
89
|
requirement: !ruby/object:Gem::Requirement
|
96
90
|
requirements:
|
97
91
|
- - "~>"
|
98
92
|
- !ruby/object:Gem::Version
|
99
|
-
version: '1'
|
93
|
+
version: '1.0'
|
100
94
|
type: :runtime
|
101
95
|
prerelease: false
|
102
96
|
version_requirements: !ruby/object:Gem::Requirement
|
103
97
|
requirements:
|
104
98
|
- - "~>"
|
105
99
|
- !ruby/object:Gem::Version
|
106
|
-
version: '1'
|
107
|
-
description:
|
100
|
+
version: '1.0'
|
101
|
+
description: Kameleon is a tool to build system appliances, possibly from scratch
|
108
102
|
email:
|
109
103
|
- salem@harrache.info
|
110
104
|
- michael.mercier@libr.fr
|
@@ -116,7 +110,6 @@ executables:
|
|
116
110
|
extensions: []
|
117
111
|
extra_rdoc_files: []
|
118
112
|
files:
|
119
|
-
- ".bumpversion.cfg"
|
120
113
|
- ".editorconfig"
|
121
114
|
- ".env"
|
122
115
|
- ".gitignore"
|
@@ -135,36 +128,6 @@ files:
|
|
135
128
|
- contrib/kameleon_exec_cmd.sh
|
136
129
|
- contrib/kameleon_exec_cmd_wrapper.sh
|
137
130
|
- contrib/proxy_env.sh
|
138
|
-
- contrib/scripts/VirtualBox_deploy.sh
|
139
|
-
- contrib/scripts/chroot_env
|
140
|
-
- contrib/scripts/create_passwd.py
|
141
|
-
- contrib/scripts/umount-chroot.sh
|
142
|
-
- contrib/steps/bootstrap/debian/bootstrap_if_needed.yaml
|
143
|
-
- contrib/steps/bootstrap/debian/bootstrap_static.yaml
|
144
|
-
- contrib/steps/bootstrap/debian/debootstrap_arm.yaml
|
145
|
-
- contrib/steps/export/clean_appliance.yaml
|
146
|
-
- contrib/steps/export/compact_qcow_img.yaml
|
147
|
-
- contrib/steps/export/save_as_g5k.yaml
|
148
|
-
- contrib/steps/setup/add_timestamp.yaml
|
149
|
-
- contrib/steps/setup/add_to_sudoers.yaml
|
150
|
-
- contrib/steps/setup/archlinux/configure_ruby.yaml
|
151
|
-
- contrib/steps/setup/archlinux/install_dev_tools.yaml
|
152
|
-
- contrib/steps/setup/archlinux/install_gnome.yaml
|
153
|
-
- contrib/steps/setup/archlinux/install_yaourt.yaml
|
154
|
-
- contrib/steps/setup/autologin.yaml
|
155
|
-
- contrib/steps/setup/centos/6.5/configure_repo.yaml
|
156
|
-
- contrib/steps/setup/copy_ssh_auth_file.yaml
|
157
|
-
- contrib/steps/setup/debian/add_network_interface.yaml
|
158
|
-
- contrib/steps/setup/debian/cluster_tools_install.yaml
|
159
|
-
- contrib/steps/setup/debian/install_gnome.yaml
|
160
|
-
- contrib/steps/setup/debian/install_kde.yaml
|
161
|
-
- contrib/steps/setup/debian/network_config_static.yaml
|
162
|
-
- contrib/steps/setup/generate_user_ssh_key.yaml
|
163
|
-
- contrib/steps/setup/install_my_ssh_key.yaml
|
164
|
-
- contrib/steps/setup/make_swap_file.yaml
|
165
|
-
- contrib/steps/setup/root_ssh_config.yaml
|
166
|
-
- contrib/steps/setup/set_user_password.yaml
|
167
|
-
- contrib/steps/setup/system_optimization.yaml
|
168
131
|
- erb/extend.yaml.erb
|
169
132
|
- erb/userconf.yaml.erb
|
170
133
|
- kameleon-builder.gemspec
|
@@ -184,7 +147,6 @@ files:
|
|
184
147
|
- lib/kameleon/utils.rb
|
185
148
|
- lib/kameleon/version.rb
|
186
149
|
- lib64
|
187
|
-
- scripts/bumpversion.py
|
188
150
|
- tests/helper.rb
|
189
151
|
- tests/issue76/fail.stdout
|
190
152
|
- tests/issue76/fail.yaml
|
@@ -229,12 +191,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
229
191
|
- !ruby/object:Gem::Version
|
230
192
|
version: '0'
|
231
193
|
requirements:
|
232
|
-
-
|
233
|
-
- graphviz
|
194
|
+
- git
|
195
|
+
- graphviz
|
234
196
|
rubygems_version: 3.2.5
|
235
197
|
signing_key:
|
236
198
|
specification_version: 4
|
237
|
-
summary:
|
199
|
+
summary: The mindful appliance builder
|
238
200
|
test_files:
|
239
201
|
- tests/helper.rb
|
240
202
|
- tests/issue76/fail.stdout
|
data/.bumpversion.cfg
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
[bumpversion]
|
2
|
-
commit = True
|
3
|
-
tag = True
|
4
|
-
current_version = 2.10.12
|
5
|
-
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\.(?P<release>[a-z]+))?
|
6
|
-
serialize =
|
7
|
-
{major}.{minor}.{patch}.{release}
|
8
|
-
{major}.{minor}.{patch}
|
9
|
-
|
10
|
-
[bumpversion:file:lib/kameleon/version.rb]
|
11
|
-
|
12
|
-
[bumpversion:part:release]
|
13
|
-
optional_value = gamma
|
14
|
-
values =
|
15
|
-
dev
|
16
|
-
gamma
|
@@ -1,12 +0,0 @@
|
|
1
|
-
#!/bin/bash
|
2
|
-
NAME=$1
|
3
|
-
VBOX_DISK=$2
|
4
|
-
|
5
|
-
VBoxManage createvm --name $NAME --register
|
6
|
-
VBoxManage modifyvm $NAME --memory 512
|
7
|
-
VBoxManage storagectl $NAME --name SATA --add sata --controller IntelAhci --bootable on --sataportcount 1
|
8
|
-
VBoxManage storageattach $NAME --storagectl SATA --port 0 --device 0 --type hdd --medium $VBOX_DISK
|
9
|
-
#VBoxManage modifyvm $NAME --nic1 hostonly
|
10
|
-
#VBoxManage modifyvm $NAME --nic1 nat
|
11
|
-
VBoxManage startvm $NAME
|
12
|
-
#VBoxManage unregistervm $NAME --delete
|
data/contrib/scripts/chroot_env
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
#!/usr/bin/env python3
|
2
|
-
### WARNING ###
|
3
|
-
# requires Python >= 3.3
|
4
|
-
|
5
|
-
import sys, crypt, getpass;
|
6
|
-
|
7
|
-
# this script generate a password using salted SHA512 whitch is the default on debian wheezy
|
8
|
-
|
9
|
-
cleartext = getpass.getpass("Password:")
|
10
|
-
cleartext2 = getpass.getpass("Again:")
|
11
|
-
if cleartext2 != cleartext:
|
12
|
-
print ('Not matched!')
|
13
|
-
sys.exit(1)
|
14
|
-
|
15
|
-
salt = crypt.mksalt(crypt.METHOD_SHA512)
|
16
|
-
print (crypt.crypt(cleartext, salt))
|
17
|
-
|
@@ -1,290 +0,0 @@
|
|
1
|
-
#!/bin/sh -e
|
2
|
-
# Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
|
3
|
-
# Use of this source code is governed by a BSD-style license that can be
|
4
|
-
# found in the LICENSE file.
|
5
|
-
|
6
|
-
APPLICATION="${0##*/}"
|
7
|
-
ALLCHROOTS=''
|
8
|
-
BINDIR="`dirname "\`readlink -f "$0"\`"`"
|
9
|
-
CHROOTS="`readlink -f "$BINDIR/../chroots"`"
|
10
|
-
EXCLUDEROOT=''
|
11
|
-
FORCE=''
|
12
|
-
PRINT=''
|
13
|
-
SIGNAL='TERM'
|
14
|
-
TRIES=5
|
15
|
-
YES=''
|
16
|
-
|
17
|
-
USAGE="$APPLICATION [options] name [...]
|
18
|
-
|
19
|
-
Unmounts one or more chroots, optionally killing any processes still running
|
20
|
-
inside them.
|
21
|
-
|
22
|
-
By default, it will run in interactive mode where it will ask to kill any
|
23
|
-
remaining processes if unable to unmount the chroot within 5 seconds.
|
24
|
-
|
25
|
-
Options:
|
26
|
-
-a Unmount all chroots in the CHROOTS directory.
|
27
|
-
-c CHROOTS Directory the chroots are in. Default: $CHROOTS
|
28
|
-
-f Forces a chroot to unmount, potentially breaking or killing
|
29
|
-
other instances of the same chroot.
|
30
|
-
-k KILL Send the processes SIGKILL instead of SIGTERM.
|
31
|
-
-p Print to STDOUT the processes stopping a chroot from unmounting.
|
32
|
-
-t TRIES Number of seconds to try before signalling the processes.
|
33
|
-
Use -t inf to be exceedingly patient. Default: $TRIES
|
34
|
-
-x Keep the root directory of the chroot mounted.
|
35
|
-
-y Signal any remaining processes without confirmation.
|
36
|
-
Automatically escalates from SIGTERM to SIGKILL."
|
37
|
-
|
38
|
-
# Function to exit with exit code $1, spitting out message $@ to stderr
|
39
|
-
error() {
|
40
|
-
local ecode="$1"
|
41
|
-
shift
|
42
|
-
echo "$*" 1>&2
|
43
|
-
exit "$ecode"
|
44
|
-
}
|
45
|
-
|
46
|
-
# Process arguments
|
47
|
-
while getopts 'ac:fkpt:xy' f; do
|
48
|
-
case "$f" in
|
49
|
-
a) ALLCHROOTS='y';;
|
50
|
-
c) CHROOTS="`readlink -f "$OPTARG"`";;
|
51
|
-
f) FORCE='y';;
|
52
|
-
k) SIGNAL="KILL";;
|
53
|
-
p) PRINT='y';;
|
54
|
-
t) TRIES="$OPTARG";;
|
55
|
-
x) EXCLUDEROOT='y';;
|
56
|
-
y) YES='a';;
|
57
|
-
\?) error 2 "$USAGE";;
|
58
|
-
esac
|
59
|
-
done
|
60
|
-
shift "$((OPTIND-1))"
|
61
|
-
|
62
|
-
# Need at least one chroot listed, or -a; not both.
|
63
|
-
if [ $# = 0 -a -z "$ALLCHROOTS" ] || [ ! $# = 0 -a -n "$ALLCHROOTS" ]; then
|
64
|
-
error 2 "$USAGE"
|
65
|
-
fi
|
66
|
-
|
67
|
-
# Make sure TRIES is valid
|
68
|
-
if [ "$TRIES" = inf ]; then
|
69
|
-
TRIES=-1
|
70
|
-
elif [ "$TRIES" -lt -1 ]; then
|
71
|
-
error 2 "$USAGE"
|
72
|
-
fi
|
73
|
-
|
74
|
-
# We need to run as root
|
75
|
-
if [ ! "$USER" = root -a ! "$UID" = 0 ]; then
|
76
|
-
error 2 "$APPLICATION must be run as root."
|
77
|
-
fi
|
78
|
-
|
79
|
-
# Check if a chroot is running with this directory. We detect the
|
80
|
-
# appropriate commands by checking if the command's parent root is not equal
|
81
|
-
# to the pid's root. This avoids not unmounting due to a lazy-quitting
|
82
|
-
# background application within the chroot. We also don't consider processes
|
83
|
-
# that have a parent PID of 1 (which would mean an orphaned process in this
|
84
|
-
# case), as enter-chroot never orphans its children, and we don't consider
|
85
|
-
# processes that have CROUTON=CORE in the environment.
|
86
|
-
# $1: $base; the canonicalized base path of the chroot
|
87
|
-
# Returns: non-zero if the chroot is in use.
|
88
|
-
checkusage() {
|
89
|
-
if [ -n "$FORCE" ]; then
|
90
|
-
return 0
|
91
|
-
fi
|
92
|
-
local b="${1%/}/" pid ppid proot prootdir root rootdir
|
93
|
-
for root in /proc/*/root; do
|
94
|
-
if [ ! -r "$root" ]; then
|
95
|
-
continue
|
96
|
-
fi
|
97
|
-
rootdir="`readlink -f "$root"`"
|
98
|
-
rootdir="${rootdir%/}/"
|
99
|
-
if [ "${rootdir#"$b"}" = "$rootdir" ]; then
|
100
|
-
continue
|
101
|
-
fi
|
102
|
-
pid="${root#/proc/}"
|
103
|
-
pid="${pid%/root}"
|
104
|
-
ppid="`ps -p "$pid" -o ppid= 2>/dev/null | sed 's/ //g'`"
|
105
|
-
if [ -z "$ppid" ] || [ "$ppid" -eq 1 ]; then
|
106
|
-
continue
|
107
|
-
fi
|
108
|
-
proot="/proc/$ppid/root"
|
109
|
-
if [ -r "$proot" ]; then
|
110
|
-
prootdir="`readlink -f "$proot"`"
|
111
|
-
if [ "${prootdir%/}/" = "$rootdir" ]; then
|
112
|
-
continue
|
113
|
-
fi
|
114
|
-
fi
|
115
|
-
if grep -q 'CROUTON=CORE' "/proc/$pid/environ" 2>/dev/null; then
|
116
|
-
continue
|
117
|
-
fi
|
118
|
-
if [ -n "$PRINT" ]; then
|
119
|
-
ps -p "$pid" -o pid= -o cmd= || true
|
120
|
-
fi
|
121
|
-
return 1
|
122
|
-
done
|
123
|
-
return 0
|
124
|
-
}
|
125
|
-
|
126
|
-
# If we specified all chroots, bring in all chroots.
|
127
|
-
if [ -n "$ALLCHROOTS" ]; then
|
128
|
-
set -- "$CHROOTS/"*
|
129
|
-
fi
|
130
|
-
|
131
|
-
# Follows and fixes dangerous symlinks, returning the canonicalized path.
|
132
|
-
fixabslinks() {
|
133
|
-
local p="$CHROOT/$1" c
|
134
|
-
# Follow and fix dangerous absolute symlinks
|
135
|
-
while c="`readlink -m "$p"`" && [ ! "$c" = "$p" ]; do
|
136
|
-
p="$CHROOT${c#"$CHROOT"}"
|
137
|
-
done
|
138
|
-
echo "$p"
|
139
|
-
}
|
140
|
-
|
141
|
-
# Unmount each chroot
|
142
|
-
ret=0
|
143
|
-
for NAME in "$@"; do
|
144
|
-
if [ -z "$NAME" ]; then
|
145
|
-
continue
|
146
|
-
fi
|
147
|
-
|
148
|
-
NAME="${NAME#"$CHROOTS/"}"
|
149
|
-
|
150
|
-
# Check for existence
|
151
|
-
CHROOT="$CHROOTS/$NAME"
|
152
|
-
if [ ! -d "$CHROOT" ]; then
|
153
|
-
echo "$CHROOT not found." 1>&2
|
154
|
-
ret=1
|
155
|
-
continue
|
156
|
-
fi
|
157
|
-
|
158
|
-
# Switch to the unencrypted mount for encrypted chroots.
|
159
|
-
if [ -f "$CHROOT/.ecryptfs" ]; then
|
160
|
-
CHROOT="$CHROOTS/.secure/$NAME"
|
161
|
-
fi
|
162
|
-
|
163
|
-
base="`readlink -f "$CHROOT"`"
|
164
|
-
|
165
|
-
if ! checkusage "$base"; then
|
166
|
-
echo "Not unmounting $CHROOT as another instance is using it." 1>&2
|
167
|
-
ret=1
|
168
|
-
continue
|
169
|
-
fi
|
170
|
-
|
171
|
-
# Kill the chroot's system dbus if one is running; failure is fine
|
172
|
-
env -i chroot "$CHROOT" su -s '/bin/sh' -c '
|
173
|
-
pidfile="/var/run/dbus/pid"
|
174
|
-
if [ ! -f "$pidfile" ]; then
|
175
|
-
exit 0
|
176
|
-
fi
|
177
|
-
pid="`cat "$pidfile"`"
|
178
|
-
if ! grep -q "^dbus-daemon" "/proc/$pid/cmdline" 2>/dev/null; then
|
179
|
-
exit 0
|
180
|
-
fi
|
181
|
-
kill $pid' - root 2>/dev/null || true
|
182
|
-
|
183
|
-
# Unmount all mounts
|
184
|
-
ntries=0
|
185
|
-
if [ -z "$EXCLUDEROOT" ]; then
|
186
|
-
echo "Unmounting $CHROOT..." 1>&2
|
187
|
-
else
|
188
|
-
echo "Pruning $CHROOT mounts..." 1>&2
|
189
|
-
fi
|
190
|
-
baseesc="`echo "$base" | sed 's= =//=g'`"
|
191
|
-
|
192
|
-
# Define the mountpoint filter to only unmount specific mounts.
|
193
|
-
# The filter is run on the escaped version of the mountpoint.
|
194
|
-
filter() {
|
195
|
-
if [ -z "$EXCLUDEROOT" ]; then
|
196
|
-
grep "^$baseesc\\(/.*\\)\\?\$"
|
197
|
-
else
|
198
|
-
# Don't include the base directory
|
199
|
-
grep "^$baseesc/."
|
200
|
-
fi
|
201
|
-
}
|
202
|
-
|
203
|
-
# Sync for safety
|
204
|
-
sync
|
205
|
-
|
206
|
-
# Make sure the chroot's system media bind-mount is marked as slave to avoid
|
207
|
-
# unmounting devices system-wide. We still want to unmount locally-mounted
|
208
|
-
# media, though.
|
209
|
-
media="`fixabslinks '/var/host/media'`"
|
210
|
-
if mountpoint -q "$media"; then
|
211
|
-
mount --make-rslave "$media"
|
212
|
-
fi
|
213
|
-
|
214
|
-
while ! sed "s=\\\\040=//=g" /proc/mounts | cut -d' ' -f2 \
|
215
|
-
| filter | sed 's=//= =g' | xargs --no-run-if-empty -d '
|
216
|
-
' -n 50 umount 2>/dev/null; do
|
217
|
-
if [ "$ntries" -eq "$TRIES" ]; then
|
218
|
-
# Send signal to all processes running under the chroot
|
219
|
-
# ...but confirm first.
|
220
|
-
printonly=''
|
221
|
-
if [ "${YES#[Aa]}" = "$YES" ]; then
|
222
|
-
echo -n "Failed to unmount $CHROOT. Kill processes? [a/k/y/p/N] " 1>&2
|
223
|
-
read YES
|
224
|
-
if [ ! "${YES#[Kk]}" = "$YES" ]; then
|
225
|
-
SIGNAL='KILL'
|
226
|
-
elif [ ! "${YES#[Pp]}" = "$YES" ]; then
|
227
|
-
printonly=y
|
228
|
-
elif [ "${YES#[AaYy]}" = "$YES" ]; then
|
229
|
-
echo "Skipping unmounting of $CHROOT" 1>&2
|
230
|
-
ret=1
|
231
|
-
break
|
232
|
-
fi
|
233
|
-
fi
|
234
|
-
if [ -z "$printonly" ]; then
|
235
|
-
echo "Sending SIG$SIGNAL to processes under $CHROOT..." 1>&2
|
236
|
-
fi
|
237
|
-
for root in /proc/*/root; do
|
238
|
-
if [ ! -r "$root" ] \
|
239
|
-
|| [ ! "`readlink -f "$root"`" = "$base" ]; then
|
240
|
-
continue
|
241
|
-
fi
|
242
|
-
pid="${root#/proc/}"
|
243
|
-
pid="${pid%/root}"
|
244
|
-
if [ -z "$FORCE" ] \
|
245
|
-
&& grep -q 'CROUTON=CORE' \
|
246
|
-
"/proc/$pid/environ" 2>/dev/null; then
|
247
|
-
continue
|
248
|
-
fi
|
249
|
-
if [ -n "${printonly:-"$PRINT"}" ]; then
|
250
|
-
ps -p "$pid" -o pid= -o cmd= || true
|
251
|
-
fi
|
252
|
-
if [ -z "$printonly" ]; then
|
253
|
-
kill "-$SIGNAL" "$pid" 2>/dev/null || true
|
254
|
-
fi
|
255
|
-
done
|
256
|
-
|
257
|
-
# Escalate
|
258
|
-
if [ ! "${YES#[Aa]}" = "$YES" ]; then
|
259
|
-
SIGNAL='KILL'
|
260
|
-
fi
|
261
|
-
|
262
|
-
if [ -z "$printonly" ]; then
|
263
|
-
ntries=0
|
264
|
-
fi
|
265
|
-
else
|
266
|
-
ntries="$((ntries+1))"
|
267
|
-
fi
|
268
|
-
sleep 1
|
269
|
-
if ! checkusage "$base"; then
|
270
|
-
echo "Aborting unmounting $CHROOT as another instance has begun using it." 1>&2
|
271
|
-
ret=1
|
272
|
-
break
|
273
|
-
fi
|
274
|
-
done
|
275
|
-
|
276
|
-
# More sync for more safety
|
277
|
-
sync
|
278
|
-
done
|
279
|
-
|
280
|
-
# Re-disable USB persistence (the Chromium OS default) if we no longer
|
281
|
-
# have chroots running with a root in removable media
|
282
|
-
if checkusage /media; then
|
283
|
-
for usbp in /sys/bus/usb/devices/*/power/persist; do
|
284
|
-
if [ -e "$usbp" ]; then
|
285
|
-
echo 0 > "$usbp"
|
286
|
-
fi
|
287
|
-
done
|
288
|
-
fi
|
289
|
-
|
290
|
-
exit $ret
|
@@ -1,47 +0,0 @@
|
|
1
|
-
# This step store the bootstrap for a particular distrib and achitechture
|
2
|
-
# to avoid downloading on every execution
|
3
|
-
# Bootstrap if needed
|
4
|
-
- debootstrap:
|
5
|
-
- exec_out: |
|
6
|
-
export tgz_bootstrap_file=$(echo "../$$workdir""/bootstrap/""$$distrib""_$$debian_version_name""_$$arch"".tar.gz")
|
7
|
-
mkdir -p $(dirname $tgz_bootstrap_file)
|
8
|
-
if [ ! -f "$tgz_bootstrap_file" ]
|
9
|
-
then
|
10
|
-
debootstrap --arch=$$arch $$debian_version_name $$rootfs $$distrib_repository
|
11
|
-
tar zcf $tgz_bootstrap_file -C $$rootfs --numeric-owner --one-file-system .
|
12
|
-
else
|
13
|
-
tar zxf $tgz_bootstrap_file -C $$rootfs
|
14
|
-
cp -f /etc/resolv.conf $$rootfs/etc
|
15
|
-
fi
|
16
|
-
#- include:
|
17
|
-
# - mount_proc
|
18
|
-
- mount_dev:
|
19
|
-
- exec_out: mount -o bind /dev $$rootfs/dev
|
20
|
-
- on_setup_clean: |
|
21
|
-
if mountpoint -q $$rootfs/dev
|
22
|
-
then umount $$rootfs/dev
|
23
|
-
fi
|
24
|
-
|
25
|
-
- exec_out: mount -o bind /dev/pts $$rootfs/dev/pts
|
26
|
-
- on_setup_clean: |
|
27
|
-
if mountpoint -q $$rootfs/dev/pts
|
28
|
-
then umount $$rootfs/dev/pts
|
29
|
-
fi
|
30
|
-
- mount_proc:
|
31
|
-
- exec_out: mount -o bind /proc $$rootfs/proc
|
32
|
-
- on_setup_clean: |
|
33
|
-
if mountpoint -q $$rootfs/proc
|
34
|
-
then umount $$rootfs/proc
|
35
|
-
fi
|
36
|
-
- mount_sys:
|
37
|
-
- exec_out: mount -o bind /sys $$rootfs/sys
|
38
|
-
- on_setup_clean: |
|
39
|
-
if mountpoint -q $$rootfs/sys
|
40
|
-
then umount $$rootfs/sys
|
41
|
-
fi
|
42
|
-
|
43
|
-
- update_bootstrap:
|
44
|
-
- exec_in: |
|
45
|
-
DEBIAN_FRONTEND=noninteractive apt-get -y --force-yes update
|
46
|
-
DEBIAN_FRONTEND=noninteractive apt-get -y --force-yes dist-upgrade
|
47
|
-
|
@@ -1,38 +0,0 @@
|
|
1
|
-
# # Bootstrap Static
|
2
|
-
- debootstrap:
|
3
|
-
- check_cmd: cdebootstrap-static
|
4
|
-
- exec_out: |
|
5
|
-
cdebootstrap-static \
|
6
|
-
--verbose \
|
7
|
-
--allow-unauthenticated \
|
8
|
-
--arch=$$arch \
|
9
|
-
--include=locales \
|
10
|
-
$$debian_version_name \
|
11
|
-
$$rootfs \
|
12
|
-
$$distrib_repository
|
13
|
-
#- include:
|
14
|
-
# - mount_proc
|
15
|
-
- mount_dev:
|
16
|
-
- exec_out: mount -o bind /dev $$rootfs/dev
|
17
|
-
- on_setup_clean: |
|
18
|
-
if mountpoint -q $$rootfs/dev
|
19
|
-
then umount $$rootfs/dev
|
20
|
-
fi
|
21
|
-
|
22
|
-
- exec_out: mount -o bind /dev/pts $$rootfs/dev/pts
|
23
|
-
- on_setup_clean: |
|
24
|
-
if mountpoint -q $$rootfs/dev/pts
|
25
|
-
then umount $$rootfs/dev/pts
|
26
|
-
fi
|
27
|
-
- mount_proc:
|
28
|
-
- exec_out: mount -o bind /proc $$rootfs/proc
|
29
|
-
- on_setup_clean: |
|
30
|
-
if mountpoint -q $$rootfs/proc
|
31
|
-
then umount $$rootfs/proc
|
32
|
-
fi
|
33
|
-
- mount_sys:
|
34
|
-
- exec_out: mount -o bind /sys $$rootfs/sys
|
35
|
-
- on_setup_clean: |
|
36
|
-
if mountpoint -q $$rootfs/sys
|
37
|
-
then umount $$rootfs/sys
|
38
|
-
fi
|
@@ -1,23 +0,0 @@
|
|
1
|
-
# # Bootstrap
|
2
|
-
- enable_cache: true
|
3
|
-
|
4
|
-
- debootstrap:
|
5
|
-
- check_cmd_out: debootstrap
|
6
|
-
- check_cmd_out: qemu-arm-static
|
7
|
-
- exec_out:|
|
8
|
-
mkdir -p $$rootfs
|
9
|
-
debootstrap --no-check-gpg --foreign --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
|
17
|
-
- write_out:
|
18
|
-
- $$rootfs/etc/network/interfaces
|
19
|
-
- |
|
20
|
-
auto lo
|
21
|
-
iface lo inet loopback
|
22
|
-
auto eth0
|
23
|
-
iface eth0 inet dhcp
|
@@ -1,12 +0,0 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
- nullify_freespace:
|
4
|
-
- exec_out: |
|
5
|
-
echo "Nullify freespace..."
|
6
|
-
dd if=/dev/zero of=$$mountdir/bigemptyfile bs=1M 2>&1 >/dev/null || true
|
7
|
-
rm -f $$mountdir/bigemptyfile
|
8
|
-
echo "sync..." ; sync
|
9
|
-
|
10
|
-
- compact_qcow_img:
|
11
|
-
- exec_out: qemu-img convert -c -O qcow2 $$filename compressed_$$filename
|
12
|
-
- exec_out: mv compressed_$$filename $$filename
|