From Fedora Project Wiki
(Created page with "{{autolang}} 111")
 
No edit summary
Line 1: Line 1:
{{autolang}}
{{autolang}}


111
== Обновление ядра Fedora системах с Arm ==
Обычно, при обновлении, достаточно через yum установить последний выпуск ядра Fedora. Однако, иногда необходимо собирать и устанавливать "собственные" ядра для отладки нового функционала.
 
== Цель ==
 
Обновление ситем на ARM со "свеже собранным" ядро необходимо так, чтобы был доступ из uboot.
 
Это Пособие основано на опыте обновления trimslice устройствах. Однако, основные принципы вполне приминимы в других системах.
 
== Сборка ядра из исходников ==
 
Получив архив, для сбрки следуйте инструкциям  описанных в README.
 
<pre>
  # cd linux-xxxxx    # or wherever you uinpacked the kernel to
  # make mrproper
  # cp/path/to/provided/config ./config
  # make oldconfig
  # make -j 6
</pre>
 
конечно, возможно потребуется установить некоторые патчи перед фактичеким выполнением шагов сборки.
 
n.b the example above assumes you have a config file supplied with the kernel to configure the kernel settings. If you don't have a pre-defined config then you can execute command 'make config' to interactively select from a vast array of config options or you can run 'make arm_defconfig' to generate an arm default config.
 
Also, it is probably quicker to cross-compile from, say, x86 if you have the relevant tool chain available. Of course, after building you will need to make the src tree available on the trimslice to install.
 
== Installing the kernel ==
 
As root in the src tree top-level dir:
 
  # make modules_install install
 
This should put the vmlinux and initramfs images into /boot or /boot/uboot or wherever your boot scripts and images are located. The destination may vary depending on how your system is configured. The target dir for the install should be the one defined by the setting for UBOOT_DIR in /etc/sysconfig/uboot)
 
== Generating the uImage and uInitrd Images Needed By UBoot ==
 
Next you need to generate the uInitrd (uboot initial ram disk) and uImage (uboot image) files in your boot directory. You can substitute more suitable suffixes than armv7hl-tegra if you ar eon a different architecture.
 
<pre>
  # cd /boot                    # or whatever UBOOT_DIR is
  # export VERSION=3.4.0-rc4    # or whatever the kernel version is
  # mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e
0x00008000 -n $VERSION -d ./vmlinuz-$VERSION uImage-$VERSION-armv7hl-tegra
  # mkimage -A arm -O linux -T ramdisk -C none -n $VERSION -d
./initramfs-$VERSION.img uInitrd-$VERSION-armv7hl-tegra
</pre>
 
== Going Live ==
 
You might want to save a cop of your rootfs at this point, just in case.
 
You can now copy the files uImage-$VERSION-armv7hl-tegra and uInitrd-$VERSION-armv7hl-tegra over the current ones referenced from boot.scr so they are used for booting (in my case it loads files uImage and uInitrd). Or alternatively rebuild boot.scr to  point at the new files.
 
The 3.4.0 kernel shown here is a lot bigger than the one I was using previously. If that is true for you this might mean that you need to change the load addresses used in your boot.cmd to load the uInitrd file at a higher initial address. Rebuild boot.scr using this command:
 
<pre>
  # mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "Trim Slice
F17 boot script" -d boot.cmd boot.scr
</pre>
 
Currently my boot.cmd contains the following
 
<pre>
  setenv bootargs mem=384M@0M mem=512M@512M nvmem=128M@384M vmalloc=248M
video=tegrafb console=ttyS0,115200n8 rw root=/dev/sdb1 nohdparm rootwait
earlyprintk rd_NO_PLYMOUTH
  ext2load usb 0:1 4080000 /boot/uImage
  ext2load usb 0:1 4480000 /boot/uInitrd
  bootm 4080000 4480000
</pre>
 
Will Cohen and Jon Masters recommended replacing 4480000 with 8400000. All you need to do is make sure that the uImage file extent does not overlap the uInitrd file extent
 
<pre>
  setenv bootargs mem=384M@0M mem=512M@512M nvmem=128M@384M vmalloc=248M
video=tegrafb console=ttyS0,115200n8 rw root=/dev/sdb1 nohdparm rootwait
earlyprintk rd_NO_PLYMOUTH
  ext2load usb 0:1 4080000 /boot/uImage
  ext2load usb 0:1 8400000 /boot/uInitrd
  bootm 4080000 8400000
</pre>
 
n.b. don't forget to set the correct device in boot.cmd -- usb 0:1 identifies my USB stick but you may need to specify a memory card or local disk and so the device may be different. Check UBOOT_DEVICE in /etc/sysconfig/uboot which ought to match the value in boot.cmd/boot.scr
 
OK, now reboot and enjoy, fingers crossed!

Revision as of 11:03, 16 August 2013

Обновление ядра Fedora системах с Arm

Обычно, при обновлении, достаточно через yum установить последний выпуск ядра Fedora. Однако, иногда необходимо собирать и устанавливать "собственные" ядра для отладки нового функционала.

Цель

Обновление ситем на ARM со "свеже собранным" ядро необходимо так, чтобы был доступ из uboot.

Это Пособие основано на опыте обновления trimslice устройствах. Однако, основные принципы вполне приминимы в других системах.

Сборка ядра из исходников

Получив архив, для сбрки следуйте инструкциям описанных в README.

  # cd linux-xxxxx     # or wherever you uinpacked the kernel to
  # make mrproper
  # cp/path/to/provided/config ./config
  # make oldconfig
  # make -j 6

конечно, возможно потребуется установить некоторые патчи перед фактичеким выполнением шагов сборки.

n.b the example above assumes you have a config file supplied with the kernel to configure the kernel settings. If you don't have a pre-defined config then you can execute command 'make config' to interactively select from a vast array of config options or you can run 'make arm_defconfig' to generate an arm default config.

Also, it is probably quicker to cross-compile from, say, x86 if you have the relevant tool chain available. Of course, after building you will need to make the src tree available on the trimslice to install.

Installing the kernel

As root in the src tree top-level dir:

 # make modules_install install

This should put the vmlinux and initramfs images into /boot or /boot/uboot or wherever your boot scripts and images are located. The destination may vary depending on how your system is configured. The target dir for the install should be the one defined by the setting for UBOOT_DIR in /etc/sysconfig/uboot)

Generating the uImage and uInitrd Images Needed By UBoot

Next you need to generate the uInitrd (uboot initial ram disk) and uImage (uboot image) files in your boot directory. You can substitute more suitable suffixes than armv7hl-tegra if you ar eon a different architecture.

  # cd /boot                     # or whatever UBOOT_DIR is
  # export VERSION=3.4.0-rc4     # or whatever the kernel version is
  # mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e
0x00008000 -n $VERSION -d ./vmlinuz-$VERSION uImage-$VERSION-armv7hl-tegra
  # mkimage -A arm -O linux -T ramdisk -C none -n $VERSION -d
./initramfs-$VERSION.img uInitrd-$VERSION-armv7hl-tegra

Going Live

You might want to save a cop of your rootfs at this point, just in case.

You can now copy the files uImage-$VERSION-armv7hl-tegra and uInitrd-$VERSION-armv7hl-tegra over the current ones referenced from boot.scr so they are used for booting (in my case it loads files uImage and uInitrd). Or alternatively rebuild boot.scr to point at the new files.

The 3.4.0 kernel shown here is a lot bigger than the one I was using previously. If that is true for you this might mean that you need to change the load addresses used in your boot.cmd to load the uInitrd file at a higher initial address. Rebuild boot.scr using this command:

  # mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "Trim Slice
F17 boot script" -d boot.cmd boot.scr

Currently my boot.cmd contains the following

  setenv bootargs mem=384M@0M mem=512M@512M nvmem=128M@384M vmalloc=248M
video=tegrafb console=ttyS0,115200n8 rw root=/dev/sdb1 nohdparm rootwait
earlyprintk rd_NO_PLYMOUTH
  ext2load usb 0:1 4080000 /boot/uImage
  ext2load usb 0:1 4480000 /boot/uInitrd
  bootm 4080000 4480000

Will Cohen and Jon Masters recommended replacing 4480000 with 8400000. All you need to do is make sure that the uImage file extent does not overlap the uInitrd file extent

  setenv bootargs mem=384M@0M mem=512M@512M nvmem=128M@384M vmalloc=248M
video=tegrafb console=ttyS0,115200n8 rw root=/dev/sdb1 nohdparm rootwait
earlyprintk rd_NO_PLYMOUTH
  ext2load usb 0:1 4080000 /boot/uImage
  ext2load usb 0:1 8400000 /boot/uInitrd
  bootm 4080000 8400000

n.b. don't forget to set the correct device in boot.cmd -- usb 0:1 identifies my USB stick but you may need to specify a memory card or local disk and so the device may be different. Check UBOOT_DEVICE in /etc/sysconfig/uboot which ought to match the value in boot.cmd/boot.scr

OK, now reboot and enjoy, fingers crossed!