Makefile 3.1 KB

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