diff --git a/srcpkgs/ci20-base/INSTALL b/srcpkgs/ci20-base/INSTALL new file mode 100644 index 00000000000..f494b16c13d --- /dev/null +++ b/srcpkgs/ci20-base/INSTALL @@ -0,0 +1,8 @@ +case "$ACTION" in +post) + mkdir -p etc/runit/runsvdir/default/ + ln -sf /etc/sv/sshd etc/runit/runsvdir/default/ + ln -sf /etc/sv/ntpd etc/runit/runsvdir/default/ + ln -sf /etc/sv/dhcpcd etc/runit/runsvdir/default/ + ;; +esac diff --git a/srcpkgs/ci20-base/template b/srcpkgs/ci20-base/template new file mode 100644 index 00000000000..513cc7f6e32 --- /dev/null +++ b/srcpkgs/ci20-base/template @@ -0,0 +1,12 @@ +# Template file for 'ci20-base' +pkgname=ci20-base +version=1.0 +revision=1 +build_style=meta +homepage="http://www.voidlinux.eu" +short_desc="Void Linux MIPS CI20 Creator base files" +maintainer="Juan RP " +license="Public Domain" + +only_for_archs="mipsel mipsel-musl mipselhf-musl" +depends="virtual?ntp-daemon ci20-kernel ci20-uboot" diff --git a/srcpkgs/ci20-kernel-headers b/srcpkgs/ci20-kernel-headers new file mode 120000 index 00000000000..caa56212863 --- /dev/null +++ b/srcpkgs/ci20-kernel-headers @@ -0,0 +1 @@ +ci20-kernel \ No newline at end of file diff --git a/srcpkgs/ci20-kernel/template b/srcpkgs/ci20-kernel/template new file mode 100644 index 00000000000..cea9eda0849 --- /dev/null +++ b/srcpkgs/ci20-kernel/template @@ -0,0 +1,162 @@ +# Template file for 'ci20-kernel' +# +_githash="fbf929bc733b82b15f6996d4262a45870f19d214" +_gitshort="${_githash:0:7}" + +pkgname=ci20-kernel +version=3.18.3 +revision=1 +wrksrc="CI20_linux-${_githash}" +maintainer="Juan RP " +homepage="http://www.kernel.org" +license="GPL-2" +short_desc="The Linux kernel for CI20 Creator (${version%.*} series [git ${_gitshort}])" +distfiles="https://github.com/MIPS/CI20_linux/archive/${_githash}.tar.gz" +checksum=1fb5ef0154867f5e2b7c10fd770295b58ac1e698527c47c84f8bba25bd0892e5 + +_kernver="${version}_${revision}" + +nodebug=yes +nostrip=yes +noverifyrdeps=yes +noshlibprovides=yes + +only_for_archs="mipsel mipsel-musl mipselhf-musl" +hostmakedepends="perl kmod uboot-mkimage libressl bc" +makedepends="ncurses-devel" +triggers="kernel-hooks" +# These files could be modified when an external module is built. +mutable_files=" + /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" + +do_configure() { + if [ "$CROSS_BUILD" ]; then + _args="CROSS_COMPILE=${XBPS_CROSS_TRIPLET}-" + fi + + # Use upstream default configuration, no need to maintain ours. + make ${makejobs} ${_args} ARCH=mips ci20_defconfig + + # Always use our revision to CONFIG_LOCALVERSION to match our pkg version. + sed -i -e "s|^\(CONFIG_LOCALVERSION=\).*|\1\"_${revision}\"|" .config +} +do_build() { + unset LDFLAGS + if [ "$CROSS_BUILD" ]; then + _args="CROSS_COMPILE=${XBPS_CROSS_TRIPLET}-" + fi + make ${makejobs} ${_args} ARCH=mips prepare + make ${makejobs} ${_args} ARCH=mips 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=mips INSTALL_MOD_PATH=${DESTDIR} modules_install + + vmkdir boot + vinstall arch/mips/boot/uImage 644 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/mips + cp -a arch/mips/include ${hdrdest}/arch/mips + #mkdir -p ${hdrdest}/arch/mips/mach-ci20 + #cp -a arch/mips/mach-ci20/include ${hdrdest}/arch/mips/mach-ci20 + + mkdir -p ${hdrdest}/arch/mips/kernel + + cp arch/mips/Makefile ${hdrdest}/arch/mips + cp arch/mips/kernel/asm-offsets.s ${hdrdest}/arch/mips/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 + + # add dvb headers for external modules + mkdir -p ${hdrdest}/include/config/dvb/ + cp include/config/dvb/*.h ${hdrdest}/include/config/dvb/ + + # 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 arm 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} +} + +ci20-kernel-headers_package() { + nostrip=yes + noverifyrdeps=yes + noshlibprovides=yes + short_desc="The Linux kernel headers for CI20 Creator (${version%.*} series [git ${_gitshort}])" + pkg_install() { + vmove usr/src + vmove usr/lib/modules/${_kernver}/build + } +} diff --git a/srcpkgs/ci20-uboot/template b/srcpkgs/ci20-uboot/template new file mode 100644 index 00000000000..5c1870e2827 --- /dev/null +++ b/srcpkgs/ci20-uboot/template @@ -0,0 +1,35 @@ +# Template file for 'ci20-uboot' +pkgname=ci20-uboot +version=v2013.10 +revision=1 +hostmakedepends="bc git uboot-mkimage" +short_desc="U-Boot for the MIPS Creator CI20" +maintainer="Juan RP " +license="GPL-2" +homepage="http://www.denx.de/wiki/U-Boot/WebHome" + +only_for_archs="mipsel mipsel-musl mipselhf-musl" + +do_fetch() { + git clone -b ci20-${version} git://github.com/MIPS/CI20_u-boot ${wrksrc} + cd $wrksrc + git reset --hard 25f5638f961c6bfcc64a1e02f742e60aa13fc1c6 + + sed -i 's,ulong,unsigned long,g' include/image.h include/bootstage.h \ + tools/mkimage.h common/image.c common/image-fit.c tools/proftool.c +} +do_build() { + unset CFLAGS CXXFLAGS LDFLAGS + make distclean + if [ -n "$CROSS_BUILD" ]; then + make ARCH=mips CROSS_COMPILE=${XBPS_CROSS_TRIPLET}- ci20_mmc + make ARCH=mips CROSS_COMPILE=${XBPS_CROSS_TRIPLET}- ${makejobs} + else + make ARCH=mips ci20_mmc + make ARCH=mips ${makejobs} + fi +} +do_install() { + vinstall spl/u-boot-spl.bin 644 boot + vinstall u-boot.img 644 boot +}