Makefile 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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:= 43
  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. ifeq (${ADK_TARGET_ROOTFS_NFSROOT},y)
  20. @echo "#" > $(IDIR_BASE_FILES)/etc/network/interfaces
  21. endif
  22. $(SED) 's,@ARCH@,$(ADK_TARGET_ARCH),g' $(IDIR_BASE_FILES)/etc/ipkg.conf
  23. $(SED) 's,@SYSTEM@,$(ADK_TARGET_SYSTEM),g' $(IDIR_BASE_FILES)/etc/ipkg.conf
  24. $(SED) 's,@LIBC@,$(ADK_TARGET_LIBC),g' $(IDIR_BASE_FILES)/etc/ipkg.conf
  25. $(SED) 's,@HOST@,$(ADK_HOST),g' $(IDIR_BASE_FILES)/etc/ipkg.conf
  26. $(SED) 's,@VENDOR@,$(ADK_VENDOR),g' $(IDIR_BASE_FILES)/etc/ipkg.conf
  27. echo /bin/sh >${IDIR_BASE_FILES}/etc/shells
  28. echo /bin/ash >>${IDIR_BASE_FILES}/etc/shells
  29. ifneq (${ADK_PACKAGE_BASH},)
  30. echo /bin/bash >>${IDIR_BASE_FILES}/etc/shells
  31. endif
  32. ifneq (${ADK_PACKAGE_MKSH},)
  33. echo /bin/mksh >>${IDIR_BASE_FILES}/etc/shells
  34. endif
  35. ifneq (${ADK_PACKAGE_ZSH},)
  36. echo /bin/zsh >>${IDIR_BASE_FILES}/etc/shells
  37. endif
  38. mkdir -p $(IDIR_BASE_FILES)/usr/lib/ipkg/lists
  39. mkdir -p $(IDIR_BASE_FILES)/etc/crontabs
  40. mkdir -p $(IDIR_BASE_FILES)/{dev,boot,root,sys,proc,tmp,mnt}
  41. mkdir -p $(IDIR_BASE_FILES)/etc/network/{if-pre-up.d,if-up.d,if-down.d,if-post-down.d}
  42. mkdir -p $(IDIR_BASE_FILES)/usr/{lib,bin}
  43. chmod 755 $(IDIR_BASE_FILES)/lib/mdev/init
  44. chmod 600 $(IDIR_BASE_FILES)/etc/shadow
  45. chmod 600 $(IDIR_BASE_FILES)/etc/network/interfaces
  46. ln -sf ../proc/mounts $(IDIR_BASE_FILES)/etc/mtab
  47. rm -rf $(IDIR_BASE_FILES)/var
  48. ln -sf tmp $(IDIR_BASE_FILES)/var
  49. test -z $(ADK_RUNTIME_CONSOLE_VGA) || \
  50. cat ./files/inittab.vga >> $(IDIR_BASE_FILES)/etc/inittab
  51. test -z $(ADK_RUNTIME_CONSOLE_SERIAL) || \
  52. cat ./files/inittab.serial >> $(IDIR_BASE_FILES)/etc/inittab
  53. test -z $(ADK_RUNTIME_CONSOLE_BOTH) || \
  54. cat ./files/inittab.serial >> $(IDIR_BASE_FILES)/etc/inittab
  55. test -z $(ADK_RUNTIME_CONSOLE_BOTH) || \
  56. cat ./files/inittab.vga >> $(IDIR_BASE_FILES)/etc/inittab
  57. $(SED) 's#@SPEED@#$(ADK_RUNTIME_CONSOLE_SERIAL_SPEED)#' $(IDIR_BASE_FILES)/etc/inittab
  58. test -z $(ADK_RUNTIME_HOSTNAME) || \
  59. echo $(ADK_RUNTIME_HOSTNAME) > $(IDIR_BASE_FILES)/etc/hostname; \
  60. echo "127.0.0.1 $(ADK_RUNTIME_HOSTNAME)" >> $(IDIR_BASE_FILES)/etc/hosts
  61. test -z $(ADK_RUNTIME_PASSWORD) || \
  62. $(SED) 's,\*NP\*,'"$$(${TOPDIR}/bin/tools/mkcrypt \
  63. ${ADK_RUNTIME_PASSWORD}),g" $(IDIR_BASE_FILES)/etc/shadow
  64. git log -1|head -1|sed -e 's#commit ##' \
  65. > $(IDIR_BASE_FILES)/etc/adkversion
  66. test -z $(ADK_TARGET_SYSTEM) || \
  67. echo $(ADK_TARGET_SYSTEM) > $(IDIR_BASE_FILES)/etc/adktarget
  68. echo $(ADK_RUNTIME_TMPFS_SIZE) > $(IDIR_BASE_FILES)/etc/tmpfs
  69. ifneq (${ADK_PACKAGE_CONFIG_IN_ETC},)
  70. gzip -9c ${TOPDIR}/.config >$(IDIR_BASE_FILES)/etc/adkconfig.gz
  71. chmod 600 $(IDIR_BASE_FILES)/etc/adkconfig.gz
  72. endif
  73. include ${TOPDIR}/mk/pkg-bottom.mk