summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorEnrico Jorns <ejo@pengutronix.de>2017-03-24 12:15:02 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-03-27 08:15:07 +0100
commita2d1d525f0f84c10e9ac53a2c87967fa05eae260 (patch)
tree76c7c9f76ed7360889b1c593c07f9be2bb5def12 /meta
parent430394da972a0270c2c882fa255a4d3c64edbdbf (diff)
downloadpoky-a2d1d525f0f84c10e9ac53a2c87967fa05eae260.tar.gz
image_types: perform fsck on created ext image
When performing a file system check, the image created with mkfs will trigger Pass 3A ('Optimizing directories') which turns the file system into state "changed" (EXT2_FLAG_CHANGED). This will let fsck request a reboot by setting the return code flag "2". The result of this is that each ext-image built with oe-core will trigger a reboot during the first time an fsck is triggered. A common case where this might occur is when fsck detects having a future superblock write time. This always happens when booting a newly created ext4 rootfs with a target that does not have a recent time set. This patch moves the initial fsck run that performs the optimization from the target to the host system and thus prevents the target from performing an avoidable reboot. (From OE-Core rev: a93d005934192402d7cceb36016b25b7d0c65547) Signed-off-by: Enrico Jorns <ejo@pengutronix.de> Signed-off-by: Ulrich Ölmann <uol@pengutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/image_types.bbclass2
1 files changed, 2 insertions, 0 deletions
diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass
index 99adeb3122..7749b00098 100644
--- a/meta/classes/image_types.bbclass
+++ b/meta/classes/image_types.bbclass
@@ -74,6 +74,8 @@ oe_mkext234fs () {
74 # Create a sparse image block 74 # Create a sparse image block
75 dd if=/dev/zero of=${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.$fstype seek=$ROOTFS_SIZE count=$COUNT bs=1024 75 dd if=/dev/zero of=${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.$fstype seek=$ROOTFS_SIZE count=$COUNT bs=1024
76 mkfs.$fstype -F $extra_imagecmd ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.$fstype -d ${IMAGE_ROOTFS} 76 mkfs.$fstype -F $extra_imagecmd ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.$fstype -d ${IMAGE_ROOTFS}
77 # Error codes 0-3 indicate successfull operation of fsck (no errors or errors corrected)
78 fsck.$fstype -pvfD ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.$fstype || [ $? -le 3 ]
77} 79}
78 80
79IMAGE_CMD_ext2 = "oe_mkext234fs ext2 ${EXTRA_IMAGECMD}" 81IMAGE_CMD_ext2 = "oe_mkext234fs ext2 ${EXTRA_IMAGECMD}"