help with compiling first image

Discuss the technical details of Gargoyle and ongoing development

Moderator: Moderators

Post Reply
oliver
Posts: 48
Joined: Wed Jun 04, 2014 7:30 pm

help with compiling first image

Post by oliver »

I should preface this by saying I don't really know what I'm doing.

I have a Hootoo HT-ND001 that is sold under a few different names:
Strong 1200
MTC WR1201

The Strong 1200 page has links to official OpenWRT 19.07.0 images so I guessed that Gargoyle 1.13 should be good too

I cloned the git repo and edited the files under gargoyle/targets/ramips/profiles/mt7621 (the device has a MediaTek 7621AT SOC.)
Within 'config' I unhashed the "mt7621_DEVICE" lines and set to "y" and added "mtc_wr1201-" to profile-images

Then ran:
$ make ramips FULL_BUILD=true

Everything seemed to compile OK and I see a ton of IPKs under ./ramips-src/bin/targets/ramips/mt7621/packages/

I'm not sure how to get from here to flashable images (initramfs and sysupgrade)
I realise it's probably in the docs somewhere but I'm not seeing it. I also think I've missed a step because I'm not sure how an image would know which partition to put stuff into etc.

Is there a guide somewhere for total newbies? I have soldered pins for the serial and it's working as expected so I can experiment

ispyisail
Moderator
Posts: 5180
Joined: Mon Apr 06, 2009 3:15 am
Location: New Zealand

Re: help with compiling first image

Post by ispyisail »

In my opinion you really need to do a default build first.

Make sure your build environment works before moving onto more advanced things.

Get a cheap router like the inet AR150 to test with.

pythonic
Posts: 230
Joined: Mon Mar 11, 2019 5:47 am
Location: Australia

Re: help with compiling first image

Post by pythonic »

oliver wrote:
Sun Oct 23, 2022 9:11 am
Everything seemed to compile OK and I see a ton of IPKs under ./ramips-src/bin/targets/ramips/mt7621/packages/
Did you look in ./built (should contain packages) and ./images (where the output images go...).

I take it you have read the developer docs...

oliver
Posts: 48
Joined: Wed Jun 04, 2014 7:30 pm

Re: help with compiling first image

Post by oliver »

ispyisail wrote:
Sun Oct 23, 2022 11:29 pm
In my opinion you really need to do a default build first.

Make sure your build environment works before moving onto more advanced things.

Get a cheap router like the inet AR150 to test with.
Fair enough - I see where you're coming from on that.

oliver
Posts: 48
Joined: Wed Jun 04, 2014 7:30 pm

Re: help with compiling first image

Post by oliver »

pythonic wrote:
Mon Oct 24, 2022 6:50 am

Did you look in ./built (should contain packages) and ./images (where the output images go...).
"should contain packages"... just empty dirs

Code: Select all

$ find .
.
./ramips
./ramips/mt7620
./ramips/mt7620_usb
./ramips/default_kernelspecific
./ramips/mt7620_kernelspecific
./ramips/mt7621_kernelspecific
./ramips/default
./ramips/mt7620_usb_kernelspecific
./ramips/mt7621
images just looks like kernel configs

Code: Select all

$ find .
.
./ramips
./ramips/ramips-default.buildinfo
./ramips/ramips-mt7621.buildinfo
./ramips/ramips-mt7620_usb.buildinfo
./ramips/ramips-mt7620.buildinfo
I take it you have read the developer docs...
Yeah - some of it was going over my head. No biggie, I'll continue to try to see if I can get this working. I appreciate the response.

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

Re: help with compiling first image

Post by Lantis »

If those folders are empty then you produced nothing viable. I agree with the advice to try a plain build first, make sure that works, then you can add your desired new device.
Also run
make FULL_BUILD=true ramips.mt7621
Which will just build the one profile and save you some time


1. Back to basics, do a default ramips.mt7621 build and prove your environment works
2. Try your modifications again
3. Post your config for checking
In that order :)
http://lantisproject.com/downloads/gargoyle_ispyisail.php for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

oliver
Posts: 48
Joined: Wed Jun 04, 2014 7:30 pm

Re: help with compiling first image

Post by oliver »

1) My environment was, indeed, bad. Must have missed some development pkg somewhere. Anyway, I switched to a docker container, got the needed packages and was able to build the ramips.mt7621 image

2+3) The only files I edited were in .../targets/ramips/profiles/mt7621

Code: Select all

$ sdiff -s config config.dist 
CONFIG_TARGET_ramips_mt7621_DEVICE_mtc_wr1201=y               | # CONFIG_TARGET_ramips_mt7621_DEVICE_mtc_wr1201 is not set
CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_mtc_wr1201=y        | # CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_mtc_wr1201 is not

Code: Select all

$ sdiff -s profile_images profile_images.dist 
mtc_wr1201-
This did indeed, build a initramfs and sysupgrade image.

The part I'm still missing is how does it know which part of the flash memory to install to? E.g. when I'm booted up to openwrt I see the partitions as follows:

Code: Select all

root@OpenWrt:/# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00030000 00010000 "Bootloader"
mtd1: 00010000 00010000 "Config"
mtd2: 00010000 00010000 "factory"
mtd3: 00fa0000 00010000 "firmware"
mtd4: 00290e82 00010000 "kernel"
mtd5: 00d0f17e 00010000 "rootfs"
mtd6: 00950000 00010000 "rootfs_data"
mtd7: 00010000 00010000 "Second_Config"


root@OpenWrt:/# cat /proc/partitions
major minor  #blocks  name

  31        0        192 mtdblock0
  31        1         64 mtdblock1
  31        2         64 mtdblock2
  31        3      16000 mtdblock3
  31        4       2627 mtdblock4
  31        5      13372 mtdblock5
  31        6       9536 mtdblock6
  31        7         64 mtdblock7
I'm assuming that if I overwrite the bootloader, the router is dead (for example)

Can I assume that since there were entries for wr1201 in the config, this part has been taken care of already... and it really is just as simple as enabling them, building and flashing?

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

Re: help with compiling first image

Post by Lantis »

Generally that’s correct.
Openwrt makes critical partitions read only by default and requires additional modules installed to make them read write. It’s hard to make a mistake unless you start using low level tools like dd to write to disk.
Another good place to check is the initial commit that introduced support for the device for any warnings or special instructions.
The only notable thing I see is about the factory web interface requiring initramfs first.
https://git.openwrt.org/?p=openwrt/open ... d6a12b096b

Good job getting your build working.
By the way with that one you probably only need the change to profile_images and not the config. The mt7621 target in gargoyle doesn’t use individual device configs (we do in other targets) and so it was probably building by default just not copying to output :)
http://lantisproject.com/downloads/gargoyle_ispyisail.php for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

oliver
Posts: 48
Joined: Wed Jun 04, 2014 7:30 pm

Re: help with compiling first image

Post by oliver »

Thanks for all the advice, flashing was a success

Code: Select all

BusyBox v1.30.1 () built-in shell (ash)

------------------------------------------------------------------
|            _____                             _                 |
|           |  __ \                           | |                |
|           | |  \/ __ _ _ __ __ _  ___  _   _| | ___            |
|           | | __ / _` | '__/ _` |/ _ \| | | | |/ _ \           |
|           | |_\ \ (_| | | | (_| | (_) | |_| | |  __/           |
|            \____/\__,_|_|  \__, |\___/ \__, |_|\___|           |
|                             __/ |       __/ |                  |
|                            |___/       |___/                   |
|                                                                |
|----------------------------------------------------------------|
| Gargoyle version 1.13.X   | OpenWrt 19.07 branch               |
| Gargoyle revision 4f6e9c33| OpenWrt commit 83b0e20             |
| Built October 27, 2022    | Target  ramips/mt7621              |
------------------------------------------------------------------
Can't do a real full test because others are using the internet and I don't want to disrupt them but I think it's good.

Post Reply