Advertisement
VolleMelk

Kernel compilation 3.8.3

Mar 16th, 2013
1,510
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 4.93 KB | None | 0 0
  1. # NAS Status: Booted into debian, buffalo kernel
  2. # Goal: Real kernel with brains!
  3. # Everything below as root, make sure we are in ~/
  4. # ---
  5. # Thanks hato! He put the patch file together, and created the .config file for you to build on
  6. # Special credits go to Phil Sutter (TDMA support for CESA engine) - included in the patch
  7. # ---
  8. # NOTE:
  9. # Quote hato:
  10. #    "Please remember to warn the audience the kernel configuration still uses
  11. #    built-in (default) kernel command line, if you haven't change that setting."
  12. #
  13. # under "BOOT OPTIONS", line 403:
  14. #    CONFIG_CMDLINE="loglevel=7 root=/dev/sda2 rw initrd=0x00800040,12M
  15. #    netconsole=6665@192.168.1.2/eth0,6666@192.168.1.24/00:1e:c2:be:47:18"
  16. # If you don't know what this means, ignore this and continue below
  17. # ---
  18. # NOTE2:
  19. # After kernel compilation, do NOT INSTALL BSTOOLS! This WILL brick your NAS, and you
  20. # have to start over with TFTP
  21.  
  22. # As of 2013-03-21, I have no idea how to get the powerswitch  to work.
  23. # If you wish to shutdown the NAS with this kernel (and .config and patch):
  24. # Put powerswitch on back of NAS to 'OFF'
  25. # Login as root
  26. # reboot
  27. # This will power down the NAS.
  28. # ---
  29.  
  30. apt-get update
  31. apt-get install build-essential fakeroot uboot-mkimage debhelper python libncurses5-dev screen
  32.  
  33. screen          # Press space or enter to continue
  34. # We are now using screen. This utility gives us some advantages. Everything we do inside this 'screen'
  35. # will be saved, even if we loose connection between you and the host (in this case the NAS).
  36. # Also, the compiling takes a long time. With this tool, we can detach the console and close our ssh
  37. # client.
  38. # To detach: press CTRL + A, followed by CTRL + D. To re-attach the screen, enter 'screen -r'
  39.  
  40. # We need to download two files. First the config file
  41. wget http://http://members.ziggo.nl/roodgoudzilver/lswvl/kernel/lswvl_config_by_hato.config
  42.  
  43. # Now we have to download the patch. There are two different patches. One for devices with NAND, and one
  44. # for devices without NAND. If you bought your NAS with drives, you do NOT have NAND. If you bought
  45. # your NAS without drives, you DO have NAND. Download and apply only ONE patch.
  46. # With NAND
  47. wget http://http://members.ziggo.nl/roodgoudzilver/lswvl/kernel/lswvl_support_and_mv-cesa_dma_3.8_nand_native.patch
  48. # Without NAND
  49. wget http://http://members.ziggo.nl/roodgoudzilver/lswvl/kernel/lswvl_support_and_mv-cesa_dma_3.8_nonand_native.patch
  50.  
  51. # If you are cross compiling, you can download these patches:
  52. # With NAND
  53. wget http://http://members.ziggo.nl/roodgoudzilver/lswvl/kernel/lswvl_support_and_mv-cesa_dma_3.8_nand_cross.patch
  54. # Without NAND
  55. wget http://http://members.ziggo.nl/roodgoudzilver/lswvl/kernel/lswvl_support_and_mv-cesa_dma_3.8_nonand_cross.patch
  56.  
  57. cd /usr/src
  58. wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.8.3.tar.bz2
  59. tar xjf linux-3.8.3.tar.bz2
  60. ln -s linux-3.8.3 linux
  61. cd linux
  62.  
  63. patch -Np1 --dry-run -i ~/lswvl_support_and_mv-cesa_dma_3.8*.patch      # Dry-run the patch. No errors?
  64.                                         # Continue!
  65.  
  66. patch -Np1 -i ~/lswvl_support_and_mv-cesa_dma_3.8*.patch            # Apply the patch
  67.  
  68. cp ~/lswvl_config_by_hato.config ./.config
  69.  
  70. # The .config has netconsole enabled. Google it, it's very useful.
  71. # Edit the .config file, go to line 403.
  72. # Change the following:
  73. # 192.168.1.2       - IP of the NAS
  74. # 192.168.1.24      - IP of the target machine (who is displaying the bootlog)
  75. # 00:1e:c2:be:47:18 - Mac address of the ethernet card of the target machine
  76. nano .config
  77. # Save and quit
  78.  
  79. # If you want to alter the kernel (You can try this config first, if it works you can recompile the kernel
  80. #                  with this guide and make modifications with menuconfig. This way you know
  81. #                  where it went wrong if it's not working)
  82. make menuconfig
  83.  
  84. # Compile the kernel
  85. make uImage modules                 # This will take a LONG time
  86. cp arch/arm/boot/uImage uImage.buffalo.debian       # This is very quick
  87. make modules_install INSTALL_MOD_PATH=./modules     # This is quick
  88.  
  89. # Install kernel
  90. mount -o remount,rw /boot               # Remount /boot as readwrite
  91.  
  92. mv /boot/uImage.buffalo /boot/uImage.buffalo.old    # Make backup of stock kernel
  93. cp uImage.buffalo.debian /boot/uImage.buffalo       # Copy kernel
  94.  
  95. # Copy modules
  96. cp -a modules/lib/modules/3.8.3 /lib/modules
  97.  
  98. # Now the kernel is installed. As stated before, the kernel supports netconsole. Start
  99. # a netcat client on the target computer. Depending on your client you either have to start
  100. # it with:
  101. # nc -u -l 6666
  102. # or
  103. # nc -u -l -p 6666
  104.  
  105. reboot                          # AND PRAY!
  106.  
  107. # As soon as the blinking light on the NAS goes solid, you should see a bootlog coming up on
  108. # your netcat. If it doesn't show any (significant) errors, you should be good to go.
  109. # Here is an example bootlog of a succesfull boot: http://pastebin.com/0wNJn1vB
  110.  
  111. # Try to ssh to your NAS and see if it works. If you can login, check
  112. uname -all
  113. # to see if you are running a 3.8.3 kernel
  114.  
  115. # Update 2013-04-13: To get your fan control back, go here: http://pastebin.com/ch7TuxED
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement