home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / usr / src / linux-headers-2.6.17-6 / debian / docs / HOWTO-Linux-2.6-Woody < prev    next >
Encoding:
Text File  |  2005-06-08  |  6.2 KB  |  201 lines

  1.  
  2.  
  3.  
  4.            HOWTO install an (initrd) linux 2.6 kernel
  5.                      on Debian woody
  6.  
  7.                         $Revision: 1.1 $
  8.  
  9.                    Marc.Herbert@free.fr
  10.  
  11.  
  12. Motivation
  13. ----------
  14.  
  15. You may find this document useful if:
  16.  
  17. - you want to test the latest linux 2.6 kernels
  18. - you want to keep your debian woody ("stable") box as intact as
  19. possible, i.e., you want to test _only_ linux 2.6 and not all the latest
  20. stuff from Debian.
  21.  
  22. You may find it even more useful if:
  23.  
  24. - you prefer booting from a RAM-disk instead of from your hard disk
  25. (the "initrd-way"). See initrd(4) for more information.
  26.  
  27.  
  28.  
  29. Need fresh modutils and module-init-tools
  30. -----------------------------------------
  31.  
  32. The mechanism for dynamically loading kernel modules has been
  33. rewritten between 2.4 and 2.6. As a consequence, the former "modutils"
  34. tools (insmod, modprobe,...) are not compatible with 2.6 You need the
  35. new "module-init-tools" instead.
  36.  
  37. Issue: these new and incompatible tools have the same filenames as
  38. their 2.4 siblings (insmod, modprobe,...). As often, installing from
  39. source updated packages on your stable debian distribution does the
  40. trick here. The recent debian packages "modutils" and
  41. module-init-tools" do some automatic kernel version detection before
  42. invoking the right version of modprobe, insmod, etc.
  43.  
  44. First you'll need some basic tools to compile and generate
  45. the debian packages:
  46. # apt-get install gcc debhelper fakeroot ...
  47.  
  48. Then edit your /etc/apt/sources/list file, so that the sources of
  49. packages come from the "testing" or even "unstable" version of
  50. debian. For instance:
  51.  
  52. deb-src ftp://ftp.yourmirror.org/pub/debian unstable main non-free contrib
  53.  
  54.  
  55. Then fetch recent sources:
  56. $ apt-get source modutils module-init-tools
  57.  
  58. Recent modutils sources need a small hack to compile on woody:
  59.  
  60.         dh_installman extra/modules*.5 extra/update-modules*.8 *.8 *.5
  61.         sh -e debian/fixmanpages
  62. -       dh_installinit --no-start --update-rcd-params="start 20 S ."
  63. +       dh_installinit --update-rcd-params="start 20 S ."
  64.         dh_strip
  65.         dh_link bin/lsmod sbin/lsmod
  66.  
  67. Build the .deb packages:
  68. $ cd module-init-* && fakeroot dpkg-buildpackage -d
  69.  
  70. $ cd ..; cd modutils-* && fakeroot dpkg-buildpackage -d
  71.  
  72. And install them:
  73. $ dpkg -i modutil*.deb
  74. $ dpkg -i module-init-tools*.deb
  75.  
  76. You're done.
  77.  
  78.  
  79. Please note that Documentation/Changes gives a lengthy list of other
  80. kernel-related utilities mandatory upgrades before using 2.6. However,
  81. upgrading only modprobe & co was enough for me.
  82.  
  83.  
  84. make config
  85. -----------
  86.  
  87. From the (outdated) Documentation/initrd.txt:
  88.  
  89. "Second, the kernel has to be compiled with RAM disk support and with
  90. support for the initial RAM disk enabled."
  91.  
  92. When the kernel boots, it needs to mount the initial ramdisk as its
  93. root partition, and to read from it. As a consequence, the following
  94. features need to be compiled _built-in_ (not as modules)
  95.  
  96. CONFIG_BLK_DEV_RAM=y     (section "Block Devices")
  97. CONFIG_BLK_DEV_INITRD=y
  98.  
  99. CONFIG_ROMFS_FS=y        (section "Filesystems")
  100.  
  101. An alternative to the "ROMFS" filesystem above could be "CRAMFS"
  102. (short for "Compressed ROM") used by default by the debian mkinitrd
  103. script, but... the initrd+CRAMFS combination is not supported by
  104. linux, unless you use a kernel source with debian patches.  Moreover, it
  105. seemed to me that the mere presence of the CRAMFS code in the vanilla
  106. linux kernel prevented a ROMFS initrd image to boot!? I suggest
  107. avoiding built-in CRAMFS code for the moment, unless you are a
  108. hardcore debian fan (compiling it as module is OK).
  109.  
  110. CONFIG_CRAMFS=m          (section "Miscellaneous filesystems")
  111.  
  112.  
  113.  
  114. mkinitrd
  115. --------
  116.  
  117. After having installed your brand new 2.6 and its modules, you need to
  118. create the initrd image.
  119.  
  120. # apt-get install initrd-tools genromfs
  121.  
  122. If you use ROMFS instead of CRAMFS (see above), you must edit
  123. /etc/mkinitrd/mkinitrd.conf:
  124.  
  125. @@ -18,4 +18,4 @@
  126.  UMASK=022
  127.  
  128.  # Command to generate the initrd image.
  129. -MKIMAGE='mkcramfs %s %s > /dev/null'
  130. +MKIMAGE='genromfs -d %s -f %s'
  131.  
  132.  
  133. The mkinitrd machinery tries hard, when building the initrd image, to
  134. guess what are the modules to preload from the ram disk, in
  135. order to be able to access the real (hard drive) root partition.  But
  136. unfortunately, it may sometimes fail. This is hard to blame, since we
  137. are mixing software from various provenances.
  138.  
  139. If you find that your 2.6 kernel boots from the RAM disk, but has
  140. later problems to mount the root partition of your hard drive,
  141. then tweaking the RAM disk may help. Thanks to the file
  142. /etc/mkinitrd/modules (see mkinitrd(8)), you can force the kernel to
  143. load some modules from the RAM disk (e.g., "sd_mod") before trying to
  144. mount the real root partition. Check also mkinitrd.conf(5)
  145.  
  146. If things still go wrong, you can insert "set -x" and other debugging
  147. stuff into the two scripts that the kernel launches after initrd
  148. boot and before mounting the real root:
  149.  
  150. /usr/share/initrd-tools/linuxrc
  151. /usr/share/initrd-tools/init
  152.  
  153.  
  154.  
  155. LILO
  156. ----
  157.  
  158. As stated in Documentation/initrd.txt, do not forget to add an initrd
  159. line in /etc/lilo.conf
  160.  
  161.   initrd=/boot/initrd-my2.6
  162.  
  163. DO NOT append="root=/dev/ram0 init=/linuxrc rw" to boot arguments,
  164. contrary to stated in Documentation/initrd.txt, which seems outdated
  165. wrt this.
  166.  
  167.  
  168.  
  169. What did you break?
  170. -------------------
  171.  
  172. OK, your debian woody machine is now running a linux 2.6 kernel and is
  173. almost intact, expect... you cannot create initrd images compatible
  174. with 2.4 kernels anymore, because mkinitrd blindly stores
  175. /sbin/modprobe etc. in the RAM disk, i.e., 2.6-modules utilities!
  176.  
  177. Again, if needed, you can solve this issue by upgrading initrd-tools
  178. to a recent version that takes 2.4/2.6 differences into account.  The
  179. good side-effect is that the new version of the mkinitrd script will 
  180. probably be more clever when guessing the modules needed to mount the
  181. real root. The nasty side-effect is that you may get some bugs...
  182.  
  183. As usual, type:
  184. $ apt-get source initrd-tools
  185. $ fakeroot dpkg-buildpackage
  186. # dpkg -i initrd-tools*.deb
  187.  
  188. It seems you can safely ignore the failure of the configure step.
  189.  
  190.  
  191.  
  192. kernel-package
  193. --------------
  194.  
  195. When everything above is working OK, then you can use the "make-kpkg"
  196. tool to automate some parts and create a debian package with your 2.6
  197. kernels, its modules, etc.  It seems the (old) woody version of
  198. make-kpkg is able to manage (new) 2.6 kernels without problem.
  199.  
  200.  
  201.