diff --git a/src/Cargo.lock b/src/Cargo.lock index 9071fefb9..ecedeaff8 100644 --- a/src/Cargo.lock +++ b/src/Cargo.lock @@ -596,9 +596,9 @@ dependencies = [ [[package]] name = "trapframe" version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f287ee70169f5bfddba441baf901b620e3655f16fa7815f48a7e100ec6d86a8f" +source = "git+https://github.com/sdww0/trapframe-rs?rev=13e1065#13e106595d3cde9988e101e6b51e8fb9da38053d" dependencies = [ + "log", "raw-cpuid", "x86_64", ] diff --git a/src/apps/scripts/test_cmd.sh b/src/apps/scripts/test_cmd.sh new file mode 100755 index 000000000..1083d7615 --- /dev/null +++ b/src/apps/scripts/test_cmd.sh @@ -0,0 +1,36 @@ +#!/bin/sh + +set -e +set -x + +cd scripts + +touch hello.txt +mv hello.txt hello_world.txt +rm hello_world.txt + +awk '{print $2}' test_cmd.sh +cp test_cmd.sh test_cmd_backup.sh +cat test_cmd_backup.sh +rm test_cmd_backup.sh + +ln -s test_cmd.sh tesk_cmd_soft_link +readlink -f tesk_cmd_soft_link +tail -n 1 tesk_cmd_soft_link +rm tesk_cmd_soft_link + +ln test_cmd.sh tesk_cmd_hard_link +tail -n 1 tesk_cmd_hard_link +unlink tesk_cmd_hard_link + +sed 3q test_cmd.sh + +find . -name "*test_cmd*" + +mkdir foo +rmdir foo + +echo "Hello world from jinux" > hello.txt +rm hello.txt + +cd .. diff --git a/src/services/libs/jinux-std/src/process/program_loader/mod.rs b/src/services/libs/jinux-std/src/process/program_loader/mod.rs index 675f14f73..314a18f70 100644 --- a/src/services/libs/jinux-std/src/process/program_loader/mod.rs +++ b/src/services/libs/jinux-std/src/process/program_loader/mod.rs @@ -26,6 +26,13 @@ pub fn load_program_to_root_vmar( fs_resolver: &FsResolver, recursion_limit: usize, ) -> Result { + // Temporary use because fs_resolver cannot deal with procfs now. + // FIXME: removes this when procfs is ready. + let executable_path = if &executable_path == "/proc/self/exe" { + current!().executable_path().unwrap().clone() + } else { + executable_path + }; let fs_path = FsPath::new(AT_FDCWD, &executable_path)?; let file = fs_resolver.open(&fs_path, AccessMode::O_RDONLY as u32, 0)?; let file_header = {