mirror of
https://github.com/archlinuxarm/PKGBUILDs.git
synced 2024-11-08 22:45:43 +00:00
added core/linux-odroid-c1
This commit is contained in:
parent
698337c51a
commit
df8ea3d47f
5 changed files with 4831 additions and 0 deletions
273
core/linux-odroid-c1/PKGBUILD
Normal file
273
core/linux-odroid-c1/PKGBUILD
Normal file
|
@ -0,0 +1,273 @@
|
|||
# ODROID-C1
|
||||
# Maintainer: Kevin Mihelich <kevin@archlinuxarm.org>
|
||||
|
||||
buildarch=4
|
||||
|
||||
pkgbase=linux-odroid-c1
|
||||
_commit=35ff6937e3c89590acf1d3551ae3af89761ddfc1
|
||||
_srcname=linux-${_commit}
|
||||
_kernelname=${pkgbase#linux}
|
||||
_desc="ODROID-C1"
|
||||
pkgver=3.10.43
|
||||
pkgrel=1
|
||||
arch=('armv7h')
|
||||
url="https://github.com/hardkernel/linux"
|
||||
license=('GPL2')
|
||||
makedepends=('xmlto' 'docbook-xsl' 'kmod' 'inetutils' 'bc' 'git' 'uboot-tools')
|
||||
options=('!strip')
|
||||
source=("https://github.com/hardkernel/linux/archive/${_commit}.tar.gz"
|
||||
'config'
|
||||
'amlogic.sh'
|
||||
'amlogic.service')
|
||||
md5sums=('b94cefcd22a1328b39104768b287b6e9'
|
||||
'dd051df5fbe810df80f8d0ebc02991c4'
|
||||
'efa48d32e3d4ef7903a726bc8cadddcc'
|
||||
'b8956789318f49cec5b8bb0b41654a9b')
|
||||
|
||||
prepare() {
|
||||
cd "${srcdir}/${_srcname}"
|
||||
|
||||
cat "${srcdir}/config" > ./.config
|
||||
|
||||
# add pkgrel to extraversion
|
||||
sed -ri "s|^(EXTRAVERSION =)(.*)|\1 \2-${pkgrel}-ARCH|" Makefile
|
||||
|
||||
# don't run depmod on 'make install'. We'll do this ourselves in packaging
|
||||
sed -i '2iexit 0' scripts/depmod.sh
|
||||
}
|
||||
|
||||
build() {
|
||||
cd "${srcdir}/${_srcname}"
|
||||
|
||||
# get kernel version
|
||||
make prepare
|
||||
|
||||
# load configuration
|
||||
# Configure the kernel. Replace the line below with one of your choice.
|
||||
#make menuconfig # CLI menu for configuration
|
||||
#make nconfig # new CLI menu for configuration
|
||||
#make xconfig # X-based configuration
|
||||
#make oldconfig # using old config from previous kernel version
|
||||
# ... or manually edit .config
|
||||
|
||||
# Copy back our configuration (use with new kernel version)
|
||||
#cp ./.config ../${pkgbase}.config
|
||||
|
||||
####################
|
||||
# stop here
|
||||
# this is useful to configure the kernel
|
||||
#msg "Stopping build"
|
||||
#return 1
|
||||
####################
|
||||
|
||||
#yes "" | make config
|
||||
|
||||
# build!
|
||||
make ${MAKEFLAGS} uImage modules meson8b_odroidc.dtd meson8b_odroidc.dtb
|
||||
}
|
||||
|
||||
_package() {
|
||||
pkgdesc="The Linux Kernel and modules - ${_desc}"
|
||||
depends=('coreutils' 'linux-firmware' 'kmod' 'mkinitcpio>=0.7')
|
||||
optdepends=('crda: to set the correct wireless channels of your country')
|
||||
provides=('kernel26' "linux=${pkgver}")
|
||||
conflicts=('linux')
|
||||
install=${pkgname}.install
|
||||
|
||||
cd "${srcdir}/${_srcname}"
|
||||
|
||||
KARCH=arm
|
||||
|
||||
# get kernel version
|
||||
_kernver="$(make kernelrelease)"
|
||||
_basekernel=${_kernver%%-*}
|
||||
_basekernel=${_basekernel%.*}
|
||||
|
||||
mkdir -p "${pkgdir}"/{lib/modules,lib/firmware,boot/dtbs}
|
||||
make INSTALL_MOD_PATH="${pkgdir}" modules_install
|
||||
cp arch/$KARCH/boot/uImage "${pkgdir}/boot/uImage"
|
||||
cp arch/$KARCH/boot/dts/amlogic/meson8b_odroidc.dtb "${pkgdir}/boot/dtbs"
|
||||
|
||||
# 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
|
||||
# make room for external modules
|
||||
ln -s "../extramodules-${_basekernel}-${_kernelname:-ARCH}" "${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"
|
||||
|
||||
# Now we call depmod...
|
||||
depmod -b "$pkgdir" -F System.map "$_kernver"
|
||||
|
||||
# move module tree /lib -> /usr/lib
|
||||
mkdir -p "${pkgdir}/usr"
|
||||
mv "$pkgdir/lib" "$pkgdir/usr"
|
||||
|
||||
# install amlogic hdmi init script/service
|
||||
install -Dm644 "${srcdir}/amlogic.service" "${pkgdir}/usr/lib/systemd/system/amlogic.service"
|
||||
install -Dm755 "${srcdir}/amlogic.sh" "${pkgdir}/usr/bin/amlogic.sh"
|
||||
}
|
||||
|
||||
_package-headers() {
|
||||
pkgdesc="Header files and scripts for building modules for linux kernel - ${_desc}"
|
||||
provides=("linux-headers=${pkgver}")
|
||||
conflicts=('linux-headers')
|
||||
|
||||
install -dm755 "${pkgdir}/usr/lib/modules/${_kernver}"
|
||||
|
||||
cd "${pkgdir}/usr/lib/modules/${_kernver}"
|
||||
ln -sf ../../../src/linux-${_kernver} build
|
||||
|
||||
cd "${srcdir}/${_srcname}"
|
||||
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 uapi 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-exynos
|
||||
cp -a arch/$KARCH/mach-exynos/include ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/mach-exynos/
|
||||
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
|
||||
# pci
|
||||
for i in bt8xx cx88 saa7134; do
|
||||
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/pci/${i}"
|
||||
cp -a drivers/media/pci/${i}/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/pci/${i}"
|
||||
done
|
||||
# usb
|
||||
for i in cpia2 em28xx pwc sn9c102; do
|
||||
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/usb/${i}"
|
||||
cp -a drivers/media/usb/${i}/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/usb/${i}"
|
||||
done
|
||||
# i2c
|
||||
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/i2c"
|
||||
cp drivers/media/i2c/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/i2c/"
|
||||
for i in cx25840; do
|
||||
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/i2c/${i}"
|
||||
cp -a drivers/media/i2c/${i}/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/i2c/${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-core"
|
||||
cp drivers/media/dvb-core/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb-core/"
|
||||
# and...
|
||||
# http://bugs.archlinux.org/task/11194
|
||||
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/"
|
||||
cp include/config/dvb/*.h "${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/"
|
||||
|
||||
# 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/i2c/msp3400-driver.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/i2c/"
|
||||
|
||||
# add dvb headers
|
||||
# in reference to:
|
||||
# http://bugs.archlinux.org/task/20402
|
||||
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/usb/dvb-usb"
|
||||
cp drivers/media/usb/dvb-usb/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/usb/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/tuners"
|
||||
cp drivers/media/tuners/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/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"
|
||||
|
||||
#make uapi headers, some of them are needed for vpu/ipu usage
|
||||
mkdir -p "${srcdir}/headers"
|
||||
make headers_install ARCH=$KARCH INSTALL_HDR_PATH="${srcdir}/headers"
|
||||
|
||||
# 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}
|
||||
}
|
||||
|
||||
pkgname=("${pkgbase}" "${pkgbase}-headers")
|
||||
for _p in ${pkgname[@]}; do
|
||||
eval "package_${_p}() {
|
||||
_package${_p#${pkgbase}}
|
||||
}"
|
||||
done
|
10
core/linux-odroid-c1/amlogic.service
Normal file
10
core/linux-odroid-c1/amlogic.service
Normal file
|
@ -0,0 +1,10 @@
|
|||
[Unit]
|
||||
Description=AMlogic HDMI Initialization
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
ExecStart=/usr/bin/amlogic.sh
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
62
core/linux-odroid-c1/amlogic.sh
Executable file
62
core/linux-odroid-c1/amlogic.sh
Executable file
|
@ -0,0 +1,62 @@
|
|||
#!/bin/sh
|
||||
|
||||
for x in $(cat /proc/cmdline); do
|
||||
case ${x} in
|
||||
m_bpp=*) export bpp=${x#*=} ;;
|
||||
hdmimode=*) export mode=${x#*=} ;;
|
||||
esac
|
||||
done
|
||||
|
||||
HPD_STATE=/sys/class/amhdmitx/amhdmitx0/hpd_state
|
||||
DISP_CAP=/sys/class/amhdmitx/amhdmitx0/disp_cap
|
||||
DISP_MODE=/sys/class/display/mode
|
||||
|
||||
hdmi=`cat $HPD_STATE`
|
||||
if [ $hdmi -eq 1 ]; then
|
||||
echo $mode > $DISP_MODE
|
||||
fi
|
||||
|
||||
outputmode=$mode
|
||||
|
||||
case $mode in
|
||||
800x480*) fbset -fb /dev/fb0 -g 800 480 800 960 $bpp ;;
|
||||
vga*) fbset -fb /dev/fb0 -g 640 480 640 960 $bpp ;;
|
||||
480*) fbset -fb /dev/fb0 -g 720 480 720 960 $bpp ;;
|
||||
svga*) fbset -fb /dev/fb0 -g 800 600 800 1200 $bpp ;;
|
||||
576*) fbset -fb /dev/fb0 -g 720 576 720 1152 $bpp ;;
|
||||
720*) fbset -fb /dev/fb0 -g 1280 720 1280 1440 $bpp ;;
|
||||
800*) fbset -fb /dev/fb0 -g 1280 800 1280 1600 $bpp ;;
|
||||
sxga*) fbset -fb /dev/fb0 -g 1280 1024 1280 2048 $bpp ;;
|
||||
wsxga*) fbset -fb /dev/fb0 -g 1440 900 1440 1800 $bpp ;;
|
||||
1080*) fbset -fb /dev/fb0 -g 1920 1080 1920 2160 $bpp ;;
|
||||
1920x1200*) fbset -fb /dev/fb0 -g 1920 1200 1920 2400 $bpp ;;
|
||||
esac
|
||||
fbset -fb /dev/fb1 -g 32 32 32 32 32
|
||||
|
||||
echo $outputmode > /sys/class/display/mode
|
||||
|
||||
echo 0 > /sys/class/ppmgr/ppscaler
|
||||
echo 0 > /sys/class/graphics/fb0/free_scale
|
||||
echo 1 > /sys/class/graphics/fb0/freescale_mode
|
||||
|
||||
|
||||
case $outputmode in
|
||||
800x480*) M="0 0 799 479" ;;
|
||||
vga*) M="0 0 639 749" ;;
|
||||
svga*) M="0 0 799 599" ;;
|
||||
sxga*) M="0 0 1279 1023" ;;
|
||||
wsxga*) M="0 0 1439 899" ;;
|
||||
480*) M="0 0 719 479" ;;
|
||||
576*) M="0 0 719 575" ;;
|
||||
720*) M="0 0 1279 719" ;;
|
||||
800*) M="0 0 1279 799" ;;
|
||||
1080*) M="0 0 1919 1079" ;;
|
||||
1920x1200*) M="0 0 1919 1199" ;;
|
||||
esac
|
||||
|
||||
echo $M > /sys/class/graphics/fb0/free_scale_axis
|
||||
echo $M > /sys/class/graphics/fb0/window_axis
|
||||
|
||||
|
||||
echo 0x10001 > /sys/class/graphics/fb0/free_scale
|
||||
echo 0 > /sys/class/graphics/fb1/free_scale
|
4469
core/linux-odroid-c1/config
Normal file
4469
core/linux-odroid-c1/config
Normal file
File diff suppressed because it is too large
Load diff
17
core/linux-odroid-c1/linux-odroid-c1.install
Normal file
17
core/linux-odroid-c1/linux-odroid-c1.install
Normal file
|
@ -0,0 +1,17 @@
|
|||
# arg 1: the new package version
|
||||
# arg 2: the old package version
|
||||
|
||||
KERNEL_NAME=-odroid-c1
|
||||
KERNEL_VERSION=3.10.42-1-ARCH
|
||||
|
||||
post_install () {
|
||||
# updating module dependencies
|
||||
echo ">>> Updating module dependencies. Please wait ..."
|
||||
depmod ${KERNEL_VERSION}
|
||||
}
|
||||
|
||||
post_upgrade() {
|
||||
# updating module dependencies
|
||||
echo ">>> Updating module dependencies. Please wait ..."
|
||||
depmod ${KERNEL_VERSION}
|
||||
}
|
Loading…
Reference in a new issue