mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-04-21 15:38:23 -04:00
Add support for the EXT4 filesystem using LWEXT4 Add minor VFS fixes Add unittest for the EXT4 partitions Reformat partition for use EXT4 filesystem [EGD-7587] Initial cmake of the ext4 [EGD-7587] Block driver for the ext4 Initial version of the block driver for the ext4 device [EGD-7587] Initial version of the EXT4 fs support Initial version of the ext4 filesystem support Signed-off-by: Lucjan Bryndza <lucjan.bryndza@mudita.com> [EGD-7587] Mount unmount initial unit tests Mount and unmount initial unit tests [EGD-7587] Unit tests and fixes for ext4 Unit tests and fixes for the ext4 partition [EGD-7587[ adjust flags Adjust ext configuration flags [EGD-7587] Change to generate ext4 image Change image generation script to generate ext4 image [EGD-7584] Change cache memory settings Change cache memory settings [EGD-7587] Change create image flags Change create image flags Signed-off-by: Lucjan Bryndza <lucjan.bryndza@mudita.com> [EGD-7587] Git change lwext4 to the mudita version Change LWEXT4 to mudita version [EGD-7587] Modify ext4 implementation Modify ext4 implementation according to the new lwext4 mudita branch. Some issues were fixed in this branch Signed-off-by: Lucjan Bryndza <lucjan.bryndza@mudita.com> [EGD-7587] Add to VFS rmdir syscall Add to VFS missing rmdir for compliance POSIX std Signed-off-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>
63 lines
1.2 KiB
Bash
Executable File
63 lines
1.2 KiB
Bash
Executable File
#!/bin/bash -e
|
|
#Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
|
|
#For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
|
|
|
|
usage() {
|
|
cat << ==usage
|
|
Usage: $(basename $0) [image_size] [image_file] [sysroot]
|
|
image_size Target disk image size in bytes
|
|
image_file Target image name
|
|
sysroot Source directory with files
|
|
==usage
|
|
}
|
|
|
|
if [ $# -lt 2 ]; then
|
|
echo "Error! Invalid argument count"
|
|
usage
|
|
exit -1
|
|
fi
|
|
IMAGE_SIZE="$1"
|
|
IMAGE_FILE="$2"
|
|
SYSROOT="$3"
|
|
shift 3
|
|
|
|
if [ ! -d "${SYSROOT}" ]; then
|
|
echo "Invalid sysroot: ${SYSROOT}"
|
|
exit -1
|
|
fi
|
|
|
|
_REQ_CMDS="sfdisk truncate mke2fs"
|
|
for cmd in $_REQ_CMDS; do
|
|
if [ ! $(command -v $cmd) ]; then
|
|
echo "Error! $cmd is not installed, please use 'sudo apt install' for install required tool"
|
|
exit -1
|
|
fi
|
|
done
|
|
truncate -s $IMAGE_SIZE $IMAGE_FILE
|
|
|
|
SECTOR_START=2048
|
|
SECTOR_END=$(( $(stat -c "%s" $IMAGE_FILE)/512 - $SECTOR_START))
|
|
|
|
sfdisk $IMAGE_FILE << ==sfdisk
|
|
label: dos
|
|
unit: sectors
|
|
|
|
/dev/sdz1 : start=$SECTOR_START, size=$SECTOR_END, type=83
|
|
==sfdisk
|
|
|
|
#Generate image
|
|
mke2fs \
|
|
-F \
|
|
-L 'user' \
|
|
-N 0 \
|
|
-E offset=$(($SECTOR_START*512)) \
|
|
-O ^64bit \
|
|
-O ^flex_bg \
|
|
-O ^metadata_csum \
|
|
-d "${SYSROOT}" \
|
|
-m 0 \
|
|
-r 1 \
|
|
-t ext4 \
|
|
"$IMAGE_FILE" \
|
|
;
|