Makefile 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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:= 5
  8. PKG_DESCR:= basic filesystem structure and scripts
  9. PKG_SECTION:= base
  10. WRKDIST= ${WRKDIR}/base-files
  11. NO_DISTFILES:= 1
  12. ifeq ($(CPU_ARCH),x86_64)
  13. PKG_ID= x86-64-${FS}
  14. else
  15. PKG_ID= ${DEVICE}-${FS}
  16. endif
  17. WRKDIR= ${WRKDIR_BASE}/w-${PKG_NAME}-${PKG_VERSION}-${PKG_RELEASE}-${PKG_ID}
  18. include $(TOPDIR)/mk/package.mk
  19. $(eval $(call PKG_template,BASE_FILES,base-files-${PKG_ID},${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  20. do-install:
  21. $(CP) ./extra/* $(IDIR_BASE_FILES)
  22. $(CP) $(TOPDIR)/target/$(DEVICE)/files/* $(IDIR_BASE_FILES)
  23. $(SED) 's,@TARGET@,$(DEVICE),g' $(IDIR_BASE_FILES)/etc/ipkg.conf
  24. $(SED) 's,@VERSION@,$(ADK_VERSION),g' $(IDIR_BASE_FILES)/etc/ipkg.conf
  25. echo /bin/sh >${IDIR_BASE_FILES}/etc/shells
  26. echo /bin/ash >>${IDIR_BASE_FILES}/etc/shells
  27. ifneq (${ADK_PACKAGE_BASH},)
  28. echo /bin/bash >>${IDIR_BASE_FILES}/etc/shells
  29. endif
  30. ifneq (${ADK_PACKAGE_MKSH},)
  31. echo /bin/mksh >>${IDIR_BASE_FILES}/etc/shells
  32. endif
  33. ifneq (${ADK_PACKAGE_ZSH},)
  34. echo /bin/zsh >>${IDIR_BASE_FILES}/etc/shells
  35. endif
  36. mkdir -p $(IDIR_BASE_FILES)/dev
  37. mkdir -p $(IDIR_BASE_FILES)/boot
  38. mkdir -p $(IDIR_BASE_FILES)/root
  39. mkdir -p $(IDIR_BASE_FILES)/sys
  40. mkdir -p $(IDIR_BASE_FILES)/etc/crontabs
  41. mkdir -p $(IDIR_BASE_FILES)/mnt
  42. mkdir -p $(IDIR_BASE_FILES)/proc
  43. mkdir -p $(IDIR_BASE_FILES)/tmp
  44. mkdir -p $(IDIR_BASE_FILES)/usr/lib
  45. mkdir -p $(IDIR_BASE_FILES)/usr/bin
  46. chmod 755 $(IDIR_BASE_FILES)/lib/mdev/init
  47. chmod 600 $(IDIR_BASE_FILES)/etc/shadow
  48. ln -sf ../tmp/resolv.conf $(IDIR_BASE_FILES)/etc/resolv.conf
  49. ln -sf ../proc/mounts $(IDIR_BASE_FILES)/etc/mtab
  50. rm -rf $(IDIR_BASE_FILES)/var
  51. ln -sf tmp $(IDIR_BASE_FILES)/var
  52. ifneq (${ADK_PACKAGE_CONFIG_IN_ETC},)
  53. gzip -9c ${TOPDIR}/.config >$(IDIR_BASE_FILES)/etc/adkconfig.gz
  54. endif
  55. include ${TOPDIR}/mk/pkg-bottom.mk