diff --git a/stand/kboot/Makefile b/stand/kboot/Makefile index b9d68cddf97d..2e0b9d7a2e09 100644 --- a/stand/kboot/Makefile +++ b/stand/kboot/Makefile @@ -1,69 +1,7 @@ - -LOADER_DISK_SUPPORT?= yes -LOADER_CD9660_SUPPORT?= yes -LOADER_MSDOS_SUPPORT?= no -LOADER_EXT2FS_SUPPORT?= yes -LOADER_UFS_SUPPORT?= yes -LOADER_ZFS_SUPPORT?= yes -LOADER_NET_SUPPORT?= no -LOADER_NFS_SUPPORT?= no -LOADER_TFTP_SUPPORT?= no -LOADER_GZIP_SUPPORT?= no -LOADER_BZIP2_SUPPORT?= no +NO_OBJ=t .include -PROG= loader.kboot -NEWVERSWHAT= "kboot loader" ${MACHINE_ARCH} -INSTALLFLAGS= -b +SUBDIR+= kboot -# Architecture-specific loader code -SRCS= \ - bootinfo.c \ - conf.c \ - crt1.c \ - gfx_fb_stub.c \ - host_syscalls.c \ - hostcons.c \ - hostdisk.c \ - hostfs.c \ - init.c \ - kbootfdt.c \ - main.c \ - seg.c \ - termios.c \ - util.c \ - vers.c - -CFLAGS.gfx_fb_stub.c += -I${SRCTOP}/contrib/pnglite -I${SRCTOP}/sys/teken -.if ${MK_LOADER_ZFS} != "no" -CFLAGS+= -I${ZFSSRC} -CFLAGS+= -I${SYSDIR}/contrib/openzfs/include -CFLAGS+= -I${SYSDIR}/contrib/openzfs/include/os/freebsd/zfs -HAVE_ZFS=yes -.endif - -HELP_FILENAME= loader.help.kboot - -.include "${BOOTSRC}/fdt.mk" - -# We share bootinfo.c with efi -.PATH: ${BOOTSRC}/efi/loader - -# Note: Since we're producing a userland binary, we key off of MACHINE_ARCH -# instead of the more normal MACHINE since the changes between different flavors -# of MACHINE_ARCH are large enough in Linux that it's easier that way. -.PATH: ${.CURDIR}/arch/${MACHINE_ARCH} -.include "${.CURDIR}/arch/${MACHINE_ARCH}/Makefile.inc" - -# Always add MI sources -.include "${BOOTSRC}/loader.mk" -.PATH: ${SYSDIR}/libkern -CFLAGS+= -I${.CURDIR} -I${.CURDIR}/arch/${MACHINE_ARCH} - -CFLAGS+= -Wall - -DPADD= ${LDR_INTERP} ${LIBOFW} ${LIBSAFDT} ${LIBSA} -LDADD= ${LDR_INTERP} ${LIBOFW} ${LIBSAFDT} ${LIBSA} - -.include +.include diff --git a/stand/kboot/Makefile.inc b/stand/kboot/Makefile.inc new file mode 100644 index 000000000000..01b5f23410c8 --- /dev/null +++ b/stand/kboot/Makefile.inc @@ -0,0 +1 @@ +.include "../Makefile.inc" diff --git a/stand/kboot/kboot/Makefile b/stand/kboot/kboot/Makefile new file mode 100644 index 000000000000..b9d68cddf97d --- /dev/null +++ b/stand/kboot/kboot/Makefile @@ -0,0 +1,69 @@ + +LOADER_DISK_SUPPORT?= yes +LOADER_CD9660_SUPPORT?= yes +LOADER_MSDOS_SUPPORT?= no +LOADER_EXT2FS_SUPPORT?= yes +LOADER_UFS_SUPPORT?= yes +LOADER_ZFS_SUPPORT?= yes +LOADER_NET_SUPPORT?= no +LOADER_NFS_SUPPORT?= no +LOADER_TFTP_SUPPORT?= no +LOADER_GZIP_SUPPORT?= no +LOADER_BZIP2_SUPPORT?= no + +.include + +PROG= loader.kboot +NEWVERSWHAT= "kboot loader" ${MACHINE_ARCH} +INSTALLFLAGS= -b + +# Architecture-specific loader code +SRCS= \ + bootinfo.c \ + conf.c \ + crt1.c \ + gfx_fb_stub.c \ + host_syscalls.c \ + hostcons.c \ + hostdisk.c \ + hostfs.c \ + init.c \ + kbootfdt.c \ + main.c \ + seg.c \ + termios.c \ + util.c \ + vers.c + +CFLAGS.gfx_fb_stub.c += -I${SRCTOP}/contrib/pnglite -I${SRCTOP}/sys/teken +.if ${MK_LOADER_ZFS} != "no" +CFLAGS+= -I${ZFSSRC} +CFLAGS+= -I${SYSDIR}/contrib/openzfs/include +CFLAGS+= -I${SYSDIR}/contrib/openzfs/include/os/freebsd/zfs +HAVE_ZFS=yes +.endif + +HELP_FILENAME= loader.help.kboot + +.include "${BOOTSRC}/fdt.mk" + +# We share bootinfo.c with efi +.PATH: ${BOOTSRC}/efi/loader + +# Note: Since we're producing a userland binary, we key off of MACHINE_ARCH +# instead of the more normal MACHINE since the changes between different flavors +# of MACHINE_ARCH are large enough in Linux that it's easier that way. +.PATH: ${.CURDIR}/arch/${MACHINE_ARCH} +.include "${.CURDIR}/arch/${MACHINE_ARCH}/Makefile.inc" + +# Always add MI sources +.include "${BOOTSRC}/loader.mk" +.PATH: ${SYSDIR}/libkern +CFLAGS+= -I${.CURDIR} -I${.CURDIR}/arch/${MACHINE_ARCH} + +CFLAGS+= -Wall + +DPADD= ${LDR_INTERP} ${LIBOFW} ${LIBSAFDT} ${LIBSA} +LDADD= ${LDR_INTERP} ${LIBOFW} ${LIBSAFDT} ${LIBSA} + +.include diff --git a/stand/kboot/arch/aarch64/Makefile.inc b/stand/kboot/kboot/arch/aarch64/Makefile.inc similarity index 100% rename from stand/kboot/arch/aarch64/Makefile.inc rename to stand/kboot/kboot/arch/aarch64/Makefile.inc diff --git a/stand/kboot/arch/aarch64/exec.c b/stand/kboot/kboot/arch/aarch64/exec.c similarity index 100% rename from stand/kboot/arch/aarch64/exec.c rename to stand/kboot/kboot/arch/aarch64/exec.c diff --git a/stand/kboot/arch/aarch64/fdt_arch.c b/stand/kboot/kboot/arch/aarch64/fdt_arch.c similarity index 100% rename from stand/kboot/arch/aarch64/fdt_arch.c rename to stand/kboot/kboot/arch/aarch64/fdt_arch.c diff --git a/stand/kboot/arch/aarch64/host_syscall.S b/stand/kboot/kboot/arch/aarch64/host_syscall.S similarity index 100% rename from stand/kboot/arch/aarch64/host_syscall.S rename to stand/kboot/kboot/arch/aarch64/host_syscall.S diff --git a/stand/kboot/arch/aarch64/ldscript.aarch64 b/stand/kboot/kboot/arch/aarch64/ldscript.aarch64 similarity index 100% rename from stand/kboot/arch/aarch64/ldscript.aarch64 rename to stand/kboot/kboot/arch/aarch64/ldscript.aarch64 diff --git a/stand/kboot/arch/aarch64/load_addr.c b/stand/kboot/kboot/arch/aarch64/load_addr.c similarity index 100% rename from stand/kboot/arch/aarch64/load_addr.c rename to stand/kboot/kboot/arch/aarch64/load_addr.c diff --git a/stand/kboot/arch/aarch64/start_arch.h b/stand/kboot/kboot/arch/aarch64/start_arch.h similarity index 100% rename from stand/kboot/arch/aarch64/start_arch.h rename to stand/kboot/kboot/arch/aarch64/start_arch.h diff --git a/stand/kboot/arch/aarch64/stat_arch.h b/stand/kboot/kboot/arch/aarch64/stat_arch.h similarity index 100% rename from stand/kboot/arch/aarch64/stat_arch.h rename to stand/kboot/kboot/arch/aarch64/stat_arch.h diff --git a/stand/kboot/arch/aarch64/syscall_nr.h b/stand/kboot/kboot/arch/aarch64/syscall_nr.h similarity index 100% rename from stand/kboot/arch/aarch64/syscall_nr.h rename to stand/kboot/kboot/arch/aarch64/syscall_nr.h diff --git a/stand/kboot/arch/aarch64/termios_arch.h b/stand/kboot/kboot/arch/aarch64/termios_arch.h similarity index 100% rename from stand/kboot/arch/aarch64/termios_arch.h rename to stand/kboot/kboot/arch/aarch64/termios_arch.h diff --git a/stand/kboot/arch/aarch64/tramp.S b/stand/kboot/kboot/arch/aarch64/tramp.S similarity index 100% rename from stand/kboot/arch/aarch64/tramp.S rename to stand/kboot/kboot/arch/aarch64/tramp.S diff --git a/stand/kboot/arch/amd64/Makefile.inc b/stand/kboot/kboot/arch/amd64/Makefile.inc similarity index 100% rename from stand/kboot/arch/amd64/Makefile.inc rename to stand/kboot/kboot/arch/amd64/Makefile.inc diff --git a/stand/kboot/arch/amd64/amd64_tramp.S b/stand/kboot/kboot/arch/amd64/amd64_tramp.S similarity index 100% rename from stand/kboot/arch/amd64/amd64_tramp.S rename to stand/kboot/kboot/arch/amd64/amd64_tramp.S diff --git a/stand/kboot/arch/amd64/elf64_freebsd.c b/stand/kboot/kboot/arch/amd64/elf64_freebsd.c similarity index 100% rename from stand/kboot/arch/amd64/elf64_freebsd.c rename to stand/kboot/kboot/arch/amd64/elf64_freebsd.c diff --git a/stand/kboot/arch/amd64/fdt_arch.c b/stand/kboot/kboot/arch/amd64/fdt_arch.c similarity index 100% rename from stand/kboot/arch/amd64/fdt_arch.c rename to stand/kboot/kboot/arch/amd64/fdt_arch.c diff --git a/stand/kboot/arch/amd64/host_syscall.S b/stand/kboot/kboot/arch/amd64/host_syscall.S similarity index 100% rename from stand/kboot/arch/amd64/host_syscall.S rename to stand/kboot/kboot/arch/amd64/host_syscall.S diff --git a/stand/kboot/arch/amd64/ldscript.amd64 b/stand/kboot/kboot/arch/amd64/ldscript.amd64 similarity index 100% rename from stand/kboot/arch/amd64/ldscript.amd64 rename to stand/kboot/kboot/arch/amd64/ldscript.amd64 diff --git a/stand/kboot/arch/amd64/load_addr.c b/stand/kboot/kboot/arch/amd64/load_addr.c similarity index 100% rename from stand/kboot/arch/amd64/load_addr.c rename to stand/kboot/kboot/arch/amd64/load_addr.c diff --git a/stand/kboot/arch/amd64/multiboot2.h b/stand/kboot/kboot/arch/amd64/multiboot2.h similarity index 100% rename from stand/kboot/arch/amd64/multiboot2.h rename to stand/kboot/kboot/arch/amd64/multiboot2.h diff --git a/stand/kboot/arch/amd64/start_arch.h b/stand/kboot/kboot/arch/amd64/start_arch.h similarity index 100% rename from stand/kboot/arch/amd64/start_arch.h rename to stand/kboot/kboot/arch/amd64/start_arch.h diff --git a/stand/kboot/arch/amd64/stat_arch.h b/stand/kboot/kboot/arch/amd64/stat_arch.h similarity index 100% rename from stand/kboot/arch/amd64/stat_arch.h rename to stand/kboot/kboot/arch/amd64/stat_arch.h diff --git a/stand/kboot/arch/amd64/syscall_nr.h b/stand/kboot/kboot/arch/amd64/syscall_nr.h similarity index 100% rename from stand/kboot/arch/amd64/syscall_nr.h rename to stand/kboot/kboot/arch/amd64/syscall_nr.h diff --git a/stand/kboot/arch/amd64/termios_arch.h b/stand/kboot/kboot/arch/amd64/termios_arch.h similarity index 100% rename from stand/kboot/arch/amd64/termios_arch.h rename to stand/kboot/kboot/arch/amd64/termios_arch.h diff --git a/stand/kboot/arch/powerpc64/Makefile.inc b/stand/kboot/kboot/arch/powerpc64/Makefile.inc similarity index 100% rename from stand/kboot/arch/powerpc64/Makefile.inc rename to stand/kboot/kboot/arch/powerpc64/Makefile.inc diff --git a/stand/kboot/arch/powerpc64/fdt_arch.c b/stand/kboot/kboot/arch/powerpc64/fdt_arch.c similarity index 100% rename from stand/kboot/arch/powerpc64/fdt_arch.c rename to stand/kboot/kboot/arch/powerpc64/fdt_arch.c diff --git a/stand/kboot/arch/powerpc64/host_syscall.S b/stand/kboot/kboot/arch/powerpc64/host_syscall.S similarity index 100% rename from stand/kboot/arch/powerpc64/host_syscall.S rename to stand/kboot/kboot/arch/powerpc64/host_syscall.S diff --git a/stand/kboot/arch/powerpc64/kerneltramp.S b/stand/kboot/kboot/arch/powerpc64/kerneltramp.S similarity index 100% rename from stand/kboot/arch/powerpc64/kerneltramp.S rename to stand/kboot/kboot/arch/powerpc64/kerneltramp.S diff --git a/stand/kboot/arch/powerpc64/ldscript.powerpc b/stand/kboot/kboot/arch/powerpc64/ldscript.powerpc similarity index 100% rename from stand/kboot/arch/powerpc64/ldscript.powerpc rename to stand/kboot/kboot/arch/powerpc64/ldscript.powerpc diff --git a/stand/kboot/arch/powerpc64/load_addr.c b/stand/kboot/kboot/arch/powerpc64/load_addr.c similarity index 100% rename from stand/kboot/arch/powerpc64/load_addr.c rename to stand/kboot/kboot/arch/powerpc64/load_addr.c diff --git a/stand/kboot/arch/powerpc64/ppc64_elf_freebsd.c b/stand/kboot/kboot/arch/powerpc64/ppc64_elf_freebsd.c similarity index 100% rename from stand/kboot/arch/powerpc64/ppc64_elf_freebsd.c rename to stand/kboot/kboot/arch/powerpc64/ppc64_elf_freebsd.c diff --git a/stand/kboot/arch/powerpc64/start_arch.h b/stand/kboot/kboot/arch/powerpc64/start_arch.h similarity index 100% rename from stand/kboot/arch/powerpc64/start_arch.h rename to stand/kboot/kboot/arch/powerpc64/start_arch.h diff --git a/stand/kboot/arch/powerpc64/stat_arch.h b/stand/kboot/kboot/arch/powerpc64/stat_arch.h similarity index 100% rename from stand/kboot/arch/powerpc64/stat_arch.h rename to stand/kboot/kboot/arch/powerpc64/stat_arch.h diff --git a/stand/kboot/arch/powerpc64/syscall_nr.h b/stand/kboot/kboot/arch/powerpc64/syscall_nr.h similarity index 100% rename from stand/kboot/arch/powerpc64/syscall_nr.h rename to stand/kboot/kboot/arch/powerpc64/syscall_nr.h diff --git a/stand/kboot/arch/powerpc64/termios_arch.h b/stand/kboot/kboot/arch/powerpc64/termios_arch.h similarity index 100% rename from stand/kboot/arch/powerpc64/termios_arch.h rename to stand/kboot/kboot/arch/powerpc64/termios_arch.h diff --git a/stand/kboot/conf.c b/stand/kboot/kboot/conf.c similarity index 100% rename from stand/kboot/conf.c rename to stand/kboot/kboot/conf.c diff --git a/stand/kboot/crt1.c b/stand/kboot/kboot/crt1.c similarity index 100% rename from stand/kboot/crt1.c rename to stand/kboot/kboot/crt1.c diff --git a/stand/kboot/host_syscall.h b/stand/kboot/kboot/host_syscall.h similarity index 100% rename from stand/kboot/host_syscall.h rename to stand/kboot/kboot/host_syscall.h diff --git a/stand/kboot/host_syscalls.c b/stand/kboot/kboot/host_syscalls.c similarity index 100% rename from stand/kboot/host_syscalls.c rename to stand/kboot/kboot/host_syscalls.c diff --git a/stand/kboot/hostcons.c b/stand/kboot/kboot/hostcons.c similarity index 100% rename from stand/kboot/hostcons.c rename to stand/kboot/kboot/hostcons.c diff --git a/stand/kboot/hostdisk.c b/stand/kboot/kboot/hostdisk.c similarity index 100% rename from stand/kboot/hostdisk.c rename to stand/kboot/kboot/hostdisk.c diff --git a/stand/kboot/hostfs.c b/stand/kboot/kboot/hostfs.c similarity index 100% rename from stand/kboot/hostfs.c rename to stand/kboot/kboot/hostfs.c diff --git a/stand/kboot/init.c b/stand/kboot/kboot/init.c similarity index 100% rename from stand/kboot/init.c rename to stand/kboot/kboot/init.c diff --git a/stand/kboot/kboot.h b/stand/kboot/kboot/kboot.h similarity index 100% rename from stand/kboot/kboot.h rename to stand/kboot/kboot/kboot.h diff --git a/stand/kboot/kbootfdt.c b/stand/kboot/kboot/kbootfdt.c similarity index 100% rename from stand/kboot/kbootfdt.c rename to stand/kboot/kboot/kbootfdt.c diff --git a/stand/kboot/main.c b/stand/kboot/kboot/main.c similarity index 100% rename from stand/kboot/main.c rename to stand/kboot/kboot/main.c diff --git a/stand/kboot/seg.c b/stand/kboot/kboot/seg.c similarity index 100% rename from stand/kboot/seg.c rename to stand/kboot/kboot/seg.c diff --git a/stand/kboot/termios.c b/stand/kboot/kboot/termios.c similarity index 100% rename from stand/kboot/termios.c rename to stand/kboot/kboot/termios.c diff --git a/stand/kboot/termios.h b/stand/kboot/kboot/termios.h similarity index 100% rename from stand/kboot/termios.h rename to stand/kboot/kboot/termios.h diff --git a/stand/kboot/termios_gen.h b/stand/kboot/kboot/termios_gen.h similarity index 100% rename from stand/kboot/termios_gen.h rename to stand/kboot/kboot/termios_gen.h diff --git a/stand/kboot/util.c b/stand/kboot/kboot/util.c similarity index 100% rename from stand/kboot/util.c rename to stand/kboot/kboot/util.c diff --git a/stand/kboot/version b/stand/kboot/kboot/version similarity index 100% rename from stand/kboot/version rename to stand/kboot/kboot/version