Makefile 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. $(CP) $(TOPDIR)/target/$(ADK_TARGET)/files/* $(IDIR_BASE_FILES)
  22. ifeq (${ADK_TARGET_ROOTFS_NFSROOT},y)
  23. @-rm $(IDIR_BASE_FILES)/etc/network/interfaces
  24. endif
  25. ifeq (${ADK_TARGET_PACKAGE_IPKG},y)
  26. $(SED) 's,@TARGET@,$(ADK_TARGET),g' $(IDIR_BASE_FILES)/etc/ipkg.conf
  27. $(SED) 's,@VERSION@,$(ADK_VERSION),g' $(IDIR_BASE_FILES)/etc/ipkg.conf
  28. else
  29. @-rm $(IDIR_BASE_FILES)/etc/ipkg.conf
  30. endif
  31. echo /bin/sh >${IDIR_BASE_FILES}/etc/shells
  32. echo /bin/ash >>${IDIR_BASE_FILES}/etc/shells
  33. ifneq (${ADK_PACKAGE_BASH},)
  34. echo /bin/bash >>${IDIR_BASE_FILES}/etc/shells
  35. endif
  36. ifneq (${ADK_PACKAGE_MKSH},)
  37. echo /bin/mksh >>${IDIR_BASE_FILES}/etc/shells
  38. endif
  39. ifneq (${ADK_PACKAGE_ZSH},)
  40. echo /bin/zsh >>${IDIR_BASE_FILES}/etc/shells
  41. endif
  42. mkdir -p $(IDIR_BASE_FILES)/dev
  43. mkdir -p $(IDIR_BASE_FILES)/boot
  44. mkdir -p $(IDIR_BASE_FILES)/root
  45. mkdir -p $(IDIR_BASE_FILES)/sys
  46. mkdir -p $(IDIR_BASE_FILES)/etc/crontabs
  47. mkdir -p $(IDIR_BASE_FILES)/etc/network/if-pre-up.d
  48. mkdir -p $(IDIR_BASE_FILES)/etc/network/if-up.d
  49. mkdir -p $(IDIR_BASE_FILES)/etc/network/if-down.d
  50. mkdir -p $(IDIR_BASE_FILES)/etc/network/if-post-down.d
  51. mkdir -p $(IDIR_BASE_FILES)/mnt
  52. mkdir -p $(IDIR_BASE_FILES)/proc
  53. mkdir -p $(IDIR_BASE_FILES)/tmp
  54. mkdir -p $(IDIR_BASE_FILES)/usr/lib
  55. mkdir -p $(IDIR_BASE_FILES)/usr/bin
  56. chmod 755 $(IDIR_BASE_FILES)/lib/mdev/init
  57. chmod 600 $(IDIR_BASE_FILES)/etc/shadow
  58. ln -sf ../tmp/resolv.conf $(IDIR_BASE_FILES)/etc/resolv.conf
  59. ln -sf ../proc/mounts $(IDIR_BASE_FILES)/etc/mtab
  60. rm -rf $(IDIR_BASE_FILES)/var
  61. ln -sf tmp $(IDIR_BASE_FILES)/var
  62. ifneq (${ADK_PACKAGE_CONFIG_IN_ETC},)
  63. gzip -9c ${TOPDIR}/.config >$(IDIR_BASE_FILES)/etc/adkconfig.gz
  64. endif
  65. include ${TOPDIR}/mk/pkg-bottom.mk