chlw的原创笔记 https://bbs.21ic.com/?111401 [收藏] [复制] [RSS] 本人做单片机、ARM的软硬件件开发,有一定的奉献精神,会不定时的将开发中的收获整理以方便家,希望我的工作能对同行有所帮助。  本站大部分作品为原创,若要转载请注明站点和作者(EE.C)

日志

Linux:一次处理多个补丁

热度 1已有 1994 次阅读2009-12-31 12:55 |系统分类:嵌入式系统| linux, 编程 批处理 patch, 一次打大量补丁的方法


















LINUX KERNEL REVISION


VANILLA LINUX KERNEL


AT91 MAINTAINER PATCHSET


EXPERIMENTAL PATCHES


Linux 2.6.30


linux-2.6.30.tar.bz2


2.6.30-at91.patch.gz


2.6.30-at91-exp.tar.gz


Atmel给出的资源有以上三项内核源码为普通源代码,打上后面两个补丁包后可用于AT91CPU上。关于补丁atmel的支持站点有以下说明:


Get and patch the Linux kernel


To get an experimental Linux4SAM kernel up and running on an AT91 product, you have to go through the following steps:


    1. identify on which linux kernel revision the experimental patches will apply 
    2. download the corresponding Linux kernel



wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.xx.tar.bz2


tar xvjf linux-2.6.xx.tar.bz2


cd linux-2.6.xx


    3. download the AT91 Maintainer's patch and apply it



wget http://maxim.org.za/AT91RM9200/2.6/2.6.xx-at91.patch.gz


zcat 2.6.xx-at91.patch.gz | patch -p1


    4. take the experimental patchset and apply it on top of the AT91 one












BEFORE LINUX 2.6.30 EXPERIMENTAL PATCHES


Download experimental patch:



wget ftp://www.linux4sam.org/pub/linux/2.6.xx-at91-exp.patch.gz


or



wget ftp://www.linux4sam.org/pub/linux/2.6.xx.at91.y/2.6.xx.at91.y-exp.patch.gz


And then:



zcat linux-2.6.xx-at91-exp.diff.gz | patch -p1


LINUX 2.6.30 EXPERIMENTAL PATCHES AND ONWARDS


Download experimental patch archive:



wget ftp://www.linux4sam.org/pub/linux/2.6.xx.at91/2.6.xx-at91-exp.y.tar.gz


Decompress archive with:



tar xvzf 2.6.xx-at91-exp.y.tar.gz


And then apply patchset one patch after the other in proper order:



for p in 2.6.xx-at91-exp.y/*; do patch -p1 < $p ; done


You will now have an updated copy of the experimental Linux4SAM kernel


4步的说明和提供的资源无法匹配,要么是提供的资源不完整,要么是这段说明有问题,按照其说明无法完成操作,如ftp://www.linux4sam.org/pub/linux/2.6.xx-at91-exp.patch.gz  ftp://www.linux4sam.org/pub/linux/2.6.xx.at91.y/2.6.xx.at91.y-exp.patch.gz等资源均不可用(xx已改为相应的版本号)。只好在其提供的两个补丁上要工夫,第一个补丁可以用zcat 轻松打上,但是第二个补丁2.6.30-at91-exp.tar.gz因格式不一样无法用此办法完成,tar –xzf  2.6.30-at91-exp.tar.gz 后发现这是一组patch文件:


2.6.30-at91-exp-0001-at91-dm9000-initialization-update.patch                    2.6.30-at91-exp-0040-AT91-modify-the-support-of-AC97-on-the-at91sam9263.patch


2.6.30-at91-exp-0002-at91-add-gpio-button-support-for-at91sam9g20ek.patch       2.6.30-at91-exp-0041-AT91-correct-AC97-reset-line-in-at91sam9263ek-board.patch


2.6.30-at91-exp-0003-at91-add-gpio-button-and-leds-support-for-at91sam9r.patch  2.6.30-at91-exp-0042-at91-add-AC97-support-to-at91sam9rl-and-at91sam9rle.patch


2.6.30-at91-exp-0004-at91-at91sam9rlek-lcd-interface-correction.patch           2.6.30-at91-exp-0043-at91-add-AC97-support-to-at91sam9g45-series-and-at9.patch


2.6.30-at91-exp-0005-avr32-add-two-new-at91-to-cpu.h-definition.patch           2.6.30-at91-exp-0044-input-atmel_tsadcc-touchscreen-rework-setting-capa.patch


2.6.30-at91-exp-0006-5438-1-AT91-manage-clock-by-ality-instead.patch    2.6.30-at91-exp-0045-input-atmel_tsadcc-touchscreen-use-platform-paramet.patch


2.6.30-at91-exp-0007-atmel_serial-fix-hang-in-set_termios-when-crtscts-i.patch  2.6.30-at91-exp-0046-at91-input-platform-parameters-for-atmel_tsadcc-in.patch


2.6.30-at91-exp-0008-USB-atmel_usba_udc-change-way-of-specifying-bias-f.patch   2.6.30-at91-exp-0047-at91-input-touchscreen-support-for-at91sam9g45ekes.patch


2.6.30-at91-exp-0009-Add-MACB-TX-Buffer-in-SRAM-support.patch                   2.6.30-at91-exp-0048-at91-extend-power-management-to-at91sam9g45-chip.patch


2.6.30-at91-exp-0010-5569-1-at91-Support-for-at91sam9g45-clocks-manage.patch    2.6.30-at91-exp-0049-at91-at91sam9g45-family-identify-several-chip-vers.patch


2.6.30-at91-exp-0011-5571-1-at91-Basic-support-for-at91sam9g45-series.patch     2.6.30-at91-exp-0050-atmel_lcdfb-New-alternate-pixel-clock-formula.patch


2.6.30-at91-exp-0012-5572-1-at91-Support-for-at91sam9g45-series-core-c.patch    2.6.30-at91-exp-0051-mach-types-add-2MMC-slot-9g20-board.patch


2.6.30-at91-exp-0013-ARM-5622-1-at91-at91sam9g45-headers-DMA-peripher.patch     2.6.30-at91-exp-0052-at91-at91sam9g20ek-add-card-detect-signal-to-sd-mmc.patch


2.6.30-at91-exp-0014-5567-1-at91-Support-for-at91sam9g10-clocks-manage.patch    2.6.30-at91-exp-0053-at91-at91sam9g20ek-modify-dual-slot-evaluation-kit.patch


2.6.30-at91-exp-0015-5568-1-at91-Basic-support-for-at91sam9g10-header.patch     2.6.30-at91-exp-0054-at91-add-gpio-buttons-to-at91sam9g20-ek-2mmc.patch


2.6.30-at91-exp-0016-5570-1-at91-Support-for-at91sam9g10-core-chip-b.patch      2.6.30-at91-exp-0055-Bug-workaround-for-channel-in-ac97.patch


2.6.30-at91-exp-0017-5614-1-at91-atmel_lcdfb-add-at91sam9g10-support-t.patch    2.6.30-at91-exp-0056-input-atmel_tsadcc-report-fake-pressure-measure.patch


2.6.30-at91-exp-0018-USB-at91-Add-USB-EHCI-driver-for-at91sam9g45-serie.patch   2.6.30-at91-exp-0057-at91-No-more-SD-MMC-Write-Protect-pin-connected-on.patch


2.6.30-at91-exp-0019-USB-at91-Add-USB-gadget-driver-selection-for-at91s.patch   2.6.30-at91-exp-0058-net-macb-modify-SRAM-location-of-deor-buffer.patch


2.6.30-at91-exp-0020-USB-at91-modify-OHCI-driver-to-allow-shared-interr.patch   2.6.30-at91-exp-0059-at91-add-pwm-support-in-Kconfig-for-at91sam9g45.patch


2.6.30-at91-exp-0021-at91-USB-at91sam9g45-series-USB-host-integration.patch     2.6.30-at91-exp-0060-at91-update-at91sam9263ek-defconfig-file.patch


2.6.30-at91-exp-0022-at91-USB-USB-drivers-modifications-for-at91sam9g10.patch   2.6.30-at91-exp-0061-at91-add-at91sam9g45ekes-defconfig-file.patch


2.6.30-at91-exp-0023-dmaengine-at_hdmac-new-driver-for-the-Atmel-AHB-DM.patch   2.6.30-at91-exp-0062-at91-update-at91sam9g20ek-defconfig-file.patch


2.6.30-at91-exp-0024-dmaengine-at_hdmac-add-DMA-slave-transfers.patch           2.6.30-at91-exp-0063-at91-update-at91sam9261ek-defconfig-file.patch


2.6.30-at91-exp-0025-at91-dmaengine-integration-of-at_hdmac-driver-in-at.patch  2.6.30-at91-exp-0064-at91-update-at91sam9260ek-defconfig-file.patch


2.6.30-at91-exp-0026-at91-dmaengine-integration-of-at_hdmac-driver-in-at.patch  2.6.30-at91-exp-0065-at91-update-at91sam9rlek-defconfig-file.patch


2.6.30-at91-exp-0027-atmel-mci-Integrate-AT91-specific-definition-in-hea.patch  2.6.30-at91-exp-0066-sound-soc-update-soc-support-to-2.6.32-rc3-alsa.patch


2.6.30-at91-exp-0028-atmel-mci-add-MCI2-register-definitions.patch              2.6.30-at91-exp-0067-sound-at91sam9g20ek_2mmc-board-uses-same-audio-conn.patch


2.6.30-at91-exp-0029-atmel-mci-Unified-Atmel-MCI-drivers-AVR32-AT91.patch       2.6.30-at91-exp-0068-at91-add-I2C-definitions-for-at91sam9g20ek-boards.patch


2.6.30-at91-exp-0030-AT91-atmel-mci-Platform-configuration-to-the-the-a.patch   2.6.30-at91-exp-0069-at91-add-at91sam9g10ek-defconfig-file.patch


2.6.30-at91-exp-0031-atmel-mci-change-use-of-dma-slave-interface.patch          2.6.30-at91-exp-0070-at91-update-at91sam9260ek_defconfig.patch


2.6.30-at91-exp-0032-mmc-atmel-mci-New-MCI2-module-support-in-atmel-mci.patch   2.6.30-at91-exp-0071-at91-update-at91sam9261ek_defconfig.patch


2.6.30-at91-exp-0033-at91-atmel-mci-inclusion-of-sd-mmc-driver-in-at91sa.patch  2.6.30-at91-exp-0072-at91-update-at91sam9263ek_defconfig.patch


2.6.30-at91-exp-0034-MCI2-High-speed-mode-support.patch                         2.6.30-at91-exp-0073-at91-update-at91sam9g20ek_defconfig.patch


2.6.30-at91-exp-0035-at91_mci-Enable-MMC_CAP_SDIO_IRQ-only-when-it-actua.patch  2.6.30-at91-exp-0074-at91-update-at91sam9g20ek_2mmc_defconfig.patch


2.6.30-at91-exp-0036-at91_mci-Do-a-reset-after-each-request.patch               2.6.30-at91-exp-0075-at91-update-at91sam9g45ekes_defconfig.patch


2.6.30-at91-exp-0037-at91_mci-introduce-per-mci-revision-conditional-cod.patch  2.6.30-at91-exp-0076-at91-update-at91sam9rlek_defconfig.patch


2.6.30-at91-exp-0038-dmaengine-Move-all-map_sg-unmap_sg-for-slave-channe.patch  2.6.30-at91-exp-0077-at91-add-at91sam9xeek-defconfig.patch


2.6.30-at91-exp-0039-AC97-atmel-add-support-for-AT91-common-with-AVR32.patch    2.6.30-at91-exp-0078-Final-release-for-2.6.30-at91-exp.patch


 


――这可能是ATMEL提供麻烦说明的原因。


需要找方便的方法一次性的把所有补丁打上,在LINUX一定会有这样的方法,仔细向下看,发现有:for p in 2.6.xx-at91-exp.y/*; do patch -p1 < $p ; done的语句,一个明显的循环语句,2.6.30-at91-exp.tar.gz解压后的目录名是2.6.30-at91-exp,将2.6.xx-at91-exp.y/*换为2.6.30-at91-exp后,一次打上了所有补丁。


此为一次打大量补丁的方法。


 


EE.C


二○○九年十二月三十一日


 


路过

鸡蛋

鲜花

握手

雷人

发表评论 评论 (1 个评论)

回复 woshic23 2013-6-29 15:30
多谢分享!