mirror of
https://github.com/EnderIce2/Fennix.git
synced 2025-07-03 03:19:16 +00:00
refactor(rootfs): reorganize file structure and remove unnecessary .gitkeep files
Signed-off-by: EnderIce2 <enderice2@protonmail.com>
This commit is contained in:
@ -13,7 +13,7 @@ ifneq ($(shell uname -s), Linux)
|
||||
endif
|
||||
$(info Compiling $(FILENAME)linux)
|
||||
gcc linux_glibc.c $(CFLAGS) -o $(FILENAME)linux
|
||||
cp $(FILENAME)linux $(WORKSPACE_DIR)/out/bin/$(FILENAME)linux
|
||||
cp $(FILENAME)linux $(WORKSPACE_DIR)/out/sys/bin/$(FILENAME)linux
|
||||
|
||||
$(FILENAME)win.exe:
|
||||
ifneq ($(shell uname -s), Linux)
|
||||
@ -22,7 +22,7 @@ ifneq ($(shell uname -s), Linux)
|
||||
endif
|
||||
$(info Compiling $(FILENAME)win)
|
||||
x86_64-w64-mingw32-gcc win_mingw.c $(CFLAGS) -o $(FILENAME)win.exe
|
||||
cp $(FILENAME)win.exe $(WORKSPACE_DIR)/out/bin/$(FILENAME)win.exe
|
||||
cp $(FILENAME)win.exe $(WORKSPACE_DIR)/out/sys/bin/$(FILENAME)win.exe
|
||||
|
||||
build: $(FILENAME)linux $(FILENAME)win.exe
|
||||
|
||||
|
@ -11,7 +11,7 @@ FILENAME = $(notdir $(shell pwd))
|
||||
WARNCFLAG = -Wall -Wextra
|
||||
|
||||
build: $(FILENAME).elf
|
||||
cp $(FILENAME).elf $(WORKSPACE_DIR)/out/bin/$(FILENAME)
|
||||
cp $(FILENAME).elf $(WORKSPACE_DIR)/out/sys/bin/$(FILENAME)
|
||||
|
||||
# Use static linking
|
||||
LDFLAGS += -ggdb3 -g -static -fno-pic -fno-pie -Wl,-static -Wl,-Ttext=0x00600000
|
||||
|
@ -11,7 +11,7 @@ FILENAME = $(notdir $(shell pwd))
|
||||
WARNCFLAG = -Wall -Wextra
|
||||
|
||||
build: $(FILENAME).elf
|
||||
cp $(FILENAME).elf $(WORKSPACE_DIR)/out/bin/$(FILENAME)
|
||||
cp $(FILENAME).elf $(WORKSPACE_DIR)/out/sys/bin/$(FILENAME)
|
||||
|
||||
# Use static linking
|
||||
LDFLAGS += -static -fno-pic -fno-pie -Wl,-static
|
||||
|
@ -344,7 +344,7 @@ void test_file()
|
||||
{
|
||||
printf("- Testing file operations\n");
|
||||
|
||||
FILE *test = fopen("/etc/passwd", "r");
|
||||
FILE *test = fopen("/sys/cfg/passwd", "r");
|
||||
if (test == NULL)
|
||||
{
|
||||
perror("fopen");
|
||||
@ -353,7 +353,7 @@ void test_file()
|
||||
return;
|
||||
}
|
||||
|
||||
printf("/etc/passwd contents: ");
|
||||
printf("/sys/cfg/passwd contents: ");
|
||||
char ch;
|
||||
while (1)
|
||||
{
|
||||
@ -373,7 +373,7 @@ void test_stat()
|
||||
printf("- Testing stat\n");
|
||||
|
||||
struct stat st;
|
||||
if (stat("/etc/passwd", &st) == -1)
|
||||
if (stat("/sys/cfg/passwd", &st) == -1)
|
||||
{
|
||||
perror("stat");
|
||||
fflush(stdout);
|
||||
@ -385,7 +385,7 @@ void test_stat()
|
||||
printf("File mode: %o\n", st.st_mode);
|
||||
printf("File inode: %ld\n", st.st_ino);
|
||||
|
||||
int fd = open("/etc/passwd", O_RDONLY);
|
||||
int fd = open("/sys/cfg/passwd", O_RDONLY);
|
||||
if (fd == -1)
|
||||
{
|
||||
perror("open");
|
||||
@ -407,7 +407,7 @@ void test_stat()
|
||||
printf("File inode: %ld\n", st.st_ino);
|
||||
close(fd);
|
||||
|
||||
if (lstat("/etc/passwd", &st) == -1)
|
||||
if (lstat("/sys/cfg/passwd", &st) == -1)
|
||||
{
|
||||
perror("lstat");
|
||||
fflush(stdout);
|
||||
|
Reference in New Issue
Block a user