Better Mozilla Flame device support (#435)

* No need to append DTB to kernel
* Remove kernel module build for now
* Add device-specific firmware package
* Add special partitions to fstab
* Fix typo in screen width
This commit is contained in:
Yuval Adam 2017-08-21 22:38:11 +03:00 committed by Oliver Smith
parent 1e71befed4
commit 645141a5b9
6 changed files with 59 additions and 30 deletions

View file

@ -1,15 +1,15 @@
pkgname=device-mozilla-flame pkgname=device-mozilla-flame
pkgver=1 pkgver=1
pkgrel=1 pkgrel=2
pkgdesc="Mozilla Flame" pkgdesc="Mozilla Flame"
url="https://github.com/postmarketOS" url="https://github.com/postmarketOS"
arch="noarch" arch="noarch"
license="MIT" license="MIT"
depends="linux-mozilla-flame mkbootimg" depends="linux-mozilla-flame firmware-mozilla-flame mkbootimg"
makedepends="" makedepends=""
install="" install="$pkgname.post-install"
subpackages="" subpackages=""
source="deviceinfo initfs-hook.sh 90-android-touch-dev.rules" source="deviceinfo initfs-hook.sh 90-android-touch-dev.rules $install"
options="!check" options="!check"
build() { build() {
@ -25,6 +25,7 @@ package() {
"$pkgdir"/etc/udev/rules.d/90-android-touch-dev.rules "$pkgdir"/etc/udev/rules.d/90-android-touch-dev.rules
} }
sha512sums="e1491537517787e7828ca88e749fefba7aafdc14062ce292e4e39d0cfc215ba79c79a64c5be9f4e65e092aabb060a051472c476d49105ed2e048dda88a0f9edd deviceinfo sha512sums="6fed912ef5850ba75e4b8f5e8dd36141965978faab011c1556a02c6e2ae42d02710b9a9f0e53f08e9c63d95eafce7c748c37928741157fa321d9f4c1ed6bac4a deviceinfo
8590967fa10388a890fdfafdb1070b9ab22dc89e06a3a8834806c772191e3b67de7b914b0d68e5ddf581cee715cb90f3f24abcb8762c415ff328c6da23e55d52 initfs-hook.sh 29f7be2df62a48604cfbb48bc2192ac309b36b0bf0f02819fdbb240868ff382c0cf17baf1ad8c84361474a2218ec34bdb28ae3ccd940b2560d1b1e281449c48d initfs-hook.sh
ee25f3d0377f027d108593eb7953b8db49d7f05a5c36a0c8ca7e7849d15e3c217bc1ac97d77a66e28d2db4b81c0f50b905639911276da40321d2b6cca7f797df 90-android-touch-dev.rules" ee25f3d0377f027d108593eb7953b8db49d7f05a5c36a0c8ca7e7849d15e3c217bc1ac97d77a66e28d2db4b81c0f50b905639911276da40321d2b6cca7f797df 90-android-touch-dev.rules
0a301a723f2a6ad8285fa8c016a73b0d05ae9811a8c96cd73f6db274e85676f7b3d427ede46484665fd613b67ef42330f0b69413328c04c3f489db86c5aa9038 device-mozilla-flame.post-install"

View file

@ -0,0 +1,21 @@
#!/bin/sh
# Add firmware partition mount points
mkdir /data
mkdir /persist
mkdir /modem
# Add firmware partitions to fstab
if [ -z "$(grep /data /etc/fstab)" ]; then
echo "/dev/mmcblk0p29 /data ext4 defaults 0 2" >> /etc/fstab
fi
if [ -z "$(grep /persist /etc/fstab)" ]; then
echo "/dev/mmcblk0p13 /persist ext4 defaults 0 2" >> /etc/fstab
fi
if [ -z "$(grep /modem /etc/fstab)" ]; then
echo "/dev/mmcblk0p1 /modem vfat defaults 0 2" >> /etc/fstab
fi
exit 0

View file

@ -13,7 +13,7 @@ deviceinfo_flash_methods="fastboot"
deviceinfo_arch="armhf" deviceinfo_arch="armhf"
deviceinfo_screen_width="480" deviceinfo_screen_width="480"
deviceinfo_screen_height="864" deviceinfo_screen_height="854"
deviceinfo_generate_bootimg="true" deviceinfo_generate_bootimg="true"
deviceinfo_bootimg_qcdt="true" deviceinfo_bootimg_qcdt="true"

View file

@ -1,4 +1,5 @@
#!/bin/sh #!/bin/sh
# set framebuffer resolution fbdev=/sys/class/graphics/fb0
cat /sys/class/graphics/fb0/modes > /sys/class/graphics/fb0/mode echo "480,1708" > $fbdev/virtual_size
cat $fbdev/modes > $fbdev/mode

View file

@ -20,7 +20,7 @@ case $pkgver in
*.*.*) _kernver=${pkgver%.*};; *.*.*) _kernver=${pkgver%.*};;
*.*) _kernver=$pkgver;; *.*) _kernver=$pkgver;;
esac esac
pkgrel=4 pkgrel=5
arch="armhf" arch="armhf"
pkgdesc="Mozilla flame kernel" pkgdesc="Mozilla flame kernel"
url="https://github.com/mozilla-b2g/codeaurora_kernel_msm" url="https://github.com/mozilla-b2g/codeaurora_kernel_msm"
@ -78,9 +78,6 @@ prepare() {
silentoldconfig silentoldconfig
} }
# this is so we can do: 'abuild menuconfig' to reconfigure kernel
menuconfig() { menuconfig() {
cd "$srcdir"/build || return 1 cd "$srcdir"/build || return 1
make ARCH="$_carch" menuconfig make ARCH="$_carch" menuconfig
@ -95,10 +92,6 @@ build() {
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-Alpine" CONFIG_NO_ERROR_ON_MISMATCH=y DTC_FLAGS="-p 1024" \ KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-Alpine" CONFIG_NO_ERROR_ON_MISMATCH=y DTC_FLAGS="-p 1024" \
|| return 1 || return 1
make ARCH="$_carch" CC="${CC:-gcc}" \
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-Alpine" CONFIG_NO_ERROR_ON_MISMATCH=y modules \
|| return 1
dtbTool -s 2048 -p "scripts/dtc/" -o "arch/arm/boot/dt.img" "arch/arm/boot/" dtbTool -s 2048 -p "scripts/dtc/" -o "arch/arm/boot/dt.img" "arch/arm/boot/"
} }
@ -106,21 +99,10 @@ package() {
cd "$srcdir"/build cd "$srcdir"/build
unset LDFLAGS unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-Alpine" CONFIG_NO_ERROR_ON_MISMATCH=y \
INSTALL_MOD_PATH="${pkgdir}" modules_install
make ARCH="$_carch" CC="${CC:-gcc}" \ make ARCH="$_carch" CC="${CC:-gcc}" \
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-Alpine" CONFIG_NO_ERROR_ON_MISMATCH=y \ KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-Alpine" CONFIG_NO_ERROR_ON_MISMATCH=y \
INSTALL_MOD_PATH="${pkgdir}" firmware_install INSTALL_MOD_PATH="${pkgdir}" firmware_install
rm "${pkgdir}/lib/modules/${pkgver}/build"
install -Dm644 "${srcdir}"/build/Module.symvers "${pkgdir}/lib/modules/${pkgver}/build/Module.symvers"
install -Dm644 "${srcdir}"/build/System.map "${pkgdir}/lib/modules/${pkgver}/build/System.map"
install -Dm644 "${srcdir}"/build/modules.builtin "${pkgdir}/lib/modules/${pkgver}/build/modules.builtin"
install -Dm644 "${srcdir}"/build/modules.order "${pkgdir}/lib/modules/${pkgver}/build/modules.order"
cd ../..
mkdir -p "$pkgdir/usr/lib/linux-mozilla-flame" mkdir -p "$pkgdir/usr/lib/linux-mozilla-flame"
for dtb in $(find "$srcdir/build/arch/arm/boot" -name "*.dtb") for dtb in $(find "$srcdir/build/arch/arm/boot" -name "*.dtb")
do do
@ -130,7 +112,7 @@ package() {
install -Dm644 "$srcdir/build/arch/arm/boot/dt.img" \ install -Dm644 "$srcdir/build/arch/arm/boot/dt.img" \
"$pkgdir/boot/dt.img" "$pkgdir/boot/dt.img"
install -Dm644 "$srcdir/build/arch/arm/boot/zImage-dtb" \ install -Dm644 "$srcdir/build/arch/arm/boot/zImage" \
"$pkgdir/boot/vmlinuz-$_flavor" "$pkgdir/boot/vmlinuz-$_flavor"
install -D "$srcdir/build/include/config/kernel.release" \ install -D "$srcdir/build/include/config/kernel.release" \

View file

@ -0,0 +1,24 @@
pkgname=firmware-mozilla-flame
pkgver=1
pkgrel=1
pkgdesc="Mozilla Flame Firmware"
url="https://github.com/yuvadm/mozilla-flame-firmware"
arch="armhf"
license="proprietary"
depends=""
makedepends=""
install=""
subpackages=""
_hash=503a4052a8bfdc3b4c06533f2d08fe4d6a923842
source=$pkgname-$_hash.zip::$url"/archive/${_hash}.zip"
options="!check !strip"
package() {
mkdir -p "$pkgdir/lib/firmware/postmarketos"
for fw in $(find "${srcdir}/mozilla-flame-firmware-${_hash}/" -type f)
do
install -m644 $fw "$pkgdir/lib/firmware/postmarketos/"
done
}
sha512sums="dc9253f5891a488874879fbe94d9d3e59807f33c91958d9b93fc0b07fe31ca664b9929a98857831be07900280ce4c04c4231ab3951e4f02f81b66dd034354560 firmware-mozilla-flame-503a4052a8bfdc3b4c06533f2d08fe4d6a923842.zip"