mirror of
https://github.com/archlinuxarm/PKGBUILDs.git
synced 2025-01-17 23:34:07 +00:00
ARM Chromebook kernel (for nv-U-Boot setups only!!!)
This commit is contained in:
parent
68159bce10
commit
f7a9389577
5 changed files with 3736 additions and 0 deletions
239
core/linux-chromebook/PKGBUILD
Normal file
239
core/linux-chromebook/PKGBUILD
Normal file
|
@ -0,0 +1,239 @@
|
|||
# Maintainer: stratum nine <strata@dropswitch.net>
|
||||
|
||||
buildarch=4
|
||||
|
||||
pkgbase=linux-chromebook
|
||||
pkgname=('linux-chromebook' 'linux-headers-chromebook')
|
||||
pkgver=20130218
|
||||
_kernelname=${pkgname#linux}
|
||||
_basever=3.4
|
||||
pkgrel=1
|
||||
pkgdesc="Chromium OS kernel with ArchLinux ARM tweaks for SAMSUNG ARM Chromebook."
|
||||
arch=('armv7h')
|
||||
url="http://git.chromium.org/gitweb/?p=chromiumos/third_party/kernel.git;a=summary"
|
||||
license=('GPL2')
|
||||
makedepends=('uboot-mkimage' 'dtc' 'git')
|
||||
|
||||
_gitroot='https://git.chromium.org/git/chromiumos/third_party/kernel.git'
|
||||
_gitname='chromeos-3.4'
|
||||
_gitbranch='chromeos-3.4'
|
||||
|
||||
build() {
|
||||
cd "$srcdir"
|
||||
msg "Connecting to GIT server...."
|
||||
|
||||
if [[ -d "$_gitname" ]]; then
|
||||
cd "$_gitname" && git pull origin
|
||||
msg "The local files are updated."
|
||||
else
|
||||
git clone "$_gitroot" "$_gitname"
|
||||
cd "$_gitname"
|
||||
git checkout "$_gitbranch"
|
||||
fi
|
||||
|
||||
msg "GIT checkout done or server timeout"
|
||||
msg "Starting build..."
|
||||
|
||||
rm -rf "$srcdir/${_gitname}-build"
|
||||
git clone "$srcdir/$_gitname" "$srcdir/${_gitname}-build"
|
||||
cd "$srcdir/${_gitname}-build"
|
||||
|
||||
# set DEFAULT_CONSOLE_LOGLEVEL to 4 (same value as the 'quiet' kernel param)
|
||||
# remove this when a Kconfig knob is made available by upstream
|
||||
# (relevant patch sent upstream: https://lkml.org/lkml/2011/7/26/227)
|
||||
patch -Np1 -i "${srcdir}/../change-default-console-loglevel.patch"
|
||||
|
||||
# Kernel configuration
|
||||
cp "${srcdir}/../config.exynos5" .config
|
||||
|
||||
msg "Get kernel version ..."
|
||||
make prepare
|
||||
|
||||
msg "Building kernel and modules ..."
|
||||
make uImage modules
|
||||
|
||||
msg "Creating .dtb's ..."
|
||||
make dtbs
|
||||
|
||||
msg "Creating FIT image for nv-U-boot ..."
|
||||
cp "${srcdir}/../kernel.its" arch/arm/boot/kernel.its
|
||||
cd arch/arm/boot
|
||||
mkimage -f kernel.its zImage
|
||||
cp -v zImage vmlinux.uimg
|
||||
cd ../../..
|
||||
}
|
||||
|
||||
package_linux-chromebook() {
|
||||
pkgdesc="The Linux Kernel and modules - SAMSUNG ARM Chromebook kernel and modules"
|
||||
depends=('coreutils' 'linux-firmware' 'module-init-tools>=3.16')
|
||||
optdepends=('crda: to set the correct wireless channels of your country')
|
||||
provides=('linux26' "linux=${pkgver}")
|
||||
install=${pkgname}.install
|
||||
|
||||
cd "${srcdir}/${_gitname}-build"
|
||||
|
||||
KARCH=arm
|
||||
|
||||
# get kernel version
|
||||
_kernver="$(make kernelrelease)"
|
||||
|
||||
mkdir -p "${pkgdir}"/{lib/modules,lib/firmware,boot}
|
||||
make INSTALL_MOD_PATH="${pkgdir}" modules_install
|
||||
cp arch/arm/boot/vmlinux.uimg "${pkgdir}/boot/vmlinux.uimg"
|
||||
|
||||
# set correct depmod command for install
|
||||
sed \
|
||||
-e "s/KERNEL_NAME=.*/KERNEL_NAME=${_kernelname}/g" \
|
||||
-e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/g" \
|
||||
-i "${startdir}/${pkgname}.install"
|
||||
|
||||
# remove build and source links
|
||||
rm -f "${pkgdir}"/lib/modules/${_kernver}/{source,build}
|
||||
|
||||
# remove the firmware
|
||||
rm -rf "${pkgdir}/lib/firmware"
|
||||
|
||||
# gzip -9 all modules to save 100MB of space
|
||||
find "${pkgdir}" -name '*.ko' | xargs -P 2 -n 1 gzip -9
|
||||
|
||||
# add real version for building modules and running depmod from post_install/upgrade
|
||||
mkdir -p "${pkgdir}/lib/modules/extramodules-${_basever}"
|
||||
echo "${_kernver}" > "${pkgdir}/lib/modules/extramodules-${_basever}/version"
|
||||
|
||||
# Now we call depmod...
|
||||
depmod -b "$pkgdir" -F System.map "$_kernver"
|
||||
|
||||
# move the module tree /lib -> /usr/lib
|
||||
mkdir -p "${pkgdir}/usr"
|
||||
mv "$pkgdir/lib" "$pkgdir/usr"
|
||||
}
|
||||
|
||||
package_linux-headers-chromebook() {
|
||||
pkgdesc="Header files and scripts for building modules for linux kernel - SAMSUNG ARM Chromebook"
|
||||
provides=("linux-headers=${pkgver}")
|
||||
conflicts=('linux-headers-omap' 'linux-headers-trimslice')
|
||||
|
||||
install -dm755 "${pkgdir}/usr/lib/modules/${_kernver}"
|
||||
|
||||
cd "${pkgdir}/usr/lib/modules/${_kernver}"
|
||||
ln -sf ../../../src/linux-${_kernver} build
|
||||
|
||||
cd "${srcdir}/${_gitname}-build"
|
||||
install -D -m644 Makefile \
|
||||
"${pkgdir}/usr/src/linux-${_kernver}/Makefile"
|
||||
install -D -m644 kernel/Makefile \
|
||||
"${pkgdir}/usr/src/linux-${_kernver}/kernel/Makefile"
|
||||
install -D -m644 .config \
|
||||
"${pkgdir}/usr/src/linux-${_kernver}/.config"
|
||||
|
||||
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/include"
|
||||
|
||||
for i in acpi asm-generic config crypto drm generated linux math-emu \
|
||||
media net pcmcia scsi sound trace video xen; do
|
||||
cp -a include/${i} "${pkgdir}/usr/src/linux-${_kernver}/include/"
|
||||
done
|
||||
|
||||
# copy arch includes for external modules
|
||||
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH
|
||||
cp -a arch/$KARCH/include ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
|
||||
# mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/mach-mx6
|
||||
# cp -a arch/$KARCH/mach-mx6/include ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/mach-mx6/
|
||||
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/plat-samsung
|
||||
cp -a arch/$KARCH/plat-samsung/include ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/plat-samsung/
|
||||
|
||||
# copy files necessary for later builds, like nvidia and vmware
|
||||
cp Module.symvers "${pkgdir}/usr/src/linux-${_kernver}"
|
||||
cp -a scripts "${pkgdir}/usr/src/linux-${_kernver}"
|
||||
|
||||
# fix permissions on scripts dir
|
||||
chmod og-w -R "${pkgdir}/usr/src/linux-${_kernver}/scripts"
|
||||
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/.tmp_versions"
|
||||
|
||||
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/arch/${KARCH}/kernel"
|
||||
|
||||
cp arch/${KARCH}/Makefile "${pkgdir}/usr/src/linux-${_kernver}/arch/${KARCH}/"
|
||||
|
||||
if [ "${CARCH}" = "i686" ]; then
|
||||
cp arch/${KARCH}/Makefile_32.cpu "${pkgdir}/usr/src/linux-${_kernver}/arch/${KARCH}/"
|
||||
fi
|
||||
|
||||
cp arch/${KARCH}/kernel/asm-offsets.s "${pkgdir}/usr/src/linux-${_kernver}/arch/${KARCH}/kernel/"
|
||||
|
||||
# add headers for lirc package
|
||||
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video"
|
||||
|
||||
cp drivers/media/video/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/"
|
||||
|
||||
for i in bt8xx cpia2 cx25840 cx88 em28xx et61x251 pwc saa7134 sn9c102; do
|
||||
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/${i}"
|
||||
cp -a drivers/media/video/${i}/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/${i}"
|
||||
done
|
||||
|
||||
# add docbook makefile
|
||||
install -D -m644 Documentation/DocBook/Makefile \
|
||||
"${pkgdir}/usr/src/linux-${_kernver}/Documentation/DocBook/Makefile"
|
||||
|
||||
# add dm headers
|
||||
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/md"
|
||||
cp drivers/md/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/md"
|
||||
|
||||
# add inotify.h
|
||||
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/include/linux"
|
||||
cp include/linux/inotify.h "${pkgdir}/usr/src/linux-${_kernver}/include/linux/"
|
||||
|
||||
# add wireless headers
|
||||
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/"
|
||||
cp net/mac80211/*.h "${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/"
|
||||
|
||||
# add dvb headers for external modules
|
||||
# in reference to:
|
||||
# http://bugs.archlinux.org/task/9912
|
||||
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core"
|
||||
cp drivers/media/dvb/dvb-core/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core/"
|
||||
|
||||
# add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
|
||||
# in reference to:
|
||||
# http://bugs.archlinux.org/task/13146
|
||||
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/"
|
||||
cp drivers/media/dvb/frontends/lgdt330x.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/"
|
||||
cp drivers/media/video/msp3400-driver.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/"
|
||||
|
||||
# add dvb headers
|
||||
# in reference to:
|
||||
# http://bugs.archlinux.org/task/20402
|
||||
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-usb"
|
||||
cp drivers/media/dvb/dvb-usb/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-usb/"
|
||||
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends"
|
||||
cp drivers/media/dvb/frontends/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/"
|
||||
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/common/tuners"
|
||||
cp drivers/media/common/tuners/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/common/tuners/"
|
||||
|
||||
# add xfs and shmem for aufs building
|
||||
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/fs/xfs"
|
||||
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/mm"
|
||||
cp fs/xfs/xfs_sb.h "${pkgdir}/usr/src/linux-${_kernver}/fs/xfs/xfs_sb.h"
|
||||
|
||||
# copy in Kconfig files
|
||||
for i in `find . -name "Kconfig*"`; do
|
||||
mkdir -p "${pkgdir}"/usr/src/linux-${_kernver}/`echo ${i} | sed 's|/Kconfig.*||'`
|
||||
cp ${i} "${pkgdir}/usr/src/linux-${_kernver}/${i}"
|
||||
done
|
||||
|
||||
chown -R root.root "${pkgdir}/usr/src/linux-${_kernver}"
|
||||
find "${pkgdir}/usr/src/linux-${_kernver}" -type d -exec chmod 755 {} \;
|
||||
|
||||
# strip scripts directory
|
||||
find "${pkgdir}/usr/src/linux-${_kernver}/scripts" -type f -perm -u+w 2>/dev/null | while read binary ; do
|
||||
case "$(file -bi "${binary}")" in
|
||||
*application/x-sharedlib*) # Libraries (.so)
|
||||
/usr/bin/strip ${STRIP_SHARED} "${binary}";;
|
||||
*application/x-archive*) # Libraries (.a)
|
||||
/usr/bin/strip ${STRIP_STATIC} "${binary}";;
|
||||
*application/x-executable*) # Binaries
|
||||
/usr/bin/strip ${STRIP_BINARIES} "${binary}";;
|
||||
esac
|
||||
done
|
||||
|
||||
# remove unneeded architectures
|
||||
rm -rf "${pkgdir}"/usr/src/linux-${_kernver}/arch/{alpha,arm26,avr32,blackfin,cris,frv,h8300,ia64,m32r,m68k,m68knommu,mips,microblaze,mn10300,parisc,powerpc,ppc,s390,sh,sh64,sparc,sparc64,um,v850,x86,xtensa}
|
||||
}
|
12
core/linux-chromebook/change-default-console-loglevel.patch
Normal file
12
core/linux-chromebook/change-default-console-loglevel.patch
Normal file
|
@ -0,0 +1,12 @@
|
|||
diff -upr chromeos-3.4.orig/kernel/printk.c chromeos-3.4/kernel/printk.c
|
||||
--- chromeos-3.4.orig/kernel/printk.c 2013-02-17 20:37:48.018383118 -0500
|
||||
+++ chromeos-3.4/kernel/printk.c 2013-02-17 20:38:43.679214839 -0500
|
||||
@@ -62,7 +62,7 @@ void asmlinkage __attribute__((weak)) ea
|
||||
|
||||
/* We show everything that is MORE important than this.. */
|
||||
#define MINIMUM_CONSOLE_LOGLEVEL 1 /* Minimum loglevel we let people use */
|
||||
-#define DEFAULT_CONSOLE_LOGLEVEL 7 /* anything MORE serious than KERN_DEBUG */
|
||||
+#define DEFAULT_CONSOLE_LOGLEVEL 4 /* anything MORE serious than KERN_DEBUG */
|
||||
|
||||
DECLARE_WAIT_QUEUE_HEAD(log_wait);
|
||||
|
3414
core/linux-chromebook/config.exynos5
Normal file
3414
core/linux-chromebook/config.exynos5
Normal file
File diff suppressed because it is too large
Load diff
35
core/linux-chromebook/kernel.its
Normal file
35
core/linux-chromebook/kernel.its
Normal file
|
@ -0,0 +1,35 @@
|
|||
/dts-v1/;
|
||||
|
||||
/ {
|
||||
description = "Chrome OS kernel image with one or more FDT blobs";
|
||||
#address-cells = <1>;
|
||||
images {
|
||||
kernel@1{
|
||||
description = "kernel";
|
||||
data = /incbin/("zImage");
|
||||
type = "kernel_noload";
|
||||
arch = "arm";
|
||||
os = "linux";
|
||||
compression = "none";
|
||||
load = <0>;
|
||||
entry = <0>;
|
||||
};
|
||||
fdt@1{
|
||||
description = "exynos5250-snow.dtb";
|
||||
data = /incbin/("exynos5250-snow.dtb");
|
||||
type = "flat_dt";
|
||||
arch = "arm";
|
||||
compression = "none";
|
||||
hash@1{
|
||||
algo = "sha1";
|
||||
};
|
||||
};
|
||||
};
|
||||
configurations {
|
||||
default = "conf@1";
|
||||
conf@1{
|
||||
kernel = "kernel@1";
|
||||
fdt = "fdt@1";
|
||||
};
|
||||
};
|
||||
};
|
36
core/linux-chromebook/linux-chromebook.install
Normal file
36
core/linux-chromebook/linux-chromebook.install
Normal file
|
@ -0,0 +1,36 @@
|
|||
# arg 1: the new package version
|
||||
# arg 2: the old package versio
|
||||
|
||||
KERNEL_VERSION=3.4.0-ARCH
|
||||
|
||||
post_install () {
|
||||
# updating module dependencies
|
||||
echo ">>> Updating module dependencies. Please wait ..."
|
||||
depmod ${KERNEL_VERSION}
|
||||
sync
|
||||
|
||||
echo "NOTE: This kernel will only work on systems with nv-U-boot!"
|
||||
echo -e "For more details, visit:\n"
|
||||
echo "http://www.chromium.org/chromium-os/how-tos-and-troubleshooting/using-nv-u-boot-on-the-samsung-arm-chromebook"
|
||||
# echo "NOTE: You will probably need to copy /boot/uImage to the first partition"
|
||||
# echo " of your SD card."
|
||||
}
|
||||
|
||||
post_upgrade() {
|
||||
if grep "^[^#]*[[:space:]]/boot" etc/fstab 2>&1 >/dev/null; then
|
||||
if ! grep "[[:space:]]/boot" etc/mtab 2>&1 >/dev/null; then
|
||||
echo "WARNING: /boot appears to be a seperate partition but is not mounted"
|
||||
echo " This is most likely not what you want. Please mount your /boot"
|
||||
echo " partition and reinstall the kernel unless you are sure this is OK"
|
||||
fi
|
||||
fi
|
||||
|
||||
# updating module dependencies
|
||||
echo ">>> Updating module dependencies. Please wait ..."
|
||||
depmod ${KERNEL_VERSION}
|
||||
sync
|
||||
|
||||
echo "NOTE: This kernel will only work on systems with nv-U-boot!"
|
||||
echo -e "For more details, visit:\n"
|
||||
echo "http://www.chromium.org/chromium-os/how-tos-and-troubleshooting/using-nv-u-boot-on-the-samsung-arm-chromebook"
|
||||
}
|
Loading…
Reference in a new issue