diff --git a/stand/Makefile b/stand/Makefile index ce91802d4a8b..5d81e5f8a032 100644 --- a/stand/Makefile +++ b/stand/Makefile @@ -37,7 +37,7 @@ INTERP_DEPENDS+= lua .include S.${MK_EFI}+= efi -.if ${MK_FDT} != "no" +.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "aarch64" || ${MACHINE_ARCH} == "powerpc64" S.${MK_LOADER_KBOOT}+= kboot .endif S.${MK_LOADER_UBOOT}+= uboot diff --git a/stand/kboot/kboot/Makefile b/stand/kboot/kboot/Makefile index d354e1bc7e60..064d43701ebd 100644 --- a/stand/kboot/kboot/Makefile +++ b/stand/kboot/kboot/Makefile @@ -24,12 +24,15 @@ SRCS= \ hostdisk.c \ hostfs.c \ init.c \ - kbootfdt.c \ main.c \ seg.c \ util.c \ vers.c +.if ${MK_FDT} != "no" +SRCS+= kbootfdt.c +.endif + .if ${MK_LOADER_ZFS} != "no" CFLAGS+= -I${ZFSSRC} CFLAGS+= -I${SYSDIR}/contrib/openzfs/include diff --git a/stand/kboot/kboot/main.c b/stand/kboot/kboot/main.c index 994df1ec9fa1..a9ea2d9354c9 100644 --- a/stand/kboot/kboot/main.c +++ b/stand/kboot/kboot/main.c @@ -26,7 +26,9 @@ #include #include #include +#ifdef LOADER_FDT_SUPPORT #include +#endif #include #include @@ -620,6 +622,7 @@ kboot_zfs_probe(void) #endif } +#ifdef LOADER_FDT_SUPPORT /* * Since proper fdt command handling function is defined in fdt_loader_cmd.c, * and declaring it as extern is in contradiction with COMMAND_SET() macro @@ -634,4 +637,4 @@ command_fdt(int argc, char *argv[]) } COMMAND_SET(fdt, "fdt", "flattened device tree handling", command_fdt); - +#endif