Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ext2: add support to various inode sizes #92

Merged
merged 1 commit into from
Feb 12, 2024

Commits on Feb 12, 2024

  1. ext2: add support to various inode sizes

    the script used for generating test inputs:
    
        declare -A sizes=(
    	[1024,1024]=$((130048 + 1024))
    	[2048,512]=$((  45056 + 2048))
    	[4096,128]=$((  53248 + 4096))
        )
    
        adjust_size()
        {
    	local f=$1
    	local bsize=$2
    	local isize=$3
    
    	truncate --size=${sizes[$bsize,$isize]} $f
        }
    
        makeimg()
        {
    	local bsize=$1
    	local isize=$2
    
    	local f=tests/files/bsize-${bsize}-isize-${isize}.ext2
    	dd if=/dev/zero of=$f bs=${bsize} count=128
    	mkfs.ext2 -I ${isize} -b ${bsize} $f
    	sudo mount $f __tmp__
    	echo hello | sudo dd if=/dev/stdin of=__tmp__/source
    	(cd __tmp__/; sudo ln -s source target)
    	sudo umount __tmp__
    	adjust_size $f $bsize $isize
        }
    
        mkdir -p __tmp__
        makeimg 1024 1024
        makeimg 2048 512
        makeimg 4096 128
        rmdir __tmp__
    
    Signed-off-by: Masatake YAMATO <[email protected]>
    masatake committed Feb 12, 2024
    Configuration menu
    Copy the full SHA
    7bc5592 View commit details
    Browse the repository at this point in the history