summaryrefslogtreecommitdiffstats
path: root/classes
diff options
context:
space:
mode:
authorAnton Gerasimov <anton@advancedtelematic.com>2017-04-03 12:05:53 +0200
committerAnton Gerasimov <anton@advancedtelematic.com>2017-04-03 12:10:27 +0200
commitb49c2631b6bc48ead4d352e2bd00cdfbca7af5e8 (patch)
tree1493f6d046067c36a4059b26b690f5d8cae9f50d /classes
parent501e07acd803df6f9264c4206b4b9529006f287a (diff)
downloadmeta-updater-b49c2631b6bc48ead4d352e2bd00cdfbca7af5e8.tar.gz
Replace sdcard_image* classes with wic
Diffstat (limited to 'classes')
-rw-r--r--classes/sdcard_image-dra7xx-evm-ota.bbclass75
-rw-r--r--classes/sdcard_image-minnowboard-ota.bbclass78
-rw-r--r--classes/sdcard_image-porter-ota.bbclass78
3 files changed, 0 insertions, 231 deletions
diff --git a/classes/sdcard_image-dra7xx-evm-ota.bbclass b/classes/sdcard_image-dra7xx-evm-ota.bbclass
deleted file mode 100644
index 179ed10..0000000
--- a/classes/sdcard_image-dra7xx-evm-ota.bbclass
+++ /dev/null
@@ -1,75 +0,0 @@
1inherit image_types
2
3# Boot partition volume id
4BOOTDD_VOLUME_ID ?= "${MACHINE}"
5
6# Boot partition size [in KiB] (will be rounded up to IMAGE_ROOTFS_ALIGNMENT)
7BOOT_SPACE ?= "4096"
8
9IMAGE_ROOTFS_ALIGNMENT = "4096"
10SDIMG_OTA_ROOTFS_TYPE ?= "otaimg"
11SDIMG_OTA_ROOTFS = "${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.${SDIMG_OTA_ROOTFS_TYPE}"
12
13IMAGE_TYPEDEP_dra7xx-evm-sdimg-ota = "${SDIMG_OTA_ROOTFS_TYPE}"
14IMAGE_DEPENDS_dra7xx-evm-sdimg-ota = " \
15 parted-native \
16 mtools-native \
17 dosfstools-native \
18 "
19
20SDIMG_OTA = "${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.dra7xx-evm-sdimg-ota"
21
22IMAGE_CMD_dra7xx-evm-sdimg-ota () {
23 OTAROOT_SIZE=`du -Lb ${SDIMG_OTA_ROOTFS} | cut -f1`
24 OTAROOT_SIZE=$(expr ${OTAROOT_SIZE} / 1024 + 1)
25 BOOT_SPACE_ALIGNED=$(expr ${BOOT_SPACE} + ${IMAGE_ROOTFS_ALIGNMENT} - 1)
26 BOOT_SPACE_ALIGNED=$(expr ${BOOT_SPACE_ALIGNED} - ${BOOT_SPACE_ALIGNED} % ${IMAGE_ROOTFS_ALIGNMENT})
27 SDIMG_OTA_SIZE=$(expr ${IMAGE_ROOTFS_ALIGNMENT} + ${BOOT_SPACE_ALIGNED} + $OTAROOT_SIZE)
28
29 echo "Creating filesystem with Boot partition ${BOOT_SPACE_ALIGNED} KiB and RootFS $OTAROOT_SIZE KiB"
30
31 # Initialize sdcard image file
32 dd if=/dev/zero of=${SDIMG_OTA} bs=1024 count=0 seek=${SDIMG_OTA_SIZE}
33
34 # Create partition table
35 parted -s ${SDIMG_OTA} mklabel msdos
36 # Create boot partition and mark it as bootable
37 parted -s ${SDIMG_OTA} unit KiB mkpart primary fat32 ${IMAGE_ROOTFS_ALIGNMENT} $(expr ${BOOT_SPACE_ALIGNED} \+ ${IMAGE_ROOTFS_ALIGNMENT})
38 parted -s ${SDIMG_OTA} set 1 boot on
39 # Create rootfs partition to the end of disk
40 parted -s ${SDIMG_OTA} -- unit KiB mkpart primary ext2 $(expr ${BOOT_SPACE_ALIGNED} \+ ${IMAGE_ROOTFS_ALIGNMENT}) -1s
41 parted ${SDIMG_OTA} print
42
43 # Create a vfat image with boot files
44 BOOT_BLOCKS=$(LC_ALL=C parted -s ${SDIMG_OTA} unit b print | awk '/ 1 / { print substr($4, 1, length($4 -1)) / 512 /2 }')
45 rm -f ${WORKDIR}/boot.img
46 mkfs.vfat -n "${BOOTDD_VOLUME_ID}" -S 512 -C ${WORKDIR}/boot.img $BOOT_BLOCKS
47 sync
48
49 sync
50 #dd if=${WORKDIR}/boot.img of=${SDIMG_OTA} conv=notrunc seek=1 bs=$(expr ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) && sync && sync
51
52 if echo "${SDIMG_OTA_ROOTFS_TYPE}" | egrep -q "*\.xz"
53 then
54 xzcat ${SDIMG_OTA_ROOTFS} | dd of=${SDIMG_OTA} conv=notrunc seek=1 bs=$(expr 1024 \* ${BOOT_SPACE_ALIGNED} + ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) && sync && sync
55 else
56 dd if=${SDIMG_OTA_ROOTFS} of=${SDIMG_OTA} conv=notrunc seek=1 bs=$(expr 1024 \* ${BOOT_SPACE_ALIGNED} + ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) && sync && sync
57 fi
58
59 # Optionally apply compression
60 case "${SDIMG_OTA_COMPRESSION}" in
61 "gzip")
62 gzip -k9 "${SDIMG_OTA}"
63 ;;
64 "bzip2")
65 bzip2 -k9 "${SDIMG_OTA}"
66 ;;
67 "xz")
68 xz -k "${SDIMG_OTA}"
69 ;;
70 esac
71
72 rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.rootfs.dra7xx-evm-sdimg-ota
73 ln -s ${IMAGE_NAME}.rootfs.dra7xx-evm-sdimg-ota ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.rootfs.dra7xx-evm-sdimg-ota
74}
75
diff --git a/classes/sdcard_image-minnowboard-ota.bbclass b/classes/sdcard_image-minnowboard-ota.bbclass
deleted file mode 100644
index c49b3cd..0000000
--- a/classes/sdcard_image-minnowboard-ota.bbclass
+++ /dev/null
@@ -1,78 +0,0 @@
1inherit image_types
2
3# Boot partition volume id
4BOOTDD_VOLUME_ID ?= "${MACHINE}"
5
6# Boot partition size [in KiB] (will be rounded up to IMAGE_ROOTFS_ALIGNMENT)
7BOOT_SPACE ?= "4096"
8
9IMAGE_ROOTFS_ALIGNMENT = "4096"
10SDIMG_OTA_ROOTFS_TYPE ?= "otaimg"
11SDIMG_OTA_ROOTFS = "${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.${SDIMG_OTA_ROOTFS_TYPE}"
12
13IMAGE_TYPEDEP_minnowboard-sdimg-ota = "${SDIMG_OTA_ROOTFS_TYPE}"
14IMAGE_DEPENDS_minnowboard-sdimg-ota = " \
15 parted-native \
16 mtools-native \
17 dosfstools-native \
18 minnowboard-bootfiles \
19 "
20
21SDIMG_OTA = "${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.minnowboard-sdimg-ota"
22
23IMAGE_CMD_minnowboard-sdimg-ota () {
24 OTAROOT_SIZE=`du -Lb ${SDIMG_OTA_ROOTFS} | cut -f1`
25 OTAROOT_SIZE=$(expr ${OTAROOT_SIZE} / 1024 + 1)
26 BOOT_SPACE_ALIGNED=$(expr ${BOOT_SPACE} + ${IMAGE_ROOTFS_ALIGNMENT} - 1)
27 BOOT_SPACE_ALIGNED=$(expr ${BOOT_SPACE_ALIGNED} - ${BOOT_SPACE_ALIGNED} % ${IMAGE_ROOTFS_ALIGNMENT})
28 SDIMG_OTA_SIZE=$(expr ${IMAGE_ROOTFS_ALIGNMENT} + ${BOOT_SPACE_ALIGNED} + $OTAROOT_SIZE)
29
30 echo "Creating filesystem with Boot partition ${BOOT_SPACE_ALIGNED} KiB and RootFS $OTAROOT_SIZE KiB"
31
32 # Initialize sdcard image file
33 dd if=/dev/zero of=${SDIMG_OTA} bs=1024 count=0 seek=${SDIMG_OTA_SIZE}
34
35 # Create partition table
36 parted -s ${SDIMG_OTA} mklabel msdos
37 # Create boot partition and mark it as bootable
38 parted -s ${SDIMG_OTA} unit KiB mkpart primary fat32 ${IMAGE_ROOTFS_ALIGNMENT} $(expr ${BOOT_SPACE_ALIGNED} \+ ${IMAGE_ROOTFS_ALIGNMENT})
39 parted -s ${SDIMG_OTA} set 1 boot on
40 # Create rootfs partition to the end of disk
41 parted -s ${SDIMG_OTA} -- unit KiB mkpart primary ext2 $(expr ${BOOT_SPACE_ALIGNED} \+ ${IMAGE_ROOTFS_ALIGNMENT}) -1s
42 parted ${SDIMG_OTA} print
43
44 # Create a vfat image with boot files
45 BOOT_BLOCKS=$(LC_ALL=C parted -s ${SDIMG_OTA} unit b print | awk '/ 1 / { print substr($4, 1, length($4 -1)) / 512 /2 }')
46 rm -f ${WORKDIR}/boot.img
47 mkfs.vfat -n "${BOOTDD_VOLUME_ID}" -S 512 -C ${WORKDIR}/boot.img $BOOT_BLOCKS
48 sync
49
50 mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/minnowboard-bootfiles/* ::/
51
52 sync
53 dd if=${WORKDIR}/boot.img of=${SDIMG_OTA} conv=notrunc seek=1 bs=$(expr ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) && sync && sync
54
55 if echo "${SDIMG_OTA_ROOTFS_TYPE}" | egrep -q "*\.xz"
56 then
57 xzcat ${SDIMG_OTA_ROOTFS} | dd of=${SDIMG_OTA} conv=notrunc seek=1 bs=$(expr 1024 \* ${BOOT_SPACE_ALIGNED} + ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) && sync && sync
58 else
59 dd if=${SDIMG_OTA_ROOTFS} of=${SDIMG_OTA} conv=notrunc seek=1 bs=$(expr 1024 \* ${BOOT_SPACE_ALIGNED} + ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) && sync && sync
60 fi
61
62 # Optionally apply compression
63 case "${SDIMG_OTA_COMPRESSION}" in
64 "gzip")
65 gzip -k9 "${SDIMG_OTA}"
66 ;;
67 "bzip2")
68 bzip2 -k9 "${SDIMG_OTA}"
69 ;;
70 "xz")
71 xz -k "${SDIMG_OTA}"
72 ;;
73 esac
74
75 rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.minnowboard-sdimg-ota
76 ln -s ${IMAGE_NAME}.minnowboard-sdimg-ota ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.minnowboard-sdimg-ota
77}
78
diff --git a/classes/sdcard_image-porter-ota.bbclass b/classes/sdcard_image-porter-ota.bbclass
deleted file mode 100644
index a9619dc..0000000
--- a/classes/sdcard_image-porter-ota.bbclass
+++ /dev/null
@@ -1,78 +0,0 @@
1inherit image_types
2
3# Boot partition volume id
4BOOTDD_VOLUME_ID ?= "${MACHINE}"
5
6# Boot partition size [in KiB] (will be rounded up to IMAGE_ROOTFS_ALIGNMENT)
7BOOT_SPACE ?= "4096"
8
9IMAGE_ROOTFS_ALIGNMENT = "4096"
10SDIMG_OTA_ROOTFS_TYPE ?= "otaimg"
11SDIMG_OTA_ROOTFS = "${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.${SDIMG_OTA_ROOTFS_TYPE}"
12
13IMAGE_TYPEDEP_porter-sdimg-ota = "${SDIMG_OTA_ROOTFS_TYPE}"
14IMAGE_DEPENDS_porter-sdimg-ota = " \
15 parted-native \
16 mtools-native \
17 dosfstools-native \
18 porter-bootfiles \
19 "
20
21SDIMG_OTA = "${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.porter-sdimg-ota"
22
23IMAGE_CMD_porter-sdimg-ota () {
24 OTAROOT_SIZE=`du -Lb ${SDIMG_OTA_ROOTFS} | cut -f1`
25 OTAROOT_SIZE=$(expr ${OTAROOT_SIZE} / 1024 + 1)
26 BOOT_SPACE_ALIGNED=$(expr ${BOOT_SPACE} + ${IMAGE_ROOTFS_ALIGNMENT} - 1)
27 BOOT_SPACE_ALIGNED=$(expr ${BOOT_SPACE_ALIGNED} - ${BOOT_SPACE_ALIGNED} % ${IMAGE_ROOTFS_ALIGNMENT})
28 SDIMG_OTA_SIZE=$(expr ${IMAGE_ROOTFS_ALIGNMENT} + ${BOOT_SPACE_ALIGNED} + $OTAROOT_SIZE)
29
30 echo "Creating filesystem with Boot partition ${BOOT_SPACE_ALIGNED} KiB and RootFS $OTAROOT_SIZE KiB"
31
32 # Initialize sdcard image file
33 dd if=/dev/zero of=${SDIMG_OTA} bs=1024 count=0 seek=${SDIMG_OTA_SIZE}
34
35 # Create partition table
36 parted -s ${SDIMG_OTA} mklabel msdos
37 # Create boot partition and mark it as bootable
38 parted -s ${SDIMG_OTA} unit KiB mkpart primary fat32 ${IMAGE_ROOTFS_ALIGNMENT} $(expr ${BOOT_SPACE_ALIGNED} \+ ${IMAGE_ROOTFS_ALIGNMENT})
39 parted -s ${SDIMG_OTA} set 1 boot on
40 # Create rootfs partition to the end of disk
41 parted -s ${SDIMG_OTA} -- unit KiB mkpart primary ext2 $(expr ${BOOT_SPACE_ALIGNED} \+ ${IMAGE_ROOTFS_ALIGNMENT}) -1s
42 parted ${SDIMG_OTA} print
43
44 # Create a vfat image with boot files
45 BOOT_BLOCKS=$(LC_ALL=C parted -s ${SDIMG_OTA} unit b print | awk '/ 1 / { print substr($4, 1, length($4 -1)) / 512 /2 }')
46 rm -f ${WORKDIR}/boot.img
47 mkfs.vfat -n "${BOOTDD_VOLUME_ID}" -S 512 -C ${WORKDIR}/boot.img $BOOT_BLOCKS
48 sync
49
50 mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/porter-bootfiles/* ::/
51
52 sync
53 dd if=${WORKDIR}/boot.img of=${SDIMG_OTA} conv=notrunc seek=1 bs=$(expr ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) && sync && sync
54
55 if echo "${SDIMG_OTA_ROOTFS_TYPE}" | egrep -q "*\.xz"
56 then
57 xzcat ${SDIMG_OTA_ROOTFS} | dd of=${SDIMG_OTA} conv=notrunc seek=1 bs=$(expr 1024 \* ${BOOT_SPACE_ALIGNED} + ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) && sync && sync
58 else
59 dd if=${SDIMG_OTA_ROOTFS} of=${SDIMG_OTA} conv=notrunc seek=1 bs=$(expr 1024 \* ${BOOT_SPACE_ALIGNED} + ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) && sync && sync
60 fi
61
62 # Optionally apply compression
63 case "${SDIMG_OTA_COMPRESSION}" in
64 "gzip")
65 gzip -k9 "${SDIMG_OTA}"
66 ;;
67 "bzip2")
68 bzip2 -k9 "${SDIMG_OTA}"
69 ;;
70 "xz")
71 xz -k "${SDIMG_OTA}"
72 ;;
73 esac
74
75 rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.rootfs.porter-sdimg-ota
76 ln -s ${IMAGE_NAME}.rootfs.porter-sdimg-ota ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.rootfs.porter-sdimg-ota
77}
78