daily pastebin goal
35%
SHARE
TWEET

kernel-sharespace Makefile

a guest Mar 4th, 2015 280 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. srcdir = $(shell pwd)
  2. kernel_src = $(srcdir)/linux-source-3.2-sharespace
  3. arch_src = $(kernel_src)/arch/arm
  4. mach_src = $(arch_src)/mach-orion5x
  5. z_image = $(arch_src)/boot/zImage
  6. u_image = $(arch_src)/boot/uImage
  7. make_args = ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-
  8. mkimage = $(kernel_src)/scripts/mkuboot.sh
  9.  
  10. include $(mach_src)/Makefile.boot
  11.  
  12. LOADADDR = $(zreladdr-y)
  13. STARTADDR = $(LOADADDR)
  14.  
  15. all: uImage_hack
  16.  
  17. uImage_hack: uImage
  18.         rm uImage
  19.         cat mach-id $(z_image) > zImage
  20.         $(mkimage) -A arm -O linux -T kernel \
  21.                 -C none -a $(LOADADDR) -e $(STARTADDR) \
  22.                 -n 'Linux-Sharespace' -d zImage uImage
  23.         rm zImage
  24.  
  25. tftp_install:
  26.         cp uImage /srv/tftp
  27.  
  28. uImage: $(kernel_src)/.config mach-id FORCE
  29.         $(MAKE) -C $(kernel_src) $(make_args) uImage
  30.         cp $(u_image) uImage
  31.  
  32. $(kernel_src)/.config mach-id:
  33.         echo "No config found"
  34.         false
  35.  
  36. %_config: $(srcdir)/configs/% $(arch_src)/tools/mach-types
  37. # find mach-id
  38.         @machtype=$$(sed -n 's/^$*.*\s\([0-9]*\)$$/\1/p' $(arch_src)/tools/mach-types); \
  39.         if [ "x$$machtype" = "x" ]; then \
  40.                 echo "Could not find mach type for $*"; \
  41.                 false; \
  42.         else \
  43.                 magic=$$(echo "obase=16; $$machtype" | bc); \
  44.                 len=$$(expr length $$magic); \
  45.                 sepa=$$(expr $$len - 2); \
  46.                 sepb=$$(expr $$sepa + 1); \
  47.                 magica=$$(expr substr $$magic 1 $$sepa); \
  48.                 magicb=$$(expr substr $$magic $$sepb $$len); \
  49.                 len=$$(expr length $$magica); \
  50.                 [ $$len -lt 2 ] && magica="0$$magica"; \
  51.                 echo "devio > mach-id \"wl 0xe3a01c$$magica,4\" \"wl 0xe38110$$magicb,4\""; \
  52.                 devio > mach-id "wl 0xe3a01c$$magica,4" "wl 0xe38110$$magicb,4"; \
  53.                 echo "cp $< $(kernel_src)/.config"; \
  54.                 cp $< $(kernel_src)/.config; \
  55.         fi
  56.  
  57. FORCE:
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top