Makefile 3.4 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/kernel.mk
  5. include $(TOPDIR)/mk/modules.mk
  6. include $(TOPDIR)/mk/kernel-build.mk
  7. include $(TOPDIR)/mk/image.mk
  8. kernel-install:
  9. @cp $(LINUX_DIR)/arch/x86/boot/bzImage $(TARGET_DIR)/boot/vmlinuz-adk
  10. createinit:
  11. @-rm $(LINUX_DIR)/usr/initramfs_data.cpio.*
  12. $(SED) 's#^CONFIG_INITRAMFS_SOURCE.*#CONFIG_INITRAMFS_SOURCE="${BUILD_DIR}/${INITRAMFS_PIGGYBACK}"#' $(LINUX_DIR)/.config
  13. echo 'CONFIG_INITRAMFS_ROOT_UID=0' >> $(LINUX_DIR)/.config
  14. echo 'CONFIG_INITRAMFS_ROOT_GID=0' >> $(LINUX_DIR)/.config
  15. echo 'CONFIG_INITRAMFS_COMPRESSION_LZMA=y' >> $(LINUX_DIR)/.config
  16. echo N |$(MAKE) -C $(LINUX_DIR) V=0 CROSS_COMPILE="$(TARGET_CROSS)" ARCH=$(ARCH) \
  17. CC="$(TARGET_CC)" oldconfig $(MAKE_TRACE)
  18. $(MAKE) -C $(LINUX_DIR) V=0 CROSS_COMPILE="$(TARGET_CROSS)" ARCH=$(ARCH) \
  19. CC="$(TARGET_CC)" $(MAKE_TRACE)
  20. $(CP) $(LINUX_DIR)/arch/x86/boot/compressed/vmlinux \
  21. $(BIN_DIR)/${ADK_TARGET}-${FS}-kernel
  22. createinitcrypt:
  23. $(SED) 's#^CONFIG_INITRAMFS_SOURCE.*#CONFIG_INITRAMFS_SOURCE="./initramfs_list"#' $(LINUX_DIR)/.config
  24. echo 'CONFIG_INITRAMFS_ROOT_UID=0' >> $(LINUX_DIR)/.config
  25. echo 'CONFIG_INITRAMFS_ROOT_GID=0' >> $(LINUX_DIR)/.config
  26. echo N |$(MAKE) -C $(LINUX_DIR) V=1 CROSS_COMPILE="$(TARGET_CROSS)" ARCH=$(ARCH) \
  27. CC="$(TARGET_CC)" oldconfig $(MAKE_TRACE)
  28. $(MAKE) -C $(LINUX_DIR) V=1 CROSS_COMPILE="$(TARGET_CROSS)" ARCH=$(ARCH) \
  29. CC="$(TARGET_CC)" $(MAKE_TRACE)
  30. @cp $(LINUX_DIR)/arch/x86/boot/compressed/vmlinux \
  31. $(BIN_DIR)/${ADK_TARGET}-${FS}-kernel
  32. ifeq ($(FS),archive)
  33. imageinstall: $(BIN_DIR)/$(ROOTFSTARBALL)
  34. @echo "The RootFS tarball is: $(BIN_DIR)/$(ROOTFSTARBALL)"
  35. @echo 'Login as user root with password linux123 via ssh or console'
  36. endif
  37. ifeq ($(FS),usb)
  38. imageinstall: $(BIN_DIR)/$(ROOTFSTARBALL)
  39. @echo "The RootFS tarball is: $(BIN_DIR)/$(ROOTFSTARBALL)"
  40. @echo "To install everything to USB use scripts/install.sh"
  41. @echo 'Login as user root with password linux123 via ssh or console'
  42. endif
  43. ifeq ($(FS),initramfs-piggyback)
  44. imageinstall: ${BUILD_DIR}/${INITRAMFS_PIGGYBACK} createinit
  45. @echo 'The kernel file is: ${BIN_DIR}/${ADK_TARGET}-${FS}-kernel'
  46. @echo 'Login as user root with password linux123 via ssh or console'
  47. endif
  48. ifeq ($(FS),encrypted)
  49. imageinstall: $(BIN_DIR)/$(ROOTFSUSERTARBALL) createinitcrypt
  50. @echo 'The kernel+cryptinit file is: ${BIN_DIR}/${ADK_TARGET}-${FS}-kernel'
  51. @echo "The RootFS tarball is: $(BIN_DIR)/$(ROOTFSUSERTARBALL)"
  52. @echo 'Boot your IBM X40 via NFS or USB.'
  53. @echo 'Then create at least three partitions with fdisk:'
  54. @echo '/dev/sda1 (ext2)'
  55. @echo '/dev/sda2 (encrypted root)'
  56. @echo '/dev/sda3 (swap)'
  57. @echo 'mkdir /mnt/{boot,root}'
  58. @echo 'mke2fs /dev/sda1'
  59. @echo 'cryptsetup luksFormat /dev/sda2'
  60. @echo 'cryptsetup luksFormat /dev/sda3'
  61. @echo 'cryptsetup luksOpen /dev/sda2 root'
  62. @echo 'cryptsetup luksOpen /dev/sda3 swap'
  63. @echo 'mkfs.xfs /dev/mapper/root'
  64. @echo 'mkswap /dev/mapper/swap'
  65. @echo 'mount /dev/sda1 /mnt/boot'
  66. @echo 'mount /dev/mapper/crypt /mnt/root'
  67. @echo 'mkdir /mnt/boot/boot'
  68. @echo
  69. @echo 'Copy $(ROOTFSUSERTARBALL) via scp to /mnt/root and extract it'
  70. @echo 'cd /mnt/root ; gunzip $(ROOTFSUSERTARBALL); tar xpvf $(ROOTFSUSERTARBALL)'
  71. @echo 'cd /mnt/root ; mknod -m 644 console c 5 1'
  72. @echo 'Login as user root with password linux123 via ssh or console'
  73. endif