@@ -23,7 +23,8 @@ function depends_image() {
23
23
function _get_info_image() {
24
24
local dist=" $1 "
25
25
local key=" $2 "
26
- local ini=" $md_data /dists/${dist} .ini"
26
+ # don't use $md_data so this function can be used directly from builder.sh
27
+ local ini=" ${__mod_info[image/path]%/* } /image/dists/${dist} .ini"
27
28
[[ ! -f " $ini " ]] && fatalError " Definition file $ini does not exist"
28
29
29
30
iniConfig " =" " \" " " $ini "
@@ -37,7 +38,7 @@ function create_chroot_image() {
37
38
[[ -z " $dist " ]] && return 1
38
39
39
40
local chroot=" $2 "
40
- [[ -z " $chroot " ]] && chroot=" $md_build /chroot "
41
+ [[ -z " $chroot " ]] && chroot=" $md_build /$dist "
41
42
42
43
mkdir -p " $md_build "
43
44
pushd " $md_build "
@@ -105,7 +106,7 @@ function install_rp_image() {
105
106
fi
106
107
107
108
local chroot=" $3 "
108
- [[ -z " $chroot " ]] && chroot=" $md_build /chroot "
109
+ [[ -z " $chroot " ]] && chroot=" $md_build /$dist "
109
110
110
111
local dist_version=" $( _get_info_image " $dist " " version" ) "
111
112
@@ -180,6 +181,9 @@ _EOF_
180
181
}
181
182
182
183
function _init_chroot_image() {
184
+ local chroot=" $1 "
185
+ [[ -z " $chroot " ]] && return 1
186
+
183
187
# unmount on ctrl+c
184
188
trap " _trap_chroot_image '$chroot '" INT
185
189
@@ -202,7 +206,7 @@ function _init_chroot_image() {
202
206
203
207
function _deinit_chroot_image() {
204
208
local chroot=" $1 "
205
- [[ -z " $chroot " ]] && chroot= " $md_build /chroot "
209
+ [[ -z " $chroot " ]] && return 1
206
210
207
211
trap " " INT
208
212
@@ -224,7 +228,7 @@ function _trap_chroot_image() {
224
228
225
229
function chroot_image() {
226
230
local chroot=" $1 "
227
- [[ -z " $chroot " ]] && chroot= " $md_build /chroot "
231
+ [[ -z " $chroot " ]] && return 1
228
232
shift
229
233
230
234
printMsgs " console" " Chrooting to $chroot ..."
@@ -311,7 +315,7 @@ function create_bb_image() {
311
315
[[ -z " $image " ]] && return 1
312
316
313
317
local chroot=" $2 "
314
- [[ -z " $chroot " ]] && chroot= " $md_build /chroot "
318
+ [[ -z " $chroot " ]] && return 1
315
319
316
320
# replace fstab
317
321
echo " proc /proc proc defaults 0 0" > " $chroot /etc/fstab"
@@ -346,7 +350,7 @@ function platform_image() {
346
350
printMsgs " heading" " Building $platform image based on $dist ..."
347
351
348
352
rp_callModule image create_chroot " $dist "
349
- rp_callModule image install_rp " $platform " " $dist " " $md_build /chroot "
353
+ rp_callModule image install_rp " $platform " " $dist " " $md_build /$dist "
350
354
351
355
local dist_name=" $( _get_info_image " $dist " " name" ) "
352
356
local file_add=" $( _get_info_image " $dist " " file_${platform} " ) "
0 commit comments