Skip to content

Commit

Permalink
make sure _pvr_pvroot_images_deploy fails if the tar commands fail.
Browse files Browse the repository at this point in the history
  • Loading branch information
KobusG committed Aug 4, 2023
1 parent 63d38d4 commit 1b52ab9
Showing 1 changed file with 22 additions and 16 deletions.
38 changes: 22 additions & 16 deletions classes/pvroot-image.bbclass
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ PVROOT_CONTAINERS_CORE ?= ""
PVROOT_IMAGE_BSP ?= ""
PVROOT_IMAGE ?= "yes"

DEPENDS += " pvr-native squashfs-tools-native"
DEPENDS += " pvr-native squashfs-tools-native ${INITRAMFS_IMAGE}"

IMAGE_BUILDINFO_FILE = "pvroot.build"

Expand All @@ -25,7 +25,7 @@ python __anonymous () {
pn = d.getVar("PN")

for img in d.getVar("PVROOT_IMAGE_BSP").split():
d.appendVarFlag('do_rootfs', 'depends', ' '+img+':do_image_complete')
d.appendVarFlag('do_rootfs', 'depends', ' '+img+':do_image_complete '+img+':do_image_pvbspit')
for img in d.getVar("PVROOT_CONTAINERS").split():
d.appendVarFlag('do_rootfs', 'depends', ' '+img+':do_deploy')
for img in d.getVar("PVROOT_CONTAINERS_CORE").split():
Expand Down Expand Up @@ -74,20 +74,26 @@ def _pvr_pvroot_images_deploy(d, factory, images):

imgpath = tmpdir + "/" + img + versionsuffix + ".pvrexport"
Path(imgpath).mkdir(parents=True,exist_ok=True)
process = subprocess.run(
['tar', '--no-same-owner', '-xvf', deployimg + "/" + img + '.pvrexport.tgz' ],
cwd=Path(imgpath),
env=my_env
)
print ("completed tar process: %d" % process.returncode)

process = subprocess.run(
['pvr', 'deploy', deployrootfs,
imgpath + '#_sigs/'+part+'.json,'+part ],
cwd=Path(tmpdir),
env=my_env
)
print ("completed pvr deploy process: %d" % process.returncode)
try:
subprocess.check_output(
['tar', '--no-same-owner', '-xvf', deployimg + "/" + img + '.pvrexport.tgz' ],
cwd=Path(imgpath),
stderr=subprocess.PIPE,
env=my_env
)
except subprocess.CalledProcessError as e:
bb.fatal("failed to extract pvrimage %s: \n%s\n%s" % (img, e.stdout, e.stderr))

try:
subprocess.check_output(
['pvr', 'deploy', deployrootfs,
imgpath + '#_sigs/'+part+'.json,'+part ],
cwd=Path(tmpdir),
stderr=subprocess.PIPE,
env=my_env
)
except subprocess.CalledProcessError as e:
bb.fatal("failed to deploy pvrimage %s: \n%s\n%s" % (img, e.stdout, e.stderr))


def do_rootfs_mixing(d):
Expand Down

0 comments on commit 1b52ab9

Please sign in to comment.