mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-28 11:53:24 +00:00
Add exFAT file system
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
52f07458f7
commit
650c7dfbad
@ -8,6 +8,7 @@ INITRAMFS := $(BUILD_DIR)/initramfs
|
||||
INITRAMFS_FILELIST := $(BUILD_DIR)/initramfs.filelist
|
||||
INITRAMFS_IMAGE := $(BUILD_DIR)/initramfs.cpio.gz
|
||||
EXT2_IMAGE := $(BUILD_DIR)/ext2.img
|
||||
EXFAT_IMAGE := $(BUILD_DIR)/exfat.img
|
||||
INITRAMFS_EMPTY_DIRS := \
|
||||
$(INITRAMFS)/sbin \
|
||||
$(INITRAMFS)/root \
|
||||
@ -15,7 +16,8 @@ INITRAMFS_EMPTY_DIRS := \
|
||||
$(INITRAMFS)/opt \
|
||||
$(INITRAMFS)/proc \
|
||||
$(INITRAMFS)/dev \
|
||||
$(INITRAMFS)/ext2
|
||||
$(INITRAMFS)/ext2 \
|
||||
$(INITRAMFS)/exfat
|
||||
INITRAMFS_ALL_DIRS := \
|
||||
$(INITRAMFS)/etc \
|
||||
$(INITRAMFS)/lib/x86_64-linux-gnu \
|
||||
@ -117,8 +119,12 @@ $(EXT2_IMAGE):
|
||||
@dd if=/dev/zero of=$(EXT2_IMAGE) bs=2G count=1
|
||||
@mke2fs $(EXT2_IMAGE)
|
||||
|
||||
$(EXFAT_IMAGE):
|
||||
@fallocate -l 64M $(EXFAT_IMAGE)
|
||||
@mkfs.exfat $(EXFAT_IMAGE)
|
||||
|
||||
.PHONY: build
|
||||
build: $(INITRAMFS_IMAGE) $(EXT2_IMAGE)
|
||||
build: $(INITRAMFS_IMAGE) $(EXT2_IMAGE) $(EXFAT_IMAGE)
|
||||
|
||||
.PHONY: format
|
||||
format:
|
||||
@ -130,4 +136,4 @@ check:
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
@rm -rf $(BUILD_DIR)
|
||||
@rm -rf $(BUILD_DIR)
|
@ -43,6 +43,7 @@ INITRAMFS ?= $(CUR_DIR)/../build/initramfs
|
||||
TARGET_DIR := $(INITRAMFS)/opt/syscall_test
|
||||
RUN_BASH := $(CUR_DIR)/run_syscall_test.sh
|
||||
BLOCK_LIST := $(CUR_DIR)/blocklists
|
||||
EXFAT_BLOCK_LIST := $(CUR_DIR)/blocklists.exfat
|
||||
|
||||
.PHONY: all
|
||||
all: $(TESTS)
|
||||
@ -65,12 +66,14 @@ $(SRC_DIR):
|
||||
@cd $@ && git clone -b 20200921.0 https://github.com/asterinas/gvisor.git .
|
||||
endif
|
||||
|
||||
$(TARGET_DIR): $(RUN_BASH) $(BLOCK_LIST)
|
||||
$(TARGET_DIR): $(RUN_BASH) $(BLOCK_LIST) $(EXFAT_BLOCK_LIST)
|
||||
@rm -rf $@ && mkdir -p $@
|
||||
@# Prepare tests dir for test binaries
|
||||
@mkdir $@/tests
|
||||
@# Copy blocklists
|
||||
@cp -rf $(BLOCK_LIST) $@
|
||||
@# Copy exFAT specific blocklists
|
||||
@cp -rf $(EXFAT_BLOCK_LIST) $@
|
||||
@# Copy bash script
|
||||
@cp -f $(RUN_BASH) $@
|
||||
|
||||
|
7
regression/syscall_test/blocklists.exfat/chmod_test
Normal file
7
regression/syscall_test/blocklists.exfat/chmod_test
Normal file
@ -0,0 +1,7 @@
|
||||
ChmodTest.ChmodFileSucceeds
|
||||
ChmodTest.ChmodDirSucceeds
|
||||
ChmodTest.FchmodFileSucceeds_NoRandomSave
|
||||
ChmodTest.FchmodatFileAbsolutePath
|
||||
ChmodTest.FchmodatFile
|
||||
ChmodTest.ChmodFileToNoPermissionsSucceeds
|
||||
ChmodTest.FchmodFileToNoPermissionsSucceeds_NoRandomSave
|
9
regression/syscall_test/blocklists.exfat/link_test
Normal file
9
regression/syscall_test/blocklists.exfat/link_test
Normal file
@ -0,0 +1,9 @@
|
||||
LinkTest.CanCreateLinkFile
|
||||
LinkTest.PermissionDenied
|
||||
LinkTest.CannotLinkDirectory
|
||||
LinkTest.WithOldDirFD
|
||||
LinkTest.WithNewDirFD
|
||||
LinkTest.AbsPathsWithNonDirFDs
|
||||
LinkTest.LinkDoesNotFollowSymlinks
|
||||
LinkTest.LinkatDoesNotFollowSymlinkByDefault
|
||||
LinkTest.LinkatWithSymlinkFollow
|
2
regression/syscall_test/blocklists.exfat/mkdir_test
Normal file
2
regression/syscall_test/blocklists.exfat/mkdir_test
Normal file
@ -0,0 +1,2 @@
|
||||
MkdirTest.HonorsUmask
|
||||
MkdirTest.HonorsUmask2
|
2
regression/syscall_test/blocklists.exfat/open_test
Normal file
2
regression/syscall_test/blocklists.exfat/open_test
Normal file
@ -0,0 +1,2 @@
|
||||
OpenTest.OpenNoFollowSymlink
|
||||
OpenTest.SymlinkDirectory
|
2
regression/syscall_test/blocklists.exfat/stat_test
Normal file
2
regression/syscall_test/blocklists.exfat/stat_test
Normal file
@ -0,0 +1,2 @@
|
||||
StatTest.FstatatSymlinkDir
|
||||
StatTest.LstatELOOPPath
|
18
regression/syscall_test/blocklists.exfat/symlink_test
Normal file
18
regression/syscall_test/blocklists.exfat/symlink_test
Normal file
@ -0,0 +1,18 @@
|
||||
SymlinkTest.CanCreateSymlinkWithCachedSourceDirent
|
||||
SymlinkTest.CanCreateSymlinkFile
|
||||
SymlinkTest.CanCreateSymlinkDir
|
||||
SymlinkTest.OldnameIsDangling
|
||||
SymlinkTest.CanEvaluateLink
|
||||
SymlinkTest.TargetIsNotMapped
|
||||
SymlinkTest.PreadFromSymlink
|
||||
SymlinkTest.ChmodSymlink
|
||||
AbsAndRelTarget/ParamSymlinkTest.OpenLinkCreatesTarget/0
|
||||
AbsAndRelTarget/ParamSymlinkTest.OpenLinkCreatesTarget/1
|
||||
AbsAndRelTarget/ParamSymlinkTest.CreateExistingSelfLink/0
|
||||
AbsAndRelTarget/ParamSymlinkTest.CreateExistingSelfLink/1
|
||||
AbsAndRelTarget/ParamSymlinkTest.CreateExistingParentLink/0
|
||||
AbsAndRelTarget/ParamSymlinkTest.CreateExistingParentLink/1
|
||||
AbsAndRelTarget/ParamSymlinkTest.OpenLinkExclFails/0
|
||||
AbsAndRelTarget/ParamSymlinkTest.OpenLinkExclFails/1
|
||||
AbsAndRelTarget/ParamSymlinkTest.OpenLinkNoFollowFails/0
|
||||
AbsAndRelTarget/ParamSymlinkTest.OpenLinkNoFollowFails/1
|
@ -18,11 +18,18 @@ NC='\033[0m'
|
||||
get_blocklist_subtests(){
|
||||
if [ -f $BLOCKLIST_DIR/$1 ]; then
|
||||
BLOCK=$(sed ':a;N;$!ba;s/\n/:/g' $BLOCKLIST_DIR/$1)
|
||||
return 0
|
||||
else
|
||||
BLOCK=""
|
||||
return 1
|
||||
fi
|
||||
|
||||
for extra_dir in $EXTRA_BLOCKLISTS_DIRS ; do
|
||||
if [ -f $SCRIPT_DIR/$extra_dir/$1 ]; then
|
||||
BLOCK="${BLOCK}:$(sed ':a;N;$!ba;s/\n/:/g' $SCRIPT_DIR/$extra_dir/$1)"
|
||||
fi
|
||||
done
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
run_one_test(){
|
||||
@ -31,10 +38,11 @@ run_one_test(){
|
||||
export TEST_TMPDIR=$TEST_TMP_DIR
|
||||
ret=0
|
||||
if [ -f $TEST_BIN_DIR/$1 ]; then
|
||||
rm -rf $TEST_TMP_DIR/*
|
||||
get_blocklist_subtests $1
|
||||
$TEST_BIN_DIR/$1 --gtest_filter=-$BLOCK
|
||||
ret=$?
|
||||
#After executing the test, it is necessary to clean the directory to ensure no residual data remains
|
||||
rm -rf $TEST_TMP_DIR/*
|
||||
else
|
||||
echo -e "Warning: $1 test does not exit"
|
||||
ret=1
|
||||
@ -44,6 +52,7 @@ run_one_test(){
|
||||
}
|
||||
|
||||
rm -f $FAIL_CASES && touch $FAIL_CASES
|
||||
rm -rf $TEST_TMP_DIR/*
|
||||
|
||||
for syscall_test in $(find $TEST_BIN_DIR/. -name \*_test) ; do
|
||||
test_name=$(basename "$syscall_test")
|
||||
@ -63,4 +72,4 @@ if [ $TESTS != $PASSED_TESTS ]; then
|
||||
cat $FAIL_CASES
|
||||
fi
|
||||
|
||||
exit $RESULT
|
||||
exit $RESULT
|
Reference in New Issue
Block a user