Skip to content
Snippets Groups Projects
Unverified Commit ec55e7b9 authored by Connor Eliffe's avatar Connor Eliffe
Browse files

amazon-tate: new device (MR 5473)

parent 315d85a7
No related branches found
No related tags found
No related merge requests found
Showing
with 3323 additions and 0 deletions
# Reference: <https://postmarketos.org/devicepkg>
pkgname=device-amazon-tate
pkgdesc="Amazon Kindle Fire HD (2nd Generation)"
pkgver=1
pkgrel=1
url="https://postmarketos.org"
license="MIT"
arch="armv7"
options="!check !archcheck"
depends="
postmarketos-base
linux-amazon-tate
mkbootimg
"
makedepends="devicepkg-dev"
source="
deviceinfo
initfs-hook.sh
amazon-omap-boot-hack.sh
"
build() {
devicepkg_build $startdir $pkgname
}
package() {
devicepkg_package $startdir $pkgname
install -Dm755 "$srcdir/amazon-omap-boot-hack.sh" "$pkgdir/usr/share/mkinitfs/amazon-omap-boot-hack.sh"
}
sha512sums="
2e06c09046be664bbba5d55aafb06aceafbf41777bf116caa508d461190d546cc7ceae5160f0582dee20d88b5998837c00ffc3de928d1e5892bb32485523ce79 deviceinfo
1aca985770246b9ca140996a498815b5c9ca3458a6cb84db85825344f01deda8b1de7c88e2e0c610df636ad2179faac7fd90d9992add51186a6449f2d43a3f71 initfs-hook.sh
a5027ac9f113018d55e4c5fc065b0498d0a50df099a348fe38d6b841087aa285a8d67b400b9fe88007f41d0fd79c2fe69d62300af6963ecb40c5fb2353cbabf1 amazon-omap-boot-hack.sh
"
#!/bin/sh
echo "==> Amending boot.img for Amazon signature verification exploit"
BOWSER_HEADER_DATA='\x50\x03\x00\x00\x00\x25\xe4\x00'
BOWSER_HEADER_SIZE=1024
BOWSER_HEADER_OFFSET=52
tempfile=$(mktemp)
bootimgfile=$(echo "${1}" | sed 's/initramfs/boot.img/g')
dd if=/dev/zero of="${tempfile}" bs=$BOWSER_HEADER_SIZE count=1
printf "%b" $BOWSER_HEADER_DATA | dd of="${tempfile}" bs=$BOWSER_HEADER_OFFSET seek=1 conv=notrunc
cat "${bootimgfile}" >> "${tempfile}"
mv "${tempfile}" "${bootimgfile}"
# Reference: <https://postmarketos.org/deviceinfo>
# Please use double quotes only. You can source this file in shell
# scripts.
deviceinfo_format_version="0"
deviceinfo_name="Amazon Kindle Fire HD (2nd Generation)"
deviceinfo_manufacturer="Amazon"
deviceinfo_codename="amazon-tate"
deviceinfo_year="2012"
deviceinfo_arch="armv7"
# Device related
deviceinfo_gpu_accelerated="false"
deviceinfo_chassis="tablet"
deviceinfo_keyboard="false"
deviceinfo_external_storage="false"
deviceinfo_screen_width="800"
deviceinfo_screen_height="1280"
# Bootloader related
deviceinfo_flash_method="fastboot"
deviceinfo_kernel_cmdline="console=tty0 ignore_loglevel mem=1G init=/init"
deviceinfo_generate_bootimg="true"
deviceinfo_bootimg_qcdt="false"
deviceinfo_bootimg_mtk_mkimage="false"
deviceinfo_bootimg_dtb_second="false"
deviceinfo_mkinitfs_postprocess="/usr/share/mkinitfs/amazon-omap-boot-hack.sh"
deviceinfo_flash_offset_base="0x80000000"
deviceinfo_flash_offset_kernel="0x00008000"
deviceinfo_flash_offset_ramdisk="0x01000000"
deviceinfo_flash_offset_second="0x00f00000"
deviceinfo_flash_offset_tags="0x00000100"
deviceinfo_flash_pagesize="2048"
# Lab126, Inc.
deviceinfo_usb_idVendor="0x1949"
# Kindle
deviceinfo_usb_idProduct="0x0007"
#!/bin/sh
# Turn overlay0 off and on again to remove bootloader screen
echo 0 > /sys/devices/platform/omapdss/overlay0/enabled
echo 1 > /sys/devices/platform/omapdss/overlay0/enabled
# Reference: <https://postmarketos.org/vendorkernel>
# Kernel config based on: arch/arm/configs/android_tate_defconfig
pkgname=linux-amazon-tate
pkgver=3.0.72
pkgrel=1
pkgdesc="Amazon Kindle Fire HD (2nd Generation) kernel fork"
arch="armv7"
_carch="arm"
_flavor="amazon-tate"
url="https://kernel.org"
license="GPL-2.0-only"
options="!strip !check !tracedeps pmb:cross-native"
makedepends="bash bc bison devicepkg-dev flex openssl-dev perl xz gcc6"
# Compiler: GCC 6 (doesn't boot when compiled with newer versions)
if [ "${CC:0:5}" != "gcc6-" ]; then
CC="gcc6-$CC"
HOSTCC="gcc6-gcc"
CROSS_COMPILE="gcc6-$CROSS_COMPILE"
fi
# Source
_repository="android_kernel_amazon_bowser-common"
_commit="1364d678a9f79abb6ab9310669700e6fabb51a24"
_config="config-$_flavor.$arch"
source="
$pkgname-$_commit.tar.gz::https://github.com/LineageOS/$_repository/archive/$_commit.tar.gz
$_config
gcc10-extern_YYLOC_global_declaration.patch
kernel-use-the-gnu89-standard-explicitly.patch
linux3.0-fix-piggy.lzma.S.patch
linux3.0-fix-piggy.lzo.S.patch
tate-fix-sun-solaris-style-flag-on-section.patch
revert_sysfs_readdir_lseek_race_fix.patch
ifdef-audio-dep-hdmi.patch
"
builddir="$srcdir/$_repository-$_commit"
_outdir="out"
prepare() {
default_prepare
. downstreamkernel_prepare
}
build() {
unset LDFLAGS
make O="$_outdir" ARCH="$_carch" CC="${CC:-gcc}" \
CFLAGS_MODULE=-fno-pic \
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-postmarketOS"
}
package() {
downstreamkernel_package "$builddir" "$pkgdir" "$_carch" "$_flavor" "$_outdir"
make modules_install \
O="$_outdir" ARCH="$_carch" \
CC="${CC:-gcc}" \
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-postmarketOS" \
INSTALL_MOD_STRIP=1 \
INSTALL_MOD_PATH="$pkgdir"
}
sha512sums="
4a50a9beb3238adaf19b222e66216ce4ddee930d21f8d80ad43bcd557a7ba169687d3cb61479a7d2e79f898c9416a4fe520e0d681f46bb4370956c16cc36a47c linux-amazon-tate-1364d678a9f79abb6ab9310669700e6fabb51a24.tar.gz
f5fb6d2f80b635f813151c03014e628467a3f17e5958043155d270078d2146a28b6c055bf8f61d28d04e37857d8219c9e8381145320c65240e8ae67126d374fa config-amazon-tate.armv7
2b48f1bf0e3f70703d2cdafc47d5e615cc7c56c70bec56b2e3297d3fa4a7a1321d649a8679614553dde8fe52ff1051dae38d5990e3744c9ca986d92187dcdbeb gcc10-extern_YYLOC_global_declaration.patch
ad0182a483791fc88e058838bc331b2f04a75ba291e763767babdb815efadfc3b4fda97e69e2e3f00a426cabea088e35297a92bd287592597d1e309be68ee92c kernel-use-the-gnu89-standard-explicitly.patch
3c098328e45db14cbeff6a515bb373129e0d0983884178f413c5a4206704b356ddecdf58557a04b828b391dbfef3cea0e98b47834aa97b86496aa2fce0013b92 linux3.0-fix-piggy.lzma.S.patch
8837c884060d87232ba3fa9fce0e815d7ddf33c82ad49260426fe83754baa2f4d92a36a17561083ac8b3674564b7433b3141cacc63b520deec52bbcc1d92d5c9 linux3.0-fix-piggy.lzo.S.patch
2027d4a68d9537b9d487572c8de6a68e9608087156b4fbc185cd6bd9df2dd4147d9f0e517fd50e653c4d73584df3977d739561446ee00c9409015ffa138f732b tate-fix-sun-solaris-style-flag-on-section.patch
03a694cf3a6659afc6439df3cfff3c37b6bdcce05cd6286b97c8fc1892a8c3985bfce64e574a23ba79de8bd614f4b5b57fb9dd18b8640ef8786f533e5c88530d revert_sysfs_readdir_lseek_race_fix.patch
d4e6b179e3fc875c4aa5ac204c3cb9d14c85fa66b0d5ded55a10ab3f342f953083635a575fbc5092b66e5994a037b670b68cdb5217356db10eae587d306738aa ifdef-audio-dep-hdmi.patch
"
This diff is collapsed.
../../.shared-patches/linux/gcc10-extern_YYLOC_global_declaration.patch
\ No newline at end of file
Ifdef a few HDMI audio function calls behind the relevant SoC HDMI audio flag.
Temporarily needed to avoid kernel hangs caused by interacting with audio.
diff --git a/drivers/video/omap2/dss/hdmi_panel.c b/drivers/video/omap2/dss/hdmi_panel.c
index 8503459e83c..696629debde 100644
--- a/drivers/video/omap2/dss/hdmi_panel.c
+++ b/drivers/video/omap2/dss/hdmi_panel.c
@@ -42,7 +42,9 @@ static ssize_t hdmi_audio_max_channel_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
int r;
+#ifdef CONFIG_SND_OMAP_SOC_OMAP4_HDMI
r = hdmi_audio_get_max_channels();
+#endif
return snprintf(buf, PAGE_SIZE, "%d\n", r);
}
@@ -335,7 +337,9 @@ static void hdmi_hotplug_detect_worker(struct work_struct *work)
mutex_unlock(&hdmi.hdmi_lock);
dssdev->driver->disable(dssdev);
omapdss_hdmi_enable_s3d(false);
+#ifdef CONFIG_SND_OMAP_SOC_OMAP4_HDMI
hdmi_audio_update_edid_info();
+#endif
mutex_lock(&hdmi.hdmi_lock);
}
goto done;
@@ -358,7 +362,9 @@ static void hdmi_hotplug_detect_worker(struct work_struct *work)
dssdev->panel.monspecs.max_x * 10000;
dssdev->panel.height_in_um =
dssdev->panel.monspecs.max_y * 10000;
+#ifdef CONFIG_SND_OMAP_SOC_OMAP4_HDMI
hdmi_audio_update_edid_info();
+#endif
hdmi_inform_hpd_to_cec(true);
switch_set_state(&hdmi.hpd_switch, 1);
goto done;
../../.shared-patches/linux/kernel-use-the-gnu89-standard-explicitly.patch
\ No newline at end of file
../../.shared-patches/linux/linux3.0-fix-piggy.lzma.S.patch
\ No newline at end of file
../../.shared-patches/linux/linux3.0-fix-piggy.lzo.S.patch
\ No newline at end of file
commit bb5489176fda28aff304b59e0405f7d7d4906224
Author: Jiri Kosina <jkosina@suse.cz>
Date: Mon Apr 22 15:40:15 2013 +0200
Revert "sysfs: fix race between readdir and lseek"
This reverts commit 991f76f837bf22c5bb07261cfd86525a0a96650c in Linus'
tree which is f366c8f271888f48e15cc7c0ab70f184c220c8a4 in
linux-stable.git
It depends on ef3d0fd27e90f ("vfs: do (nearly) lockless generic_file_llseek")
which is available only in 3.2+.
When applied on 3.0 codebase, it causes A-A deadlock, whenever anyone does
seek() on sysfs, as both generic_file_llseek() and sysfs_dir_llseek() obtain
i_mutex.
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Cc: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index 7cbc5856feea..3ab78b873376 100644
--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -959,21 +959,9 @@ static int sysfs_readdir(struct file * filp, void * dirent, filldir_t filldir)
return 0;
}
-static loff_t sysfs_dir_llseek(struct file *file, loff_t offset, int whence)
-{
- struct inode *inode = file->f_path.dentry->d_inode;
- loff_t ret;
-
- mutex_lock(&inode->i_mutex);
- ret = generic_file_llseek(file, offset, whence);
- mutex_unlock(&inode->i_mutex);
-
- return ret;
-}
-
const struct file_operations sysfs_dir_operations = {
.read = generic_read_dir,
.readdir = sysfs_readdir,
.release = sysfs_dir_release,
- .llseek = sysfs_dir_llseek,
+ .llseek = generic_file_llseek,
};
Replace Solaris-style section flags with GNU equivalent.
The regular version in shared-patches doesn't apply cleanly to this kernel tree,
so a separate patch is needed.
diff --git a/arch/arm/boot/compressed/big-endian.S b/arch/arm/boot/compressed/big-endian.S
index 25ab26f1c6f..f22428e275f 100644
--- a/arch/arm/boot/compressed/big-endian.S
+++ b/arch/arm/boot/compressed/big-endian.S
@@ -5,7 +5,7 @@
* Author: Nicolas Pitre
*/
- .section ".start", #alloc, #execinstr
+ .section ".start", "ax"
mrc p15, 0, r0, c1, c0, 0 @ read control reg
orr r0, r0, #(1 << 7) @ enable big endian mode
diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S
index caddb9d35b7..3ba2ca1b202 100644
--- a/arch/arm/boot/compressed/head.S
+++ b/arch/arm/boot/compressed/head.S
@@ -112,7 +112,7 @@
#endif
.endm
- .section ".start", #alloc, #execinstr
+ .section ".start", "ax"
/*
* sort out different calling conventions
*/
diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S
index f649f1c589e..3ec865c11c9 100644
--- a/arch/arm/mm/proc-v7.S
+++ b/arch/arm/mm/proc-v7.S
@@ -477,7 +477,7 @@ cpu_elf_name:
.size cpu_elf_name, . - cpu_elf_name
.align
- .section ".proc.info.init", #alloc, #execinstr
+ .section ".proc.info.init", "ax"
.type __v7_ca9mp_proc_info, #object
__v7_ca9mp_proc_info:
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment