Yes
The changes in the repository are so ridiculous that there is no point in even creating a diff-file.
change file {repo}/scripts/mkits.sh
if [ -n "${INITRD}" ]; then
INITRD_NODE="
initrd${REFERENCE_CHAR}$INITRDNUM {
description = \"${ARCH_UPPER} OpenWrt ${DEVICE} initrd\";
${COMPATIBLE_PROP}
data = /incbin/(\"${INITRD}\");
type = \"ramdisk\";
load = <0x5f000000>; <==== new line with load addr for initrd
arch = \"${ARCH}\";
os = \"linux\";
hash${REFERENCE_CHAR}1 {
algo = \"crc32\";
};
hash${REFERENCE_CHAR}2 {
algo = \"${HASH}\";
};
};
"
change file {repo}/target/linux/mediatek/dts/mt7986a-asus-tuf-ax4200.dts
chosen {
stdout-path = "serial0:115200n8";
bootargs-override = "ubi.mtd=UBI_DEV root=/dev/ram0 rw initrd=0x5f000000,8M";
};
change file {repo}/target/linux/mediatek/image/filogic.mk
define Device/asus_tuf-ax4200
DEVICE_VENDOR := ASUS
DEVICE_MODEL := TUF-AX4200
DEVICE_DTS := mt7986a-asus-tuf-ax4200
DEVICE_DTS_DIR := ../dts
# DEVICE_DTS_LOADADDR := 0x47000000
DEVICE_PACKAGES := kmod-usb3 kmod-mt7986-firmware mt7986-wo-firmware
IMAGES := sysupgrade.bin
KERNEL := kernel-bin | lzma | \
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
# KERNEL_INITRAMFS := kernel-bin | lzma | \
# fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
KERNEL_INITRAMFS := kernel-bin | lzma | \
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | uImage none
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
endef
TARGET_DEVICES += asus_tuf-ax4200
After making changes to the files, you need to run the build and wait for initramfs image to appear.
From the resulting bin
image, you need to use the mkasustrx
utility to obtain the trx
image:
mkasustrx.exe -n TUF-AX4200 -i openwrt-mediatek-filogic-asus_tuf-ax4200-initramfs-kernel.bin -o openwrt-mediatek-filogic-asus_tuf-ax4200-initramfs-kernel.trx
A More Correct Way
It is necessary to add support for the mkasustrx
utility to the building scripts and change filogic.mk
:
KERNEL_INITRAMFS := kernel-bin | lzma | \
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | \
uImage none | mkasustrx -n $$(DEVICE_MODEL)
All the assembly changes described above are a terrible hack!
The correct solution is to integrate initrd into the kernel image. I don't know how to build OpenWRT initramfs images this way. But it seems that the kernel parameter CONFIG_INITRAMFS_SOURCE
is responsible for this.
bmork
October 26, 2023, 8:58am
206
The mkits script has grown too many options, but this does look like something which probably should be supported somehow. E.g similar to how the DTB load address was added. Ref
committed 05:41PM - 17 Mar 21 UTC
Allow adding multiple device tree overlay blobs to an image and
generate configu… rations for each of them.
This is useful on boards with modern U-Boot which allow e.g. user-
configurable peripherals ("shields") in that way.
Note that currently, each generated configuration adds exactly one
overlay on top of the base image, ie. adding multiple overlays at the
same time is not yet supported.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
committed 11:16AM - 08 Nov 22 UTC
Support defining a per-device loadaddress for the DTB. This is required
for devi… ces which to not align the DTB from the bootloader correctly.
Signed-off-by: David Bauer <mail@david-bauer.net>
No need to do this. You just need to convince the most important maintainers that you need to make it possible to build a second kernel, which will contain the initrd image.
Some things for this are already in the scripts:
ifeq ($(strip $(CONFIG_EXTERNAL_CPIO)),"")
define Kernel/SetInitramfs/PreConfigure
grep -v -e INITRAMFS -e CONFIG_RD_ -e CONFIG_BLK_DEV_INITRD $(LINUX_DIR)/.config.old > $(LINUX_DIR)/.config
echo 'CONFIG_BLK_DEV_INITRD=y' >> $(LINUX_DIR)/.config
echo 'CONFIG_INITRAMFS_SOURCE="$(strip $(TARGET_DIR) $(INITRAMFS_EXTRA_FILES))"' >> $(LINUX_DIR)/.config
endef
bmork
October 26, 2023, 9:31am
208
OK. This is done by pull requests, not discussions.
Hmmmm. My 4 pull requests have been hanging unclosed for 1...2 years....
2 Likes
bmork
October 26, 2023, 11:27am
210
I can only see 3, and they're all waiting for you to implement requested changes
https://github.com/openwrt/openwrt/pulls?q=is%3Apr+is%3Aopen+remittor
But whatever. Maybe your method works better than mine.
lukjod
October 26, 2023, 11:48am
211
Thank You very much, It worked very good.
I had working openwrt in 3 minutes without nedd of opening housing. Simply GREAT !!!
3 Likes
good job i will try for see
remittor:
I still managed to create a working OpenWRT-initrd image that loads normally into the device’s memory.
Download: https://drive.google.com/drive/folders/172Kyopi-ioart97Pcxtdp0cVz-P1uLcS?usp=sharing
This trx-image must be installed through the stock AsusWRT WEB-panel.
After installation, you need to change your IP-address to 192.168.1.1 and logon into OpenWRT LUCI.
Finally, you need to install the sysupgrade OpenWRT image.
for install via oem and we are OpenWrt ? what is the first file ?
anon78773196:
what is the first file ?
This is a utility for creating an trx-image compatible with AsusWRT installer.
1 Like
ok it's just a bonus that you've added since you've already created the image below, then all I have to do is upgrade the firmware right?
1: I install your image via the software update
2: I update via sysupgrade?
1 Like
lukjod
October 26, 2023, 7:44pm
216
Yes, thats it from asus firmware trx file then log in into luci and make sysupgrade with asus 4200 23.05 sysupgrade image
1 Like
lukjod
October 26, 2023, 7:46pm
217
is there a point in setting on hardware flow offload ? is this feature implemented in this soc?
ok thanks for response
yes
you can see software accelleration in network--> firewall
but i do'nt need me
1 Like
any idea if the initram file posted above will work the same for ASUS TUF-AX5400?
i receve my router tommorow i will test again big thanks for your work
juste a question a flash is like usually router just connect to lan 1 and go
deeddy
October 27, 2023, 1:37am
221
Owengerig:
ASUS TUF-AX5400?
Isn’t that router built on a Broadcom SoC (comparing to Mediatek)?
1 Like
patrykk
October 27, 2023, 7:06am
222
Owengerig:
ASUS TUF-AX5400?
Hi, probably no because of platform "Broadcom BCM6750 1.5Ghz Triple-Core with 512MB RAM". But this solution should be common for TUF ax4200 and TUF ax6000.
1 Like
I updated the trx-image, which is located at the link provided.
Now creating this image is fully automated.
To get this trx-image, just run the following commands:
git clone https://github.com/openwrt-xiaomi/builder -b v23 openwrt-v23
cd openwrt-v23
./xcreate.sh -v xq-23.05.0
cd xq-23.05.0
./xupdate.sh -f
./xmake.sh -f -t tuf_ax4200_initramfs
After the build is completed, in the ./xq-23.05.0/bin/targets/mediatek/filogic
directory should appear file openwrt-mediatek-filogic-asus_tuf-ax4200-initramfs.trx
File changes
New image tool mkasustrx
for creating Asus trx-image:
https://github.com/openwrt-xiaomi/firmware-utils/commit/1d44ff4c26d79c5755ddf5107a83f5bf202f4cae
Downloading and compile new image tool mkasustrx
:
https://github.com/openwrt-xiaomi/openwrt/commit/f282f8ef3e5e688884a5f62429a46ddafb9b933f
Using new image tool mkasustrx
:
https://github.com/openwrt-xiaomi/openwrt/commit/61d5891f8c7d1d6ddbf9675d3d84edfd368eefca
Forced change of the main options responsible for assembling images:
https://github.com/openwrt-xiaomi/builder/commit/975cc0efb3dea0f551cdc82ce819fd74a0d6045f#diff-c5024fd0171059d662ead280421311d0a4a825381fcec2f2bc58baaa40d21198R61-R65
.
Feature separate_ramdisk
The method of building images that I described cannot be added to the official OpenWRT repository, because there, for mtk/filogic
devices, they completely abandoned the integration of initramfs into the kernel:
https://github.com/openwrt/openwrt/blob/eacc885816fb46bf4054b0c3dd2cd1513322ad09/target/linux/mediatek/Makefile#L9
Feature separate_ramdisk
blocks the ability to insert initrams into the kernel!
1 Like
what is the rapport between writed
below and this files
i have my asus in one hour i will test
thanks