Error: cmd/libkiosk_crypto.c:5:10: fatal error: unistd.h: No such file or directory

Thu Ra thura747 at gmail.com
Thu Jul 7 12:30:35 CEST 2022


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
-------------- next part --------------
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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: common.mk
Type: text/x-makefile
Size: 807 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20220707/b6e26209/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bootloader-Makefile
Type: application/octet-stream
Size: 1315 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20220707/b6e26209/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main-Makefile
Type: application/octet-stream
Size: 849 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20220707/b6e26209/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: common-Makefile
Type: application/octet-stream
Size: 1255 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20220707/b6e26209/attachment-0002.obj>


More information about the U-Boot mailing list