📄 managing_kernel_upgrades.html
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head> <title></title> <link rel="stylesheet" media="screen" type="text/css" href="./style.css" /> <link rel="stylesheet" media="screen" type="text/css" href="./design.css" /> <link rel="stylesheet" media="print" type="text/css" href="./print.css" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head><body><a href=start.html>start</a></br><div class="toc"><div class="tocheader toctoggle" id="toc__header">Table of Contents</div><div id="toc__inside"><ul class="toc"><li class="level1"><div class="li"><span class="li"><a href="#managing_kernel_upgrades" class="toc">Managing Kernel Upgrades</a></span></div><ul class="toc"><li class="level2"><div class="li"><span class="li"><a href="#configuration_files" class="toc">Configuration Files</a></span></div></li><li class="level2"><div class="li"><span class="li"><a href="#adding_your_platform_into_the_make_system" class="toc">Adding Your Platform into the Make System</a></span></div><ul class="toc"><li class="level3"><div class="li"><span class="li"><a href="#romfsinst" class="toc">$ROMFSINST</a></span></div></li></ul></li><li class="level2"><div class="li"><span class="li"><a href="#saving_kernel_settings" class="toc">Saving kernel settings</a></span></div></li><li class="level2"><div class="li"><span class="li"><a href="#recalling_kernel_settings" class="toc">Recalling kernel settings</a></span></div></li><li class="level2"><div class="li"><span class="li"><a href="#updating_the_kernel" class="toc">Updating the kernel</a></span></div></li></ul></li></ul></div></div><h1><a name="managing_kernel_upgrades" id="managing_kernel_upgrades">Managing Kernel Upgrades</a></h1><div class="level1"><p> It is a fact of life that right after you download a kernel release, and spend a few months getting everything working with your custom applications, and custom drivers, that a new kernel release will be avaliable, which will either add a new feature that you are looking for, or include a bug fix that you require. The problem comes on how to upgrade with the minimum effort, ensuring that all your settings are not wiped out by the upgrade.</p></div><!-- SECTION [1-484] --><h2><a name="configuration_files" id="configuration_files">Configuration Files</a></h2><div class="level2"><p>There are a few configuration files, which control things, you need to understand where they are, and what they control. <strong>None</strong> of these files should be modified by hand.</p><ul><li class="level1"><div class="li"> <code>./uClinux-dist/config.arch</code> : should point to the configuration setting for your chip architecture, in the Blackfin case, this should be <code>$(ROOTDIR)/vendors/config/bfin/config.arch</code></div></li><li class="level1"><div class="li"> <code>./uClinux-dist/.config</code> : This is the top level configuration file, which is generated by <code>make menuconfig</code>, which controls the Vendor/Product Selection.</div></li><li class="level1"><div class="li"> <code>uClinux-dist/linux-2.6.x/.config</code> The configuration file for the kernel and driver settings</div></li><li class="level1"><div class="li"> <code>uClinux-dist/uClibc/.config</code> : The configuration file for uClibc</div></li><li class="level1"><div class="li"> <code>uClinux-dist/config/.config</code> : The configuration file for the user and external libraries</div></li></ul><p> In the <code>uClinux-dist/vendors</code> folder, there are directories for each and every platform that uClinux supports. These files are just a collection of the above files, which are copied over when the platform is either selected for the first time, or if you want the defaults to be set. For example, for the Analog Devices BF537-STAMP Platform:</p><ul><li class="level1"><div class="li"> <code>./uClinux-dist/vendors/AnalogDevices/BF537-STAMP/config.arch</code> ↔ <code>./uClinux-dist/config.arch</code></div></li><li class="level1"><div class="li"> <code>./uClinux-dist/vendors/AnalogDevices/BF537-STAMP/config.device</code> ↔ <code>./uClinux-dist/.config</code></div></li><li class="level1"><div class="li"> <code>./uClinux-dist/vendors/AnalogDevices/BF537-STAMP/config.linux-2.6.x</code> ↔ <code>uClinux-dist/linux-2.6.x/.config</code></div></li><li class="level1"><div class="li"> <code>./uClinux-dist/vendors/AnalogDevices/BF537-STAMP/config.uClibc</code> ↔ <code>uClinux-dist/uClibc/.config</code></div></li><li class="level1"><div class="li"> <code>./uClinux-dist/vendors/AnalogDevices/BF537-STAMP/config.vendor-2.6.x</code> ↔ <code>uClinux-dist/config/.config</code></div></li></ul><p> The final file (which really isn’t a configuration file - since it doesn’t store any configuration data) is the <code>uClinux-dist/linux-2.6.x/arch/blackfin/Kconfig</code> file. This drives <code>make menuconfig</code> and <code>make xconfig</code>. If you want to set defaults for your platform, so <code>make clean && make</code> will build a bootable image, this file controls the default kernel settings. Have a look where <code>BFIN537_STAMP</code> (note: it is a underscore, not a dash), occurs and add similar settings for your platform..</p><p>Then platform specific kernel changes can be managed in <code>uClinux-dist/linux-2.6.x/arch/blackfin/mach-bfxxx/boards</code>. Have a look in the <code>Makefiles</code> and the <code>board_name.c</code> files to determine if you need to do this.</p></div><!-- SECTION [485-2922] --><h2><a name="adding_your_platform_into_the_make_system" id="adding_your_platform_into_the_make_system">Adding Your Platform into the Make System</a></h2><div class="level2"><p> The first step in any serious development would be to create your own platform into the make config system. This is a simple matter of creating a new directory, copying in a existing directory that is close, editing some files, and then setting the defaults, and saving them. To select the target, see the section on <a href="target_selection.html" class="wikilink1" title="target_selection.html">target selection</a>.</p><p>To do this follow the following steps:</p><ol><li class="level1"><div class="li"> download the latest <a href="http://blackfin.uclinux.org/frs/?group_id=17" class="urlextern" title="http://blackfin.uclinux.org/frs/?group_id=17" rel="nofollow">kernel</a> release. Releases are numbered in a year (2005), release number (R3), patch number (.0) fashion. <pre class="code">wget http://blackfin.uclinux.org/frs/download.php/512/uClinux-dist.tar.bz2tar -xf uClinux-dist.tar.bz2</pre></div></li><li class="level1"><div class="li"> Copy an existing similar board configuration directory to your new board file, in the <code>./uClinux-dist/vendors/AnalogDevices</code> Directory.<pre class="code">cp -R ./uClinux-dist/vendors/AnalogDevices/BF533-STAMP ./uClinux-dist/vendors/AnalogDevices/BF533-STAMP-JFFS2</pre><p>In this example, we will create a new board configuration with the settings with a JFFS2 root directory. Having dome this the new vendor selection will show up as an option to the menuitem</p><pre class="code">Vendor/Product Selection ---></pre><p>The vendors directory is scanned and any vendor names found are added to the selection list automatically. The targets, based on directory entries, are also added automatically as each vendor selection is made. As each new vendor / target combination is selected the uClinux-distribution will clean up all files from the previous target and then reconfigure and rebuild the kernel, libraries and user code based on the default configuration options avaialble for the new vendor / target selection.</p></div></li><li class="level1"><div class="li"> This will have copied exactly the same configuration as the board that you copied. If necessary, customize things in <code>./uClinux-dist/vendors/AnalogDevices/BF533-STAMP-JFFS2</code> by manually changing any of these files to suite your specific configuration:</div><ul><li class="level2"><div class="li"> <code>device_table.txt</code> - Using the device table, can create device nodes, directories, and change permissions of files during the build. This device table file is used in creating both the ram filesystem with <code>genext2fs</code> and the JFFS2 file system with <code>mkfs.jffs2</code>. All sorts of interesting things with can be done with a device table file. For example, if you want to adjust the permissions on a particular file you can just add an entry like:<pre class="code">/sbin/foobar f 2755 0 0 - - - - -</pre><p>and (assuming the file /sbin/foobar exists) it will be made setuid root (regardless of what its permissions are on the host filesystem). Furthermore, you can use a single table entry to create a many device minors. For example, if I wanted to create <code>/dev/hda</code> and <code>/dev/hda[0-15]</code> I could just use the following two table entries:</p><pre class="code">/dev/hda b 640 0 0 3 0 0 0 -/dev/hda b 640 0 0 3 1 1 1 15</pre><p>Device table entries take the form of:</p><pre class="code"><name> <type> <mode> <uid> <gid> <major> <minor> <start> <inc> <count></pre><p> where <code>name</code> is the file name, <code>type</code> can be one of the below options, <code>uid</code> is the user id for the target file, <code>gid</code> is the group id for the target file. The rest of the entries (major, minor, etc) apply only to device special files.</p></div><ul><li class="level3"><div class="li"> <code>f</code> A regular file</div></li><li class="level3"><div class="li"> <code>d</code> Directory</div></li><li class="level3"><div class="li"> <code>c</code> Character special device file</div></li><li class="level3"><div class="li"> <code>b</code> Block special device file</div></li><li class="level3"><div class="li"> <code>p</code> Fifo (named pipe)</div></li></ul></li><li class="level2"><div class="li"> <code>Makefile</code> - this is the Makefile for this system. It would include system specific configuration. It will create the romfs directory structure, and copy files into it. This is also where the size of the file system is determined by the following lines:<pre class="code"># Blocks must be a multiple of 256BLOCKS = 4096
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -