Makefile 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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 \
  10. $(BIN_DIR)/${ADK_TARGET}-${FS}-kernel
  11. createinit:
  12. @-rm $(LINUX_DIR)/usr/initramfs_data.cpio.*
  13. $(SED) 's#^CONFIG_INITRAMFS_SOURCE.*#CONFIG_INITRAMFS_SOURCE="${BUILD_DIR}/${INITRAMFS_PIGGYBACK}"#' \
  14. $(LINUX_DIR)/.config
  15. echo 'CONFIG_INITRAMFS_ROOT_UID=0' >> $(LINUX_DIR)/.config
  16. echo 'CONFIG_INITRAMFS_ROOT_GID=0' >> $(LINUX_DIR)/.config
  17. echo N |$(MAKE) -C $(LINUX_DIR) V=1 CROSS_COMPILE="$(TARGET_CROSS)" ARCH=$(ARCH) \
  18. CC="$(TARGET_CC)" oldconfig $(MAKE_TRACE)
  19. $(MAKE) -C $(LINUX_DIR) V=1 CROSS_COMPILE="$(TARGET_CROSS)" ARCH=$(ARCH) \
  20. CC="$(TARGET_CC)" $(MAKE_TRACE)
  21. @cp $(LINUX_DIR)/arch/x86/boot/bzImage $(BIN_DIR)/${ADK_TARGET}-${FS}-kernel
  22. ifeq ($(FS),archive)
  23. imageinstall: $(BIN_DIR)/$(ROOTFSTARBALL)
  24. @echo "The RootFS tarball is: $(BIN_DIR)/$(ROOTFSTARBALL),"
  25. @echo "Use following command to create a QEMU Image:"
  26. @echo "sudo ./scripts/create-image.sh -f ${ADK_TARGET_ROOTFS} qemu-${CPU_ARCH}.img $(BIN_DIR)/$(ROOTFSTARBALL)"
  27. @echo "Start qemu with following command line:"
  28. @echo 'qemu -nographic -net user,hostfwd=tcp::2222-:22 -net nic,model=rtl8139 -kernel $(BIN_DIR)/${ADK_TARGET}-${FS}-kernel qemu-${CPU_ARCH}.img'
  29. @echo 'Login as user root with password linux123 via ssh or console'
  30. endif
  31. ifeq ($(FS),initramfs)
  32. imageinstall: $(BIN_DIR)/$(INITRAMFS)
  33. @echo 'The kernel file is: ${BIN_DIR}/${ADK_TARGET}-${FS}-kernel'
  34. @echo 'The initramfs image is: ${BIN_DIR}/${INITRAMFS}'
  35. @echo 'You need a dummy qemu.img, create it with:'
  36. @echo 'qemu-img create -f raw qemu.img 1M'
  37. @echo "Start qemu with following command line:"
  38. @echo 'qemu -nographic -net user,hostfwd=tcp::2222-:22 -net nic,model=rtl8139 -kernel $(BIN_DIR)/${ADK_TARGET}-${FS}-kernel -initrd ${BIN_DIR}/${INITRAMFS} qemu.img'
  39. @echo 'Login as user root with password linux123 via ssh or console'
  40. endif
  41. ifeq ($(FS),initramfs-piggyback)
  42. imageinstall: ${BUILD_DIR}/${INITRAMFS_PIGGYBACK} createinit
  43. @echo 'The kernel+initramfs file is: ${BIN_DIR}/${ADK_TARGET}-${FS}-kernel'
  44. @echo 'You need a dummy qemu.img, create it with:'
  45. @echo 'qemu-img create -f raw qemu.img 1M'
  46. @echo "Start qemu with following command line:"
  47. @echo 'qemu -nographic -net user,hostfwd=tcp::2222-:22 -net nic,model=rtl8139 -kernel $(BIN_DIR)/${ADK_TARGET}-${FS}-kernel qemu.img'
  48. @echo 'Login as user root with password linux123 via ssh or console'
  49. endif