Makefile 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. # This file is part of the OpenADK project. OpenADK is copyrighted
  2. # material, please see the LICENCE file in the top-level directory.
  3. include $(TOPDIR)/rules.mk
  4. include $(TOPDIR)/mk/rootfs.mk
  5. PKG_NAME:= base-files
  6. PKG_VERSION:= 1.0
  7. PKG_RELEASE:= 10
  8. PKG_DESCR:= basic filesystem structure and scripts
  9. PKG_SECTION:= base
  10. WRKDIST= ${WRKDIR}/base-files
  11. NO_DISTFILES:= 1
  12. include $(TOPDIR)/mk/package.mk
  13. $(eval $(call PKG_template,BASE_FILES,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  14. PKGDFLT_BASE_FILES= y if !ADK_TOOLCHAIN_ONLY
  15. CFLINE_BASE_FILES:= depends on !ADK_TOOLCHAIN_ONLY
  16. CONFIG_STYLE:= manual
  17. BUILD_STYLE:= manual
  18. INSTALL_STYLE:= manual
  19. do-install:
  20. $(CP) ./src/* $(IDIR_BASE_FILES)
  21. # allow this to fail, as there might be no target-specific files to copy
  22. -$(CP) $(TOPDIR)/target/$(ADK_TARGET)/files/* $(IDIR_BASE_FILES)
  23. ifeq (${ADK_TARGET_ROOTFS_NFSROOT},y)
  24. @-rm $(IDIR_BASE_FILES)/etc/network/interfaces
  25. endif
  26. ifeq (${ADK_TARGET_PACKAGE_IPKG},y)
  27. $(SED) 's,@TARGET@,$(ADK_TARGET),g' $(IDIR_BASE_FILES)/etc/ipkg.conf
  28. $(SED) 's,@VERSION@,$(ADK_VERSION),g' $(IDIR_BASE_FILES)/etc/ipkg.conf
  29. else
  30. @-rm $(IDIR_BASE_FILES)/etc/ipkg.conf
  31. endif
  32. echo /bin/sh >${IDIR_BASE_FILES}/etc/shells
  33. echo /bin/ash >>${IDIR_BASE_FILES}/etc/shells
  34. ifneq (${ADK_PACKAGE_BASH},)
  35. echo /bin/bash >>${IDIR_BASE_FILES}/etc/shells
  36. endif
  37. ifneq (${ADK_PACKAGE_MKSH},)
  38. echo /bin/mksh >>${IDIR_BASE_FILES}/etc/shells
  39. endif
  40. ifneq (${ADK_PACKAGE_ZSH},)
  41. echo /bin/zsh >>${IDIR_BASE_FILES}/etc/shells
  42. endif
  43. mkdir -p $(IDIR_BASE_FILES)/dev
  44. mkdir -p $(IDIR_BASE_FILES)/boot
  45. mkdir -p $(IDIR_BASE_FILES)/root
  46. mkdir -p $(IDIR_BASE_FILES)/sys
  47. mkdir -p $(IDIR_BASE_FILES)/etc/crontabs
  48. mkdir -p $(IDIR_BASE_FILES)/etc/network/if-pre-up.d
  49. mkdir -p $(IDIR_BASE_FILES)/etc/network/if-up.d
  50. mkdir -p $(IDIR_BASE_FILES)/etc/network/if-down.d
  51. mkdir -p $(IDIR_BASE_FILES)/etc/network/if-post-down.d
  52. mkdir -p $(IDIR_BASE_FILES)/mnt
  53. mkdir -p $(IDIR_BASE_FILES)/proc
  54. mkdir -p $(IDIR_BASE_FILES)/tmp
  55. mkdir -p $(IDIR_BASE_FILES)/usr/lib
  56. mkdir -p $(IDIR_BASE_FILES)/usr/bin
  57. chmod 755 $(IDIR_BASE_FILES)/lib/mdev/init
  58. chmod 600 $(IDIR_BASE_FILES)/etc/shadow
  59. ln -sf ../tmp/resolv.conf $(IDIR_BASE_FILES)/etc/resolv.conf
  60. ln -sf ../proc/mounts $(IDIR_BASE_FILES)/etc/mtab
  61. rm -rf $(IDIR_BASE_FILES)/var
  62. ln -sf tmp $(IDIR_BASE_FILES)/var
  63. ifneq (${ADK_PACKAGE_CONFIG_IN_ETC},)
  64. gzip -9c ${TOPDIR}/.config >$(IDIR_BASE_FILES)/etc/adkconfig.gz
  65. endif
  66. include ${TOPDIR}/mk/pkg-bottom.mk