u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
* Error: cmd/libkiosk_crypto.c:5:10: fatal error: unistd.h: No such file or directory
@ 2022-07-07 10:30 Thu Ra
  2022-07-08 17:01 ` Ralph Siemsen
  0 siblings, 1 reply; 2+ messages in thread
From: Thu Ra @ 2022-07-07 10:30 UTC (permalink / raw)
  To: u-boot

[-- Attachment #1: Type: text/plain, Size: 492 bytes --]

Dear Dev of denx.de

I'm trying to create a custom os which is based on Alpine linux 3.16 with
your u-boot-2022.04 for my raspberry pi 4. Unfortunately, I got the
following error, please see the attached file(u-boot-bootloader-error.txt).

And I attached 3 Makefiles. main-makefile, common-makefile and
bootloader-makefile. and also the Version of components as common.mk.

Can you help me to solve this problem? And please let me know if you need
further information.


Your Sincerely,
T Ra

[-- Attachment #2: u-boot-bootloader-error.txt --]
[-- Type: text/plain, Size: 15213 bytes --]

copying SDK output...
all done!
touch .build.stamp
./mkspecs.sh /home/thura/workspace/cambridge/kiosk/kiosk.phy/sdk/out
make[2]: Leaving directory '/home/thura/workspace/cambridge/kiosk/kiosk.phy/sdk'
make -C kernel all
make[2]: Entering directory '/home/thura/workspace/cambridge/kiosk/kiosk.phy/kernel'
wget --no-config -P /home/thura/workspace/cambridge/kiosk/kiosk.phy/archive 'https://kernel.org/pub/linux/kernel/v5.x/linux-5.15.52.tar.xz'
--2022-07-07 11:03:20--  https://kernel.org/pub/linux/kernel/v5.x/linux-5.15.52.tar.xz
Resolving kernel.org (kernel.org)... 139.178.84.217, 2604:1380:4641:c500::1
Connecting to kernel.org (kernel.org)|139.178.84.217|:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://mirrors.edge.kernel.org/pub/linux/kernel/v5.x/linux-5.15.52.tar.xz [following]
--2022-07-07 11:03:21--  https://mirrors.edge.kernel.org/pub/linux/kernel/v5.x/linux-5.15.52.tar.xz
Resolving mirrors.edge.kernel.org (mirrors.edge.kernel.org)... 147.75.80.249, 2604:1380:4601:e00::3
Connecting to mirrors.edge.kernel.org (mirrors.edge.kernel.org)|147.75.80.249|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 126364084 (121M) [application/x-xz]
Saving to: ‘/home/thura/workspace/cambridge/kiosk/kiosk.phy/archive/linux-5.15.52.tar.xz’

linux-5.15.52.tar.xz                        100%[===========================================================================================>] 120.51M  3.33MB/s    in 29s     

2022-07-07 11:03:51 (4.09 MB/s) - ‘/home/thura/workspace/cambridge/kiosk/kiosk.phy/archive/linux-5.15.52.tar.xz’ saved [126364084/126364084]

wget --no-config -P /home/thura/workspace/cambridge/kiosk/kiosk.phy/archive 'https://kernel.org/pub/linux/kernel/v5.x/patch-5.15.52.xz'
--2022-07-07 11:03:51--  https://kernel.org/pub/linux/kernel/v5.x/patch-5.15.52.xz
Resolving kernel.org (kernel.org)... 139.178.84.217, 2604:1380:4641:c500::1
Connecting to kernel.org (kernel.org)|139.178.84.217|:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://mirrors.edge.kernel.org/pub/linux/kernel/v5.x/patch-5.15.52.xz [following]
--2022-07-07 11:03:51--  https://mirrors.edge.kernel.org/pub/linux/kernel/v5.x/patch-5.15.52.xz
Resolving mirrors.edge.kernel.org (mirrors.edge.kernel.org)... 147.75.80.249, 2604:1380:4601:e00::3
Connecting to mirrors.edge.kernel.org (mirrors.edge.kernel.org)|147.75.80.249|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2103352 (2.0M) [application/x-xz]
Saving to: ‘/home/thura/workspace/cambridge/kiosk/kiosk.phy/archive/patch-5.15.52.xz’

patch-5.15.52.xz                            100%[===========================================================================================>]   2.01M  3.62MB/s    in 0.6s    

2022-07-07 11:03:52 (3.62 MB/s) - ‘/home/thura/workspace/cambridge/kiosk/kiosk.phy/archive/patch-5.15.52.xz’ saved [2103352/2103352]

wget --no-config -P /home/thura/workspace/cambridge/kiosk/kiosk.phy/archive 'https://dev.alpinelinux.org/archive/rpi-patches/rpi-5.15.52-alpine.patch'
--2022-07-07 11:03:52--  https://dev.alpinelinux.org/archive/rpi-patches/rpi-5.15.52-alpine.patch
Resolving dev.alpinelinux.org (dev.alpinelinux.org)... 185.15.220.34, 64:ff9b::b90f:dc22
Connecting to dev.alpinelinux.org (dev.alpinelinux.org)|185.15.220.34|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 6025317 (5.7M) [application/octet-stream]
Saving to: ‘/home/thura/workspace/cambridge/kiosk/kiosk.phy/archive/rpi-5.15.52-alpine.patch’

rpi-5.15.52-alpine.patch                    100%[===========================================================================================>]   5.75M  3.23MB/s    in 1.8s    

2022-07-07 11:03:54 (3.23 MB/s) - ‘/home/thura/workspace/cambridge/kiosk/kiosk.phy/archive/rpi-5.15.52-alpine.patch’ saved [6025317/6025317]

make[2]: Leaving directory '/home/thura/workspace/cambridge/kiosk/kiosk.phy/kernel'
make -C bootloader all
make[2]: Entering directory '/home/thura/workspace/cambridge/kiosk/kiosk.phy/bootloader'
wget --no-config -P /home/thura/workspace/cambridge/kiosk/kiosk.phy/archive 'ftp://ftp.denx.de/pub/u-boot/u-boot-2022.04.tar.bz2'
--2022-07-07 11:03:55--  ftp://ftp.denx.de/pub/u-boot/u-boot-2022.04.tar.bz2
           => ‘/home/thura/workspace/cambridge/kiosk/kiosk.phy/archive/u-boot-2022.04.tar.bz2’
Resolving ftp.denx.de (ftp.denx.de)... 85.214.49.3, 2a01:238:43f4:4600:bc64:4f44:381f:1163
Connecting to ftp.denx.de (ftp.denx.de)|85.214.49.3|:21... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done.    ==> PWD ... done.
==> TYPE I ... done.  ==> CWD (1) /pub/u-boot ... done.
==> SIZE u-boot-2022.04.tar.bz2 ... 17772787
==> PASV ... done.    ==> RETR u-boot-2022.04.tar.bz2 ... done.
Length: 17772787 (17M) (unauthoritative)

u-boot-2022.04.tar.bz2                      100%[===========================================================================================>]  16.95M  4.11MB/s    in 4.8s    

2022-07-07 11:04:01 (3.50 MB/s) - ‘/home/thura/workspace/cambridge/kiosk/kiosk.phy/archive/u-boot-2022.04.tar.bz2’ saved [17772787]

rm -rf u-boot-2022.04
tar -xjf /home/thura/workspace/cambridge/kiosk/kiosk.phy/archive/u-boot-2022.04.tar.bz2
patch -d u-boot-2022.04 -p1 < cmd-objects.patch
patching file cmd/Makefile
Hunk #1 succeeded at 212 with fuzz 2 (offset 35 lines).
patch -d u-boot-2022.04 -p1 < tftp-timeout.patch
patching file net/tftp.c
Hunk #1 succeeded at 657 with fuzz 2 (offset 115 lines).
Hunk #2 succeeded at 762 (offset 125 lines).
touch .unpacked.stamp
cp ../common/monocypher-3.1.3/src/monocypher.c u-boot-2022.04/cmd/monocypher.c
cp ../common/monocypher-3.1.3/src/monocypher.h u-boot-2022.04/cmd/monocypher.h
cp ../common/src/libkiosk_crypto.h u-boot-2022.04/cmd/libkiosk_crypto.h
cp ../common/src/libkiosk_crypto.c u-boot-2022.04/cmd/libkiosk_crypto.c
cp src/cmd/crypto-uboot.c u-boot-2022.04/cmd/crypto-uboot.c
cp ../common/src/crypto-constants.S u-boot-2022.04/cmd/crypto-constants.S
./mkconfig.sh u-boot-2022.04
make[3]: Entering directory '/home/thura/workspace/cambridge/kiosk/kiosk.phy/bootloader/u-boot-2022.04'
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  YACC    scripts/kconfig/zconf.tab.c
  LEX     scripts/kconfig/zconf.lex.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
#
# configuration written to .config
#
make[3]: Leaving directory '/home/thura/workspace/cambridge/kiosk/kiosk.phy/bootloader/u-boot-2022.04'
make[3]: Entering directory '/home/thura/workspace/cambridge/kiosk/kiosk.phy/bootloader/u-boot-2022.04'
scripts/kconfig/conf  --olddefconfig Kconfig
#
# configuration written to .config
#
make[3]: Leaving directory '/home/thura/workspace/cambridge/kiosk/kiosk.phy/bootloader/u-boot-2022.04'
make -C u-boot-2022.04 CROSS_COMPILE=arm-linux-gnueabihf-
make[3]: Entering directory '/home/thura/workspace/cambridge/kiosk/kiosk.phy/bootloader/u-boot-2022.04'
scripts/kconfig/conf  --syncconfig Kconfig
  UPD     include/config.h
  CFG     u-boot.cfg
  GEN     include/autoconf.mk
  GEN     include/autoconf.mk.dep
  UPD     include/config/uboot.release
  UPD     include/generated/version_autogenerated.h
  UPD     include/generated/timestamp_autogenerated.h
  UPD     include/generated/dt.h
  ENVC    include/generated/env.txt
  ENVP    include/generated/env.in
  ENVT    include/generated/environment.h
  CC      lib/asm-offsets.s
  UPD     include/generated/generic-asm-offsets.h
  CC      arch/arm/lib/asm-offsets.s
  UPD     include/generated/asm-offsets.h
  HOSTCC  scripts/dtc/dtc.o
  HOSTCC  scripts/dtc/flattree.o
  HOSTCC  scripts/dtc/fstree.o
  HOSTCC  scripts/dtc/data.o
  HOSTCC  scripts/dtc/livetree.o
  HOSTCC  scripts/dtc/treesource.o
  HOSTCC  scripts/dtc/srcpos.o
  HOSTCC  scripts/dtc/checks.o
  HOSTCC  scripts/dtc/util.o
  LEX     scripts/dtc/dtc-lexer.lex.c
  YACC    scripts/dtc/dtc-parser.tab.h
  HOSTCC  scripts/dtc/dtc-lexer.lex.o
  YACC    scripts/dtc/dtc-parser.tab.c
  HOSTCC  scripts/dtc/dtc-parser.tab.o
  HOSTLD  scripts/dtc/dtc
  HOSTCC  tools/bmp_logo
  HOSTCC  tools/gen_eth_addr
  HOSTCC  tools/gen_ethaddr_crc.o
  WRAP    tools/lib/crc8.c
  HOSTCC  tools/lib/crc8.o
  HOSTLD  tools/gen_ethaddr_crc
  HOSTCC  tools/img2srec
  HOSTCC  tools/mkenvimage.o
  HOSTCC  tools/os_support.o
  WRAP    tools/lib/crc32.c
  HOSTCC  tools/lib/crc32.o
  HOSTLD  tools/mkenvimage
  HOSTCC  tools/aisimage.o
  HOSTCC  tools/atmelimage.o
  HOSTCC  tools/fit_common.o
  HOSTCC  tools/fit_image.o
  HOSTCC  tools/image-host.o
  WRAP    tools/boot/image-fit.c
  HOSTCC  tools/boot/image-fit.o
  HOSTCC  tools/image-sig-host.o
  WRAP    tools/boot/image-fit-sig.c
  HOSTCC  tools/boot/image-fit-sig.o
  WRAP    tools/boot/image-cipher.c
  HOSTCC  tools/boot/image-cipher.o
  WRAP    tools/boot/fdt_region.c
  HOSTCC  tools/boot/fdt_region.o
  WRAP    tools/boot/bootm.c
  HOSTCC  tools/boot/bootm.o
  HOSTCC  tools/default_image.o
  WRAP    tools/lib/fdtdec_common.c
  HOSTCC  tools/lib/fdtdec_common.o
  WRAP    tools/lib/fdtdec.c
  HOSTCC  tools/lib/fdtdec.o
  WRAP    tools/boot/image.c
  HOSTCC  tools/boot/image.o
  WRAP    tools/boot/image-host.c
  HOSTCC  tools/boot/image-host.o
  HOSTCC  tools/imagetool.o
  HOSTCC  tools/imximage.o
  HOSTCC  tools/imx8image.o
  HOSTCC  tools/imx8mimage.o
  HOSTCC  tools/kwbimage.o
  WRAP    tools/lib/md5.c
  HOSTCC  tools/lib/md5.o
  HOSTCC  tools/lpc32xximage.o
  HOSTCC  tools/mxsimage.o
  HOSTCC  tools/omapimage.o
  HOSTCC  tools/pblimage.o
  HOSTCC  tools/pbl_crc32.o
  HOSTCC  tools/vybridimage.o
  HOSTCC  tools/stm32image.o
  WRAP    tools/lib/rc4.c
  HOSTCC  tools/lib/rc4.o
  HOSTCC  tools/rkcommon.o
  HOSTCC  tools/rkimage.o
  HOSTCC  tools/rksd.o
  HOSTCC  tools/rkspi.o
  HOSTCC  tools/socfpgaimage.o
  HOSTCC  tools/sunxi_egon.o
  WRAP    tools/lib/crc16.c
  HOSTCC  tools/lib/crc16.o
  WRAP    tools/lib/hash-checksum.c
  HOSTCC  tools/lib/hash-checksum.o
  WRAP    tools/lib/sha1.c
  HOSTCC  tools/lib/sha1.o
  WRAP    tools/lib/sha256.c
  HOSTCC  tools/lib/sha256.o
  WRAP    tools/lib/sha512.c
  HOSTCC  tools/lib/sha512.o
  WRAP    tools/common/hash.c
  HOSTCC  tools/common/hash.o
  HOSTCC  tools/ublimage.o
  HOSTCC  tools/zynqimage.o
  HOSTCC  tools/zynqmpimage.o
  HOSTCC  tools/zynqmpbif.o
  WRAP    tools/lib/fdt-libcrypto.c
  HOSTCC  tools/lib/fdt-libcrypto.o
  HOSTCC  tools/libfdt/fdt.o
  HOSTCC  tools/libfdt/fdt_ro.o
  HOSTCC  tools/libfdt/fdt_wip.o
  HOSTCC  tools/libfdt/fdt_sw.o
  HOSTCC  tools/libfdt/fdt_rw.o
  HOSTCC  tools/libfdt/fdt_strerror.o
  HOSTCC  tools/libfdt/fdt_empty_tree.o
  HOSTCC  tools/libfdt/fdt_addresses.o
  HOSTCC  tools/libfdt/fdt_overlay.o
  HOSTCC  tools/gpimage.o
  HOSTCC  tools/gpimage-common.o
  HOSTCC  tools/mtk_image.o
  WRAP    tools/lib/ecdsa/ecdsa-libcrypto.c
  HOSTCC  tools/lib/ecdsa/ecdsa-libcrypto.o
  WRAP    tools/lib/rsa/rsa-sign.c
  HOSTCC  tools/lib/rsa/rsa-sign.o
  WRAP    tools/lib/rsa/rsa-verify.c
  HOSTCC  tools/lib/rsa/rsa-verify.o
  WRAP    tools/lib/rsa/rsa-mod-exp.c
  HOSTCC  tools/lib/rsa/rsa-mod-exp.o
  WRAP    tools/lib/aes/aes-encrypt.c
  HOSTCC  tools/lib/aes/aes-encrypt.o
  WRAP    tools/lib/aes/aes-decrypt.c
  HOSTCC  tools/lib/aes/aes-decrypt.o
  HOSTCC  tools/dumpimage.o
  HOSTLD  tools/dumpimage
  HOSTCC  tools/mkimage.o
  HOSTLD  tools/mkimage
  HOSTCC  tools/fit_info.o
  HOSTLD  tools/fit_info
  HOSTCC  tools/fit_check_sign.o
  HOSTLD  tools/fit_check_sign
  HOSTCC  tools/proftool
  HOSTCC  tools/fdtgrep.o
  HOSTLD  tools/fdtgrep
  HOSTCC  tools/spl_size_limit
tools/bmp_logo --gen-info ./tools/logos/denx.bmp > include/bmp_logo.h
tools/bmp_logo --gen-bmp ./tools/logos/denx.bmp > include/bmp_logo_data.h
  AR      arch/arm/cpu/built-in.o
  CC      arch/arm/cpu/armv7/cache_v7.o
  AS      arch/arm/cpu/armv7/cache_v7_asm.o
  CC      arch/arm/cpu/armv7/cpu.o
  CC      arch/arm/cpu/armv7/cp15.o
  CC      arch/arm/cpu/armv7/syslib.o
  AS      arch/arm/cpu/armv7/sctlr.o
  AR      arch/arm/cpu/armv7/built-in.o
  AS      arch/arm/cpu/armv7/start.o
  AS      arch/arm/lib/vectors.o
  AS      arch/arm/lib/crt0.o
  AS      arch/arm/lib/setjmp.o
  AS      arch/arm/lib/relocate.o
  CC      arch/arm/lib/bootm-fdt.o
  CC      arch/arm/lib/bootm.o
  CC      arch/arm/lib/zimage.o
  AS      arch/arm/lib/memset.o
  AS      arch/arm/lib/memcpy.o
  CC      arch/arm/lib/bdinfo.o
  CC      arch/arm/lib/sections.o
  CC      arch/arm/lib/stack.o
  CC      arch/arm/lib/interrupts.o
  CC      arch/arm/lib/reset.o
  CC      arch/arm/lib/cache.o
  CC      arch/arm/lib/cache-cp15.o
  CC      arch/arm/lib/psci-dt.o
  AR      arch/arm/lib/built-in.o
  AS      arch/arm/lib/ashldi3.o
  AS      arch/arm/lib/ashrdi3.o
  CC      arch/arm/lib/div0.o
  AS      arch/arm/lib/div64.o
  AS      arch/arm/lib/lib1funcs.o
  AS      arch/arm/lib/lshrdi3.o
  AS      arch/arm/lib/muldi3.o
  AS      arch/arm/lib/uldivmod.o
  AR      arch/arm/lib/lib.a
  CC      arch/arm/lib/eabi_compat.o
  AS      arch/arm/lib/crt0_arm_efi.o
  CC      arch/arm/lib/reloc_arm_efi.o
  CC      arch/arm/mach-bcm283x/init.o
  CC      arch/arm/mach-bcm283x/reset.o
  CC      arch/arm/mach-bcm283x/mbox.o
  CC      arch/arm/mach-bcm283x/msg.o
  CC      arch/arm/mach-bcm283x/phys2bus.o
  AR      arch/arm/mach-bcm283x/built-in.o
  CC      board/raspberrypi/rpi/rpi.o
  AS      board/raspberrypi/rpi/lowlevel_init.o
  AR      board/raspberrypi/rpi/built-in.o
  CC      boot/bootm.o
  CC      boot/bootm_os.o
  CC      boot/pxe_utils.o
  CC      boot/image.o
  CC      boot/image-board.o
  CC      boot/image-fdt.o
  AR      boot/built-in.o
  AR      cmd/arm/built-in.o
  CC      cmd/boot.o
  CC      cmd/bootm.o
  CC      cmd/help.o
  CC      cmd/panic.o
  CC      cmd/version.o
  CC      cmd/blk_common.o
  CC      cmd/source.o
  CC      cmd/bdinfo.o
  CC      cmd/blkcache.o
  CC      cmd/bootefi.o
  CC      cmd/bootz.o
  CC      cmd/console.o
  CC      cmd/dm.o
  CC      cmd/echo.o
  CC      cmd/elf.o
  CC      cmd/exit.o
  CC      cmd/ext4.o
  CC      cmd/ext2.o
  CC      cmd/fat.o
  CC      cmd/fdt.o
  CC      cmd/fs.o
  CC      cmd/gpio.o
  CC      cmd/itest.o
  CC      cmd/load.o
  CC      cmd/mem.o
  CC      cmd/mii.o
  CC      cmd/mdio.o
  CC      cmd/sleep.o
  CC      cmd/mmc.o
  CC      cmd/net.o
  CC      cmd/part.o
  CC      cmd/pinmux.o
  CC      cmd/pxe.o
  CC      cmd/setexpr.o
  CC      cmd/sysboot.o
  CC      cmd/test.o
  CC      cmd/usb.o
  CC      cmd/disk.o
  CC      cmd/fs_uuid.o
  CC      cmd/ximg.o
  CC      cmd/nvedit.o
  CC      cmd/libkiosk_crypto.o
cmd/libkiosk_crypto.c:5:10: fatal error: unistd.h: No such file or directory
    5 | #include <unistd.h>
      |          ^~~~~~~~~~
compilation terminated.
make[4]: *** [scripts/Makefile.build:254: cmd/libkiosk_crypto.o] Error 1
make[3]: *** [Makefile:1894: cmd] Error 2
make[3]: Leaving directory '/home/thura/workspace/cambridge/kiosk/kiosk.phy/bootloader/u-boot-2022.04'
make[2]: *** [Makefile:33: u-boot-2022.04/u-boot.bin] Error 2
make[2]: Leaving directory '/home/thura/workspace/cambridge/kiosk/kiosk.phy/bootloader'
make[1]: *** [Makefile:18: sub-all] Error 2
make[1]: Leaving directory '/home/thura/workspace/cambridge/kiosk/kiosk.phy'
make: *** [Makefile:6: all] Error 2


[-- Attachment #3: common.mk --]
[-- Type: text/x-makefile, Size: 807 bytes --]

# Version numbers for components

U_BOOT_VERSION = 2019.04

LINUX_BASE_VERSION = 4.19
LINUX_PATCH_VERSION = 62

ALPINE_VERSION = v3.9
ALPINE_MIRROR_URL ?= http://get.phy.cam.ac.uk/alpine-mirror/

XORG_VERSION = 1.20.7

MONOCYPHER_VERSION = 2.0.6

# Standard build flags

GCC ?= gcc
CFLAGS = -fPIC
CFLAGS += -Wall -Wextra -Werror -Wpedantic -std=gnu11 -O3
CFLAGS += -Wno-unused-function

# Automatic variables

ARCHIVE_DIR := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))/../archive)

define DOWNLOAD
DOWNLOADS += $(ARCHIVE_DIR)/$(notdir $(1))
$(ARCHIVE_DIR)/$(notdir $(1)):
	@mkdir -p $(ARCHIVE_DIR)
	wget --no-config -P $(ARCHIVE_DIR) '$(patsubst %/index.html,%/,$(1))'
endef

FORGETFUL_SSH := ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null
FORGETFUL_RSYNC := rsync -e '$(FORGETFUL_SSH)'


[-- Attachment #4: bootloader-Makefile --]
[-- Type: application/octet-stream, Size: 1315 bytes --]

.PHONY: all download clean distclean

all: .install.stamp

include ../common/common.mk

U_BOOT = u-boot-$(U_BOOT_VERSION)

$(eval $(call DOWNLOAD,ftp://ftp.denx.de/pub/u-boot/$(U_BOOT).tar.bz2))

download: $(DOWNLOADS)

.unpacked.stamp: $(DOWNLOADS)
	rm -rf $(U_BOOT)
	tar -xjf $<
	patch -d $(U_BOOT) -p1 < cmd-objects.patch
	patch -d $(U_BOOT) -p1 < tftp-timeout.patch
	touch $@

$(U_BOOT)/cmd/monocypher.c $(U_BOOT)/cmd/monocypher.h: $(U_BOOT)/cmd/%: ../common/monocypher-$(MONOCYPHER_VERSION)/src/% .unpacked.stamp
	cp $< $@

$(U_BOOT)/cmd/libkiosk_crypto.h $(U_BOOT)/cmd/libkiosk_crypto.c $(U_BOOT)/cmd/crypto-constants.S: $(U_BOOT)/cmd/%: ../common/src/% .unpacked.stamp
	cp $< $@

$(U_BOOT)/cmd/crypto-uboot.c: $(U_BOOT)/%: src/% .unpacked.stamp
	cp $< $@

$(U_BOOT)/.config: .unpacked.stamp bootcommand.sh
	./mkconfig.sh $(U_BOOT)

$(U_BOOT)/u-boot.bin: $(U_BOOT)/cmd/monocypher.c $(U_BOOT)/cmd/monocypher.h $(U_BOOT)/cmd/libkiosk_crypto.h $(U_BOOT)/cmd/libkiosk_crypto.c $(U_BOOT)/cmd/crypto-uboot.c $(U_BOOT)/cmd/crypto-constants.S $(U_BOOT)/.config .unpacked.stamp
	make -C $(U_BOOT) CROSS_COMPILE=arm-linux-gnueabihf-

out/boot/u-boot.bin: $(U_BOOT)/u-boot.bin
	@mkdir -p $(dir $@)
	cp $< $@

.install.stamp: out/boot/u-boot.bin
	touch $@

clean:
	rm -rf $(U_BOOT) out
	rm -f .*.stamp

distclean: clean


[-- Attachment #5: main-Makefile --]
[-- Type: application/octet-stream, Size: 849 bytes --]

.PHONY: all upgrade download clean distclean
.PHONY: sub-all sub-clean sub-distclean

all:
	if [ ! -e sign.pub ]; then $(MAKE) -C common generate; fi
	$(MAKE) sub-all
	$(MAKE) -C sdk combine

upgrade:
	$(MAKE) -C common upgrade

include common/common.mk

sub-all download sub-clean sub-distclean:
	$(MAKE) -C common $(patsubst sub-%,%,$@)
	$(MAKE) -C sdk $(patsubst sub-%,%,$@)
	$(MAKE) -C kernel $(patsubst sub-%,%,$@)
	$(MAKE) -C bootloader $(patsubst sub-%,%,$@)
	$(MAKE) -C lua $(patsubst sub-%,%,$@)
	$(MAKE) -C xorg $(patsubst sub-%,%,$@)

sign.pub sign.sec kex.pub kex.sec: common/.generate.stamp

sub-test: all
	$(MAKE) -C lua $(patsubst sub-%,%,$@)

test: sub-test

clean: sub-clean
	rm -f .generate.stamp .kernel.stamp .os.stamp src/generate *.img

distclean: clean sub-distclean
	rm -rf archive/
	rm -f kex.pub kex.sec sign.pub sign.sec


[-- Attachment #6: common-Makefile --]
[-- Type: application/octet-stream, Size: 1255 bytes --]

.PHONY: all download upgrade generate clean distclean

all: src/crypto-constants.S .monocypher.stamp

include common.mk

$(eval $(call DOWNLOAD,https://github.com/LoupVaillant/Monocypher/releases/download/$(MONOCYPHER_VERSION)/monocypher-$(MONOCYPHER_VERSION).tar.gz))

$(eval $(call DOWNLOAD,https://github.com/nothings/stb/raw/master/stb_image.h))

src/imagetotexture: CFLAGS += -I$(ARCHIVE_DIR)
src/imagetotexture: LDFLAGS += -lm
src/imagetotexture: src/imagetotexture.c $(ARCHIVE_DIR)/stb_image.h
	$(GCC) -o $@ $(filter %.c,$^) -static $(CFLAGS) $(LDFLAGS)

download: $(DOWNLOADS)

upgrade:
	python3 watch.py

generate: src/generate
	cd .. && common/src/generate

src/crypto-constants.S: mkconstants.sh ../sign.pub ../kex.sec
	./mkconstants.sh $@ ../sign.pub ../kex.sec

monocypher-$(MONOCYPHER_VERSION)/src/monocypher.c: | .monocypher.stamp

src/generate: src/generate.c monocypher-$(MONOCYPHER_VERSION)/src/monocypher.c
	$(GCC) -o $@ $^ -fPIC -Imonocypher-$(MONOCYPHER_VERSION)/src -Wall -Wextra -Werror -Wpedantic -std=gnu11 -O3

.monocypher.stamp: $(ARCHIVE_DIR)/monocypher-$(MONOCYPHER_VERSION).tar.gz
	tar -xzf $<
	touch $@

clean:
	rm -rf monocypher-$(MONOCYPHER_VERSION)/
	rm -f .*.stamp src/generate src/crypto-constants.S

distclean: clean


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Error: cmd/libkiosk_crypto.c:5:10: fatal error: unistd.h: No such file or directory
  2022-07-07 10:30 Error: cmd/libkiosk_crypto.c:5:10: fatal error: unistd.h: No such file or directory Thu Ra
@ 2022-07-08 17:01 ` Ralph Siemsen
  0 siblings, 0 replies; 2+ messages in thread
From: Ralph Siemsen @ 2022-07-08 17:01 UTC (permalink / raw)
  To: Thu Ra; +Cc: u-boot

On Thu, Jul 7, 2022 at 7:07 AM Thu Ra <thura747@gmail.com> wrote:
>
> Error: cmd/libkiosk_crypto.c:5:10: fatal error: unistd.h: No such file or directory

This file (libkiosk_crypto.c) is not part of u-boot. In the build log,
we can see that it is copied into the u-boot tree:
   cp ../common/src/libkiosk_crypto.c u-boot-2022.04/cmd/libkiosk_crypto.c
You will likely need to find out where this code comes from, and
contact the author(s).

U-boot executes before Linux kernel and normal userspace programs, so
the regular C runtime library (glibc) is not available to u-boot. The
header "unistd.h" defines prototypes for the C runtime library. It
does not make sense to use this within u-boot source code.

Good luck!
R

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-07-08 17:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-07 10:30 Error: cmd/libkiosk_crypto.c:5:10: fatal error: unistd.h: No such file or directory Thu Ra
2022-07-08 17:01 ` Ralph Siemsen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).