diff --git a/srcpkgs/odroid-u2-base/odroid-led b/srcpkgs/odroid-u2-base/odroid-led new file mode 100644 index 00000000000..06a622afba3 --- /dev/null +++ b/srcpkgs/odroid-u2-base/odroid-led @@ -0,0 +1,48 @@ +#!/bin/bash + +usage() { + cat >&2 <&2 + exit 1; +} + +LED=/sys/class/leds/led1/brightness +MAXLED=/sys/class/leds/led1/max_brightness + + + +if [ $# -eq 1 ]; then + [ -z "$1" ] && usage + behavior=$1 +elif [ $# -gt 1 ]; then + usage; +elif [ -f /etc/default/odroid-led ]; then + . /etc/default/odroid-led + behavior=$LED_BOOT_BEHAVIOR + auto_config=1 +else + exit 1 +fi + + +case "$behavior" in + enable) + [ -f $LED -a -f $MAXLED ] || die "LED control file can not be found" + echo 0 > $LED + cat $MAXLED > $LED + ;; + disable) + [ -f $LED ] || die "LED control file can not be found" + echo 0 > $LED + ;; + *) + [ "$auto_config" ] || usage + exit 0; + ;; +esac diff --git a/srcpkgs/odroid-u2-base/odroid-led.default b/srcpkgs/odroid-u2-base/odroid-led.default new file mode 100644 index 00000000000..2c098a32daf --- /dev/null +++ b/srcpkgs/odroid-u2-base/odroid-led.default @@ -0,0 +1,5 @@ +# LED_BOOT_BEHAVIOR: Control the behavior of the blue LED on boot +# enable: turn LED on +# disable: turn LED off +# auto: do nothing (LED will blink) +LED_BOOT_BEHAVIOR=enable diff --git a/srcpkgs/odroid-u2-base/odroid-led.service b/srcpkgs/odroid-u2-base/odroid-led.service new file mode 100644 index 00000000000..13d4aef5f90 --- /dev/null +++ b/srcpkgs/odroid-u2-base/odroid-led.service @@ -0,0 +1,9 @@ +[Unit] +Description=Sets Odroids LED on boot + +[Service] +Type=oneshot +ExecStart=/usr/sbin/odroid-led + +[Install] +WantedBy=multi-user.target diff --git a/srcpkgs/odroid-u2-base/template b/srcpkgs/odroid-u2-base/template index 0df5b49335a..12312981cf3 100644 --- a/srcpkgs/odroid-u2-base/template +++ b/srcpkgs/odroid-u2-base/template @@ -1,6 +1,6 @@ # Template file for 'odroid-u2-base' pkgname=odroid-u2-base -version=1.5 +version=1.6 revision=1 build_style=meta homepage="http://www.voidlinux.eu" @@ -9,7 +9,7 @@ maintainer="Enno Boland " license="Public Domain" only_for_archs="armv7l" -makedepends="ntp?ntp-daemon dhcpcd openssh-server odroid-u2-kernel" +makedepends="ntp?ntp-daemon dhcpcd openssh-server odroid-u2-kernel odroid-u2-uboot odroid-u2-boot-fw" depends="${makedepends}" hostmakedepends="uboot-mkimage" @@ -21,26 +21,11 @@ replaces="odroid-u2-ubootcfg>=0" _default_scr="boot-auto_edid.scr" -do_build() { - # Building uboot scr's - for source in ${FILESDIR}/*.ini; do - name=$(basename ${source%.ini}) - mkimage -A arm -T script -C none -n "${name}" -d $source ${name}.scr - done - cp ${_default_scr} boot.scr -} - do_install() { # Set proper perms to some devices. vmkdir usr/lib/udev/rules.d echo 'KERNEL=="disp|cedar_dev|mali|ump", MODE="0660", GROUP="video"' > ${DESTDIR}/usr/lib/udev/rules.d/50-odroid-u2.rules - # Install uboot scr's - for scr in *.scr; do - echo $scr - vinstall $scr 600 boot - done - # Install LED utilities vinstall ${FILESDIR}/odroid-led 744 /usr/sbin vinstall ${FILESDIR}/odroid-led.default 744 /etc/default odroid-led diff --git a/srcpkgs/odroid-u2-boot-fw/template b/srcpkgs/odroid-u2-boot-fw/template new file mode 100644 index 00000000000..73d30ec5b4e --- /dev/null +++ b/srcpkgs/odroid-u2-boot-fw/template @@ -0,0 +1,21 @@ +# Template file for 'odroid-u2-uboot' +pkgname=odroid-u2-boot-fw +version=1.0 +revision=1 +build_style=meta +wrksrc="boot" +short_desc="Odroid U2 proprietary boot files" +maintainer="Enno Boland " +license="proprietary" +homepage="http://dev.odroid.com/projects/4412boot/wiki/FrontPage" +distfiles="http://dev.odroid.com/projects/4412boot/wiki/FrontPage?action=download&value=boot.tar.gz" +checksum="e0db737d9e49f937425e4778b0ab892623bcc389d7c26329ba2e97ae7bb475c4" + +create_srcdir=yes +only_for_archs="armv7l" + +do_install() { + vinstall E4412_S.bl1.HardKernel.bin 600 boot + vinstall bl2.signed.bin 600 boot + vinstall E4412_S.tzsw.signed.bin 600 boot +} diff --git a/srcpkgs/odroid-u2-base/files/boot-1024x768-noedid.ini b/srcpkgs/odroid-u2-uboot/files/boot-1024x768-noedid.ini similarity index 100% rename from srcpkgs/odroid-u2-base/files/boot-1024x768-noedid.ini rename to srcpkgs/odroid-u2-uboot/files/boot-1024x768-noedid.ini diff --git a/srcpkgs/odroid-u2-base/files/boot-1080p-edid.ini b/srcpkgs/odroid-u2-uboot/files/boot-1080p-edid.ini similarity index 100% rename from srcpkgs/odroid-u2-base/files/boot-1080p-edid.ini rename to srcpkgs/odroid-u2-uboot/files/boot-1080p-edid.ini diff --git a/srcpkgs/odroid-u2-base/files/boot-1080p-noedid.ini b/srcpkgs/odroid-u2-uboot/files/boot-1080p-noedid.ini similarity index 100% rename from srcpkgs/odroid-u2-base/files/boot-1080p-noedid.ini rename to srcpkgs/odroid-u2-uboot/files/boot-1080p-noedid.ini diff --git a/srcpkgs/odroid-u2-base/files/boot-720p-edid.ini b/srcpkgs/odroid-u2-uboot/files/boot-720p-edid.ini similarity index 100% rename from srcpkgs/odroid-u2-base/files/boot-720p-edid.ini rename to srcpkgs/odroid-u2-uboot/files/boot-720p-edid.ini diff --git a/srcpkgs/odroid-u2-base/files/boot-720p-noedid.ini b/srcpkgs/odroid-u2-uboot/files/boot-720p-noedid.ini similarity index 100% rename from srcpkgs/odroid-u2-base/files/boot-720p-noedid.ini rename to srcpkgs/odroid-u2-uboot/files/boot-720p-noedid.ini diff --git a/srcpkgs/odroid-u2-base/files/boot-auto_edid.ini b/srcpkgs/odroid-u2-uboot/files/boot-auto_edid.ini similarity index 100% rename from srcpkgs/odroid-u2-base/files/boot-auto_edid.ini rename to srcpkgs/odroid-u2-uboot/files/boot-auto_edid.ini diff --git a/srcpkgs/odroid-u2-uboot/files/config.patch b/srcpkgs/odroid-u2-uboot/files/config.patch new file mode 100644 index 00000000000..d98d83a5e8c --- /dev/null +++ b/srcpkgs/odroid-u2-uboot/files/config.patch @@ -0,0 +1,13 @@ +diff --git a/arch/arm/cpu/armv7/config.mk b/arch/arm/cpu/armv7/config.mk +index 7f9b171..788caaa 100644 +--- a/arch/arm/cpu/armv7/config.mk ++++ b/arch/arm/cpu/armv7/config.mk +@@ -20,7 +20,7 @@ + # Foundation, Inc., 59 Temple Place, Suite 330, Boston, + # MA 02111-1307 USA + # +-PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float ++PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -mfloat-abi=hard -mfpu=vfpv3 + + # Make ARMv5 to allow more compilers to work, even though its v7a. + PLATFORM_CPPFLAGS += -march=armv7-a diff --git a/srcpkgs/odroid-u2-uboot/template b/srcpkgs/odroid-u2-uboot/template new file mode 100644 index 00000000000..a863f42c4a5 --- /dev/null +++ b/srcpkgs/odroid-u2-uboot/template @@ -0,0 +1,52 @@ +# Template file for 'odroid-u2-uboot' +_githash=89f2ab95e7304fe02e5267f1282fbc178550d528 +pkgname=odroid-u2-uboot +version=v2010.12 +revision=1 +wrksrc="u-boot-${_githash}" +hostmakedepends="uboot-mkimage" +short_desc="Odroid U2 U-Boot files for SD booting" +maintainer="Enno Boland " +license="GPL-2" +homepage="https://github.com/hardkernel/u-boot" +distfiles="https://github.com/hardkernel/u-boot/archive/${_githash}.tar.gz" +checksum="29593e636a0d908230910522aab74c09a35b92fee71b165d088f561e85ba3e1d" + +create_srcdir=yes +only_for_archs="armv7l" + +_default_scr="boot-auto_edid.scr" + +do_configure() { + make mrproper + patch -p1 < ${FILESDIR}/config.patch + make smdk4412_config +} + +do_build() { + unset CFLAGS CXXFLAGS LDFLAGS + + if [ "$CROSS_BUILD" ]; then + make ARCH=arm CROSS_COMPILE=${XBPS_CROSS_TRIPLET}- + else + make ARCH=arm + fi + + # Building uboot scr's + for source in ${FILESDIR}/*.ini; do + name=$(basename ${source%.ini}) + mkimage -A arm -T script -C none -n "${name}" -d $source ${name}.scr + done + + cp ${_default_scr} boot.scr +} + +do_install() { + vinstall u-boot.bin 600 boot + + # Install uboot scr's + for scr in *.scr; do + echo $scr + vinstall $scr 600 boot + done +}