Makefile 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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_TARGET}-${FS}-kernel
  18. ifeq ($(FS),archive)
  19. imageinstall: $(BIN_DIR)/$(ROOTFSTARBALL)
  20. @cp $(KERNEL) ${BIN_DIR}/${ADK_TARGET}-${FS}-kernel
  21. @echo 'The kernel file is: ${BIN_DIR}/${ADK_TARGET}-${FS}-kernel'
  22. @echo "The RootFS tarball is: $(BIN_DIR)/$(ROOTFSTARBALL)"
  23. endif
  24. ifeq ($(FS),usb)
  25. imageinstall: $(BIN_DIR)/$(ROOTFSTARBALL)
  26. @echo "The RootFS tarball is: $(BIN_DIR)/$(ROOTFSTARBALL)"
  27. @echo "To install everything to USB use scripts/install.sh"
  28. endif
  29. ifeq ($(FS),initramfs-piggyback)
  30. imageinstall: ${BUILD_DIR}/${INITRAMFS_PIGGYBACK} createinitramfs
  31. @cp $(KERNEL) ${BIN_DIR}/${ADK_TARGET}-${FS}-kernel
  32. @echo 'The kernel file is: ${BIN_DIR}/${ADK_TARGET}-${FS}-kernel'
  33. endif
  34. ifeq ($(FS),encrypted)
  35. imageinstall: $(BIN_DIR)/$(ROOTFSUSERTARBALL) createinitcrypt
  36. @echo 'The kernel+cryptinit file is: ${BIN_DIR}/${ADK_TARGET}-${FS}-kernel'
  37. @echo "The RootFS tarball is: $(BIN_DIR)/$(ROOTFSUSERTARBALL)"
  38. @echo 'Boot your IBM X40 via NFS or USB.'
  39. @echo 'Then create at least three partitions with fdisk:'
  40. @echo '/dev/sda1 (ext2)'
  41. @echo '/dev/sda2 (encrypted root)'
  42. @echo '/dev/sda3 (swap)'
  43. @echo 'mkdir /mnt/{boot,root}'
  44. @echo 'mke2fs /dev/sda1'
  45. @echo 'cryptsetup luksFormat /dev/sda2'
  46. @echo 'cryptsetup luksFormat /dev/sda3'
  47. @echo 'cryptsetup luksOpen /dev/sda2 root'
  48. @echo 'cryptsetup luksOpen /dev/sda3 swap'
  49. @echo 'mkfs.xfs /dev/mapper/root'
  50. @echo 'mkswap /dev/mapper/swap'
  51. @echo 'mount /dev/sda1 /mnt/boot'
  52. @echo 'mount /dev/mapper/crypt /mnt/root'
  53. @echo 'mkdir /mnt/boot/boot'
  54. @echo 'Copy $(ROOTFSUSERTARBALL) via scp to /mnt/root and extract it'
  55. @echo 'cd /mnt/root ; gunzip $(ROOTFSUSERTARBALL); tar xpvf $(ROOTFSUSERTARBALL)'
  56. @echo 'cd /mnt/root ; mknod -m 644 console c 5 1'
  57. endif