diff options
Diffstat (limited to 'website-initramfs')
| -rw-r--r-- | website-initramfs/Makefile | 39 | ||||
| -rw-r--r-- | website-initramfs/progs/init.S | 4 | ||||
| -rwxr-xr-x | website-initramfs/sbin/init | bin | 0 -> 704 bytes |
3 files changed, 43 insertions, 0 deletions
diff --git a/website-initramfs/Makefile b/website-initramfs/Makefile new file mode 100644 index 0000000..57d303b --- /dev/null +++ b/website-initramfs/Makefile @@ -0,0 +1,39 @@ +CC = clang +LD = ld.lld +OBJCOPY = llvm-objcopy + +CFLAGS = \ + --target=riscv32-unknown-elf \ + -march=rv32im_zicsr \ + -mabi=ilp32 \ + -ffreestanding \ + -fno-builtin \ + -nostdlib \ + -nostdinc \ + -nodefaultlibs \ + -O2 -g3 \ + -Wall -Wextra -Werror -Wundef + +C_SRCS = $(shell find progs -type f -name "*.c") +S_SRCS = $(shell find progs -type f -name "*.S") +SRCS = $(C_SRCS) $(S_SRCS) +OBJS = $(basename $(SRCS)) + +$(V).SILENT: +progs: $(OBJS) + +%: %.c + @echo " CC $<" + $(CC) $(CFLAGS) $< -o $@ +%: %.S + @echo " AS $<" + $(CC) $(CFLAGS) -fuse-ld=lld $< -o $@ + +.PHONY: progs mkinitrd all clean +mkinitrd: + @echo " MKINITRD" + find . -print0 | cpio --null -ov -H newc > initramfs.cpio +clean: + @echo " CLEAN $(OBJS) initramfs.cpio" + $(RM) -f $(OBJS) initramfs.cpio +all: progs mkinitrd diff --git a/website-initramfs/progs/init.S b/website-initramfs/progs/init.S new file mode 100644 index 0000000..8693bda --- /dev/null +++ b/website-initramfs/progs/init.S @@ -0,0 +1,4 @@ +.global _start +.text +_start: + ecall diff --git a/website-initramfs/sbin/init b/website-initramfs/sbin/init Binary files differnew file mode 100755 index 0000000..335afd7 --- /dev/null +++ b/website-initramfs/sbin/init |
