Skip to content

Commit c67646d

Browse files
committed
image: Extract partition images
Signed-off-by: Loïc Minier <[email protected]>
1 parent da9b295 commit c67646d

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

debos-recipes/qualcomm-linux-debian-image.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,20 @@ actions:
9696
# enable unit
9797
systemctl enable debos-grow-rootfs
9898
99+
- action: run
100+
description: Extract partition images
101+
postprocess: true
102+
command: |
103+
set -eux
104+
sector_size="{{if eq $imagetype "ufs"}}4096{{else}}512{{end}}"
105+
image="{{ $image }}"
106+
fdisk -b "${sector_size}" -l "${image}" |
107+
sed -n '1,/^Device/ d; p' |
108+
while read name start end sectors rest; do
109+
dd if="${image}" of="${ARTIFACTDIR}/${name}" \
110+
bs="${sector_size}" skip="${start}" count="${sectors}"
111+
done
112+
99113
- action: run
100114
description: Compress image file
101115
postprocess: true

0 commit comments

Comments
 (0)