Youku YK-L1c

Report problems and success stories with Gargoyle on various hardware platforms.

Moderator: Moderators

Lantis
Moderator
Posts: 6920
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: Youku YK-L1c

Post by Lantis »

So to make it a generic build, rather than picking your device specifically, you pick your devices architecture. This will mean that it builds all similar devices.
A specific device profile is probably not suited to Gargoyle on its own.

Like i said, i'm pretty sure yours could tack onto ramips.mt7620_usb
https://lantisproject.com/downloads/gargoylebuilds for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

ghorvath
Posts: 46
Joined: Thu Sep 29, 2016 12:03 pm

Re: Youku YK-L1c

Post by ghorvath »

Hm, ok, I kind of understand. So you are saying I should choose the "Default profile" as device, instead of the actual "Youku YK1" device?

I did that. The differences are the following. With the default setting I have

Code: Select all

CONFIG_TARGET_ramips_mt7620_Default=y
# CONFIG_TARGET_ramips_mt7620_DEVICE_youku-yk1 is not set
CONFIG_TARGET_PROFILE="Default"
CONFIG_DEFAULT_kmod-usb-core=y
# CONFIG_PACKAGE_kmod-mmc is not set
# CONFIG_PACKAGE_kmod-sdhci-mt7620 is not set
whereas with the "Youku YK1" setting I have

Code: Select all

# CONFIG_TARGET_ramips_mt7620_Default is not set
CONFIG_TARGET_ramips_mt7620_DEVICE_youku-yk1=y
CONFIG_TARGET_PROFILE="DEVICE_youku-yk1"
CONFIG_DEFAULT_kmod-sdhci-mt7620=y
CONFIG_PACKAGE_kmod-mmc=y
CONFIG_PACKAGE_kmod-sdhci-mt7620=y
Now, the first 3 lines are obvious differences, nothing to worry about.
I believe the 5th and 6th line correspond to the drivers of a micro-sd card reader. Now I did not disassemble (yet) my youku device, but according to the specifications, it should contain a micro sd card reader.
The 4th line (kmod-usb-core vs kmod-sdhci-mt7620) I am not entirely sure about. The "kmod-sdhci-mt7620" in my config indicates again something to do with the micro sd card reader, but I am not quite sure why kmod-usb-core is missing as CONFIG_DEFAULT. The kmod-usb-core is certainly added as a package, though.

Anyway, I am happy to generate the default profiles, and see if they compile. For that, I actually would like to know the difference between usb_mt7620 and usb_mt7620_mt76. In the repository file, they differ in two lines:

Code: Select all

CONFIG_PACKAGE_kmod-usb-dwc2=y
CONFIG_PACKAGE_kmod-mt76=y
are set in the _mt76 version, and not in the other. However, I am not sure how the _mt76 version was obtained. Should I just pick these two extra packages?

In any case I am not sure that my device should be in any of the default profiles, because of the micro sd card reader. Or maybe those could be added by selecting some appropriate packages?

Does it make sense? What should be my next steps?

Lantis
Moderator
Posts: 6920
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: Youku YK-L1c

Post by Lantis »

Your generic profile now looks better.

I too am not sure about the _mt76 version. @obsy (Cezary) submitted the ramips platform so he is the one to ask.

I don't see a problem adding sd card support to the mt7620_usb profile. They should have enough space to add that module without any problems even if they don't have an sd card slot themselves.

Ultimately i don't have any ramips devices so i can't assist much.
https://lantisproject.com/downloads/gargoylebuilds for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

ghorvath
Posts: 46
Joined: Thu Sep 29, 2016 12:03 pm

Re: Youku YK-L1c

Post by ghorvath »

Ok, I can add the mmc support by hand, that's not a problem. Then we could replace usb_mt7620 with the one with mmc support?

As for usb_mt7620_mt76, I wrote a PM to Cezary. Now, kmod-mt76 seems to be already added to the current default setting, so that leaves kmod-usb-dwc2 to be added as extra to this profile. However, if I make a config using the Xiaomi Miwifi mini target profile (the only one supported by usb_mt7620_mt76), then I do not get the kmod-usb-dwc2 package to be turned on. So maybe the usb_mt7620 and usb_mt7620_mt76 profiles can be merged, as well, and we could have one unified usb_mt7620 profile?

@Cezary, could you please take a look and advise?

PS. @Lantis I guess I would need to add my pull request on top of your pull request or something? How would that technically work?

Lantis
Moderator
Posts: 6920
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: Youku YK-L1c

Post by Lantis »

You can just create a new PR and mention that it relies on mine.
https://lantisproject.com/downloads/gargoylebuilds for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

ghorvath
Posts: 46
Joined: Thu Sep 29, 2016 12:03 pm

Re: Youku YK-L1c

Post by ghorvath »

Ok, so I have a problem. I somehow need to be able to select which devices should be compiled, because gargoyle does not fit every device:

Code: Select all

ghorvath@SamsungLaptop:~/work/gargoyle$ make ramips.mt7620_min

....

/mnt/work/ghorvath/gargoyle/ramips-src/staging_dir/host/bin/padjffs2 /mnt/work/ghorvath/gargoyle/ramips-src/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7620/tmp/openwrt-ramips-mt7620-ex2700-squashfs-factory.bin  4
padding image to 0045b000
WARNING: Image file /mnt/work/ghorvath/gargoyle/ramips-src/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7620/tmp/openwrt-ramips-mt7620-ex2700-squashfs-factory.bin is too big
/mnt/work/ghorvath/gargoyle/ramips-src/staging_dir/host/bin/mkdniimg -B EX2700 -v OpenWrt.r6907+336 -H 29764623+4+0+32+2x2+0 -r "" -i /mnt/work/ghorvath/gargoyle/ramips-src/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7620/tmp/openwrt-ramips-mt7620-ex2700-squashfs-factory.bin -o /mnt/work/ghorvath/gargoyle/ramips-src/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7620/tmp/openwrt-ramips-mt7620-ex2700-squashfs-factory.bin.new
[mkdniimg] *** error: stat failed on /mnt/work/ghorvath/gargoyle/ramips-src/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7620/tmp/openwrt-ramips-mt7620-ex2700-squashfs-factory.bin: No such file or directory
Makefile:288: recipe for target '/mnt/work/ghorvath/gargoyle/ramips-src/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7620/tmp/openwrt-ramips-mt7620-ex2700-squashfs-factory.bin' failed
make[6]: *** [/mnt/work/ghorvath/gargoyle/ramips-src/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7620/tmp/openwrt-ramips-mt7620-ex2700-squashfs-factory.bin] Error 1
make[6]: Leaving directory '/mnt/work/ghorvath/gargoyle/ramips-src/target/linux/ramips/image'
Makefile:26: recipe for target 'install' failed
make[5]: *** [install] Error 2
make[5]: Leaving directory '/mnt/work/ghorvath/gargoyle/ramips-src/target/linux/ramips'
Makefile:13: recipe for target 'install' failed
make[4]: *** [install] Error 2
make[4]: Leaving directory '/mnt/work/ghorvath/gargoyle/ramips-src/target/linux'
Command exited with non-zero status 2
time: target/linux/install#72.30#6.00#79.22
target/Makefile:23: recipe for target 'target/linux/install' failed
make[3]: *** [target/linux/install] Error 2
make[3]: Leaving directory '/mnt/work/ghorvath/gargoyle/ramips-src'
target/Makefile:19: recipe for target '/mnt/work/ghorvath/gargoyle/ramips-src/staging_dir/target-mipsel_24kc_musl/stamp/.target_install' failed
make[2]: *** [/mnt/work/ghorvath/gargoyle/ramips-src/staging_dir/target-mipsel_24kc_musl/stamp/.target_install] Error 2
make[2]: Leaving directory '/mnt/work/ghorvath/gargoyle/ramips-src'
/mnt/work/ghorvath/gargoyle/ramips-src/include/toplevel.mk:216: recipe for target 'world' failed
make[1]: *** [world] Error 2
make[1]: Leaving directory '/mnt/work/ghorvath/gargoyle/ramips-src'
ghorvath@SamsungLaptop:~/work/gargoyle$ 
Here the mt7620_min profile contains only the gargoyle basic package as an extra compared to the openwrt default config. So the compile exits with error, and not all images are built.

What can I do now? How can I exclude specific devices from a particular default build?

Lantis
Moderator
Posts: 6920
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: Youku YK-L1c

Post by Lantis »

You can’t. You need to patch the build process to not bailout on oversized images. I’ve patched most of the ramips required components while investigating your image, but as I said, I stopped.

This isn’t entirely straight forward to explain or do
https://lantisproject.com/downloads/gargoylebuilds for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

Lantis
Moderator
Posts: 6920
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: Youku YK-L1c

Post by Lantis »

This is the beginning of a patch that will fix the build crashing on oversized images. I didn't finish it. The next place it crashes is at padjffs2 from memory

The patch hasn't been formatted properly for inclusion in Gargoyle yet, it was just a scratch pad.

Code: Select all

Index: gargoyle/ramips-src/include/image-commands.mk
===================================================================
--- gargoyle.orig/ramips-src/include/image-commands.mk
+++ gargoyle/ramips-src/include/image-commands.mk
@@ -275,9 +275,12 @@ define Build/tplink-v2-image
 		-H $(TPLINK_HWID) -W $(TPLINK_HWREV) \
 		-w $(TPLINK_HWREVADD) -F "$(TPLINK_FLASHLAYOUT)" \
 		-T $(TPLINK_HVERSION) -V "ver. 2.0" -a 0x4 -j \
-		-k $(IMAGE_KERNEL) -r $(IMAGE_ROOTFS) -o $@.new $(1)
-	cat $@.new >> $@
-	rm -rf $@.new
+		-k $(IMAGE_KERNEL) -r $(IMAGE_ROOTFS) -o $@.new $(1); \
+	if [ -e "$@.new" ]; then \
+		cat $@.new >> $@; \
+		rm -rf $@.new;	\
+	fi ; \
+	echo ""
 endef
 
 json_quote=$(subst ','\'',$(subst ",\",$(1)))
Index: gargoyle/ramips-src/target/linux/ramips/image/Makefile
===================================================================
--- gargoyle.orig/ramips-src/target/linux/ramips/image/Makefile
+++ gargoyle/ramips-src/target/linux/ramips/image/Makefile
@@ -135,7 +135,8 @@ define Build/mkdlinkfw
 		-k $(IMAGE_KERNEL) \
 		-r $(IMAGE_ROOTFS) \
 		-o $@ \
-		-s $(DLINK_FIRMWARE_SIZE)
+		-s $(DLINK_FIRMWARE_SIZE); \
+	echo ""
 endef
 
 define Build/mkdlinkfw-factory
@@ -143,8 +144,11 @@ define Build/mkdlinkfw-factory
 		-m $(DLINK_ROM_ID) -f $(DLINK_FAMILY_MEMBER) \
 		-F $@ \
 		-o $@.new \
-		-s $(DLINK_FIRMWARE_SIZE)
-	mv $@.new $@
+		-s $(DLINK_FIRMWARE_SIZE); \
+	if [ -e "$@.new" ]; then \
+		mv $@.new $@; \
+	fi ; \
+	echo ""
 endef
 
 #
https://lantisproject.com/downloads/gargoylebuilds for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

ghorvath
Posts: 46
Joined: Thu Sep 29, 2016 12:03 pm

Re: Youku YK-L1c

Post by ghorvath »

Ok, I have a pull request, which is not ready to be merged, yet, but I wanted to put out the config file in the open:

https://github.com/ericpaulbishop/gargoyle/pull/772

Lantis: for some reason I was not able to apply your patch directly, I got an error for the check:

Code: Select all

ghorvath@SamsungLaptop:~/work/gargoyle$ git apply --check ramips.patch
error: patch failed: ramips-src/include/image-commands.mk:275
error: ramips-src/include/image-commands.mk: patch does not apply
error: patch failed: ramips-src/target/linux/ramips/image/Makefile:135
error: ramips-src/target/linux/ramips/image/Makefile: patch does not apply
I will try to apply it by hand, and see where I get with it. Then I may try to continue creating the patch, and if it works, I will post that, as well. Any suggestions on how I could continue?

ghorvath
Posts: 46
Joined: Thu Sep 29, 2016 12:03 pm

Re: Youku YK-L1c

Post by ghorvath »

Oh, yes, and if I continue changing the necessary files, how do I save the changes afterwards into a patch file? So they would not get lost?

Post Reply