HI
Im looking how to create a custom image for GL-AR150 with custom files,and Im using
Imagebuilder from Github
All part to update and install packages goes nice, my problem is to use files function. In my case Im checking to use “customize.json” file from root imagebuildrer folder adding this lines
“project”:{
“profile”: “gl-ar150”,
“version”: “3.027”,
“imagebuilder”: “3.1/openwrt-imagebuilder-ar71xx-generic_3.1”,
“packages”: “gl-base-files-ar $basic $vpn $storage $usb $glinet tcpdump logrotate curl gawk”,
“files”: “etc/config/firewall”
}
and not appears any error but firewall file not appears modified. I create a “files” folder to create all tree like
$IMAGEFOLDER_ROOT/files/etc/config/firewall
being in same level that imagebuilder folder used in “imagebuilder” section. To understand:
imagebuilder
├── bin
├── config
├── customize.json
├── Dockerfile
├── gl_image
├── glinet
├── imagebuilder
├── openwrt
├── files
After to exec
gl_image -c customize.json -p project
Create the image .bin but not appears new file being always default file. Any idea?
I was checking inside history and only I saw similar this topic, but still incomplete.
Hi.
I’m using the latest version of the imagebuilder (GitHub - gl-inet/imagebuilder: Warning!Please look at 'GL.iNET Imagebuilder Introduction' section. )
I need an image preconfigured with different packages and some custom config files.
I’m creating the image using the command
./gl_image -p ar300m16 -e “openssh-sftp-server nano htop curl tcpdump usbutils etc…”
and I’m placing my custom config files on
imagebuilder/3.0/openwrt-imagebuilder-ar71xx-generic/files/etc/config/mycustomconfig
wh…
alzhao
February 14, 2020, 4:58am
2
The files path should be the root path of all your files. For example, if you put /etc/config/firewall in
/home/xxx/openwrt/files/etc/config/firewall, you need to write
“files”: “/home/xxx/openwrt/files”
It will simply copy all the contents to your firmware to override the other files. Note, you have to set the correct access right first. For example if you have a executable script you need to use chmod +x yourshcript.sh
in your host system.
To update this case, for now I detected that only you can upload non config files, because script process will remove files in the process to setup.
inside customize.json you need to add for example:
"files": "imagebuilder/3.1/openwrt-imagebuilder-ar71xx-generic_3.1/files"
and this folder “files” is the root tree to copy files, in my case I created
imagebuilder/3.1/openwrt-imagebuilder-ar71xx-generic_3.1/files/etc/config/test
but I don’t know how to change config templates.
alzhao
February 18, 2020, 6:37am
4
What do you want to change?
lancer
February 18, 2020, 7:11am
5
Which files do you want to modify?
Could you please show me your operate step by step?
Thanks.
My idea in this thread is only to change firewall file config. Other idea is justly to setup crontab and logrotate, but I imagine is a bit different
lancer
February 18, 2020, 1:16pm
7
You better not modify the firewall configuration directly.
This may cause you to lose access to the router. And you had to use uboot to debrick your router.
I recommend you to write a startup script to change it.
rp201rp
February 18, 2020, 1:42pm
8
is it possible to put firewall in / / /files/root/firewall
and a modded /files/etc/rc.local
where rc.local has
onetime()
cp /root/firewall /etc/config
rm /root/firewall
lancer
February 19, 2020, 4:46am
9
Your changes about the firewall need to be based on the firewall configuration after the system initialized.
Therefore, you can copy the firewall configuration from the router to the Imagebuilder to make a default configuration.
Yes, but I can’t find the file that configs default values. I was looking different folders but never change de file when compile.
alzhao
February 19, 2020, 9:54am
11
You need to copy a firewall config from your existing working firmware and put it in your imagebuilder files.
It is actually just easy.
Hi
I copied customized firewall file into:
./gl_imagebuilder/imagebuilder/3.1/openwrt-imagebuilder-ar71xx-generic_3.1/build_dir/target-mips_24kc_musl/root-ar71xx/etc/config/firewall
I compiled
./gl_image --offline -c customize.json -p ondego
(I used offline mode to be sure than nothing is replaced)
and extracted:
binwalk -e openwrt-ondego-3.027-0219_customize.bin
inside the package I can’t find any file firewall with similar content
$ find ./ -name “*firewall”
./S19firewall
./gl-firewall
./firewall
./20-firewall
being firewall file this code;
#!/bin/sh /etc/rc.common
START=19
USE_PROCD=1
QUIET=“”
etc…
Where is setting firewall openwrt?
alzhao
February 19, 2020, 10:46am
13
You should put your firewall in your “files” path, not root-ar71xx. That is how “files” work.
imagebuilder/3.1/openwrt-imagebuilder-ar71xx-generic_3.1/files/etc/config/firewall
Checking I see how I included in both places. test file works, firewall file is changed.
Hi
to update and close thread the problem was the form to use sysupgrade command
By default sysupgrade not remove system. To work fine is
sysupgrade -n /tmp/image.bin
Documentation advise but putting bad the first example and induce to error.
1 Like