@@ -23,7 +23,8 @@ function depends_image() {
2323function _get_info_image() {
2424 local dist=" $1 "
2525 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"
2728 [[ ! -f " $ini " ]] && fatalError " Definition file $ini does not exist"
2829
2930 iniConfig " =" " \" " " $ini "
@@ -37,7 +38,7 @@ function create_chroot_image() {
3738 [[ -z " $dist " ]] && return 1
3839
3940 local chroot=" $2 "
40- [[ -z " $chroot " ]] && chroot=" $md_build /chroot "
41+ [[ -z " $chroot " ]] && chroot=" $md_build /$dist "
4142
4243 mkdir -p " $md_build "
4344 pushd " $md_build "
@@ -105,7 +106,7 @@ function install_rp_image() {
105106 fi
106107
107108 local chroot=" $3 "
108- [[ -z " $chroot " ]] && chroot=" $md_build /chroot "
109+ [[ -z " $chroot " ]] && chroot=" $md_build /$dist "
109110
110111 local dist_version=" $( _get_info_image " $dist " " version" ) "
111112
@@ -180,6 +181,9 @@ _EOF_
180181}
181182
182183function _init_chroot_image() {
184+ local chroot=" $1 "
185+ [[ -z " $chroot " ]] && return 1
186+
183187 # unmount on ctrl+c
184188 trap " _trap_chroot_image '$chroot '" INT
185189
@@ -202,7 +206,7 @@ function _init_chroot_image() {
202206
203207function _deinit_chroot_image() {
204208 local chroot=" $1 "
205- [[ -z " $chroot " ]] && chroot= " $md_build /chroot "
209+ [[ -z " $chroot " ]] && return 1
206210
207211 trap " " INT
208212
@@ -224,7 +228,7 @@ function _trap_chroot_image() {
224228
225229function chroot_image() {
226230 local chroot=" $1 "
227- [[ -z " $chroot " ]] && chroot= " $md_build /chroot "
231+ [[ -z " $chroot " ]] && return 1
228232 shift
229233
230234 printMsgs " console" " Chrooting to $chroot ..."
@@ -311,7 +315,7 @@ function create_bb_image() {
311315 [[ -z " $image " ]] && return 1
312316
313317 local chroot=" $2 "
314- [[ -z " $chroot " ]] && chroot= " $md_build /chroot "
318+ [[ -z " $chroot " ]] && return 1
315319
316320 # replace fstab
317321 echo " proc /proc proc defaults 0 0" > " $chroot /etc/fstab"
@@ -346,7 +350,7 @@ function platform_image() {
346350 printMsgs " heading" " Building $platform image based on $dist ..."
347351
348352 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 "
350354
351355 local dist_name=" $( _get_info_image " $dist " " name" ) "
352356 local file_add=" $( _get_info_image " $dist " " file_${platform} " ) "
0 commit comments