Makefile 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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)/arch/x86/boot/bzImage
  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_HW}-${ADK_TARGET}-${FS}-kernel
  18. ifeq ($(FS),archive)
  19. imageinstall: $(BIN_DIR)/$(ROOTFSTARBALL)
  20. @echo "The RootFS tarball is: $(BIN_DIR)/$(ROOTFSTARBALL)"
  21. ifeq ($(ADK_HARDWARE_QEMU_X86),y)
  22. @cp $(KERNEL) $(BIN_DIR)/${ADK_HW}-${ADK_TARGET}-${FS}-kernel
  23. @echo "Use following command to create a QEMU Image:"
  24. @echo "sudo ./scripts/create-image.sh -f ${ADK_TARGET_ROOTFS} qemu-${CPU_ARCH}.img $(BIN_DIR)/$(ROOTFSTARBALL)"
  25. @echo "Start qemu with following command line:"
  26. @echo 'qemu -nographic -net user,hostfwd=tcp::2222-:22 -net nic,model=e1000 -kernel $(BIN_DIR)/${ADK_HW}-${ADK_TARGET}-${FS}-kernel qemu-${CPU_ARCH}.img'
  27. endif
  28. endif
  29. ifeq ($(FS),usb)
  30. imageinstall: $(BIN_DIR)/$(ROOTFSTARBALL)
  31. @echo "The RootFS tarball is: $(BIN_DIR)/$(ROOTFSTARBALL)"
  32. @echo "To install everything to USB use scripts/install.sh"
  33. endif
  34. ifeq ($(FS),initramfs)
  35. imageinstall: $(BIN_DIR)/$(INITRAMFS)
  36. @cp $(KERNEL) $(BIN_DIR)/${ADK_HW}-${ADK_TARGET}-${FS}-kernel
  37. @echo 'The kernel file is: ${BIN_DIR}/${ADK_HW}-${ADK_TARGET}-${FS}-kernel'
  38. @echo 'The initramfs image is: ${BIN_DIR}/${INITRAMFS}'
  39. ifeq ($(ADK_HARDWARE_QEMU_X86),y)
  40. @echo "Start qemu with following command line:"
  41. @echo 'qemu -nographic -net user,hostfwd=tcp::2222-:22 -net nic,model=e1000 -kernel $(BIN_DIR)/${ADK_HW}-${ADK_TARGET}-${FS}-kernel -initrd ${BIN_DIR}/${INITRAMFS}'
  42. endif
  43. endif
  44. ifeq ($(FS),initramfs-piggyback)
  45. imageinstall: ${BUILD_DIR}/${INITRAMFS_PIGGYBACK} createinitramfs
  46. @cp $(KERNEL) ${BIN_DIR}/${ADK_HW}-${ADK_TARGET}-${FS}-kernel
  47. @echo 'The kernel+initramfs file is: ${BIN_DIR}/${ADK_HW}-${ADK_TARGET}-${FS}-kernel'
  48. ifeq ($(ADK_HARDWARE_QEMU_X86),y)
  49. @echo "Start qemu with following command line:"
  50. @echo 'qemu -nographic -net user,hostfwd=tcp::2222-:22 -net nic,model=e1000 -kernel $(BIN_DIR)/${ADK_HW}-${ADK_TARGET}-${FS}-kernel'
  51. endif
  52. endif
  53. ifeq ($(FS),encrypted)
  54. imageinstall: $(BIN_DIR)/$(ROOTFSUSERTARBALL) createinitcrypt
  55. @echo 'The kernel+cryptinit file is: ${BIN_DIR}/${ADK_HW}-${ADK_TARGET}-${FS}-kernel'
  56. @echo "The RootFS tarball is: $(BIN_DIR)/$(ROOTFSUSERTARBALL)"
  57. @echo 'Boot your IBM X40 via NFS or USB.'
  58. @echo 'Then create at least three partitions with fdisk:'
  59. @echo '/dev/sda1 (ext2)'
  60. @echo '/dev/sda2 (encrypted root)'
  61. @echo '/dev/sda3 (swap)'
  62. @echo 'mkdir /mnt/{boot,root}'
  63. @echo 'mke2fs /dev/sda1'
  64. @echo 'cryptsetup luksFormat /dev/sda2'
  65. @echo 'cryptsetup luksFormat /dev/sda3'
  66. @echo 'cryptsetup luksOpen /dev/sda2 root'
  67. @echo 'cryptsetup luksOpen /dev/sda3 swap'
  68. @echo 'mkfs.xfs /dev/mapper/root'
  69. @echo 'mkswap /dev/mapper/swap'
  70. @echo 'mount /dev/sda1 /mnt/boot'
  71. @echo 'mount /dev/mapper/crypt /mnt/root'
  72. @echo 'mkdir /mnt/boot/boot'
  73. @echo 'Copy $(ROOTFSUSERTARBALL) via scp to /mnt/root and extract it'
  74. @echo 'cd /mnt/root ; gunzip $(ROOTFSUSERTARBALL); tar xpvf $(ROOTFSUSERTARBALL)'
  75. @echo 'cd /mnt/root ; mknod -m 644 console c 5 1'
  76. endif