Makefile 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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/kernel.mk
  5. include $(TOPDIR)/mk/modules.mk
  6. include $(TOPDIR)/mk/kernel-build.mk
  7. include $(TOPDIR)/mk/image.mk
  8. KERNEL:=$(LINUX_DIR)/vmlinuz
  9. createinitcrypt:
  10. $(SED) 's#^CONFIG_INITRAMFS_SOURCE.*#CONFIG_INITRAMFS_SOURCE="./initramfs_list"#' $(LINUX_DIR)/.config
  11. echo 'CONFIG_INITRAMFS_ROOT_UID=0' >> $(LINUX_DIR)/.config
  12. echo 'CONFIG_INITRAMFS_ROOT_GID=0' >> $(LINUX_DIR)/.config
  13. echo N |$(MAKE) -C $(LINUX_DIR) V=1 CROSS_COMPILE="$(TARGET_CROSS)" ARCH=$(ARCH) \
  14. CC="$(TARGET_CC)" oldconfig $(MAKE_TRACE)
  15. $(MAKE) -C $(LINUX_DIR) V=1 CROSS_COMPILE="$(TARGET_CROSS)" ARCH=$(ARCH) \
  16. CC="$(TARGET_CC)" $(MAKE_TRACE)
  17. @cp $(KERNEL) $(BIN_DIR)/${ADK_TARGET}-${FS}-kernel
  18. ifeq ($(FS),nfsroot)
  19. imageinstall: $(BIN_DIR)/$(ROOTFSUSERTARBALL)
  20. @cp $(KERNEL) $(BIN_DIR)/${ADK_TARGET}-${FS}-kernel
  21. @echo 'The kernel file is: ${BIN_DIR}/${ADK_TARGET}-${FS}-kernel'
  22. @echo 'The nfs root tarball is: ${BIN_DIR}/${ROOTFSUSERTARBALL}'
  23. @echo 'Boot your lemote and type following commands in PMON:'
  24. @echo 'PMON> ifaddr rtl0 <ip-address-client>'
  25. @echo 'PMON> load tftp://<ip-address-server>/${ADK_TARGET}-${FS}-kernel'
  26. @echo 'PMON> g'
  27. endif
  28. ifeq ($(FS),initramfs)
  29. imageinstall: $(BIN_DIR)/$(INITRAMFS)
  30. @cp $(KERNEL) $(BIN_DIR)/${ADK_TARGET}-${FS}-kernel
  31. @echo 'The kernel file is: ${BIN_DIR}/${ADK_TARGET}-${FS}-kernel'
  32. @echo 'The initramfs image is: ${BIN_DIR}/${INITRAMFS}'
  33. endif
  34. ifeq ($(FS),initramfs-piggyback)
  35. imageinstall: $(BUILD_DIR)/$(INITRAMFS_PIGGYBACK) createinitramfs
  36. @cp $(KERNEL) $(BIN_DIR)/${ADK_TARGET}-${FS}-kernel
  37. @echo 'The kernel+initramfs file is: ${BIN_DIR}/${ADK_TARGET}-${FS}-kernel'
  38. endif
  39. ifeq ($(FS),archive)
  40. imageinstall: $(BIN_DIR)/$(ROOTFSTARBALL)
  41. @echo "The RootFS tarball is: $(BIN_DIR)/$(ROOTFSTARBALL)"
  42. endif
  43. ifeq ($(FS),encrypted)
  44. imageinstall: $(BIN_DIR)/$(ROOTFSUSERTARBALL) createinitcrypt
  45. @echo 'The kernel+cryptinit file is: ${BIN_DIR}/${ADK_TARGET}-${FS}-kernel'
  46. @echo "The RootFS tarball is: $(BIN_DIR)/$(ROOTFSUSERTARBALL)"
  47. @echo 'Boot your lemote via NFS or USB.'
  48. @echo 'Then create at least three partitions with fdisk:'
  49. @echo '/dev/sda1 (ext2)'
  50. @echo '/dev/sda2 (encrypted root)'
  51. @echo '/dev/sda3 (swap)'
  52. @echo 'mkdir /mnt/{boot,root}'
  53. @echo 'mke2fs /dev/sda1'
  54. @echo 'cryptsetup luksFormat /dev/sda2'
  55. @echo 'cryptsetup luksFormat /dev/sda3'
  56. @echo 'cryptsetup luksOpen /dev/sda2 root'
  57. @echo 'cryptsetup luksOpen /dev/sda3 swap'
  58. @echo 'mkfs.xfs /dev/mapper/root'
  59. @echo 'mkswap /dev/mapper/swap'
  60. @echo 'mount /dev/sda1 /mnt/boot'
  61. @echo 'mount /dev/mapper/crypt /mnt/root'
  62. @echo 'mkdir /mnt/boot/boot'
  63. @echo 'Copy $(ROOTFSUSERTARBALL) via scp to /mnt/root and extract it'
  64. @echo 'cd /mnt/root ; gunzip $(ROOTFSUSERTARBALL); tar xpvf $(ROOTFSUSERTARBALL)'
  65. @echo 'Copy ${ADK_TARGET}-${FS}-kernel via scp to /mnt/boot/boot'
  66. @echo 'Move boot.cfg to /mnt/boot/boot'
  67. @echo 'mv /mnt/root/boot/boot.cfg /mnt/boot/boot'
  68. @echo 'cd /mnt/root ; mknod -m 644 console c 5 1'
  69. endif