Makefile 3.3 KB

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