How to edit and delete files in OpenWRT Image Builder

Hello. I always receive a lot of help here. There's still a lot I don't know, but thanks to that, my router is gradually coming together.

I used the Image Builder to create my own installation image. At this time, I changed the Luci interface using FILES to include custom configuration files.

However, in FILES, I can only include custom files; I can't change the titles of existing installed files or exclude files.

I want to display MWAN3 status information at the top of the status menu's overview. To do this, I found out that I need to change the number at the beginning of the file name 90_mwan3.js in the /www/luci-static/resources/view/status/include/ directory to a lower number.

Also, I don't want the Software menu under the System menu to be displayed in my Luci. I found that by deleting the /usr/share/luci/menu.d/luci-app-opkg.json file, Software is not displayed under the System menu.

The problem is that I don't know how to modify the file name of a specific file and delete a specific file to create an image with the Image Builder.

I need to create several identical routers, so creating image files with applied configuration settings is important.

If anyone knows about this issue, I would really appreciate your response. Thank you very much.

At some point you will have to build from source…

1 Like

You can include a uci-defaults script with commands not limited to UCI.

1 Like

Thank you very much for your response. I tried using UCI defaults as you suggested. However, I feel that I lack a good understanding of how to use UCI defaults effectively. I attempted to create the following, but it didn't seem to apply at all. Could you please provide me with a more detailed explanation of how to use UCI defaults effectively? I truly appreciate your help.

mkdir -p files/etc/uci-defaults
cat << "EOF" > /etc/uci-defaults/99-custom
uci -q batch << EOI
mv files/www/luci-static/resources/view/status/include/90_mwan3.js files/www/luci-static/resources/view/status/include/1_mwan3.js
rm -f files/usr/share/luci/menu.d/luci-app-opkg.json
EOI
EOF
make image PROFILE="generic" PACKAGES="luci mwan3 luci-app-mwan3 luci-theme-openwrt-2020 luci-i18n-base-ko iptables-nft ip6tables-nft" FILES="files"

Thank you!!

mkdir -p files/etc/uci-defaults
cat << "EOF" > files/etc/uci-defaults/99-custom
mv -f /www/luci-static/resources/view/status/include/90_mwan3.js \
/www/luci-static/resources/view/status/include/05_mwan3.js
rm -f /usr/share/luci/menu.d/luci-app-opkg.json
EOF

Note that you can hide the Software menu entry by removing the luci-app-opkg package.

1 Like

Thank you so much for your reply! Let's handle it like this. Thank you~!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.