diff options
author | Nicolás Reynolds <fauno@kiwwwi.com.ar> | 2012-11-06 13:37:54 -0300 |
---|---|---|
committer | Nicolás Reynolds <fauno@kiwwwi.com.ar> | 2012-11-06 13:37:54 -0300 |
commit | a48d075b90120462b9f97ab95a224d47e072f7dd (patch) | |
tree | 8ba729381a11d91f09b298d888636425c549498b /libre/linux-libre-lts | |
parent | 4ce84837520f8c56ae998d5d2d98380faf3e3eb5 (diff) | |
parent | 8ab3c2d0517cb4db3ab2f7635d0b71b701e464ba (diff) |
Merge branch 'master' of ssh://gparabola/srv/git/abslibre
Diffstat (limited to 'libre/linux-libre-lts')
-rw-r--r-- | libre/linux-libre-lts/.directory | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | libre/linux-libre-lts/Kbuild | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | libre/linux-libre-lts/Kbuild.platforms | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | libre/linux-libre-lts/PKGBUILD | 156 | ||||
-rwxr-xr-x[-rw-r--r--] | libre/linux-libre-lts/boot-logo.patch | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | libre/linux-libre-lts/change-default-console-loglevel.patch | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | libre/linux-libre-lts/config.i686 | 54 | ||||
-rwxr-xr-x[-rw-r--r--] | libre/linux-libre-lts/config.x86_64 | 58 | ||||
-rwxr-xr-x[-rw-r--r--] | libre/linux-libre-lts/ext4-options.patch | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | libre/linux-libre-lts/i915-fix-ghost-tv-output.patch | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | libre/linux-libre-lts/linux-libre-lts.install | 19 | ||||
-rwxr-xr-x[-rw-r--r--] | libre/linux-libre-lts/linux-libre-lts.preset | 0 | ||||
-rw-r--r-- | libre/linux-libre-lts/module-init-wait-3.0.patch | 77 | ||||
-rw-r--r-- | libre/linux-libre-lts/module-symbol-waiting-3.0.patch | 66 |
14 files changed, 322 insertions, 110 deletions
diff --git a/libre/linux-libre-lts/.directory b/libre/linux-libre-lts/.directory deleted file mode 100644 index 89e875be9..000000000 --- a/libre/linux-libre-lts/.directory +++ /dev/null @@ -1,2 +0,0 @@ -[Dolphin] -Timestamp=2012,4,16,17,55,34 diff --git a/libre/linux-libre-lts/Kbuild b/libre/linux-libre-lts/Kbuild index 8a9d7dceb..8a9d7dceb 100644..100755 --- a/libre/linux-libre-lts/Kbuild +++ b/libre/linux-libre-lts/Kbuild diff --git a/libre/linux-libre-lts/Kbuild.platforms b/libre/linux-libre-lts/Kbuild.platforms index 90a226888..90a226888 100644..100755 --- a/libre/linux-libre-lts/Kbuild.platforms +++ b/libre/linux-libre-lts/Kbuild.platforms diff --git a/libre/linux-libre-lts/PKGBUILD b/libre/linux-libre-lts/PKGBUILD index 3593442f9..b7ffda209 100644..100755 --- a/libre/linux-libre-lts/PKGBUILD +++ b/libre/linux-libre-lts/PKGBUILD @@ -1,18 +1,16 @@ # $Id: PKGBUILD 130991 2011-07-09 12:23:51Z thomas $ # Maintainer: Tobias Powalowski <tpowa@archlinux.org> # Maintainer: Thomas Baechler <thomas@archlinux.org> -# Maintainer (Parabola): André Silva <andre.paulista@adinet.com.uy> -# Contributor (Parabola): Márcio Silva <coadde@adinet.com.uy> +# Maintainer (Parabola): André Silva <emulatorman@lavabit.com> +# Maintainer (Parabola): Márcio Silva <coadde@lavabit.com> -pkgbase=linux-libre-lts -pkgname=('linux-libre-lts' 'linux-libre-lts-headers') # Build stock -LIBRE kernel -# pkgname=linux-custom # Build kernel with a different name -_kernelname=-LIBRE-LTS +pkgbase=linux-libre-lts # Build stock -LIBRE-LTS kernel +#pkgbase=linux-libre-custom # Build kernel with a different name _basekernel=3.0 -_sublevel=32 +_sublevel=51 pkgver=${_basekernel}.${_sublevel} -_lxopkgver=${_basekernel}.31 # nearly always the same as pkgver pkgrel=1 +_lxopkgver=${_basekernel}.50 # nearly always the same as pkgver arch=('i686' 'x86_64' 'mips64el') url="http://linux-libre.fsfla.org/" license=('GPL2') @@ -23,18 +21,20 @@ source=("http://linux-libre.fsfla.org/pub/linux-libre/releases/${_basekernel}-gn # the main kernel config files 'config.i686' 'config.x86_64' # standard config files for mkinitcpio ramdisk - "${pkgname}.preset" + "${pkgbase}.preset" 'Kbuild' 'Kbuild.platforms' 'boot-logo.patch' 'change-default-console-loglevel.patch' 'i915-fix-ghost-tv-output.patch' 'ext4-options.patch' - "http://www.linux-libre.fsfla.org/pub/linux-libre/lemote/gnewsense/pool/linux-patches-${_lxopkgver}-gnu_0loongsonlibre_mipsel.tar.bz2") + 'module-symbol-waiting-3.0.patch' + 'module-init-wait-3.0.patch' + "http://www.linux-libre.fsfla.org/pub/linux-libre/lemote/gnewsense/pool/debuginfo/linux-patches-${_lxopkgver}-gnu_0loongsonlibre_mipsel.tar.bz2") md5sums=('5f64180fe7df4e574dac5911b78f5067' - '1fc88c19baf04fbb37385712ad9c4d57' - 'df7e69a7b238c6492b589cc2beb894d2' - '2ef390e115d6ae1c074c30fec9258442' + 'fb3c742b1f8b01131534a22348cfa712' + 'aed25ab047e1c0b020a1516c235c6a74' + '7d37e8ce0f4bd5a957172b12ae742ea0' 'c072b17032e80debc6a8626299245d46' '2967cecc3af9f954ccc822fd63dca6ff' '8267264d9a8966e57fdacd1fa1fc65c4' @@ -42,13 +42,18 @@ md5sums=('5f64180fe7df4e574dac5911b78f5067' '9d3c56a4b999c8bfbd4018089a62f662' '263725f20c0b9eb9c353040792d644e5' 'f36222e7ce20c8e4dc27376f9be60f6c' - 'bacdceaf5ce186cfe69dffc89cd246a0') + '670931649c60fcb3ef2e0119ed532bd4' + '8a71abc4224f575008f974a099b5cf6f' + 'e2cc9f33fb26b254b6b65f8981aebf13') if [ "$CARCH" != "mips64el" ]; then # Don't use the Loongson-specific patches on non-mips64el arches. unset source[${#source[@]}-1] unset md5sums[${#md5sums[@]}-1] fi +_kernelname=${pkgbase#linux-libre} +_localversionname=-LIBRE-LTS + build() { cd "${srcdir}/linux-${_basekernel}" @@ -77,6 +82,11 @@ build() { # https://bugs.archlinux.org/task/28653 patch -Np1 -i "${srcdir}/ext4-options.patch" + # fix module initialisation + # https://bugs.archlinux.org/task/32122 + patch -Np1 -i "${srcdir}/module-symbol-waiting-3.0.patch" + patch -Np1 -i "${srcdir}/module-init-wait-3.0.patch" + if [ "$CARCH" == "mips64el" ]; then sed -i "s|^EXTRAVERSION.*|EXTRAVERSION =-libre-lts|" Makefile sed -r "s|^( SUBLEVEL = ).*|\1$_sublevel|" \ @@ -89,10 +99,10 @@ build() { # https://git.kernel.org/?p=linux/hotplug/udev.git;a=blob_plain;f=README # and make USB storage support builtin (e.g. for booting from USB # disks without slowly loading an initramfs) - sed -ri -e "s|CONFIG_MIPS32_N32=.*|CONFIG_MIPS32_N32=y|g" \ + sed -ri \ -e "s|CONFIG_MIPS32_N32=.*|CONFIG_MIPS32_N32=y|g" \ -e "s|CONFIG_UEVENT_HELPER_PATH=.*|CONFIG_UEVENT_HELPER_PATH=\"\"|g" \ - -e "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" \ + -e "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_localversionname}\"|g" \ -e "s;(CONFIG_USB(_COMMON|_EHCI_HCD|_OHCI_HCD|_STORAGE.*|_UAS)?)=.*;\1=y;g" \ ./.config else @@ -100,12 +110,16 @@ build() { fi if [ "${_kernelname}" != "" ]; then - sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config + sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_localversionname}\"|g" ./.config + sed -i "s|CONFIG_LOCALVERSION_AUTO=.*|CONFIG_LOCALVERSION_AUTO=n|" ./.config fi # set extraversion to pkgrel sed -ri "s|^(EXTRAVERSION =).*|\1 -${pkgrel}|" Makefile + # don't run depmod on 'make install'. We'll do this ourselves in packaging + sed -i '2iexit 0' scripts/depmod.sh + # get kernel version make prepare @@ -117,15 +131,22 @@ build() { #make oldconfig # using old config from previous kernel version # ... or manually edit .config + # rewrite configuration + yes "" | make config >/dev/null + + # save configuration for later reuse + if [ "${CARCH}" = "x86_64" ]; then + cat .config > "${startdir}/config.x86_64.last" + else + cat .config > "${startdir}/config.i686.last" + fi + #################### # stop here # this is useful to configure the kernel - #msg "Stopping build" - #return 1 + #msg "Stopping build"; return 1 #################### - yes "" | make config - # build! if [ "$CARCH" == "mips64el" ]; then # The build system passes it directly to linker, disable to avoid @@ -133,21 +154,22 @@ build() { export LDFLAGS="" # bzImage is arch-specific and not supported on mips; vmlinux is # useful for oprofile. - make ${MAKEFLAGS} vmlinux vmlinuz modules + make ${MAKEFLAGS} LOCALVERSION= vmlinux vmlinuz modules else - make ${MAKEFLAGS} bzImage modules + make ${MAKEFLAGS} LOCALVERSION= bzImage modules fi } -package_linux-libre-lts() { - pkgdesc="The Linux-libre Kernel and modules - stable longtime supported kernel package suitable for servers" - depends=('coreutils' 'kmod') +_package() { + pkgdesc="The ${pkgbase} kernel and modules - stable longtime supported kernel package suitable for servers" + [ "${pkgbase}" = "linux-libre" ] && groups=('base') + depends=('coreutils' 'linux-libre-firmware' 'kmod') optdepends=('crda: to set the correct wireless channels of your country') - provides=('kernel26-lts' "linux-lts=$pkgver") - conflicts=('kernel26-lts' 'kernel26-libre-lts' 'linux-lts') - replaces=('kernel26-lts' 'kernel26-libre-lts' 'linux-lts') - backup=("etc/mkinitcpio.d/${pkgname}.preset") - install=${pkgname}.install + provides=("kernel26${_kernelname}=${pkgver}" "linux${_kernelname}=${pkgver}") + conflicts=("kernel26${_kernelname}" "kernel26-libre${_kernelname}" "linux${_kernelname}") + replaces=("kernel26${_kernelname}" "kernel26-libre${_kernelname}" "linux${_kernelname}") + backup=("etc/mkinitcpio.d/${pkgbase}.preset") + install=${pkgbase}.install if [ "$CARCH" = "mips64el" ]; then optdepends+=('mkinitcpio: to make the initramfs (needs reinstall of this package)') conflicts+=('mkinitcpio<0.7') @@ -161,35 +183,42 @@ package_linux-libre-lts() { [ $CARCH = "mips64el" ] && KARCH=mips # get kernel version - _kernver="$(make kernelrelease)" + _kernver="$(make LOCALVERSION= kernelrelease)" + _basekernel=${_kernver%%-*} + _basekernel=${_basekernel%.*} mkdir -p "${pkgdir}"/{lib/modules,lib/firmware,boot} - make INSTALL_MOD_PATH="${pkgdir}" modules_install + make LOCALVERSION= INSTALL_MOD_PATH="${pkgdir}" modules_install if [ "$CARCH" == "mips64el" ]; then - cp vmlinuz "${pkgdir}/boot/vmlinuz-${pkgname}" - cp vmlinux "${pkgdir}/boot/vmlinux-${pkgname}" + cp vmlinuz "${pkgdir}/boot/vmlinuz-${pkgbase}" + cp vmlinux "${pkgdir}/boot/vmlinux-${pkgbase}" else - cp "arch/${KARCH}/boot/bzImage" "${pkgdir}/boot/vmlinuz-${pkgname}" + cp "arch/${KARCH}/boot/bzImage" "${pkgdir}/boot/vmlinuz-${pkgbase}" fi # add vmlinux install -D -m644 vmlinux "${pkgdir}/usr/src/linux-${_kernver}/vmlinux" # install fallback mkinitcpio.conf file and preset file for kernel - install -D -m644 "${srcdir}/${pkgname}.preset" "${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset" + install -D -m644 "${srcdir}/${pkgbase}.preset" "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset" # set correct depmod command for install sed \ - -e "s|ALL_kver=.*|ALL_kver=\"/boot/vmlinuz-${pkgname}\"|g" \ - -e "s|default_image=.*|default_image=\"/boot/initramfs-${pkgname}.img\"|g" \ - -e "s|fallback_image=.*|fallback_image=\"/boot/initramfs-${pkgname}-fallback.img\"|g" \ - -i "${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset" + -e "s/KERNEL_NAME=.*/KERNEL_NAME=${_kernelname}/" \ + -e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/" \ + -i "${startdir}/${pkgbase}.install" + sed \ + -e "1s|'linux*.*'|'${pkgbase}'|" \ + -e "s|ALL_kver=.*|ALL_kver=\"/boot/vmlinuz-${pkgbase}\"|" \ + -e "s|default_image=.*|default_image=\"/boot/initramfs-${pkgbase}.img\"|" \ + -e "s|fallback_image=.*|fallback_image=\"/boot/initramfs-${pkgbase}-fallback.img\"|" \ + -i "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset" # mkinitcpio 0.7 relies on bzImage to find the kernel version if [ "$CARCH" == "mips64el" ]; then - sed -e "s|ALL_kver=.*|ALL_kver=\"${_kernver}\"|g" \ - -i "${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset" + sed -e "s|ALL_kver=.*|ALL_kver=\"${_kernver}\"|" \ + -i "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset" fi # remove build and source links @@ -199,17 +228,23 @@ package_linux-libre-lts() { # gzip -9 all modules to save 100MB of space find "${pkgdir}" -name '*.ko' -exec gzip -9 {} \; # make room for external modules - ln -s "../extramodules-${_basekernel}${_kernelname:--LIBRE-LTS}" "${pkgdir}/lib/modules/${_kernver}/extramodules" + ln -s "../extramodules-${_basekernel}${_localversionname:--LIBRE-LTS}" "${pkgdir}/lib/modules/${_kernver}/extramodules" # add real version for building modules and running depmod from post_install/upgrade - mkdir -p "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:--LIBRE-LTS}" - echo "${_kernver}" > "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:--LIBRE-LTS}/version" + mkdir -p "${pkgdir}/lib/modules/extramodules-${_basekernel}${_localversionname:--LIBRE-LTS}" + echo "${_kernver}" > "${pkgdir}/lib/modules/extramodules-${_basekernel}${_localversionname:--LIBRE-LTS}/version" + + # Now we call depmod... + depmod -b "$pkgdir" -F System.map "$_kernver" + + # move module tree /lib -> /usr/lib + mv "$pkgdir/lib" "$pkgdir/usr" } -package_linux-libre-lts-headers() { - pkgdesc="Header files and scripts for building modules for linux-libre-lts longtime supported kernel" - provides=('kernel26-lts-headers' "linux-lts-headers=${pkgver}") - conflicts=('kernel26-lts-headers' 'kernel26-libre-lts-headers' 'linux-lts-headers') - replaces=('kernel26-lts-headers' 'kernel26-libre-lts-headers' 'linux-lts-headers') +_package-headers() { + pkgdesc="Header files and scripts for building modules for ${pkgbase} kernel" + provides=("kernel26${_kernelname}-headers=${pkgver}" "linux${_kernelname}-headers=${pkgver}") + conflicts=("kernel26${_kernelname}-headers" "kernel26-libre${_kernelname}-headers" "linux${_kernelname}-headers") + replaces=("kernel26${_kernelname}-headers" "kernel26-libre${_kernelname}-headers" "linux${_kernelname}-headers") KARCH=x86 [ $CARCH = "mips64el" ] && KARCH=mips @@ -217,13 +252,13 @@ package_linux-libre-lts-headers() { # In case of repackaging this is empty if [ -z "${_kernver}" ]; then cd "${srcdir}/linux-${_basekernel}" - _kernver="$(make kernelrelease)" + _kernver="$(make LOCALVERSION= kernelrelease)" fi - mkdir -p "${pkgdir}/lib/modules/${_kernver}" + install -dm755 "${pkgdir}/usr/lib/modules/${_kernver}" - cd "${pkgdir}/lib/modules/${_kernver}" - ln -sf ../../../usr/src/linux-${_kernver} build + cd "${pkgdir}/usr/lib/modules/${_kernver}" + ln -sf ../../../src/linux-${_kernver} build cd "${srcdir}/linux-${_basekernel}" install -D -m644 Makefile \ @@ -348,10 +383,19 @@ package_linux-libre-lts-headers() { done # remove unneeded architectures - rm -rf "${pkgdir}"/usr/src/linux-${_kernver}/arch/{alpha,arm,arm26,avr32,blackfin,cris,frv,h8300,ia64,m32r,m68k,m68knommu,microblaze,mn10300,parisc,powerpc,ppc,s390,score,sh,sh64,sparc,sparc64,tile,um,unicore32,v850,xtensa} + rm -rf "${pkgdir}"/usr/src/linux-${_kernver}/arch/{alpha,arm,arm26,avr32,blackfin,c6x,cris,frv,h8300,hexagon,ia64,m32r,m68k,m68knommu,microblaze,mn10300,openrisc,parisc,powerpc,ppc,s390,score,sh,sh64,sparc,sparc64,tile,unicore32,um,v850,xtensa} if [ "$CARCH" = "mips64el" ]; then rm -rf ${pkgdir}/usr/src/linux-${_kernver}/arch/x86 else rm -rf ${pkgdir}/usr/src/linux-${_kernver}/arch/mips fi } + +pkgname=("${pkgbase}" "${pkgbase}-headers") +for _p in ${pkgname[@]}; do + eval "package_${_p}() { + _package${_p#${pkgbase}} + }" +done + +# vim:set ts=8 sts=2 sw=2 et: diff --git a/libre/linux-libre-lts/boot-logo.patch b/libre/linux-libre-lts/boot-logo.patch index c392928a5..c392928a5 100644..100755 --- a/libre/linux-libre-lts/boot-logo.patch +++ b/libre/linux-libre-lts/boot-logo.patch diff --git a/libre/linux-libre-lts/change-default-console-loglevel.patch b/libre/linux-libre-lts/change-default-console-loglevel.patch index 63435d84f..63435d84f 100644..100755 --- a/libre/linux-libre-lts/change-default-console-loglevel.patch +++ b/libre/linux-libre-lts/change-default-console-loglevel.patch diff --git a/libre/linux-libre-lts/config.i686 b/libre/linux-libre-lts/config.i686 index 7094b2731..823d65d18 100644..100755 --- a/libre/linux-libre-lts/config.i686 +++ b/libre/linux-libre-lts/config.i686 @@ -1,6 +1,6 @@ # # Automatically generated make config: don't edit -# Linux/i386 3.0.29-1 Kernel Configuration +# Linux/i386 3.0.43-1 Kernel Configuration # # CONFIG_64BIT is not set CONFIG_X86_32=y @@ -62,7 +62,7 @@ CONFIG_EXPERIMENTAL=y CONFIG_INIT_ENV_ARG_LIMIT=32 CONFIG_CROSS_COMPILE="" CONFIG_LOCALVERSION="-LIBRE-LTS" -CONFIG_LOCALVERSION_AUTO=y +# CONFIG_LOCALVERSION_AUTO is not set CONFIG_HAVE_KERNEL_GZIP=y CONFIG_HAVE_KERNEL_BZIP2=y CONFIG_HAVE_KERNEL_LZMA=y @@ -81,7 +81,7 @@ CONFIG_POSIX_MQUEUE=y CONFIG_POSIX_MQUEUE_SYSCTL=y CONFIG_BSD_PROCESS_ACCT=y CONFIG_BSD_PROCESS_ACCT_V3=y -# CONFIG_FHANDLE is not set +CONFIG_FHANDLE=y CONFIG_TASKSTATS=y CONFIG_TASK_DELAY_ACCT=y CONFIG_TASK_XACCT=y @@ -106,13 +106,13 @@ CONFIG_IRQ_FORCED_THREADING=y # # RCU Subsystem # -CONFIG_TREE_PREEMPT_RCU=y -CONFIG_PREEMPT_RCU=y +CONFIG_TREE_RCU=y +# CONFIG_PREEMPT_RCU is not set # CONFIG_RCU_TRACE is not set CONFIG_RCU_FANOUT=32 # CONFIG_RCU_FANOUT_EXACT is not set +# CONFIG_RCU_FAST_NO_HZ is not set # CONFIG_TREE_RCU_TRACE is not set -# CONFIG_RCU_BOOST is not set CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y CONFIG_LOG_BUF_SHIFT=19 @@ -192,9 +192,11 @@ CONFIG_TRACEPOINTS=y CONFIG_OPROFILE=m # CONFIG_OPROFILE_EVENT_MULTIPLEX is not set CONFIG_HAVE_OPROFILE=y -# CONFIG_KPROBES is not set +CONFIG_KPROBES=y CONFIG_JUMP_LABEL=y +CONFIG_OPTPROBES=y CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y +CONFIG_KRETPROBES=y CONFIG_USER_RETURN_NOTIFIER=y CONFIG_HAVE_IOREMAP_PROT=y CONFIG_HAVE_KPROBES=y @@ -251,27 +253,27 @@ CONFIG_PADATA=y # CONFIG_INLINE_SPIN_LOCK_BH is not set # CONFIG_INLINE_SPIN_LOCK_IRQ is not set # CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set -# CONFIG_INLINE_SPIN_UNLOCK is not set +CONFIG_INLINE_SPIN_UNLOCK=y # CONFIG_INLINE_SPIN_UNLOCK_BH is not set -# CONFIG_INLINE_SPIN_UNLOCK_IRQ is not set +CONFIG_INLINE_SPIN_UNLOCK_IRQ=y # CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set # CONFIG_INLINE_READ_TRYLOCK is not set # CONFIG_INLINE_READ_LOCK is not set # CONFIG_INLINE_READ_LOCK_BH is not set # CONFIG_INLINE_READ_LOCK_IRQ is not set # CONFIG_INLINE_READ_LOCK_IRQSAVE is not set -# CONFIG_INLINE_READ_UNLOCK is not set +CONFIG_INLINE_READ_UNLOCK=y # CONFIG_INLINE_READ_UNLOCK_BH is not set -# CONFIG_INLINE_READ_UNLOCK_IRQ is not set +CONFIG_INLINE_READ_UNLOCK_IRQ=y # CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set # CONFIG_INLINE_WRITE_TRYLOCK is not set # CONFIG_INLINE_WRITE_LOCK is not set # CONFIG_INLINE_WRITE_LOCK_BH is not set # CONFIG_INLINE_WRITE_LOCK_IRQ is not set # CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set -# CONFIG_INLINE_WRITE_UNLOCK is not set +CONFIG_INLINE_WRITE_UNLOCK=y # CONFIG_INLINE_WRITE_UNLOCK_BH is not set -# CONFIG_INLINE_WRITE_UNLOCK_IRQ is not set +CONFIG_INLINE_WRITE_UNLOCK_IRQ=y # CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set # CONFIG_MUTEX_SPIN_ON_OWNER is not set CONFIG_FREEZER=y @@ -359,9 +361,9 @@ CONFIG_NR_CPUS=8 CONFIG_SCHED_SMT=y CONFIG_SCHED_MC=y # CONFIG_IRQ_TIME_ACCOUNTING is not set -# CONFIG_PREEMPT_NONE is not set +CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_VOLUNTARY is not set -CONFIG_PREEMPT=y +# CONFIG_PREEMPT is not set CONFIG_X86_LOCAL_APIC=y CONFIG_X86_IO_APIC=y CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS=y @@ -992,7 +994,9 @@ CONFIG_IP_DCCP_TFRC_LIB=y # DCCP Kernel Hacking # # CONFIG_IP_DCCP_DEBUG is not set +CONFIG_NET_DCCPPROBE=m CONFIG_IP_SCTP=m +CONFIG_NET_SCTPPROBE=m # CONFIG_SCTP_DBG_MSG is not set # CONFIG_SCTP_DBG_OBJCNT is not set # CONFIG_SCTP_HMAC_NONE is not set @@ -1104,6 +1108,7 @@ CONFIG_XPS=y # Network testing # CONFIG_NET_PKTGEN=m +CONFIG_NET_TCPPROBE=m CONFIG_NET_DROP_MONITOR=y CONFIG_HAMRADIO=y @@ -3440,6 +3445,7 @@ CONFIG_VIDEO_CX18_ALSA=m CONFIG_VIDEO_SAA7164=m CONFIG_VIDEO_CAFE_CCIC=m CONFIG_VIDEO_SR030PC30=m +CONFIG_VIDEO_VIA_CAMERA=m CONFIG_VIDEO_NOON010PC30=m CONFIG_VIDEO_M5MOLS=m CONFIG_SOC_CAMERA=m @@ -3805,6 +3811,7 @@ CONFIG_DRM_TDFX=m CONFIG_DRM_R128=m CONFIG_DRM_RADEON=m CONFIG_DRM_RADEON_KMS=y +# CONFIG_DRM_I810 is not set CONFIG_DRM_I915=m CONFIG_DRM_I915_KMS=y CONFIG_DRM_MGA=m @@ -3864,7 +3871,9 @@ CONFIG_FB_I810_I2C=y # CONFIG_FB_S3 is not set # CONFIG_FB_SAVAGE is not set # CONFIG_FB_SIS is not set -# CONFIG_FB_VIA is not set +CONFIG_FB_VIA=m +CONFIG_FB_VIA_DIRECT_PROCFS=y +CONFIG_FB_VIA_X_COMPATIBILITY=y # CONFIG_FB_NEOMAGIC is not set # CONFIG_FB_KYRO is not set # CONFIG_FB_3DFX is not set @@ -4998,7 +5007,8 @@ CONFIG_DELL_RBU=m CONFIG_DCDBAS=m CONFIG_DMIID=y CONFIG_DMI_SYSFS=m -# CONFIG_ISCSI_IBFT_FIND is not set +CONFIG_ISCSI_IBFT_FIND=y +CONFIG_ISCSI_IBFT=m CONFIG_SIGMA=m # CONFIG_GOOGLE_FIRMWARE is not set @@ -5044,7 +5054,7 @@ CONFIG_BTRFS_FS=m CONFIG_BTRFS_FS_POSIX_ACL=y CONFIG_NILFS2_FS=m CONFIG_FS_POSIX_ACL=y -CONFIG_EXPORTFS=m +CONFIG_EXPORTFS=y CONFIG_FILE_LOCKING=y CONFIG_FSNOTIFY=y CONFIG_DNOTIFY=y @@ -5059,7 +5069,7 @@ CONFIG_QUOTA_TREE=m CONFIG_QFMT_V1=m CONFIG_QFMT_V2=m CONFIG_QUOTACTL=y -CONFIG_AUTOFS4_FS=m +CONFIG_AUTOFS4_FS=y CONFIG_FUSE_FS=m CONFIG_CUSE=m CONFIG_GENERIC_ACL=y @@ -5310,7 +5320,6 @@ CONFIG_TIMER_STATS=y # CONFIG_SLUB_DEBUG_ON is not set # CONFIG_SLUB_STATS is not set # CONFIG_DEBUG_KMEMLEAK is not set -# CONFIG_DEBUG_PREEMPT is not set # CONFIG_DEBUG_RT_MUTEXES is not set # CONFIG_RT_MUTEX_TESTER is not set # CONFIG_DEBUG_SPINLOCK is not set @@ -5341,7 +5350,7 @@ CONFIG_FRAME_POINTER=y # CONFIG_BOOT_PRINTK_DELAY is not set # CONFIG_RCU_TORTURE_TEST is not set CONFIG_RCU_CPU_STALL_TIMEOUT=60 -# CONFIG_RCU_CPU_STALL_VERBOSE is not set +# CONFIG_KPROBES_SANITY_TEST is not set # CONFIG_BACKTRACE_SELF_TEST is not set # CONFIG_DEBUG_BLOCK_EXT_DEVT is not set # CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set @@ -5377,7 +5386,6 @@ CONFIG_FTRACE=y CONFIG_FUNCTION_TRACER=y CONFIG_FUNCTION_GRAPH_TRACER=y # CONFIG_IRQSOFF_TRACER is not set -# CONFIG_PREEMPT_TRACER is not set CONFIG_SCHED_TRACER=y CONFIG_FTRACE_SYSCALLS=y CONFIG_BRANCH_PROFILE_NONE=y @@ -5385,6 +5393,7 @@ CONFIG_BRANCH_PROFILE_NONE=y # CONFIG_PROFILE_ALL_BRANCHES is not set CONFIG_STACK_TRACER=y CONFIG_BLK_DEV_IO_TRACE=y +CONFIG_KPROBE_EVENT=y CONFIG_DYNAMIC_FTRACE=y CONFIG_FUNCTION_PROFILER=y CONFIG_FTRACE_MCOUNT_RECORD=y @@ -5416,6 +5425,7 @@ CONFIG_DEBUG_RODATA=y CONFIG_DOUBLEFAULT=y # CONFIG_IOMMU_STRESS is not set CONFIG_HAVE_MMIOTRACE_SUPPORT=y +# CONFIG_X86_DECODER_SELFTEST is not set CONFIG_IO_DELAY_TYPE_0X80=0 CONFIG_IO_DELAY_TYPE_0XED=1 CONFIG_IO_DELAY_TYPE_UDELAY=2 diff --git a/libre/linux-libre-lts/config.x86_64 b/libre/linux-libre-lts/config.x86_64 index f7cd1263b..89eed9382 100644..100755 --- a/libre/linux-libre-lts/config.x86_64 +++ b/libre/linux-libre-lts/config.x86_64 @@ -1,6 +1,6 @@ # # Automatically generated make config: don't edit -# Linux/x86_64 3.0.26-1 Kernel Configuration +# Linux/x86_64 3.0.43-1 Kernel Configuration # CONFIG_64BIT=y # CONFIG_X86_32 is not set @@ -63,7 +63,7 @@ CONFIG_EXPERIMENTAL=y CONFIG_INIT_ENV_ARG_LIMIT=32 CONFIG_CROSS_COMPILE="" CONFIG_LOCALVERSION="-LIBRE-LTS" -CONFIG_LOCALVERSION_AUTO=y +# CONFIG_LOCALVERSION_AUTO is not set CONFIG_HAVE_KERNEL_GZIP=y CONFIG_HAVE_KERNEL_BZIP2=y CONFIG_HAVE_KERNEL_LZMA=y @@ -82,7 +82,7 @@ CONFIG_POSIX_MQUEUE=y CONFIG_POSIX_MQUEUE_SYSCTL=y CONFIG_BSD_PROCESS_ACCT=y CONFIG_BSD_PROCESS_ACCT_V3=y -# CONFIG_FHANDLE is not set +CONFIG_FHANDLE=y CONFIG_TASKSTATS=y CONFIG_TASK_DELAY_ACCT=y CONFIG_TASK_XACCT=y @@ -107,13 +107,13 @@ CONFIG_IRQ_FORCED_THREADING=y # # RCU Subsystem # -CONFIG_TREE_PREEMPT_RCU=y -CONFIG_PREEMPT_RCU=y +CONFIG_TREE_RCU=y +# CONFIG_PREEMPT_RCU is not set # CONFIG_RCU_TRACE is not set CONFIG_RCU_FANOUT=64 # CONFIG_RCU_FANOUT_EXACT is not set +# CONFIG_RCU_FAST_NO_HZ is not set # CONFIG_TREE_RCU_TRACE is not set -# CONFIG_RCU_BOOST is not set CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y CONFIG_LOG_BUF_SHIFT=19 @@ -193,9 +193,11 @@ CONFIG_TRACEPOINTS=y CONFIG_OPROFILE=m # CONFIG_OPROFILE_EVENT_MULTIPLEX is not set CONFIG_HAVE_OPROFILE=y -# CONFIG_KPROBES is not set +CONFIG_KPROBES=y CONFIG_JUMP_LABEL=y +CONFIG_OPTPROBES=y CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y +CONFIG_KRETPROBES=y CONFIG_USER_RETURN_NOTIFIER=y CONFIG_HAVE_IOREMAP_PROT=y CONFIG_HAVE_KPROBES=y @@ -252,27 +254,27 @@ CONFIG_PADATA=y # CONFIG_INLINE_SPIN_LOCK_BH is not set # CONFIG_INLINE_SPIN_LOCK_IRQ is not set # CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set -# CONFIG_INLINE_SPIN_UNLOCK is not set +CONFIG_INLINE_SPIN_UNLOCK=y # CONFIG_INLINE_SPIN_UNLOCK_BH is not set -# CONFIG_INLINE_SPIN_UNLOCK_IRQ is not set +CONFIG_INLINE_SPIN_UNLOCK_IRQ=y # CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set # CONFIG_INLINE_READ_TRYLOCK is not set # CONFIG_INLINE_READ_LOCK is not set # CONFIG_INLINE_READ_LOCK_BH is not set # CONFIG_INLINE_READ_LOCK_IRQ is not set # CONFIG_INLINE_READ_LOCK_IRQSAVE is not set -# CONFIG_INLINE_READ_UNLOCK is not set +CONFIG_INLINE_READ_UNLOCK=y # CONFIG_INLINE_READ_UNLOCK_BH is not set -# CONFIG_INLINE_READ_UNLOCK_IRQ is not set +CONFIG_INLINE_READ_UNLOCK_IRQ=y # CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set # CONFIG_INLINE_WRITE_TRYLOCK is not set # CONFIG_INLINE_WRITE_LOCK is not set # CONFIG_INLINE_WRITE_LOCK_BH is not set # CONFIG_INLINE_WRITE_LOCK_IRQ is not set # CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set -# CONFIG_INLINE_WRITE_UNLOCK is not set +CONFIG_INLINE_WRITE_UNLOCK=y # CONFIG_INLINE_WRITE_UNLOCK_BH is not set -# CONFIG_INLINE_WRITE_UNLOCK_IRQ is not set +CONFIG_INLINE_WRITE_UNLOCK_IRQ=y # CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set # CONFIG_MUTEX_SPIN_ON_OWNER is not set CONFIG_FREEZER=y @@ -341,9 +343,9 @@ CONFIG_NR_CPUS=64 CONFIG_SCHED_SMT=y CONFIG_SCHED_MC=y # CONFIG_IRQ_TIME_ACCOUNTING is not set -# CONFIG_PREEMPT_NONE is not set +CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_VOLUNTARY is not set -CONFIG_PREEMPT=y +# CONFIG_PREEMPT is not set CONFIG_X86_LOCAL_APIC=y CONFIG_X86_IO_APIC=y CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS=y @@ -960,7 +962,9 @@ CONFIG_IP_DCCP_TFRC_LIB=y # DCCP Kernel Hacking # # CONFIG_IP_DCCP_DEBUG is not set +CONFIG_NET_DCCPPROBE=m CONFIG_IP_SCTP=m +CONFIG_NET_SCTPPROBE=m # CONFIG_SCTP_DBG_MSG is not set # CONFIG_SCTP_DBG_OBJCNT is not set # CONFIG_SCTP_HMAC_NONE is not set @@ -1070,10 +1074,9 @@ CONFIG_BPF_JIT=y # Network testing # CONFIG_NET_PKTGEN=m +CONFIG_NET_TCPPROBE=m CONFIG_NET_DROP_MONITOR=y CONFIG_HAMRADIO=y -# CONFIG_CAN is not set -CONFIG_IRDA=m # # Packet Radio protocols @@ -1093,6 +1096,8 @@ CONFIG_BAYCOM_SER_FDX=m CONFIG_BAYCOM_SER_HDX=m CONFIG_BAYCOM_PAR=m CONFIG_YAM=m +# CONFIG_CAN is not set +CONFIG_IRDA=m # # IrDA protocols @@ -3274,6 +3279,7 @@ CONFIG_VIDEO_CX18_ALSA=m CONFIG_VIDEO_SAA7164=m CONFIG_VIDEO_CAFE_CCIC=m CONFIG_VIDEO_SR030PC30=m +CONFIG_VIDEO_VIA_CAMERA=m CONFIG_VIDEO_NOON010PC30=m CONFIG_VIDEO_M5MOLS=m CONFIG_SOC_CAMERA=m @@ -3621,6 +3627,7 @@ CONFIG_DRM_TDFX=m CONFIG_DRM_R128=m CONFIG_DRM_RADEON=m CONFIG_DRM_RADEON_KMS=y +# CONFIG_DRM_I810 is not set CONFIG_DRM_I915=m CONFIG_DRM_I915_KMS=y CONFIG_DRM_MGA=m @@ -3677,7 +3684,9 @@ CONFIG_FB_EFI=y # CONFIG_FB_S3 is not set # CONFIG_FB_SAVAGE is not set # CONFIG_FB_SIS is not set -# CONFIG_FB_VIA is not set +CONFIG_FB_VIA=m +CONFIG_FB_VIA_DIRECT_PROCFS=y +CONFIG_FB_VIA_X_COMPATIBILITY=y # CONFIG_FB_NEOMAGIC is not set # CONFIG_FB_KYRO is not set # CONFIG_FB_3DFX is not set @@ -4739,7 +4748,8 @@ CONFIG_DELL_RBU=m CONFIG_DCDBAS=m CONFIG_DMIID=y CONFIG_DMI_SYSFS=m -# CONFIG_ISCSI_IBFT_FIND is not set +CONFIG_ISCSI_IBFT_FIND=y +CONFIG_ISCSI_IBFT=m CONFIG_SIGMA=m # CONFIG_GOOGLE_FIRMWARE is not set @@ -4785,7 +4795,7 @@ CONFIG_BTRFS_FS=m CONFIG_BTRFS_FS_POSIX_ACL=y CONFIG_NILFS2_FS=m CONFIG_FS_POSIX_ACL=y -CONFIG_EXPORTFS=m +CONFIG_EXPORTFS=y CONFIG_FILE_LOCKING=y CONFIG_FSNOTIFY=y CONFIG_DNOTIFY=y @@ -4801,7 +4811,7 @@ CONFIG_QFMT_V1=m CONFIG_QFMT_V2=m CONFIG_QUOTACTL=y CONFIG_QUOTACTL_COMPAT=y -CONFIG_AUTOFS4_FS=m +CONFIG_AUTOFS4_FS=y CONFIG_FUSE_FS=m CONFIG_CUSE=m CONFIG_GENERIC_ACL=y @@ -5051,7 +5061,6 @@ CONFIG_TIMER_STATS=y # CONFIG_DEBUG_OBJECTS is not set # CONFIG_SLUB_DEBUG_ON is not set # CONFIG_SLUB_STATS is not set -# CONFIG_DEBUG_PREEMPT is not set # CONFIG_DEBUG_RT_MUTEXES is not set # CONFIG_RT_MUTEX_TESTER is not set # CONFIG_DEBUG_SPINLOCK is not set @@ -5081,7 +5090,7 @@ CONFIG_FRAME_POINTER=y # CONFIG_BOOT_PRINTK_DELAY is not set # CONFIG_RCU_TORTURE_TEST is not set CONFIG_RCU_CPU_STALL_TIMEOUT=60 -# CONFIG_RCU_CPU_STALL_VERBOSE is not set +# CONFIG_KPROBES_SANITY_TEST is not set # CONFIG_BACKTRACE_SELF_TEST is not set # CONFIG_DEBUG_BLOCK_EXT_DEVT is not set # CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set @@ -5117,7 +5126,6 @@ CONFIG_FTRACE=y CONFIG_FUNCTION_TRACER=y CONFIG_FUNCTION_GRAPH_TRACER=y # CONFIG_IRQSOFF_TRACER is not set -# CONFIG_PREEMPT_TRACER is not set CONFIG_SCHED_TRACER=y CONFIG_FTRACE_SYSCALLS=y CONFIG_BRANCH_PROFILE_NONE=y @@ -5125,6 +5133,7 @@ CONFIG_BRANCH_PROFILE_NONE=y # CONFIG_PROFILE_ALL_BRANCHES is not set CONFIG_STACK_TRACER=y CONFIG_BLK_DEV_IO_TRACE=y +CONFIG_KPROBE_EVENT=y CONFIG_DYNAMIC_FTRACE=y CONFIG_FUNCTION_PROFILER=y CONFIG_FTRACE_MCOUNT_RECORD=y @@ -5156,6 +5165,7 @@ CONFIG_DEBUG_RODATA=y # CONFIG_IOMMU_DEBUG is not set # CONFIG_IOMMU_STRESS is not set CONFIG_HAVE_MMIOTRACE_SUPPORT=y +# CONFIG_X86_DECODER_SELFTEST is not set CONFIG_IO_DELAY_TYPE_0X80=0 CONFIG_IO_DELAY_TYPE_0XED=1 CONFIG_IO_DELAY_TYPE_UDELAY=2 diff --git a/libre/linux-libre-lts/ext4-options.patch b/libre/linux-libre-lts/ext4-options.patch index ef1b2417d..ef1b2417d 100644..100755 --- a/libre/linux-libre-lts/ext4-options.patch +++ b/libre/linux-libre-lts/ext4-options.patch diff --git a/libre/linux-libre-lts/i915-fix-ghost-tv-output.patch b/libre/linux-libre-lts/i915-fix-ghost-tv-output.patch index 3b631361a..3b631361a 100644..100755 --- a/libre/linux-libre-lts/i915-fix-ghost-tv-output.patch +++ b/libre/linux-libre-lts/i915-fix-ghost-tv-output.patch diff --git a/libre/linux-libre-lts/linux-libre-lts.install b/libre/linux-libre-lts/linux-libre-lts.install index 6cd9761a7..75238bf66 100644..100755 --- a/libre/linux-libre-lts/linux-libre-lts.install +++ b/libre/linux-libre-lts/linux-libre-lts.install @@ -2,14 +2,19 @@ # arg 2: the old package version KERNEL_NAME=-lts -KERNEL_VERSION=3.0.32-1-LIBRE-LTS +KERNEL_VERSION=3.0.51-1-LIBRE-LTS + +# set a sane PATH to ensure that critical utils like depmod will be found +export PATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' post_install () { # updating module dependencies echo ">>> Updating module dependencies. Please wait ..." depmod ${KERNEL_VERSION} - echo ">>> Generating initial ramdisk, using mkinitcpio. Please wait..." - mkinitcpio -p linux-libre${KERNEL_NAME} + if command -v mkinitcpio 2>&1 > /dev/null; then + echo ">>> Generating initial ramdisk, using mkinitcpio. Please wait..." + mkinitcpio -p linux-libre${KERNEL_NAME} + fi # compat symlinks for the official kernels only if [ -z "${KERNEL_NAME}" -o "${KERNEL_NAME}" = "-lts" ]; then @@ -28,7 +33,7 @@ post_install () { post_upgrade() { pacman -Q grub &>/dev/null hasgrub=$? - pacman -Q grub2 &>/dev/null + pacman -Q grub-common &>/dev/null hasgrub2=$? pacman -Q lilo &>/dev/null haslilo=$? @@ -51,8 +56,10 @@ post_upgrade() { # updating module dependencies echo ">>> Updating module dependencies. Please wait ..." depmod ${KERNEL_VERSION} - echo ">>> Generating initial ramdisk, using mkinitcpio. Please wait..." - mkinitcpio -p linux-libre${KERNEL_NAME} + if command -v mkinitcpio 2>&1 > /dev/null; then + echo ">>> Generating initial ramdisk, using mkinitcpio. Please wait..." + mkinitcpio -p linux-libre${KERNEL_NAME} + fi } post_remove() { diff --git a/libre/linux-libre-lts/linux-libre-lts.preset b/libre/linux-libre-lts/linux-libre-lts.preset index 37cf35ed0..37cf35ed0 100644..100755 --- a/libre/linux-libre-lts/linux-libre-lts.preset +++ b/libre/linux-libre-lts/linux-libre-lts.preset diff --git a/libre/linux-libre-lts/module-init-wait-3.0.patch b/libre/linux-libre-lts/module-init-wait-3.0.patch new file mode 100644 index 000000000..1bcfd2491 --- /dev/null +++ b/libre/linux-libre-lts/module-init-wait-3.0.patch @@ -0,0 +1,77 @@ +From: Rusty Russell <rusty@rustcorp.com.au> +Date: Fri, 28 Sep 2012 05:01:03 +0000 (+0930) +Subject: module: wait when loading a module which is currently initializing. +X-Git-Tag: v3.7-rc1~2^2~32 +X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=9bb9c3be568346538 + +module: wait when loading a module which is currently initializing. + +The original module-init-tools module loader used a fnctl lock on the +.ko file to avoid attempts to simultaneously load a module. +Unfortunately, you can't get an exclusive fcntl lock on a read-only +fd, making this not work for read-only mounted filesystems. +module-init-tools has a hacky sleep-and-loop for this now. + +It's not that hard to wait in the kernel, and only return -EEXIST once +the first module has finished loading (or continue loading the module +if the first one failed to initialize for some reason). It's also +consistent with what we do for dependent modules which are still loading. + +Suggested-by: Lucas De Marchi <lucas.demarchi@profusion.mobi> +Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> +--- + +diff --git a/kernel/module.c b/kernel/module.c +index 63cf6e7..74bc195 100644 +--- a/kernel/module.c ++++ b/kernel/module.c +@@ -2845,6 +2845,20 @@ static int post_relocation(struct module *mod, const struct load_info *info) + return module_finalize(info->hdr, info->sechdrs, mod); + } + ++/* Is this module of this name done loading? No locks held. */ ++static bool finished_loading(const char *name) ++{ ++ struct module *mod; ++ bool ret; ++ ++ mutex_lock(&module_mutex); ++ mod = find_module(name); ++ ret = !mod || mod->state != MODULE_STATE_COMING; ++ mutex_unlock(&module_mutex); ++ ++ return ret; ++} ++ + /* Allocate and load the module: note that size of section 0 is always + zero, and we rely on this for optional sections. */ + static struct module *load_module(void __user *umod, +@@ -2852,7 +2866,7 @@ static struct module *load_module(void __user *umod, + const char __user *uargs) + { + struct load_info info = { NULL, }; +- struct module *mod; ++ struct module *mod, *old; + long err; + + pr_debug("load_module: umod=%p, len=%lu, uargs=%p\n", +@@ -2918,8 +2932,18 @@ static struct module *load_module(void __user *umod, + * function to insert in a way safe to concurrent readers. + * The mutex protects against concurrent writers. + */ ++again: + mutex_lock(&module_mutex); +- if (find_module(mod->name)) { ++ if ((old = find_module(mod->name)) != NULL) { ++ if (old->state == MODULE_STATE_COMING) { ++ /* Wait in case it fails to load. */ ++ mutex_unlock(&module_mutex); ++ err = wait_event_interruptible(module_wq, ++ finished_loading(mod->name)); ++ if (err) ++ goto free_arch_cleanup; ++ goto again; ++ } + err = -EEXIST; + goto unlock; + } diff --git a/libre/linux-libre-lts/module-symbol-waiting-3.0.patch b/libre/linux-libre-lts/module-symbol-waiting-3.0.patch new file mode 100644 index 000000000..b87a38ff5 --- /dev/null +++ b/libre/linux-libre-lts/module-symbol-waiting-3.0.patch @@ -0,0 +1,66 @@ +From: Rusty Russell <rusty@rustcorp.com.au> +Date: Fri, 28 Sep 2012 05:01:03 +0000 (+0930) +Subject: module: fix symbol waiting when module fails before init +X-Git-Tag: v3.7-rc1~2^2~33 +X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=6f13909f4fe9652f1 + +module: fix symbol waiting when module fails before init + +We use resolve_symbol_wait(), which blocks if the module containing +the symbol is still loading. However: + +1) The module_wq we use is only woken after calling the modules' init + function, but there are other failure paths after the module is + placed in the linked list where we need to do the same thing. + +2) wake_up() only wakes one waiter, and our waitqueue is shared by all + modules, so we need to wake them all. + +3) wake_up_all() doesn't imply a memory barrier: I feel happier calling + it after we've grabbed and dropped the module_mutex, not just after + the state assignment. + +Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> +--- + +diff --git a/kernel/module.c b/kernel/module.c +index 7f2ee45f..63cf6e7 100644 +--- a/kernel/module.c ++++ b/kernel/module.c +@@ -2959,7 +2959,7 @@ static struct module *load_module(void __user *umod, + /* Unlink carefully: kallsyms could be walking list. */ + list_del_rcu(&mod->list); + module_bug_cleanup(mod); +- ++ wake_up_all(&module_wq); + ddebug: + dynamic_debug_remove(info.debug); + unlock: +@@ -3034,7 +3034,7 @@ SYSCALL_DEFINE3(init_module, void __user *, umod, + blocking_notifier_call_chain(&module_notify_list, + MODULE_STATE_GOING, mod); + free_module(mod); +- wake_up(&module_wq); ++ wake_up_all(&module_wq); + return ret; + } + if (ret > 0) { +@@ -3046,9 +3046,8 @@ SYSCALL_DEFINE3(init_module, void __user *, umod, + dump_stack(); + } + +- /* Now it's a first class citizen! Wake up anyone waiting for it. */ ++ /* Now it's a first class citizen! */ + mod->state = MODULE_STATE_LIVE; +- wake_up(&module_wq); + blocking_notifier_call_chain(&module_notify_list, + MODULE_STATE_LIVE, mod); + +@@ -3071,6 +3070,7 @@ SYSCALL_DEFINE3(init_module, void __user *, umod, + mod->init_ro_size = 0; + mod->init_text_size = 0; + mutex_unlock(&module_mutex); ++ wake_up_all(&module_wq); + + return 0; + } |