From 2a471e288c16b91a7186a60b3fb84dd55a494c7a Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Thu, 8 Oct 2020 09:47:40 -0400 Subject: New port: AIGO EROS Q / EROS K The Q and K have a slightly different case, but the hardware under the shell is completely identical. These models are rebadged versions: * Hifiwalker H2 (== Q) * AGPTek H3 (== K) * Surfans F20 (== K) Other notes: * Significant improvements in the shared Hiby-platform launcher/loader * SD card can theoretically be hot-swapped now * Support external USB mass storage! * Some consolidation of Hiby-platform targets * Some consolidation of plugin keymaps Todo/known issues: * Keymaps need to be gone over properly * Convert to HAVE_SCROLLWHEEL? Change-Id: I5a8a4f22c38a5b69392ca7c0a8ad8c4e07d9523c --- tools/builds.pm | 4 +++ tools/configure | 32 ++++++++++++++++++--- tools/hiby_patcher.pl | 77 ++++++++++++++++++++++++++++++++++++++++++++++----- tools/root.make | 6 ++++ 4 files changed, 108 insertions(+), 11 deletions(-) (limited to 'tools') diff --git a/tools/builds.pm b/tools/builds.pm index 6f0c4d0445..36c6e9b1fb 100644 --- a/tools/builds.pm +++ b/tools/builds.pm @@ -448,6 +448,10 @@ $releasenotes="/wiki/ReleaseNotes315"; name => 'FiiO M3K', status => 1, }, + 'erosq' => { + name => 'AIGO EROS Q / K', + status => 1, + }, 'ihifi770' => { name => 'Xuelin iHIFI 770', status => 2, diff --git a/tools/configure b/tools/configure index f5fb6351c0..2b34ed4cff 100755 --- a/tools/configure +++ b/tools/configure @@ -1589,7 +1589,8 @@ cat <) { if ($rootfs_found) { if (/file_path=(.*)/) { $ubiname = basename($1); - $ubiname =~ tr/[a-z]/[A-Z]/; last; } } else { @@ -92,7 +95,11 @@ while () { } close UPDATE; -die("can't locate rootfs image") if (! -e "$isowork/$ubiname"); +if (! -e "$isowork/$ubiname") { + $ubiname =~ tr/[a-z]/[A-Z]/; + die("can't locate rootfs image ($ubiname)") if (! -e "$isowork/$ubiname"); +} + $ubiname = "$isowork/$ubiname"; ### Extract RootFS @@ -102,6 +109,7 @@ mkdir($rootfsdir) || die ("Can't create '$rootfsdir'"); @sysargs = ("ubireader_extract_files", "-k", "-o", $rootfsdir, $ubiname); system(@sysargs); +# exit(0); ### Mangle RootFS # Generate rb_bootloader.sh @@ -109,19 +117,74 @@ my $rbbasename = basename($rbbname); my $bootloader_sh = "#!/bin/sh -mount /dev/mmcblk0 /mnt/sd_0 &>/dev/null || \ -mount /dev/mmcblk0p1 /mnt/sd_0 &>/dev/null +#mkdir -p /mnt/sd_0 +# +#mount /dev/mmcblk0 /mnt/sd_0 &>/dev/null || \ +#mount /dev/mmcblk0p1 /mnt/sd_0 &>/dev/null + +killall hiby_player &>/dev/null +killall -9 hiby_player &>/dev/null + +killall $rbbasename &>/dev/null +killall -9 $rbbasename &>/dev/null -killall $rbbasename -killall -9 $rbbasename +# /etc/init.d/K90adb start +# Rockbox launcher! /usr/bin/$rbbasename sleep 1 reboot - "; +"; open FILE, ">$rootfsdir/usr/bin/hiby_player.sh" || die ("can't write bootloader script!"); print FILE $bootloader_sh; close FILE; +chmod 0755, "$rootfsdir/usr/bin/hiby_player.sh"; + +# Auto mount/unmount external USB drives +open FILE, ">>$rootfsdir/etc/mdev.conf" || die ("can't access mdev conf!"); +print FILE "sd[a-z][0-9]+ 0:0 664 @ /etc/rb_inserting.sh\n"; +print FILE "mmcblk[0-9]p[0-9] 0:0 664 @ /etc/rb_inserting.sh\n"; +print FILE "mmcblk[0-9] 0:0 664 @ /etc/rb_inserting.sh\n"; +print FILE "sd[a-z] 0:0 664 \$ /etc/rb_removing.sh"; +print FILE "mmcblk[0-9] 0:0 664 \$ /etc/rb_removing.sh\n"; +close FILE; + +my $insert_sh = ' +#!/bin/sh +# $MDEV is the device + +case $MDEV in + mmc*) + MNT_POINT=/mnt/sd_0 + ;; + sd*) + MNT_POINT=/mnt/sd_0/USB + ;; +esac + +if [ ! -d $MNT_POINT ];then + mkdir $MNT_POINT +fi + +mount $MDEV $MNT_POINT +'; + +open FILE, ">$rootfsdir/etc/rb_inserting.sh" || die("can't write hotplug helpers!"); +print FILE $insert_sh; +close FILE; +chmod 0755, "$rootfsdir/etc/rb_inserting.sh"; + +my $remove_sh = ' +#!/bin/sh +# $MDEV is the device +sync; +unmount -f $MDEV; +'; + +open FILE, ">$rootfsdir/etc/rb_removing.sh" || die("can't write hotplug helpers!"); +print FILE $remove_sh; +close FILE; +chmod 0755, "$rootfsdir/etc/rb_removing.sh"; # Copy bootloader over @sysargs=("cp", "$rbbname", "$rootfsdir/usr/bin/$rbbasename"); diff --git a/tools/root.make b/tools/root.make index fd42f9b6b2..3f5b4bca17 100644 --- a/tools/root.make +++ b/tools/root.make @@ -104,6 +104,8 @@ ifneq (,$(findstring bootloader,$(APPSDIR))) include $(ROOTDIR)/firmware/target/hosted/agptek/rocker.make else ifneq (,$(findstring xduoo,$(APP_TYPE))) include $(ROOTDIR)/firmware/target/hosted/xduoo/xduoo.make + else ifneq (,$(findstring erosq,$(APP_TYPE))) + include $(ROOTDIR)/firmware/target/hosted/aigo/erosq.make else ifneq (,$(findstring fiio,$(APP_TYPE))) include $(ROOTDIR)/firmware/target/hosted/fiio/fiio.make else @@ -156,6 +158,10 @@ else # core include $(ROOTDIR)/firmware/target/hosted/fiio/fiio.make endif + ifneq (,$(findstring erosq,$(APP_TYPE))) + include $(ROOTDIR)/firmware/target/hosted/aigo/erosq.make + endif + ifneq (,$(findstring android_ndk, $(APP_TYPE))) include $(ROOTDIR)/firmware/target/hosted/ibasso/android_ndk.make else -- cgit v1.2.3