build_image: always specify filesystem type for mount

BUG=chromium-os:13221
TEST=Run build_images without ext2 loaded

Specifying a filesystem type explicitly for ext* filesystems will avoid
weird fallbacks like mounting ext2 filesystem as ext3 or even ext4.
Instead it attempts to autoload the given filesystem as a module if
available or fail right away.

Change-Id: I6be7f3f994babd8efc8eda97ea9c802e04d98be6

R=dgarret@chromium.org,sosa@chromium.org

Review URL: http://codereview.chromium.org/6696092
This commit is contained in:
Zdenek Behan 2011-03-25 01:25:41 +01:00
parent aeb8352706
commit 7454a5e6f5

View File

@ -572,7 +572,7 @@ create_base_image() {
-e remount-ro \
"${LOOP_DEV}"
# TODO(wad) call tune2fs prior to finalization to set the mount count to 0.
sudo mount "${LOOP_DEV}" "${ROOT_FS_DIR}"
sudo mount -t ext2 "${LOOP_DEV}" "${ROOT_FS_DIR}"
# Create stateful partition of the same size as the rootfs.
STATEFUL_LOOP_DEV=$(sudo losetup -f)
@ -590,7 +590,7 @@ create_base_image() {
sudo losetup "${STATEFUL_LOOP_DEV}" "${STATEFUL_FS_IMG}"
sudo mkfs.ext3 "${STATEFUL_LOOP_DEV}"
sudo tune2fs -L "${DISK_LABEL}" -U "${UUID}" -c 0 -i 0 "${STATEFUL_LOOP_DEV}"
sudo mount "${STATEFUL_LOOP_DEV}" "${STATEFUL_FS_DIR}"
sudo mount -t ext3 "${STATEFUL_LOOP_DEV}" "${STATEFUL_FS_DIR}"
# -- Install packages into the root file system --