Makefile 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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:= 34
  8. PKG_SECTION:= base
  9. PKG_DESCR:= basic files and scripts
  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. CONFIG_STYLE:= manual
  15. BUILD_STYLE:= manual
  16. INSTALL_STYLE:= manual
  17. do-install:
  18. $(CP) ./src/* $(IDIR_BASE_FILES)
  19. # allow this to fail, as there might be no target-specific files to copy
  20. -$(CP) $(TOPDIR)/target/$(ADK_TARGET)/files/* $(IDIR_BASE_FILES)
  21. ifeq (${ADK_TARGET_ROOTFS_NFSROOT},y)
  22. @-rm $(IDIR_BASE_FILES)/etc/network/interfaces
  23. endif
  24. $(SED) 's,@TARGET@,$(ADK_TARGET),g' $(IDIR_BASE_FILES)/etc/ipkg.conf
  25. $(SED) 's,@HOST@,$(ADK_HOST),g' $(IDIR_BASE_FILES)/etc/ipkg.conf
  26. $(SED) 's,@LIBC@,$(ADK_LIBC),g' $(IDIR_BASE_FILES)/etc/ipkg.conf
  27. $(SED) 's,@VENDOR@,$(ADK_VENDOR),g' $(IDIR_BASE_FILES)/etc/ipkg.conf
  28. echo /bin/sh >${IDIR_BASE_FILES}/etc/shells
  29. echo /bin/ash >>${IDIR_BASE_FILES}/etc/shells
  30. ifneq (${ADK_PACKAGE_BASH},)
  31. echo /bin/bash >>${IDIR_BASE_FILES}/etc/shells
  32. endif
  33. ifneq (${ADK_PACKAGE_MKSH},)
  34. echo /bin/mksh >>${IDIR_BASE_FILES}/etc/shells
  35. endif
  36. ifneq (${ADK_PACKAGE_ZSH},)
  37. echo /bin/zsh >>${IDIR_BASE_FILES}/etc/shells
  38. endif
  39. mkdir -p $(IDIR_BASE_FILES)/dev
  40. mkdir -p $(IDIR_BASE_FILES)/boot
  41. mkdir -p $(IDIR_BASE_FILES)/root
  42. mkdir -p $(IDIR_BASE_FILES)/sys
  43. mkdir -p $(IDIR_BASE_FILES)/etc/crontabs
  44. mkdir -p $(IDIR_BASE_FILES)/etc/network/if-pre-up.d
  45. mkdir -p $(IDIR_BASE_FILES)/etc/network/if-up.d
  46. mkdir -p $(IDIR_BASE_FILES)/etc/network/if-down.d
  47. mkdir -p $(IDIR_BASE_FILES)/etc/network/if-post-down.d
  48. mkdir -p $(IDIR_BASE_FILES)/mnt
  49. mkdir -p $(IDIR_BASE_FILES)/proc
  50. mkdir -p $(IDIR_BASE_FILES)/tmp
  51. mkdir -p $(IDIR_BASE_FILES)/usr/lib
  52. mkdir -p $(IDIR_BASE_FILES)/usr/bin
  53. chmod 755 $(IDIR_BASE_FILES)/lib/mdev/init
  54. chmod 600 $(IDIR_BASE_FILES)/etc/shadow
  55. ln -sf ../proc/mounts $(IDIR_BASE_FILES)/etc/mtab
  56. rm -rf $(IDIR_BASE_FILES)/var
  57. ln -sf tmp $(IDIR_BASE_FILES)/var
  58. test -z $(ADK_RUNTIME_CONSOLE_VGA) || \
  59. cat ./files/inittab.vga >> $(IDIR_BASE_FILES)/etc/inittab
  60. test -z $(ADK_RUNTIME_CONSOLE_SERIAL) || \
  61. cat ./files/inittab.serial >> $(IDIR_BASE_FILES)/etc/inittab
  62. test -z $(ADK_RUNTIME_CONSOLE_BOTH) || \
  63. cat ./files/inittab.serial >> $(IDIR_BASE_FILES)/etc/inittab
  64. test -z $(ADK_RUNTIME_CONSOLE_BOTH) || \
  65. cat ./files/inittab.vga >> $(IDIR_BASE_FILES)/etc/inittab
  66. test -z $(ADK_RUNTIME_HOSTNAME) || \
  67. echo $(ADK_RUNTIME_HOSTNAME) > \
  68. $(IDIR_BASE_FILES)/etc/hostname
  69. test -z $(ADK_RUNTIME_PASSWORD) || \
  70. $(SED) 's,\*NP\*,'"$$(${TOPDIR}/bin/tools/mkcrypt \
  71. ${ADK_RUNTIME_PASSWORD}),g" $(IDIR_BASE_FILES)/etc/shadow
  72. git log -1|head -1|sed -e 's#commit ##' \
  73. > $(IDIR_BASE_FILES)/etc/adkversion
  74. test -z $(ADK_HW) || \
  75. echo $(ADK_HW) > $(IDIR_BASE_FILES)/etc/adktarget
  76. ifneq (${ADK_PACKAGE_CONFIG_IN_ETC},)
  77. gzip -9c ${TOPDIR}/.config >$(IDIR_BASE_FILES)/etc/adkconfig.gz
  78. chmod 600 $(IDIR_BASE_FILES)/etc/adkconfig.gz
  79. endif
  80. include ${TOPDIR}/mk/pkg-bottom.mk