Discussion:
Reducing the root file system in openwrt
(too old to reply)
Arjav Parikh
2018-03-07 11:02:10 UTC
Permalink
Hi,

I want to reduce the root file system size for my project. Till now
after removing the unnecessary kernel modules, libraries and using
strip binary the file system size has been reduced to 8.3 MB. Bu there
are still some files which are not required and I am unaware of how to
prvent these files from being included in my file system using
openwrt.

For Ex: there are multiple binaries in /lib/firmware which are not
required. This folder itself contains size of 4.4 MB, apart from these
there are many libraries in /lib as well as /usr/lib which are not
required.

Can anyone please guide of how to remove firmware binaries and
libraries in openwrt.
--
Thanks & Regards,
Arjav Parikh
Ronaldo Afonso
2018-03-07 11:37:21 UTC
Permalink
Hi Arjav,

Which kind of firmware are you using? An OpenWrt prebuilt (from
https://downloads.openwrt.org/releases/) or a firmware build by yourself?

Well, in or case, I suggest you build your firmware ... using "make
menuconfig" is the first thing to try for removing unnecessary binaries.
Post by Arjav Parikh
Hi,
I want to reduce the root file system size for my project. Till now
after removing the unnecessary kernel modules, libraries and using
strip binary the file system size has been reduced to 8.3 MB. Bu there
are still some files which are not required and I am unaware of how to
prvent these files from being included in my file system using
openwrt.
For Ex: there are multiple binaries in /lib/firmware which are not
required. This folder itself contains size of 4.4 MB, apart from these
there are many libraries in /lib as well as /usr/lib which are not
required.
Can anyone please guide of how to remove firmware binaries and
libraries in openwrt.
--
Thanks & Regards,
Arjav Parikh
_______________________________________________
openwrt-devel mailing list
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
--
Ronaldo Afonso
11 9 5252 0484
www.ronaldoafonso.com.br
Arjav Parikh
2018-03-07 12:00:31 UTC
Permalink
Hi Ronaldo,

I am building firmware for IPQ806x platform. I have been able to
reduce my firmware image from 22 MB to 10 MB by disabling unwanted
kernel modules and libraries using make menuconfig.

But there are files in root-ipq806x/lib/fimrware directory of approx
size 4.4 MB. I do not require any of the files present in this
directory. I tried to remove those files by removing its entry from
root-ipq806x/usr/lib/opkg/info/wigig-firmware.list assuming that on
next build these files wont appear but still the files are there in
/lib/firmware directory.
By removing these files I can further reduce filesystem by 4 MB.


On Wed, Mar 7, 2018 at 5:07 PM, Ronaldo Afonso
Post by Ronaldo Afonso
Hi Arjav,
Which kind of firmware are you using? An OpenWrt prebuilt (from
https://downloads.openwrt.org/releases/) or a firmware build by yourself?
Well, in or case, I suggest you build your firmware ... using "make
menuconfig" is the first thing to try for removing unnecessary binaries.
Post by Arjav Parikh
Hi,
I want to reduce the root file system size for my project. Till now
after removing the unnecessary kernel modules, libraries and using
strip binary the file system size has been reduced to 8.3 MB. Bu there
are still some files which are not required and I am unaware of how to
prvent these files from being included in my file system using
openwrt.
For Ex: there are multiple binaries in /lib/firmware which are not
required. This folder itself contains size of 4.4 MB, apart from these
there are many libraries in /lib as well as /usr/lib which are not
required.
Can anyone please guide of how to remove firmware binaries and
libraries in openwrt.
--
Thanks & Regards,
Arjav Parikh
_______________________________________________
openwrt-devel mailing list
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
--
Ronaldo Afonso
11 9 5252 0484
www.ronaldoafonso.com.br
--
Thanks & Regards,
Arjav Parikh
Sven Eckelmann
2018-03-07 12:14:01 UTC
Permalink
On Mittwoch, 7. März 2018 17:30:31 CET Arjav Parikh wrote:
[...]
Post by Arjav Parikh
I tried to remove those files by removing its entry from
root-ipq806x/usr/lib/opkg/info/wigig-firmware.list assuming that on
next build these files wont appear but still the files are there in
/lib/firmware directory.
Is this a new package? Newer heard about wigig-firmware. Maybe this isn't
actually OpenWrt from openwrt.org. But when it is, then you should not modify
the generated root directory but just go into `make menuconfig` and deselect
the wigig-firmware entry.

Kind regards,
Sven
Felix Fietkau
2018-03-07 12:14:42 UTC
Permalink
Post by Arjav Parikh
Hi Ronaldo,
I am building firmware for IPQ806x platform. I have been able to
reduce my firmware image from 22 MB to 10 MB by disabling unwanted
kernel modules and libraries using make menuconfig.
But there are files in root-ipq806x/lib/fimrware directory of approx
size 4.4 MB. I do not require any of the files present in this
directory. I tried to remove those files by removing its entry from
root-ipq806x/usr/lib/opkg/info/wigig-firmware.list assuming that on
next build these files wont appear but still the files are there in
/lib/firmware directory.
By removing these files I can further reduce filesystem by 4 MB.
Hi Arjav,

Are you really using a real OpenWrt?
The presence of the "wigig-firmware" package makes me suspect that
you're using the "QSDK" fork instead. In that case, you should probably
ask QCA for support instead. We won't be able to help you properly,
since the system that you're using is very heavily modified in many ways.

- Felix
Aaron Z
2018-03-07 13:07:55 UTC
Permalink
Post by Felix Fietkau
Are you really using a real OpenWrt?
The presence of the "wigig-firmware" package makes me suspect that
you're using the "QSDK" fork instead. In that case, you should probably
ask QCA for support instead. We won't be able to help you properly,
since the system that you're using is very heavily modified in many ways.
Good point, looking at
https://downloads.openwrt.org/releases/17.01.4/targets/ipq806x/generic/
and https://downloads.openwrt.org/snapshots/targets/ipq806x/generic/,
with the exception of the openwrt-ipq806x-vmlinux.elf image, all of
the images on there are under 10MB and most are under 6MB.

Aaron Z
A human being should be able to change a diaper, plan an invasion,
butcher a hog, conn a ship, design a building, write a sonnet, balance
accounts, build a wall, set a bone, comfort the dying, take orders,
give orders, cooperate, act alone, solve equations, analyze a new
problem, pitch manure, program a computer, cook a tasty meal, fight
efficiently, die gallantly. Specialization is for insects.
— Robert Heinlein, Time Enough for Love
Ronaldo Afonso
2018-03-07 13:19:09 UTC
Permalink
Arjav,

I'm not 100% sure of that, but if I were you I would take a look at the
Makefiles that generate those packages whose files you don't want to be
included in the final build image.

Often the "install" directive of an OpenWrt Makefile is where developers
"include" the files they want to be include in the final image.

Here is an example of libbz2 package:

77 define Package/libbz2/install
78 $(INSTALL_DIR) $(1)/usr/lib/
79 $(CP) $(PKG_BUILD_DIR)/libbz2.so.$(PKG_VERSION) $(1)/usr/lib/
80 $(LN) libbz2.so.$(PKG_VERSION) $(1)/usr/lib/libbz2.so.1.0
81 endef

For example, if you don't want the "libbz2.so" to be included, you can
remove lines 79 and 80.
Post by Arjav Parikh
Hi Ronaldo,
I am building firmware for IPQ806x platform. I have been able to
reduce my firmware image from 22 MB to 10 MB by disabling unwanted
kernel modules and libraries using make menuconfig.
But there are files in root-ipq806x/lib/fimrware directory of approx
size 4.4 MB. I do not require any of the files present in this
directory. I tried to remove those files by removing its entry from
root-ipq806x/usr/lib/opkg/info/wigig-firmware.list assuming that on
next build these files wont appear but still the files are there in
/lib/firmware directory.
By removing these files I can further reduce filesystem by 4 MB.
On Wed, Mar 7, 2018 at 5:07 PM, Ronaldo Afonso
Post by Ronaldo Afonso
Hi Arjav,
Which kind of firmware are you using? An OpenWrt prebuilt (from
https://downloads.openwrt.org/releases/) or a firmware build by
yourself?
Post by Ronaldo Afonso
Well, in or case, I suggest you build your firmware ... using "make
menuconfig" is the first thing to try for removing unnecessary binaries.
Post by Arjav Parikh
Hi,
I want to reduce the root file system size for my project. Till now
after removing the unnecessary kernel modules, libraries and using
strip binary the file system size has been reduced to 8.3 MB. Bu there
are still some files which are not required and I am unaware of how to
prvent these files from being included in my file system using
openwrt.
For Ex: there are multiple binaries in /lib/firmware which are not
required. This folder itself contains size of 4.4 MB, apart from these
there are many libraries in /lib as well as /usr/lib which are not
required.
Can anyone please guide of how to remove firmware binaries and
libraries in openwrt.
--
Thanks & Regards,
Arjav Parikh
_______________________________________________
openwrt-devel mailing list
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
--
Ronaldo Afonso
11 9 5252 0484
www.ronaldoafonso.com.br
--
Thanks & Regards,
Arjav Parikh
--
Ronaldo Afonso
11 9 5252 0484
www.ronaldoafonso.com.br
Arjav Parikh
2018-03-07 13:24:07 UTC
Permalink
Hi Ronaldo,

I tried doing that by removing the copy line in Makefile but anyhow those
files come into build_dir.

I suspect that those files get included from dl directory. Is my
understanding in this correct?

If I remove packages from dl directory then I get compilation errors.


Thanks & Regards,
Arjav Parikh
Post by Ronaldo Afonso
Arjav,
I'm not 100% sure of that, but if I were you I would take a look at the
Makefiles that generate those packages whose files you don't want to be
included in the final build image.
Often the "install" directive of an OpenWrt Makefile is where developers
"include" the files they want to be include in the final image.
77 define Package/libbz2/install
78 $(INSTALL_DIR) $(1)/usr/lib/
79 $(CP) $(PKG_BUILD_DIR)/libbz2.so.$(PKG_VERSION) $(1)/usr/lib/
80 $(LN) libbz2.so.$(PKG_VERSION) $(1)/usr/lib/libbz2.so.1.0
81 endef
For example, if you don't want the "libbz2.so" to be included, you can
remove lines 79 and 80.
Post by Arjav Parikh
Hi Ronaldo,
I am building firmware for IPQ806x platform. I have been able to
reduce my firmware image from 22 MB to 10 MB by disabling unwanted
kernel modules and libraries using make menuconfig.
But there are files in root-ipq806x/lib/fimrware directory of approx
size 4.4 MB. I do not require any of the files present in this
directory. I tried to remove those files by removing its entry from
root-ipq806x/usr/lib/opkg/info/wigig-firmware.list assuming that on
next build these files wont appear but still the files are there in
/lib/firmware directory.
By removing these files I can further reduce filesystem by 4 MB.
On Wed, Mar 7, 2018 at 5:07 PM, Ronaldo Afonso
Post by Ronaldo Afonso
Hi Arjav,
Which kind of firmware are you using? An OpenWrt prebuilt (from
https://downloads.openwrt.org/releases/) or a firmware build by
yourself?
Post by Ronaldo Afonso
Well, in or case, I suggest you build your firmware ... using "make
menuconfig" is the first thing to try for removing unnecessary binaries.
Post by Arjav Parikh
Hi,
I want to reduce the root file system size for my project. Till now
after removing the unnecessary kernel modules, libraries and using
strip binary the file system size has been reduced to 8.3 MB. Bu there
are still some files which are not required and I am unaware of how to
prvent these files from being included in my file system using
openwrt.
For Ex: there are multiple binaries in /lib/firmware which are not
required. This folder itself contains size of 4.4 MB, apart from these
there are many libraries in /lib as well as /usr/lib which are not
required.
Can anyone please guide of how to remove firmware binaries and
libraries in openwrt.
--
Thanks & Regards,
Arjav Parikh
_______________________________________________
openwrt-devel mailing list
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
--
Ronaldo Afonso
11 9 5252 0484
www.ronaldoafonso.com.br
--
Thanks & Regards,
Arjav Parikh
--
Ronaldo Afonso
11 9 5252 0484
www.ronaldoafonso.com.br
Ronaldo Afonso
2018-03-07 19:01:12 UTC
Permalink
Arjav,

As far as I know, the final package will end up in the "staging_dir"
directory, not the build_dir. Inside the build_dir will be all the binaries
compiled by the package.

Try doing something like:

1) Edit the Makefile(s) and remove the lines that install binaries you
don't want.
2) Issue: make V=s package/"the package you are compiling"/{clen,install}
3) Check the bin and staging_dir directories (the bin directory is where
the final package will be, in the staging_dir, you can check what was put
inside the package)
Post by Arjav Parikh
Hi Ronaldo,
I tried doing that by removing the copy line in Makefile but anyhow those
files come into build_dir.
I suspect that those files get included from dl directory. Is my
understanding in this correct?
If I remove packages from dl directory then I get compilation errors.
Thanks & Regards,
Arjav Parikh
Post by Ronaldo Afonso
Arjav,
I'm not 100% sure of that, but if I were you I would take a look at the
Makefiles that generate those packages whose files you don't want to be
included in the final build image.
Often the "install" directive of an OpenWrt Makefile is where
developers "include" the files they want to be include in the final image.
77 define Package/libbz2/install
78 $(INSTALL_DIR) $(1)/usr/lib/
79 $(CP) $(PKG_BUILD_DIR)/libbz2.so.$(PKG_VERSION) $(1)/usr/lib/
80 $(LN) libbz2.so.$(PKG_VERSION) $(1)/usr/lib/libbz2.so.1.0
81 endef
For example, if you don't want the "libbz2.so" to be included, you can
remove lines 79 and 80.
Post by Arjav Parikh
Hi Ronaldo,
I am building firmware for IPQ806x platform. I have been able to
reduce my firmware image from 22 MB to 10 MB by disabling unwanted
kernel modules and libraries using make menuconfig.
But there are files in root-ipq806x/lib/fimrware directory of approx
size 4.4 MB. I do not require any of the files present in this
directory. I tried to remove those files by removing its entry from
root-ipq806x/usr/lib/opkg/info/wigig-firmware.list assuming that on
next build these files wont appear but still the files are there in
/lib/firmware directory.
By removing these files I can further reduce filesystem by 4 MB.
On Wed, Mar 7, 2018 at 5:07 PM, Ronaldo Afonso
Post by Ronaldo Afonso
Hi Arjav,
Which kind of firmware are you using? An OpenWrt prebuilt (from
https://downloads.openwrt.org/releases/) or a firmware build by
yourself?
Post by Ronaldo Afonso
Well, in or case, I suggest you build your firmware ... using "make
menuconfig" is the first thing to try for removing unnecessary
binaries.
Post by Ronaldo Afonso
Post by Arjav Parikh
Hi,
I want to reduce the root file system size for my project. Till now
after removing the unnecessary kernel modules, libraries and using
strip binary the file system size has been reduced to 8.3 MB. Bu there
are still some files which are not required and I am unaware of how to
prvent these files from being included in my file system using
openwrt.
For Ex: there are multiple binaries in /lib/firmware which are not
required. This folder itself contains size of 4.4 MB, apart from these
there are many libraries in /lib as well as /usr/lib which are not
required.
Can anyone please guide of how to remove firmware binaries and
libraries in openwrt.
--
Thanks & Regards,
Arjav Parikh
_______________________________________________
openwrt-devel mailing list
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
--
Ronaldo Afonso
11 9 5252 0484
www.ronaldoafonso.com.br
--
Thanks & Regards,
Arjav Parikh
--
Ronaldo Afonso
11 9 5252 0484
www.ronaldoafonso.com.br
--
Ronaldo Afonso
11 9 5252 0484
www.ronaldoafonso.com.br
Loading...