diff options
Diffstat (limited to 'kernels')
-rw-r--r-- | kernels/linux-libre-pae/0010-iwlwifi-mvm-delay-enabling-smart-FIFO-until-after-be.patch | 52 | ||||
-rw-r--r-- | kernels/linux-libre-pae/0011-kernfs-fix-removed-error-check.patch | 13 | ||||
-rw-r--r-- | kernels/linux-libre-pae/0012-fix-saa7134.patch | 37 | ||||
-rw-r--r-- | kernels/linux-libre-pae/0013-efistub-fix.patch | 177 | ||||
-rw-r--r-- | kernels/linux-libre-pae/0015-fix-xsdt-validation.patch | 42 | ||||
-rw-r--r-- | kernels/linux-libre-pae/PKGBUILD | 37 | ||||
-rw-r--r-- | kernels/linux-libre-pae/config | 2 | ||||
-rw-r--r-- | kernels/linux-libre-pae/linux-libre-pae.install | 12 | ||||
-rw-r--r-- | kernels/linux-libre-xen/0013-efistub-fix.patch | 177 | ||||
-rw-r--r-- | kernels/linux-libre-xen/PKGBUILD | 100 | ||||
-rw-r--r-- | kernels/linux-libre-xen/linux-libre-xen.install (renamed from kernels/linux-libre-xen/linux.install) | 10 | ||||
-rw-r--r-- | kernels/linux-libre-xen/linux-libre-xen.preset | 14 | ||||
-rw-r--r-- | kernels/linux-libre-xen/linux.preset | 14 |
13 files changed, 447 insertions, 240 deletions
diff --git a/kernels/linux-libre-pae/0010-iwlwifi-mvm-delay-enabling-smart-FIFO-until-after-be.patch b/kernels/linux-libre-pae/0010-iwlwifi-mvm-delay-enabling-smart-FIFO-until-after-be.patch deleted file mode 100644 index 7f18091a4..000000000 --- a/kernels/linux-libre-pae/0010-iwlwifi-mvm-delay-enabling-smart-FIFO-until-after-be.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 784c4f0b18f89922ddc0fe21e5ec64cc370bb3f2 Mon Sep 17 00:00:00 2001 -From: Johannes Berg <johannes.berg@intel.com> -Date: Wed, 19 Mar 2014 18:36:39 +0100 -Subject: [PATCH 10/10] iwlwifi: mvm: delay enabling smart FIFO until after - beacon RX - -If we have no beacon data before association, delay smart FIFO -enablement until after we have this data. - -Not doing so can cause association failures in extremely silent -environments (usually only a shielded box/room) as beacon RX is -not sent to the host immediately, and then the association time -event ends without the host receiving any beacon even though it -was on the air - it's just stuck on the FIFO. - -Cc: <stable@vger.kernel.org> [3.14] -Signed-off-by: Johannes Berg <johannes.berg@intel.com> -Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> ---- - drivers/net/wireless/iwlwifi/mvm/mac80211.c | 1 + - drivers/net/wireless/iwlwifi/mvm/sf.c | 3 ++- - 2 files changed, 3 insertions(+), 1 deletion(-) - -diff --git a/drivers/net/wireless/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/iwlwifi/mvm/mac80211.c -index c35b866..45e861e 100644 ---- a/drivers/net/wireless/iwlwifi/mvm/mac80211.c -+++ b/drivers/net/wireless/iwlwifi/mvm/mac80211.c -@@ -971,6 +971,7 @@ static void iwl_mvm_bss_info_changed_station(struct iwl_mvm *mvm, - */ - iwl_mvm_remove_time_event(mvm, mvmvif, - &mvmvif->time_event_data); -+ iwl_mvm_sf_update(mvm, vif, false); - } else if (changes & (BSS_CHANGED_PS | BSS_CHANGED_P2P_PS | - BSS_CHANGED_QOS)) { - ret = iwl_mvm_power_update_mode(mvm, vif); -diff --git a/drivers/net/wireless/iwlwifi/mvm/sf.c b/drivers/net/wireless/iwlwifi/mvm/sf.c -index 8401627..88809b2 100644 ---- a/drivers/net/wireless/iwlwifi/mvm/sf.c -+++ b/drivers/net/wireless/iwlwifi/mvm/sf.c -@@ -274,7 +274,8 @@ int iwl_mvm_sf_update(struct iwl_mvm *mvm, struct ieee80211_vif *changed_vif, - return -EINVAL; - if (changed_vif->type != NL80211_IFTYPE_STATION) { - new_state = SF_UNINIT; -- } else if (changed_vif->bss_conf.assoc) { -+ } else if (changed_vif->bss_conf.assoc && -+ changed_vif->bss_conf.dtim_period) { - mvmvif = iwl_mvm_vif_from_mac80211(changed_vif); - sta_id = mvmvif->ap_sta_id; - new_state = SF_FULL_ON; --- -1.9.2 - diff --git a/kernels/linux-libre-pae/0011-kernfs-fix-removed-error-check.patch b/kernels/linux-libre-pae/0011-kernfs-fix-removed-error-check.patch deleted file mode 100644 index b597595c6..000000000 --- a/kernels/linux-libre-pae/0011-kernfs-fix-removed-error-check.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/fs/kernfs/file.c b/fs/kernfs/file.c -index 8034706..e01ea4a 100644 ---- a/fs/kernfs/file.c -+++ b/fs/kernfs/file.c -@@ -484,6 +484,8 @@ static int kernfs_fop_mmap(struct file *file, struct vm_area_struct *vma) - - ops = kernfs_ops(of->kn); - rc = ops->mmap(of, vma); -+ if (rc) -+ goto out_put; - - /* - * PowerPC's pci_mmap of legacy_mem uses shmem_zero_setup() diff --git a/kernels/linux-libre-pae/0012-fix-saa7134.patch b/kernels/linux-libre-pae/0012-fix-saa7134.patch deleted file mode 100644 index 070fbc8eb..000000000 --- a/kernels/linux-libre-pae/0012-fix-saa7134.patch +++ /dev/null @@ -1,37 +0,0 @@ ---- a/drivers/media/pci/saa7134/saa7134-video.c -+++ a/drivers/media/pci/saa7134/saa7134-video.c -@@ -1243,6 +1243,7 @@ static int video_release(struct file *file) - videobuf_streamoff(&dev->cap); - res_free(dev, fh, RESOURCE_VIDEO); - videobuf_mmap_free(&dev->cap); -+ INIT_LIST_HEAD(&dev->cap.stream); - } - if (dev->cap.read_buf) { - buffer_release(&dev->cap, dev->cap.read_buf); -@@ -1254,6 +1255,7 @@ static int video_release(struct file *file) - videobuf_stop(&dev->vbi); - res_free(dev, fh, RESOURCE_VBI); - videobuf_mmap_free(&dev->vbi); -+ INIT_LIST_HEAD(&dev->vbi.stream); - } - - /* ts-capture will not work in planar mode, so turn it off Hac: 04.05*/ -@@ -1987,17 +1989,12 @@ int saa7134_streamoff(struct file *file, void *priv, - enum v4l2_buf_type type) - { - struct saa7134_dev *dev = video_drvdata(file); -- int err; - int res = saa7134_resource(file); - - if (res != RESOURCE_EMPRESS) - pm_qos_remove_request(&dev->qos_request); - -- err = videobuf_streamoff(saa7134_queue(file)); -- if (err < 0) -- return err; -- res_free(dev, priv, res); -- return 0; -+ return videobuf_streamoff(saa7134_queue(file)); - } - EXPORT_SYMBOL_GPL(saa7134_streamoff); - diff --git a/kernels/linux-libre-pae/0013-efistub-fix.patch b/kernels/linux-libre-pae/0013-efistub-fix.patch new file mode 100644 index 000000000..a2da3b63a --- /dev/null +++ b/kernels/linux-libre-pae/0013-efistub-fix.patch @@ -0,0 +1,177 @@ +From c7fb93ec51d462ec3540a729ba446663c26a0505 Mon Sep 17 00:00:00 2001 +From: Michael Brown <mbrown@fensystems.co.uk> +Date: Thu, 10 Jul 2014 12:26:20 +0100 +Subject: x86/efi: Include a .bss section within the PE/COFF headers +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The PE/COFF headers currently describe only the initialised-data +portions of the image, and result in no space being allocated for the +uninitialised-data portions. Consequently, the EFI boot stub will end +up overwriting unexpected areas of memory, with unpredictable results. + +Fix by including a .bss section in the PE/COFF headers (functionally +equivalent to the init_size field in the bzImage header). + +Signed-off-by: Michael Brown <mbrown@fensystems.co.uk> +Cc: Thomas Bächler <thomas@archlinux.org> +Cc: Josh Boyer <jwboyer@fedoraproject.org> +Cc: <stable@vger.kernel.org> +Signed-off-by: Matt Fleming <matt.fleming@intel.com> + +diff --git a/arch/x86/boot/header.S b/arch/x86/boot/header.S +index 84c2234..7a6d43a 100644 +--- a/arch/x86/boot/header.S ++++ b/arch/x86/boot/header.S +@@ -91,10 +91,9 @@ bs_die: + + .section ".bsdata", "a" + bugger_off_msg: +- .ascii "Direct floppy boot is not supported. " +- .ascii "Use a boot loader program instead.\r\n" ++ .ascii "Use a boot loader.\r\n" + .ascii "\n" +- .ascii "Remove disk and press any key to reboot ...\r\n" ++ .ascii "Remove disk and press any key to reboot...\r\n" + .byte 0 + + #ifdef CONFIG_EFI_STUB +@@ -108,7 +107,7 @@ coff_header: + #else + .word 0x8664 # x86-64 + #endif +- .word 3 # nr_sections ++ .word 4 # nr_sections + .long 0 # TimeDateStamp + .long 0 # PointerToSymbolTable + .long 1 # NumberOfSymbols +@@ -250,6 +249,25 @@ section_table: + .word 0 # NumberOfLineNumbers + .long 0x60500020 # Characteristics (section flags) + ++ # ++ # The offset & size fields are filled in by build.c. ++ # ++ .ascii ".bss" ++ .byte 0 ++ .byte 0 ++ .byte 0 ++ .byte 0 ++ .long 0 ++ .long 0x0 ++ .long 0 # Size of initialized data ++ # on disk ++ .long 0x0 ++ .long 0 # PointerToRelocations ++ .long 0 # PointerToLineNumbers ++ .word 0 # NumberOfRelocations ++ .word 0 # NumberOfLineNumbers ++ .long 0xc8000080 # Characteristics (section flags) ++ + #endif /* CONFIG_EFI_STUB */ + + # Kernel attributes; used by setup. This is part 1 of the +diff --git a/arch/x86/boot/tools/build.c b/arch/x86/boot/tools/build.c +index 1a2f212..a7661c4 100644 +--- a/arch/x86/boot/tools/build.c ++++ b/arch/x86/boot/tools/build.c +@@ -143,7 +143,7 @@ static void usage(void) + + #ifdef CONFIG_EFI_STUB + +-static void update_pecoff_section_header(char *section_name, u32 offset, u32 size) ++static void update_pecoff_section_header_fields(char *section_name, u32 vma, u32 size, u32 datasz, u32 offset) + { + unsigned int pe_header; + unsigned short num_sections; +@@ -164,10 +164,10 @@ static void update_pecoff_section_header(char *section_name, u32 offset, u32 siz + put_unaligned_le32(size, section + 0x8); + + /* section header vma field */ +- put_unaligned_le32(offset, section + 0xc); ++ put_unaligned_le32(vma, section + 0xc); + + /* section header 'size of initialised data' field */ +- put_unaligned_le32(size, section + 0x10); ++ put_unaligned_le32(datasz, section + 0x10); + + /* section header 'file offset' field */ + put_unaligned_le32(offset, section + 0x14); +@@ -179,6 +179,11 @@ static void update_pecoff_section_header(char *section_name, u32 offset, u32 siz + } + } + ++static void update_pecoff_section_header(char *section_name, u32 offset, u32 size) ++{ ++ update_pecoff_section_header_fields(section_name, offset, size, size, offset); ++} ++ + static void update_pecoff_setup_and_reloc(unsigned int size) + { + u32 setup_offset = 0x200; +@@ -203,9 +208,6 @@ static void update_pecoff_text(unsigned int text_start, unsigned int file_sz) + + pe_header = get_unaligned_le32(&buf[0x3c]); + +- /* Size of image */ +- put_unaligned_le32(file_sz, &buf[pe_header + 0x50]); +- + /* + * Size of code: Subtract the size of the first sector (512 bytes) + * which includes the header. +@@ -220,6 +222,22 @@ static void update_pecoff_text(unsigned int text_start, unsigned int file_sz) + update_pecoff_section_header(".text", text_start, text_sz); + } + ++static void update_pecoff_bss(unsigned int file_sz, unsigned int init_sz) ++{ ++ unsigned int pe_header; ++ unsigned int bss_sz = init_sz - file_sz; ++ ++ pe_header = get_unaligned_le32(&buf[0x3c]); ++ ++ /* Size of uninitialized data */ ++ put_unaligned_le32(bss_sz, &buf[pe_header + 0x24]); ++ ++ /* Size of image */ ++ put_unaligned_le32(init_sz, &buf[pe_header + 0x50]); ++ ++ update_pecoff_section_header_fields(".bss", file_sz, bss_sz, 0, 0); ++} ++ + static int reserve_pecoff_reloc_section(int c) + { + /* Reserve 0x20 bytes for .reloc section */ +@@ -259,6 +277,8 @@ static void efi_stub_entry_update(void) + static inline void update_pecoff_setup_and_reloc(unsigned int size) {} + static inline void update_pecoff_text(unsigned int text_start, + unsigned int file_sz) {} ++static inline void update_pecoff_bss(unsigned int file_sz, ++ unsigned int init_sz) {} + static inline void efi_stub_defaults(void) {} + static inline void efi_stub_entry_update(void) {} + +@@ -310,7 +330,7 @@ static void parse_zoffset(char *fname) + + int main(int argc, char ** argv) + { +- unsigned int i, sz, setup_sectors; ++ unsigned int i, sz, setup_sectors, init_sz; + int c; + u32 sys_size; + struct stat sb; +@@ -376,7 +396,9 @@ int main(int argc, char ** argv) + buf[0x1f1] = setup_sectors-1; + put_unaligned_le32(sys_size, &buf[0x1f4]); + +- update_pecoff_text(setup_sectors * 512, sz + i + ((sys_size * 16) - sz)); ++ update_pecoff_text(setup_sectors * 512, i + (sys_size * 16)); ++ init_sz = get_unaligned_le32(&buf[0x260]); ++ update_pecoff_bss(i + (sys_size * 16), init_sz); + + efi_stub_entry_update(); + +-- +cgit v0.10.1 + diff --git a/kernels/linux-libre-pae/0015-fix-xsdt-validation.patch b/kernels/linux-libre-pae/0015-fix-xsdt-validation.patch deleted file mode 100644 index 82dd2be25..000000000 --- a/kernels/linux-libre-pae/0015-fix-xsdt-validation.patch +++ /dev/null @@ -1,42 +0,0 @@ -@@ -, +, @@ - acpi_tb_parse_root_table(). - Commit: 671cc68dc61f029d44b43a681356078e02d8dab8 - Subject: ACPICA: Back port and refine validation of the XSDT root table. ---- - drivers/acpi/acpica/tbutils.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) ---- a/drivers/acpi/acpica/tbutils.c -+++ a/drivers/acpi/acpica/tbutils.c -@@ -461,6 +461,7 @@ acpi_status __init acpi_tb_parse_root_table(acpi_physical_address rsdp_address) - u32 table_count; - struct acpi_table_header *table; - acpi_physical_address address; -+ acpi_physical_address rsdt_address; - u32 length; - u8 *table_entry; - acpi_status status; -@@ -488,11 +489,13 @@ acpi_status __init acpi_tb_parse_root_table(acpi_physical_address rsdp_address) - * as per the ACPI specification. - */ - address = (acpi_physical_address) rsdp->xsdt_physical_address; -+ rsdt_address = (acpi_physical_address) rsdp->rsdt_physical_address; - table_entry_size = ACPI_XSDT_ENTRY_SIZE; - } else { - /* Root table is an RSDT (32-bit physical addresses) */ - - address = (acpi_physical_address) rsdp->rsdt_physical_address; -+ rsdt_address = address; - table_entry_size = ACPI_RSDT_ENTRY_SIZE; - } - -@@ -515,8 +518,7 @@ acpi_status __init acpi_tb_parse_root_table(acpi_physical_address rsdp_address) - - /* Fall back to the RSDT */ - -- address = -- (acpi_physical_address) rsdp->rsdt_physical_address; -+ address = rsdt_address; - table_entry_size = ACPI_RSDT_ENTRY_SIZE; - } - } - diff --git a/kernels/linux-libre-pae/PKGBUILD b/kernels/linux-libre-pae/PKGBUILD index 640259ec0..c13590b91 100644 --- a/kernels/linux-libre-pae/PKGBUILD +++ b/kernels/linux-libre-pae/PKGBUILD @@ -1,13 +1,18 @@ -# $Id: PKGBUILD 215933 2014-07-01 05:46:28Z tpowa $ +# $Id: PKGBUILD 216782 2014-07-11 06:19:46Z tpowa $ # Contributor (Arch): Tobias Powalowski <tpowa@archlinux.org> # Contributor (Arch): Thomas Baechler <thomas@archlinux.org> # Maintainer: André Silva <emulatorman@parabola.nu> +# Contributor: Nicolás Reynolds <fauno@kiwwwi.com.ar> +# Contributor: Sorin-Mihai Vârgolici <smv@yobicore.org> +# Contributor: Michał Masłowski <mtjm@mtjm.eu> +# Contributor: Márcio Silva <coadde@parabola.nu> +# Contributor: Luke Shumaker <lukeshu@sbcglobal.net> pkgbase=linux-libre-pae # Build stock -LIBRE-PAE kernel #pkgbase=linux-libre-custom # Build kernel with a different name _basekernel=3.15 -pkgver=${_basekernel}.3 -pkgrel=1 +pkgver=${_basekernel}.5 +pkgrel=2 arch=('i686') url="http://linux-libre.fsfla.org/" license=('GPL2') @@ -20,16 +25,18 @@ source=("http://linux-libre.fsfla.org/pub/linux-libre/releases/${_basekernel}-gn # standard config files for mkinitcpio ramdisk "${pkgbase}.preset" 'boot-logo.patch' - 'change-default-console-loglevel.patch') + 'change-default-console-loglevel.patch' + '0013-efistub-fix.patch') sha256sums=('93450dc189131b6a4de862f35c5087a58cc7bae1c24caa535d2357cc3301b688' - 'dfd23e705edfc0f6fcf0df1a98e58ec7ae835ec780d7092810b664093d91cd5f' + '17ee14d488733298eef21d4a82986376199d92150ed9de00c25f5d9997eb02ae' '2b4ef64eea46a74fa6a06108438cda033a6306e261b8778c7102b8f441dbfec9' '292d5c553f87246c8dc2d57cadfd2db92a3750173b4588d53c2919743171eca5' '8303b426b1a6dce456b2350003558ae312d21cab0ae6c1f0d7b9d21395f4e177' - 'faced4eb4c47c4eb1a9ee8a5bf8a7c4b49d6b4d78efbe426e410730e6267d182') + 'faced4eb4c47c4eb1a9ee8a5bf8a7c4b49d6b4d78efbe426e410730e6267d182' + '937dc895b4f5948381775a75bd198ed2f157a9f356da0ab5a5006f9f1dacde5c') _kernelname=${pkgbase#linux-libre} -_localversionname=-LIBRE-PAE +_localversionname=-libre-pae prepare() { cd "${srcdir}/linux-${_basekernel}" @@ -49,6 +56,10 @@ prepare() { # (relevant patch sent upstream: https://lkml.org/lkml/2011/7/26/227) patch -p1 -i "${srcdir}/change-default-console-loglevel.patch" + # fix efistub hang #33745 + # https://git.kernel.org/cgit/linux/kernel/git/mfleming/efi.git/patch/?id=c7fb93ec51d462ec3540a729ba446663c26a0505 + patch -Np1 -i "${srcdir}/0013-efistub-fix.patch" + cat "${srcdir}/config" > ./.config # simpler if [ "${_kernelname}" != "" ]; then @@ -131,10 +142,10 @@ _package() { # 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}${_localversionname:--LIBRE-PAE}" "${pkgdir}/lib/modules/${_kernver}/extramodules" + ln -s "../extramodules-${_basekernel}${_localversionname:--libre-pae}" "${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}${_localversionname:--LIBRE-PAE}" - echo "${_kernver}" > "${pkgdir}/lib/modules/extramodules-${_basekernel}${_localversionname:--LIBRE-PAE}/version" + mkdir -p "${pkgdir}/lib/modules/extramodules-${_basekernel}${_localversionname:--libre-pae}" + echo "${_kernver}" > "${pkgdir}/lib/modules/extramodules-${_basekernel}${_localversionname:--libre-pae}/version" # Now we call depmod... depmod -b "${pkgdir}" -F System.map "${_kernver}" @@ -178,12 +189,6 @@ _package-headers() { cp Module.symvers "${pkgdir}/usr/lib/modules/${_kernver}/build" cp -a scripts "${pkgdir}/usr/lib/modules/${_kernver}/build" - if [ "$CARCH" = "mips64el" ]; then - cp arch/${KARCH}/Kbuild "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/" - cp -a arch/${KARCH}/loongson "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/" - cp ${srcdir}/Kbuild.platforms "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/" - fi - # fix permissions on scripts dir chmod og-w -R "${pkgdir}/usr/lib/modules/${_kernver}/build/scripts" mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/.tmp_versions" diff --git a/kernels/linux-libre-pae/config b/kernels/linux-libre-pae/config index 6f125c901..a294ac994 100644 --- a/kernels/linux-libre-pae/config +++ b/kernels/linux-libre-pae/config @@ -48,7 +48,7 @@ CONFIG_BUILDTIME_EXTABLE_SORT=y CONFIG_INIT_ENV_ARG_LIMIT=32 CONFIG_CROSS_COMPILE="" # CONFIG_COMPILE_TEST is not set -CONFIG_LOCALVERSION="-LIBRE-PAE" +CONFIG_LOCALVERSION="-libre-pae" CONFIG_LOCALVERSION_AUTO=y CONFIG_HAVE_KERNEL_GZIP=y CONFIG_HAVE_KERNEL_BZIP2=y diff --git a/kernels/linux-libre-pae/linux-libre-pae.install b/kernels/linux-libre-pae/linux-libre-pae.install index 6241e6ea2..36d1edc78 100644 --- a/kernels/linux-libre-pae/linux-libre-pae.install +++ b/kernels/linux-libre-pae/linux-libre-pae.install @@ -8,10 +8,8 @@ post_install () { # updating module dependencies echo ">>> Updating module dependencies. Please wait ..." depmod ${KERNEL_VERSION} - if command -v mkinitcpio 2>&1 > /dev/null; then - echo ">>> Generating initial ramdisk, using mkinitcpio. Please wait..." - mkinitcpio -p linux-libre${KERNEL_NAME} - fi + echo ">>> Generating initial ramdisk, using mkinitcpio. Please wait..." + mkinitcpio -p linux-libre${KERNEL_NAME} } post_upgrade() { @@ -22,10 +20,8 @@ post_upgrade() { # updating module dependencies echo ">>> Updating module dependencies. Please wait ..." depmod ${KERNEL_VERSION} - if command -v mkinitcpio 2>&1 > /dev/null; then - echo ">>> Generating initial ramdisk, using mkinitcpio. Please wait..." - mkinitcpio -p linux-libre${KERNEL_NAME} - fi + echo ">>> Generating initial ramdisk, using mkinitcpio. Please wait..." + mkinitcpio -p linux-libre${KERNEL_NAME} if [ $(vercmp $2 3.13) -lt 0 ]; then echo ">>> WARNING: AT keyboard support is no longer built into the kernel." diff --git a/kernels/linux-libre-xen/0013-efistub-fix.patch b/kernels/linux-libre-xen/0013-efistub-fix.patch new file mode 100644 index 000000000..a2da3b63a --- /dev/null +++ b/kernels/linux-libre-xen/0013-efistub-fix.patch @@ -0,0 +1,177 @@ +From c7fb93ec51d462ec3540a729ba446663c26a0505 Mon Sep 17 00:00:00 2001 +From: Michael Brown <mbrown@fensystems.co.uk> +Date: Thu, 10 Jul 2014 12:26:20 +0100 +Subject: x86/efi: Include a .bss section within the PE/COFF headers +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The PE/COFF headers currently describe only the initialised-data +portions of the image, and result in no space being allocated for the +uninitialised-data portions. Consequently, the EFI boot stub will end +up overwriting unexpected areas of memory, with unpredictable results. + +Fix by including a .bss section in the PE/COFF headers (functionally +equivalent to the init_size field in the bzImage header). + +Signed-off-by: Michael Brown <mbrown@fensystems.co.uk> +Cc: Thomas Bächler <thomas@archlinux.org> +Cc: Josh Boyer <jwboyer@fedoraproject.org> +Cc: <stable@vger.kernel.org> +Signed-off-by: Matt Fleming <matt.fleming@intel.com> + +diff --git a/arch/x86/boot/header.S b/arch/x86/boot/header.S +index 84c2234..7a6d43a 100644 +--- a/arch/x86/boot/header.S ++++ b/arch/x86/boot/header.S +@@ -91,10 +91,9 @@ bs_die: + + .section ".bsdata", "a" + bugger_off_msg: +- .ascii "Direct floppy boot is not supported. " +- .ascii "Use a boot loader program instead.\r\n" ++ .ascii "Use a boot loader.\r\n" + .ascii "\n" +- .ascii "Remove disk and press any key to reboot ...\r\n" ++ .ascii "Remove disk and press any key to reboot...\r\n" + .byte 0 + + #ifdef CONFIG_EFI_STUB +@@ -108,7 +107,7 @@ coff_header: + #else + .word 0x8664 # x86-64 + #endif +- .word 3 # nr_sections ++ .word 4 # nr_sections + .long 0 # TimeDateStamp + .long 0 # PointerToSymbolTable + .long 1 # NumberOfSymbols +@@ -250,6 +249,25 @@ section_table: + .word 0 # NumberOfLineNumbers + .long 0x60500020 # Characteristics (section flags) + ++ # ++ # The offset & size fields are filled in by build.c. ++ # ++ .ascii ".bss" ++ .byte 0 ++ .byte 0 ++ .byte 0 ++ .byte 0 ++ .long 0 ++ .long 0x0 ++ .long 0 # Size of initialized data ++ # on disk ++ .long 0x0 ++ .long 0 # PointerToRelocations ++ .long 0 # PointerToLineNumbers ++ .word 0 # NumberOfRelocations ++ .word 0 # NumberOfLineNumbers ++ .long 0xc8000080 # Characteristics (section flags) ++ + #endif /* CONFIG_EFI_STUB */ + + # Kernel attributes; used by setup. This is part 1 of the +diff --git a/arch/x86/boot/tools/build.c b/arch/x86/boot/tools/build.c +index 1a2f212..a7661c4 100644 +--- a/arch/x86/boot/tools/build.c ++++ b/arch/x86/boot/tools/build.c +@@ -143,7 +143,7 @@ static void usage(void) + + #ifdef CONFIG_EFI_STUB + +-static void update_pecoff_section_header(char *section_name, u32 offset, u32 size) ++static void update_pecoff_section_header_fields(char *section_name, u32 vma, u32 size, u32 datasz, u32 offset) + { + unsigned int pe_header; + unsigned short num_sections; +@@ -164,10 +164,10 @@ static void update_pecoff_section_header(char *section_name, u32 offset, u32 siz + put_unaligned_le32(size, section + 0x8); + + /* section header vma field */ +- put_unaligned_le32(offset, section + 0xc); ++ put_unaligned_le32(vma, section + 0xc); + + /* section header 'size of initialised data' field */ +- put_unaligned_le32(size, section + 0x10); ++ put_unaligned_le32(datasz, section + 0x10); + + /* section header 'file offset' field */ + put_unaligned_le32(offset, section + 0x14); +@@ -179,6 +179,11 @@ static void update_pecoff_section_header(char *section_name, u32 offset, u32 siz + } + } + ++static void update_pecoff_section_header(char *section_name, u32 offset, u32 size) ++{ ++ update_pecoff_section_header_fields(section_name, offset, size, size, offset); ++} ++ + static void update_pecoff_setup_and_reloc(unsigned int size) + { + u32 setup_offset = 0x200; +@@ -203,9 +208,6 @@ static void update_pecoff_text(unsigned int text_start, unsigned int file_sz) + + pe_header = get_unaligned_le32(&buf[0x3c]); + +- /* Size of image */ +- put_unaligned_le32(file_sz, &buf[pe_header + 0x50]); +- + /* + * Size of code: Subtract the size of the first sector (512 bytes) + * which includes the header. +@@ -220,6 +222,22 @@ static void update_pecoff_text(unsigned int text_start, unsigned int file_sz) + update_pecoff_section_header(".text", text_start, text_sz); + } + ++static void update_pecoff_bss(unsigned int file_sz, unsigned int init_sz) ++{ ++ unsigned int pe_header; ++ unsigned int bss_sz = init_sz - file_sz; ++ ++ pe_header = get_unaligned_le32(&buf[0x3c]); ++ ++ /* Size of uninitialized data */ ++ put_unaligned_le32(bss_sz, &buf[pe_header + 0x24]); ++ ++ /* Size of image */ ++ put_unaligned_le32(init_sz, &buf[pe_header + 0x50]); ++ ++ update_pecoff_section_header_fields(".bss", file_sz, bss_sz, 0, 0); ++} ++ + static int reserve_pecoff_reloc_section(int c) + { + /* Reserve 0x20 bytes for .reloc section */ +@@ -259,6 +277,8 @@ static void efi_stub_entry_update(void) + static inline void update_pecoff_setup_and_reloc(unsigned int size) {} + static inline void update_pecoff_text(unsigned int text_start, + unsigned int file_sz) {} ++static inline void update_pecoff_bss(unsigned int file_sz, ++ unsigned int init_sz) {} + static inline void efi_stub_defaults(void) {} + static inline void efi_stub_entry_update(void) {} + +@@ -310,7 +330,7 @@ static void parse_zoffset(char *fname) + + int main(int argc, char ** argv) + { +- unsigned int i, sz, setup_sectors; ++ unsigned int i, sz, setup_sectors, init_sz; + int c; + u32 sys_size; + struct stat sb; +@@ -376,7 +396,9 @@ int main(int argc, char ** argv) + buf[0x1f1] = setup_sectors-1; + put_unaligned_le32(sys_size, &buf[0x1f4]); + +- update_pecoff_text(setup_sectors * 512, sz + i + ((sys_size * 16) - sz)); ++ update_pecoff_text(setup_sectors * 512, i + (sys_size * 16)); ++ init_sz = get_unaligned_le32(&buf[0x260]); ++ update_pecoff_bss(i + (sys_size * 16), init_sz); + + efi_stub_entry_update(); + +-- +cgit v0.10.1 + diff --git a/kernels/linux-libre-xen/PKGBUILD b/kernels/linux-libre-xen/PKGBUILD index bdbc9d9d8..4514af889 100644 --- a/kernels/linux-libre-xen/PKGBUILD +++ b/kernels/linux-libre-xen/PKGBUILD @@ -1,6 +1,6 @@ -# $Id$ -# Maintainer (Arch): Tobias Powalowski <tpowa@archlinux.org> -# Maintainer (Arch): Thomas Baechler <thomas@archlinux.org> +# $Id: PKGBUILD 216782 2014-07-11 06:19:46Z tpowa $ +# Contributor (Arch): Tobias Powalowski <tpowa@archlinux.org> +# Contributor (Arch): Thomas Baechler <thomas@archlinux.org> # Maintainer: André Silva <emulatorman@parabola.nu> # Contributor: Nicolás Reynolds <fauno@kiwwwi.com.ar> # Contributor: Sorin-Mihai Vârgolici <smv@yobicore.org> @@ -8,47 +8,41 @@ # Contributor: Márcio Silva <coadde@parabola.nu> # Contributor: Luke Shumaker <lukeshu@sbcglobal.net> -pkgbase=linux-libre-xen - -_srcbase=linux -_srcmajor=3.15 -_srcminor=3 -pkgver=${_srcmajor}.${_srcminor} - +pkgbase=linux-libre-xen # Build stock -LIBRE-XEN kernel +#pkgbase=linux-libre-custom # Build kernel with a different name +_basekernel=3.15 +pkgver=${_basekernel}.5 pkgrel=2 arch=('i686') url="http://linux-libre.fsfla.org/" license=('GPL2') makedepends=('xmlto' 'docbook-xsl' 'kmod' 'inetutils' 'bc') options=('!strip') -source=("http://linux-libre.fsfla.org/pub/linux-libre/releases/${_srcmajor}-gnu/linux-libre-${_srcmajor}-gnu.tar.xz" +source=("http://linux-libre.fsfla.org/pub/linux-libre/releases/${_basekernel}-gnu/linux-libre-${_basekernel}-gnu.tar.xz" + "http://linux-libre.fsfla.org/pub/linux-libre/releases/${pkgver}-gnu/patch-${_basekernel}-gnu-${pkgver}-gnu.xz" # the main kernel config files 'config' # standard config files for mkinitcpio ramdisk - 'linux.preset' + "${pkgbase}.preset" 'boot-logo.patch' 'change-default-console-loglevel.patch' - ) -if [[ $pkgver != $_srcmajor ]]; then - source+=("http://linux-libre.fsfla.org/pub/linux-libre/releases/${pkgver}-gnu/patch-${_srcmajor}-gnu-${pkgver}-gnu.xz") -fi - + '0013-efistub-fix.patch') sha256sums=('93450dc189131b6a4de862f35c5087a58cc7bae1c24caa535d2357cc3301b688' + '17ee14d488733298eef21d4a82986376199d92150ed9de00c25f5d9997eb02ae' '276d16a06e9fa55b79e2f5604a500071b6a42f00836175aa3e4b045f469d43a8' - 'f0d90e756f14533ee67afda280500511a62465b4f76adcc5effa95a40045179c' + '7a475ada892857397cf80d2de777825ae94758dc2d9dfa3754ae3d670f4a2f02' '8303b426b1a6dce456b2350003558ae312d21cab0ae6c1f0d7b9d21395f4e177' 'faced4eb4c47c4eb1a9ee8a5bf8a7c4b49d6b4d78efbe426e410730e6267d182' - 'dfd23e705edfc0f6fcf0df1a98e58ec7ae835ec780d7092810b664093d91cd5f') + '937dc895b4f5948381775a75bd198ed2f157a9f356da0ab5a5006f9f1dacde5c') -_srcname=linux-${_srcmajor} -_kernelname=${pkgbase#linux} -_replaces=(kernel26 kernel26-libre linux) +_kernelname=${pkgbase#linux-libre} +_localversionname=-libre-xen prepare() { - cd "${srcdir}/${_srcname}" + cd "${srcdir}/linux-${_basekernel}" - if [ "${_srcmajor}" != "${pkgver}" ]; then - patch -p1 -i "${srcdir}/patch-${_srcmajor}-gnu-${pkgver}-gnu" + if [ "${_basekernel}" != "${pkgver}" ]; then + patch -p1 -i "${srcdir}/patch-${_basekernel}-gnu-${pkgver}-gnu" fi # add freedo as boot logo @@ -62,10 +56,14 @@ prepare() { # (relevant patch sent upstream: https://lkml.org/lkml/2011/7/26/227) patch -p1 -i "${srcdir}/change-default-console-loglevel.patch" - cat "${srcdir}/config" > ./.config + # fix efistub hang #33745 + # https://git.kernel.org/cgit/linux/kernel/git/mfleming/efi.git/patch/?id=c7fb93ec51d462ec3540a729ba446663c26a0505 + patch -Np1 -i "${srcdir}/0013-efistub-fix.patch" + + cat "${srcdir}/config" > ./.config # simpler 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 @@ -91,23 +89,23 @@ prepare() { } build() { - cd "${srcdir}/${_srcname}" + cd "${srcdir}/linux-${_basekernel}" make ${MAKEFLAGS} LOCALVERSION= bzImage modules } _package() { - pkgdesc="The ${pkgbase/linux/Linux} kernel and modules" + pkgdesc="The ${pkgbase^} kernel and modules with Xen guest support" [ "${pkgbase}" = "linux-libre" ] && groups=('base') depends=('coreutils' 'linux-libre-firmware' 'kmod' 'mkinitcpio>=0.7') optdepends=('crda: to set the correct wireless channels of your country') - provides=( "${_replaces[@]/%/${_kernelname#-libre}=${pkgver}}") - conflicts=("${_replaces[@]/%/${_kernelname#-libre}}") - replaces=( "${_replaces[@]/%/${_kernelname#-libre}}") + 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=linux.install + install=${pkgbase}.install - cd "${srcdir}/${_srcname}" + cd "${srcdir}/linux-${_basekernel}" KARCH=x86 @@ -118,7 +116,7 @@ _package() { mkdir -p "${pkgdir}"/{lib/modules,lib/firmware,boot} make LOCALVERSION= INSTALL_MOD_PATH="${pkgdir}" modules_install - cp arch/$KARCH/boot/bzImage "${pkgdir}/boot/vmlinuz-${pkgbase}" + cp arch/${KARCH}/boot/bzImage "${pkgdir}/boot/vmlinuz-${pkgbase}" # set correct depmod command for install cp -f "${startdir}/${install}" "${startdir}/${install}.pkg" @@ -129,9 +127,9 @@ _package() { -i "${startdir}/${install}" # install mkinitcpio preset file for kernel - install -D -m644 "${srcdir}/linux.preset" "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset" + install -D -m644 "${srcdir}/${pkgbase}.preset" "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset" sed \ - -e "1s|'linux.*'|'${pkgbase}'|" \ + -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\"|" \ @@ -144,10 +142,10 @@ _package() { # 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:--ARCH}" "${pkgdir}/lib/modules/${_kernver}/extramodules" + ln -s "../extramodules-${_basekernel}${_localversionname:--libre-xen}" "${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:--ARCH}" - echo "${_kernver}" > "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:--ARCH}/version" + mkdir -p "${pkgdir}/lib/modules/extramodules-${_basekernel}${_localversionname:--libre-xen}" + echo "${_kernver}" > "${pkgdir}/lib/modules/extramodules-${_basekernel}${_localversionname:--libre-xen}/version" # Now we call depmod... depmod -b "${pkgdir}" -F System.map "${_kernver}" @@ -161,16 +159,14 @@ _package() { } _package-headers() { - pkgdesc="Header files and scripts for building modules for ${pkgbase/linux/Linux} kernel" - provides=( "${_replaces[@]/%/${_kernelname#-libre}-headers=${pkgver}}") - conflicts=("${_replaces[@]/%/${_kernelname#-libre}-headers}") - replaces=( "${_replaces[@]/%/${_kernelname#-libre}-headers}") - - KARCH=x86 + 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") install -dm755 "${pkgdir}/usr/lib/modules/${_kernver}" - cd "${srcdir}/${_srcname}" + cd "${srcdir}/linux-${_basekernel}" install -D -m644 Makefile \ "${pkgdir}/usr/lib/modules/${_kernver}/build/Makefile" install -D -m644 kernel/Makefile \ @@ -282,12 +278,12 @@ _package-headers() { } _package-docs() { - pkgdesc="Kernel hackers manual - HTML documentation that comes with the ${pkgbase/linux/Linux} kernel" - provides=( "${_replaces[@]/%/${_kernelname#-libre}-docs=${pkgver}}") - conflicts=("${_replaces[@]/%/${_kernelname#-libre}-docs}") - replaces=( "${_replaces[@]/%/${_kernelname#-libre}-docs}") + pkgdesc="Kernel hackers manual - HTML documentation that comes with the ${pkgbase^} kernel" + provides=("kernel26${_kernelname}-docs=${pkgver}" "linux${_kernelname}-docs=${pkgver}") + conflicts=("kernel26${_kernelname}-docs" "kernel26-libre${_kernelname}-docs" "linux${_kernelname}-docs") + replaces=("kernel26${_kernelname}-docs" "kernel26-libre${_kernelname}-docs" "linux${_kernelname}-docs") - cd "${srcdir}/${_srcname}" + cd "${srcdir}/linux-${_basekernel}" mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build" cp -al Documentation "${pkgdir}/usr/lib/modules/${_kernver}/build" diff --git a/kernels/linux-libre-xen/linux.install b/kernels/linux-libre-xen/linux-libre-xen.install index ef4241383..388c1172e 100644 --- a/kernels/linux-libre-xen/linux.install +++ b/kernels/linux-libre-xen/linux-libre-xen.install @@ -1,7 +1,7 @@ # arg 1: the new package version # arg 2: the old package version -KERNEL_NAME= +KERNEL_NAME=-xen KERNEL_VERSION= post_install () { @@ -9,7 +9,7 @@ post_install () { echo ">>> Updating module dependencies. Please wait ..." depmod ${KERNEL_VERSION} echo ">>> Generating initial ramdisk, using mkinitcpio. Please wait..." - mkinitcpio -p linux${KERNEL_NAME} + mkinitcpio -p linux-libre${KERNEL_NAME} } post_upgrade() { @@ -21,7 +21,7 @@ post_upgrade() { echo ">>> Updating module dependencies. Please wait ..." depmod ${KERNEL_VERSION} echo ">>> Generating initial ramdisk, using mkinitcpio. Please wait..." - mkinitcpio -p linux${KERNEL_NAME} + mkinitcpio -p linux-libre${KERNEL_NAME} if [ $(vercmp $2 3.13) -lt 0 ]; then echo ">>> WARNING: AT keyboard support is no longer built into the kernel." @@ -32,6 +32,6 @@ post_upgrade() { post_remove() { # also remove the compat symlinks - rm -f boot/initramfs-linux${KERNEL_NAME}.img - rm -f boot/initramfs-linux${KERNEL_NAME}-fallback.img + rm -f boot/initramfs-linux-libre${KERNEL_NAME}.img + rm -f boot/initramfs-linux-libre${KERNEL_NAME}-fallback.img } diff --git a/kernels/linux-libre-xen/linux-libre-xen.preset b/kernels/linux-libre-xen/linux-libre-xen.preset new file mode 100644 index 000000000..6d5019d92 --- /dev/null +++ b/kernels/linux-libre-xen/linux-libre-xen.preset @@ -0,0 +1,14 @@ +# mkinitcpio preset file for the 'linux-libre-xen' package + +ALL_config="/etc/mkinitcpio.conf" +ALL_kver="/boot/vmlinuz-linux-libre-xen" + +PRESETS=('default' 'fallback') + +#default_config="/etc/mkinitcpio.conf" +default_image="/boot/initramfs-linux-libre-xen.img" +#default_options="" + +#fallback_config="/etc/mkinitcpio.conf" +fallback_image="/boot/initramfs-linux-libre-xen-fallback.img" +fallback_options="-S autodetect" diff --git a/kernels/linux-libre-xen/linux.preset b/kernels/linux-libre-xen/linux.preset deleted file mode 100644 index b06292d10..000000000 --- a/kernels/linux-libre-xen/linux.preset +++ /dev/null @@ -1,14 +0,0 @@ -# mkinitcpio preset file for the 'linux' package - -ALL_config="/etc/mkinitcpio.conf" -ALL_kver="/boot/vmlinuz-linux" - -PRESETS=('default' 'fallback') - -#default_config="/etc/mkinitcpio.conf" -default_image="/boot/initramfs-linux.img" -#default_options="" - -#fallback_config="/etc/mkinitcpio.conf" -fallback_image="/boot/initramfs-linux-fallback.img" -fallback_options="-S autodetect" |