ccardimx28js removal: clean image_type class
Actually remove the code to generate SD card images. https://jira.digi.com/browse/DEL-4771 Signed-off-by: Javier Viguera <javier.viguera@digi.com>
This commit is contained in:
parent
6b78236f42
commit
d2df029153
|
|
@ -298,65 +298,5 @@ IMAGE_CMD_sdcard() {
|
||||||
dd if=${SDIMG_ROOTFS} of=${SDIMG} conv=notrunc,fsync seek=1 bs=$(expr ${IMAGE_ROOTFS_ALIGNMENT} \* 1024 + ${BOOT_SPACE_ALIGNED} \* 1024)
|
dd if=${SDIMG_ROOTFS} of=${SDIMG} conv=notrunc,fsync seek=1 bs=$(expr ${IMAGE_ROOTFS_ALIGNMENT} \* 1024 + ${BOOT_SPACE_ALIGNED} \* 1024)
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
|
||||||
# Create an image that can by written onto a SD card using dd (for ccardimx28 family)
|
|
||||||
#
|
|
||||||
# The disk layout used is:
|
|
||||||
#
|
|
||||||
# 1. Not partitioned : reserved for bootloader (u-boot at 1MiB offset)
|
|
||||||
# 2. BOOT PARTITION : kernel and device tree blobs
|
|
||||||
# 3. ROOTFS PARTITION : rootfs
|
|
||||||
#
|
|
||||||
# 4MiB BOOT_SPACE ROOTFS_SIZE
|
|
||||||
# <----------------> <--------------------> <------------------------------>
|
|
||||||
# +---+--------------+----------------------+--------------------------------+
|
|
||||||
# | | U-BOOT (RAW) | BOOT PARTITION (FAT) | ROOTFS PARTITION (EXT4) |
|
|
||||||
# +---+--------------+----------------------+--------------------------------+
|
|
||||||
# ^ ^ ^ ^ ^
|
|
||||||
# | | | | |
|
|
||||||
# 0 1MiB 4MiB 4MiB + BOOT_SPACE SDIMG_SIZE
|
|
||||||
#
|
|
||||||
IMAGE_CMD_sdcard_ccardimx28() {
|
|
||||||
# Align boot partition and calculate total sdcard image size
|
|
||||||
BOOT_SPACE_ALIGNED="$(expr \( \( ${BOARD_BOOTIMAGE_PARTITION_SIZE} + ${IMAGE_ROOTFS_ALIGNMENT} - 1 \) / ${IMAGE_ROOTFS_ALIGNMENT} \) \* ${IMAGE_ROOTFS_ALIGNMENT})"
|
|
||||||
SDIMG_SIZE="$(expr ${IMAGE_ROOTFS_ALIGNMENT} + ${BOOT_SPACE_ALIGNED} + $ROOTFS_SIZE)"
|
|
||||||
|
|
||||||
# Initialize sdcard image file
|
|
||||||
dd if=/dev/zero of=${SDIMG} bs=1024 count=0 seek=${SDIMG_SIZE}
|
|
||||||
|
|
||||||
#
|
|
||||||
# Bootstream header for u-boot at 1M offset
|
|
||||||
#
|
|
||||||
# The offset is coded in bytes 29-32 in little-endian. The
|
|
||||||
# value to set is the offset in 512 bytes blocks + 1.
|
|
||||||
#
|
|
||||||
# For 1M offset we can calculate the bytes:
|
|
||||||
#
|
|
||||||
# printf '%08x' 2049 | grep -o .. | tac | tr -d '\n'
|
|
||||||
#
|
|
||||||
BS_HDR="\x33\x22\x11\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x08\x00\x00\x00\x00\x00\x00"
|
|
||||||
|
|
||||||
# Use 'printf' command and not shell builtins because hexadecimal
|
|
||||||
# format does not work well with 'dash' shell
|
|
||||||
PRINTF="$(which printf)"
|
|
||||||
|
|
||||||
# Create partition table, boot partition (with bootable flag) and rootfs partition (to the end of the disk)
|
|
||||||
parted -s ${SDIMG} mklabel msdos
|
|
||||||
parted -s ${SDIMG} unit KiB mkpart primary 1024 ${IMAGE_ROOTFS_ALIGNMENT}
|
|
||||||
parted -s ${SDIMG} unit KiB mkpart primary fat32 ${IMAGE_ROOTFS_ALIGNMENT} $(expr ${IMAGE_ROOTFS_ALIGNMENT} \+ ${BOOT_SPACE_ALIGNED})
|
|
||||||
parted -s ${SDIMG} set 2 boot on
|
|
||||||
parted -s ${SDIMG} -- unit KiB mkpart primary ext2 $(expr ${IMAGE_ROOTFS_ALIGNMENT} \+ ${BOOT_SPACE_ALIGNED}) -1s
|
|
||||||
parted -s ${SDIMG} unit KiB print
|
|
||||||
|
|
||||||
# Change partition type to 0x53 for mxs processor family and write bootstream header
|
|
||||||
echo -n S | dd of=${SDIMG} bs=1 count=1 seek=450 conv=notrunc
|
|
||||||
${PRINTF} "${BS_HDR}" | dd of=${SDIMG} bs=512 seek=$(expr 1024 \* 2) conv=notrunc,sync
|
|
||||||
|
|
||||||
# Burn bootloader, boot and rootfs partitions
|
|
||||||
dd if=${DEPLOY_DIR_IMAGE}/${UBOOT_SYMLINK} of=${SDIMG} conv=notrunc,fsync seek=$(expr 1024 \* 2 \+ 1) bs=512
|
|
||||||
dd if=${SDIMG_BOOTFS} of=${SDIMG} conv=notrunc,fsync seek=1 bs=$(expr ${IMAGE_ROOTFS_ALIGNMENT} \* 1024)
|
|
||||||
dd if=${SDIMG_ROOTFS} of=${SDIMG} conv=notrunc,fsync seek=1 bs=$(expr ${IMAGE_ROOTFS_ALIGNMENT} \* 1024 + ${BOOT_SPACE_ALIGNED} \* 1024)
|
|
||||||
}
|
|
||||||
|
|
||||||
# The sdcard image requires the boot and rootfs images to be built before
|
# The sdcard image requires the boot and rootfs images to be built before
|
||||||
IMAGE_TYPEDEP_sdcard = "${SDIMG_BOOTFS_TYPE} ${SDIMG_ROOTFS_TYPE}"
|
IMAGE_TYPEDEP_sdcard = "${SDIMG_BOOTFS_TYPE} ${SDIMG_ROOTFS_TYPE}"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue