Merge pull request #1593 from thypon/kirkwood
Kirkwood (dockstar) support
This commit is contained in:
commit
d06830b84c
4 changed files with 5466 additions and 0 deletions
32
srcpkgs/dockstar-uboot/template
Normal file
32
srcpkgs/dockstar-uboot/template
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
# Template file for 'kirkwood-uboot'
|
||||||
|
_board=dockstar # It's easy to add also the other kirkwood boards replacing this with "goflexhome goflexnet pogo_e02"
|
||||||
|
pkgname="${_board}-uboot"
|
||||||
|
version=2014.04.R4
|
||||||
|
revision=1
|
||||||
|
wrksrc="u-boot-${version##*.}"
|
||||||
|
only_for_archs="armv5tel"
|
||||||
|
short_desc="(archlinuxarm) u-boot compiled for ${_board}"
|
||||||
|
maintainer="Andrea Brancaleoni <miwaxe@gmail.com>"
|
||||||
|
license="GPL-3"
|
||||||
|
homepage="https://github.com/archlinuxarm/u-boot"
|
||||||
|
distfiles="https://github.com/archlinuxarm/u-boot/archive/${version##*.}.tar.gz http://archlinuxarm.org/os/armv5te/boot/dockstar/uboot-${_board}.env"
|
||||||
|
checksum="22492ec730f0e91e4f732d8793cea39fb5945386eb46e86f3d8446978361c551 ec6522fdb74a41bc2b6f301729c421c9600be1a479bf7932405b39d2f459ada7"
|
||||||
|
skip_extraction="uboot-${_board}.env"
|
||||||
|
|
||||||
|
do_configure() {
|
||||||
|
make ${_board}_config
|
||||||
|
}
|
||||||
|
do_build() {
|
||||||
|
unset CFLAGS CXXFLAGS LDFLAGS
|
||||||
|
if [ "$CROSS_BUILD" ]; then
|
||||||
|
make CROSS_COMPILE=${XBPS_CROSS_TRIPLET}- u-boot.kwb
|
||||||
|
else
|
||||||
|
make u-boot.kwb
|
||||||
|
fi
|
||||||
|
dd if=u-boot.kwb of=uboot-${_board}.kwb bs=512k conv=sync
|
||||||
|
}
|
||||||
|
do_install() {
|
||||||
|
local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
|
||||||
|
vinstall uboot-${_board}.kwb 755 boot
|
||||||
|
vinstall ${srcdir}/uboot-${_board}.env 644 boot
|
||||||
|
}
|
1
srcpkgs/kirkwood-kernel-headers
Symbolic link
1
srcpkgs/kirkwood-kernel-headers
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
kirkwood-kernel/
|
5274
srcpkgs/kirkwood-kernel/files/kirkwood-config
Normal file
5274
srcpkgs/kirkwood-kernel/files/kirkwood-config
Normal file
File diff suppressed because it is too large
Load diff
159
srcpkgs/kirkwood-kernel/template
Normal file
159
srcpkgs/kirkwood-kernel/template
Normal file
|
@ -0,0 +1,159 @@
|
||||||
|
# Template file for 'kirkwood-kernel'
|
||||||
|
pkgname=kirkwood-kernel
|
||||||
|
version=4.0.4
|
||||||
|
revision=1
|
||||||
|
wrksrc="linux-${version}"
|
||||||
|
maintainer="Andrea Brancaleoni <miwaxe@gmail.com>"
|
||||||
|
homepage="http://www.kernel.org/"
|
||||||
|
license="GPL-2"
|
||||||
|
short_desc="The Linux kernel and modules for kirkwood"
|
||||||
|
distfiles="${KERNEL_SITE}/kernel/v4.x/linux-${version}.tar.xz
|
||||||
|
http://www.arm.linux.org.uk/developer/machines/download.php>mach-types
|
||||||
|
https://raw.githubusercontent.com/archlinuxarm/PKGBUILDs/master/core/linux-kirkwood/archlinuxarm.patch"
|
||||||
|
skip_extraction="mach-types archlinuxarm.patch"
|
||||||
|
checksum="30651ccd2cdf01ea2215cd39a94d9b684c1b3a681120f33e6605b467fe41b4c8
|
||||||
|
fe00141a8b03349c533647fbf707007d8a5a544203359ab8e33bd3cc399e9cf5
|
||||||
|
b2dc1d470d246817b23ce4ac62913707af8ee2eae3003da645eb42668729c328"
|
||||||
|
|
||||||
|
nodebug=yes
|
||||||
|
nostrip=yes
|
||||||
|
noverifyrdeps=yes
|
||||||
|
noshlibprovides=yes
|
||||||
|
|
||||||
|
only_for_archs="armv5tel"
|
||||||
|
hostmakedepends="perl kmod uboot-mkimage libressl-openssl bc"
|
||||||
|
makedepends="ncurses-devel"
|
||||||
|
triggers="kernel-hooks"
|
||||||
|
|
||||||
|
_kernver="${version}_${revision}"
|
||||||
|
# These files could be modified when an external module is built.
|
||||||
|
mutable_files="
|
||||||
|
/usr/lib/modules/${_kernver}/modules.builtin.bin
|
||||||
|
/usr/lib/modules/${_kernver}/modules.softdep
|
||||||
|
/usr/lib/modules/${_kernver}/modules.dep
|
||||||
|
/usr/lib/modules/${_kernver}/modules.dep.bin
|
||||||
|
/usr/lib/modules/${_kernver}/modules.symbols
|
||||||
|
/usr/lib/modules/${_kernver}/modules.symbols.bin
|
||||||
|
/usr/lib/modules/${_kernver}/modules.alias
|
||||||
|
/usr/lib/modules/${_kernver}/modules.alias.bin
|
||||||
|
/usr/lib/modules/${_kernver}/modules.devname"
|
||||||
|
|
||||||
|
post_extract() {
|
||||||
|
local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
|
||||||
|
cp "${srcdir}/mach-types" arch/arm/tools
|
||||||
|
patch -p1 < "${srcdir}/archlinuxarm.patch"
|
||||||
|
}
|
||||||
|
do_configure() {
|
||||||
|
cp ${FILESDIR}/kirkwood-config .config
|
||||||
|
|
||||||
|
# Always use our revision to CONFIG_LOCALVERSION to match our pkg version.
|
||||||
|
sed -i -e "s|^\(CONFIG_LOCALVERSION=\).*|\1\"_${revision}\"|" .config
|
||||||
|
}
|
||||||
|
do_build() {
|
||||||
|
if [ "$CROSS_BUILD" ]; then
|
||||||
|
_args="CROSS_COMPILE=${XBPS_CROSS_TRIPLET}-"
|
||||||
|
fi
|
||||||
|
make ${makejobs} ${_args} ARCH=arm prepare
|
||||||
|
make ${makejobs} ${_args} ARCH=arm uImage modules
|
||||||
|
}
|
||||||
|
|
||||||
|
do_install() {
|
||||||
|
local hdrdest
|
||||||
|
|
||||||
|
# Run depmod after compressing modules.
|
||||||
|
sed -i '2iexit 0' scripts/depmod.sh
|
||||||
|
|
||||||
|
# Install kernel, firmware and modules
|
||||||
|
make ${makejobs} ARCH=arm INSTALL_MOD_PATH=${DESTDIR} modules_install
|
||||||
|
|
||||||
|
vmkdir boot
|
||||||
|
mv arch/arm/boot/uImage ${DESTDIR}/boot
|
||||||
|
|
||||||
|
hdrdest=${DESTDIR}/usr/src/${sourcepkg}-headers-${_kernver}
|
||||||
|
|
||||||
|
# Switch to /usr.
|
||||||
|
vmkdir usr
|
||||||
|
mv ${DESTDIR}/lib ${DESTDIR}/usr
|
||||||
|
|
||||||
|
cd ${DESTDIR}/usr/lib/modules/${_kernver}
|
||||||
|
rm -f source build
|
||||||
|
ln -sf ../../../src/${sourcepkg}-headers-${_kernver} build
|
||||||
|
|
||||||
|
cd ${wrksrc}
|
||||||
|
# Install required headers to build external modules
|
||||||
|
install -Dm644 Makefile ${hdrdest}/Makefile
|
||||||
|
install -Dm644 kernel/Makefile ${hdrdest}/kernel/Makefile
|
||||||
|
install -Dm644 .config ${hdrdest}/.config
|
||||||
|
mkdir -p ${hdrdest}/include
|
||||||
|
|
||||||
|
# Remove firmware stuff provided by the "linux-firmware" pkg.
|
||||||
|
rm -rf ${DESTDIR}/usr/lib/firmware
|
||||||
|
|
||||||
|
for i in acpi asm-generic config crypto drm generated linux math-emu \
|
||||||
|
media net pcmcia scsi sound trace uapi video xen; do
|
||||||
|
[ -d include/$i ] && cp -a include/$i ${hdrdest}/include
|
||||||
|
done
|
||||||
|
|
||||||
|
cd ${wrksrc}
|
||||||
|
# Copy files necessary for later builds.
|
||||||
|
cp Module.symvers ${hdrdest}
|
||||||
|
cp -a scripts ${hdrdest}
|
||||||
|
|
||||||
|
# fix permissions on scripts dir
|
||||||
|
chmod og-w -R ${hdrdest}/scripts
|
||||||
|
|
||||||
|
# copy arch includes for external modules
|
||||||
|
mkdir -p ${hdrdest}/arch/arm/mach-kirkwood
|
||||||
|
cp -a arch/arm/include ${hdrdest}/arch/arm
|
||||||
|
|
||||||
|
mkdir -p ${hdrdest}/arch/arm/kernel
|
||||||
|
|
||||||
|
cp arch/arm/Makefile ${hdrdest}/arch/arm
|
||||||
|
cp arch/arm/kernel/asm-offsets.s ${hdrdest}/arch/arm/kernel
|
||||||
|
|
||||||
|
# Add docbook makefile
|
||||||
|
install -Dm644 Documentation/DocBook/Makefile \
|
||||||
|
${hdrdest}/Documentation/DocBook/Makefile
|
||||||
|
|
||||||
|
# Add md headers
|
||||||
|
mkdir -p ${hdrdest}/drivers/md
|
||||||
|
cp drivers/md/*.h ${hdrdest}/drivers/md
|
||||||
|
|
||||||
|
# Add inotify.h
|
||||||
|
mkdir -p ${hdrdest}/include/linux
|
||||||
|
cp include/linux/inotify.h ${hdrdest}/include/linux
|
||||||
|
|
||||||
|
# Add wireless headers
|
||||||
|
mkdir -p ${hdrdest}/net/mac80211/
|
||||||
|
cp net/mac80211/*.h ${hdrdest}/net/mac80211
|
||||||
|
|
||||||
|
# Copy in Kconfig files
|
||||||
|
for i in $(find . -name "Kconfig*"); do
|
||||||
|
mkdir -p ${hdrdest}/$(echo $i | sed 's|/Kconfig.*||')
|
||||||
|
cp $i ${hdrdest}/$i
|
||||||
|
done
|
||||||
|
|
||||||
|
# Remove unneeded architectures
|
||||||
|
for arch in alpha arm26 avr32 blackfin cris frv h8300 \
|
||||||
|
ia64 m* p* s* um v850 x86 xtensa; do
|
||||||
|
rm -rf ${hdrdest}/arch/${arch}
|
||||||
|
done
|
||||||
|
|
||||||
|
# Compress all modules with xz to save a few MBs.
|
||||||
|
msg_normal "$pkgver: compressing kernel modules with gzip, please wait...\n"
|
||||||
|
find ${DESTDIR} -name '*.ko' | xargs -n1 -P0 gzip -9
|
||||||
|
|
||||||
|
# ... and run depmod again.
|
||||||
|
depmod -b ${DESTDIR}/usr -F System.map ${_kernver}
|
||||||
|
}
|
||||||
|
|
||||||
|
kirkwood-kernel-headers_package() {
|
||||||
|
nostrip=yes
|
||||||
|
noverifyrdeps=yes
|
||||||
|
noshlibprovides=yes
|
||||||
|
short_desc="The Linux kernel headers for the kirkwood platform"
|
||||||
|
pkg_install() {
|
||||||
|
vmove usr/src
|
||||||
|
vmove usr/lib/modules/${_kernver}/build
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue