keystone-enclave / keystone

Keystone Enclave (QEMU + HiFive Unleashed)
Other
441 stars 125 forks source link

re-build fail because buildroot try to re-patch #397

Open T1anyang opened 6 months ago

T1anyang commented 6 months ago

Hi, I've built keystone successfully. I want to add some file in rootfs, so I try BUILDROOT_TARGET=rootfs-ext2 make . It failed and saying:

>>>  (INF) Configuring Buildroot with qemu_riscv64_virt_defconfig
make -C /home/yty/keystone//buildroot O=/home/yty/keystone//build-generic64/buildroot.build BR2_EXTERNAL=/home/yty/keystone//overlays/keystone qemu_riscv64_virt_defconfig
make[1]: Entering directory '/home/yty/keystone/buildroot'
  GEN     /home/yty/keystone/build-generic64/buildroot.build/Makefile
#
# configuration written to /home/yty/keystone/build-generic64/buildroot.build/.config
#
make[1]: Leaving directory '/home/yty/keystone/buildroot'
echo "BR2_ROOTFS_OVERLAY=\"/home/yty/keystone//build-generic64/overlay\"" >> /home/yty/keystone//build-generic64/buildroot.build/.config
 >>>  (INF) Building Buildroot
make -C /home/yty/keystone//buildroot O=/home/yty/keystone//build-generic64/buildroot.build BR2_EXTERNAL=/home/yty/keystone//overlays/keystone rootfs-ext2 
make[1]: Entering directory '/home/yty/keystone/buildroot'
/usr/bin/make -j1 O=/home/yty/keystone/build-generic64/buildroot.build HOSTCC="/usr/bin/gcc" HOSTCXX="/usr/bin/g++" syncconfig
  GEN     /home/yty/keystone/build-generic64/buildroot.build/Makefile
/home/yty/keystone/build-generic64/buildroot.build/.config:3522:warning: override: reassigning to symbol BR2_ROOTFS_OVERLAY
#
# configuration written to /home/yty/keystone/build-generic64/buildroot.build/.config
#
>>> host-pkgconf 1.6.3 Patching

Applying 0001-Only-prefix-with-the-sysroot-a-subset-of-variables.patch using patch: 
Error: duplicate filename '0001-Only-prefix-with-the-sysroot-a-subset-of-variables.patch'
Conflicting files are:
  already applied: /home/yty/keystone/buildroot/package/pkgconf/0001-Only-prefix-with-the-sysroot-a-subset-of-variables.patch
  to be applied  : /home/yty/keystone/buildroot/package/pkgconf/0001-Only-prefix-with-the-sysroot-a-subset-of-variables.patch
make[2]: *** [package/pkg-generic.mk:251: /home/yty/keystone/build-generic64/buildroot.build/build/host-pkgconf-1.6.3/.stamp_patched] Error 1
make[1]: *** [Makefile:82: _all] Error 2
make[1]: Leaving directory '/home/yty/keystone/buildroot'
make: *** [Makefile:85: buildroot] Error 2

It seems that there are some files need to be patched. In the first build, buildroot had patched it. But buildroot tried to re-patch them while re-building, so it failed. How should I solve this?

Thanks.

asyarifstudio commented 6 months ago

Simply clean the build-generic64 folder will solve the problem I think.

if you add other file in build-generic64/overlay, buildroot will automatically detect changes in the build-generic64/overlay so I think you can just call make . rootfs-ext2 is not available in buildroot Makefile