Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revisionBoth sides next revision
zh:docs:guide-user:additional-software:saving_space [2019/03/16 21:28] – [将LuCI的图标替换成空icon] hgaozh:docs:guide-user:additional-software:saving_space [2020/01/05 04:21] – [Build image for devices with only 4MB flash] lujimmy
Line 1: Line 1:
-FIXME **This page is not fully translated, yet. Please help completing the translation.**\\ //(remove this paragraph once the translation is finished)//+====== 节省固件空间 ====== 
 +===== 移除软件包 ===== 
 +对于仅有4M闪存的设备,闪存空间是稀有的。您在使用[[docs:guide-user:additional-software:imagebuilder|imagebuilder]]编译自己的固件镜像文件时,可以移除一些不会使用到的软件包来节省一些空间。如想完全移除IPv6支持和相关的软件包,您可以在imagebuilder的make命令中通过"CONFIG_IPV6=n"来实现。 
 +^ 指令                  ^ 相关软件包                                                                                                  ^ 
 +|remove pppoe         |''-ppp -ppp-mod-pppoe''                                                                                      | 
 +|remove IPv6          |''-ip6tables -odhcp6c -kmod-ipv6 -kmod-ip6tables -odhcpd-ipv6only''                                          | 
 +|remove dhcp server   |''-odhcpd''                                                                                                  | 
 +|remove  iptables     |''-iptables''                                                                                                | 
 +|remove opkg          |''-opkg''                                                                                                    | 
 +|add LuCI minimal     |''uhttpd uhttpd-mod-ubus libiwinfo-lua luci-base luci-app-firewall luci-mod-admin-full luci-theme-bootstrap''
 +|add zram¹            | ''zram-swap''                                                                                               |
  
-====== 节省固件空间用 ====== +¹ 备注: 4M闪存的设备请不要使用 zram-swap,因为这会//增加//固件所需的闪存空间。这里之所以会列出,是因为它对于低内存设备很有 
-===== 去除以下packages ===== +==== 为仅有4M闪存的设备构建镜像 ====
-自己编译镜像以减少空间占用(e.g. with the [[docs:guide-user:additional-software:imagebuilder|imagebuilder]]),移除不使用的packages. +
-In order to completely remove IPv6 support and related packages you also need to ask the imagebuilder to do so by also passing this option to the make command: "CONFIG_IPV6=n".+
  
-^ Action               ^ Packages                                                                                                    ^ +**镜像构建命令行示例**\\ 
-| remove pppoe         ''-ppp -ppp-mod-pppoe''                                                                                         | +**备注:** 您需要根据设备修改下方命令行中的''PROFILE=tl-wr941nd-v6'',使用''make info''命令可显示可用的设备清单。
-| remove IPv6          | ''-ip6tables -odhcp6c -kmod-ipv6 -kmod-ip6tables -odhcpd-ipv6only''                                                              | +
-| remove dhcp server   | ''-odhcpd''                                                                                                     | +
-| remove  iptables     | ''-iptables''                                                                                                   | +
-| remove opkg          | ''-opkg''                                                                                                       | +
-| add LuCI minimal     | ''uhttpd uhttpd-mod-ubus libiwinfo-lua luci-base luci-app-firewall luci-mod-admin-full luci-theme-bootstrap''   | +
-| add zram¹            | ''zram-swap''                                                                                                   |+
  
-¹ Note: Do not use zram-swap for 4MB flash devices as it //increases// the amount of firmware space used. It is listed here as it is helpful on machines with very little RAM memory. +是否集成LuCI          作用       ^ Imagebuilder命令行 
- +集成LuCI             |移除pppoeIPv6,包含必需的LuCI组件而非完整的LuCI软件包| ''make image PROFILE=tl-wr941nd-v6 \
- +
-==== 为4MB flash的设备编译镜像 ==== +
- +
-**Example image builder command line**\\ +
-**Note:** In the command line shown below, you need to adjust ''PROFILE=tl-wr941nd-v6'' to your device. Use ''make info'' to list possibilities. +
- +
-^ LuCI    Action ^ Imagebuilder commandline +
-with LuCI | - remove pppoe and IPv6\\ + include only needed luci components, not full luci package. | ''make image PROFILE=tl-wr941nd-v6 \+
 PACKAGES="uhttpd uhttpd-mod-ubus libiwinfo-lua luci-base luci-app-firewall luci-mod-admin-full luci-theme-bootstrap \ PACKAGES="uhttpd uhttpd-mod-ubus libiwinfo-lua luci-base luci-app-firewall luci-mod-admin-full luci-theme-bootstrap \
 -ppp -ppp-mod-pppoe -ip6tables -odhcp6c -kmod-ipv6 -kmod-ip6tables -odhcpd-ipv6only"'' | -ppp -ppp-mod-pppoe -ip6tables -odhcp6c -kmod-ipv6 -kmod-ip6tables -odhcpd-ipv6only"'' |
-without LuCI | - remove pppoe and IPv6 | ''make image PROFILE=tl-wr941nd-v6 PACKAGES="-ppp -ppp-mod-pppoe -ip6tables -odhcp6c -kmod-ipv6 -kmod-ip6tables -odhcpd-ipv6only"'' |+不集成LuCI           |移除pppoeIPv6| ''make image PROFILE=tl-wr941nd-v6 PACKAGES="-ppp -ppp-mod-pppoe -ip6tables -odhcp6c -kmod-ipv6 -kmod-ip6tables -odhcpd-ipv6only"'' |
  
- +相关资源:
-Resources:+
   * [[https://forum.openwrt.org/t/can-i-strip-the-ipv6-out-with-the-imagebuilder/3465/5]]   * [[https://forum.openwrt.org/t/can-i-strip-the-ipv6-out-with-the-imagebuilder/3465/5]]
   * [[https://forum.openwrt.org/t/build-lede-without-ipv6/2043]]   * [[https://forum.openwrt.org/t/build-lede-without-ipv6/2043]]
   * [[https://forum.openwrt.org/t/make-image-problem/898]]   * [[https://forum.openwrt.org/t/make-image-problem/898]]
   * [[https://forum.openwrt.org/t/tp-link-tl-mr-3420-v3-build/855/8]]   * [[https://forum.openwrt.org/t/tp-link-tl-mr-3420-v3-build/855/8]]
- +  * [[https://forum.openwrt.org/t/possible-ppp-removal-from-base-image/42024/3]] 
- +==== Build image for devices with only 16/32MB RAM ====
-==== 16/32MB RAM的设备编译镜像 ====+
  
 If the device has 16MB or less of RAM, then it should only be used as Internal AP (e.g. to extend Wi-Fi coverage).\\ If the device has 16MB or less of RAM, then it should only be used as Internal AP (e.g. to extend Wi-Fi coverage).\\
Line 60: Line 52:
  
 This option compiles the kernel modules inside the kernel, you can either pick what modules you think can be integrated and make them built-in by pressing "y" on them when in the menuconfig, or do a quick-and-dirty change of the kernel config with (adjust the path in this example to point to your target's actual kernel config) This option compiles the kernel modules inside the kernel, you can either pick what modules you think can be integrated and make them built-in by pressing "y" on them when in the menuconfig, or do a quick-and-dirty change of the kernel config with (adjust the path in this example to point to your target's actual kernel config)
-<code>sed -i 's/=m/=y/g;' build_dir/target-mipsel_24kc_musl/linux-ramips_mt7620/linux-4.14.63/.config</code>+ 
 +<code bash> 
 +sed -i -e "s/=m/=y/gbuild_dir/target-mipsel_24kc_musl/linux-ramips_mt7620/linux-4.14.63/.config 
 +</code>
  
 This will work only if your device's kernel partition is big enough to accomodate the slightly larger kernel, or if the device is using dynamic partitions. This will work only if your device's kernel partition is big enough to accomodate the slightly larger kernel, or if the device is using dynamic partitions.
Line 78: Line 73:
 //Some hardware (it’s rare but not unheard of) can only be reset by unloading and reloading the module that controls it.  Otherwise, you have to reboot the box.  If you build all of your drivers in, then rebooting is all you have.// //Some hardware (it’s rare but not unheard of) can only be reset by unloading and reloading the module that controls it.  Otherwise, you have to reboot the box.  If you build all of your drivers in, then rebooting is all you have.//
  
-===== 修改编译配置变量 =====+===== Modifying build configuration variables =====
  
 You can also save space by changing configuration variables using ''make menuconfig''. In addition to the ones mentioned here you can save a tiny bit of space by disabling commands in busybox. You can also save space by changing configuration variables using ''make menuconfig''. In addition to the ones mentioned here you can save a tiny bit of space by disabling commands in busybox.
Line 91: Line 86:
 | CONFIG_KERNEL_DEBUG_INFO | Global build settings / Kernel build options / Compile the kernel with debug information | | CONFIG_KERNEL_DEBUG_INFO | Global build settings / Kernel build options / Compile the kernel with debug information |
 | CONFIG_KERNEL_ELF_CORE   | Global build settings / Kernel build options / Enable process core dump support | | CONFIG_KERNEL_ELF_CORE   | Global build settings / Kernel build options / Enable process core dump support |
-IPV6                     | Global build settings / Enable IPv6 support in packages |+CONFIG_IPV6              | Global build settings / Enable IPv6 support in packages |
 | CONFIG_KERNEL_MAGIC_SYSRQ | Global build settings / Kernel build options / Compile the kernel with SysRq support | | CONFIG_KERNEL_MAGIC_SYSRQ | Global build settings / Kernel build options / Compile the kernel with SysRq support |
 | CONFIG_KERNEL_PRINTK_TIME | Global build settings / Kernel build options / Enable printk timestamps | | CONFIG_KERNEL_PRINTK_TIME | Global build settings / Kernel build options / Enable printk timestamps |
-PACKAGE_MAC80211_DEBUGFS | Kernel modules / Wireless Drivers / kmod-mac80211 / Export mac80211 internals in DebugFS | 21 KB | +CONFIG_PACKAGE_MAC80211_DEBUGFS | Kernel modules / Wireless Drivers / kmod-mac80211 / Export mac80211 internals in DebugFS | 21 KB | 
-PACKAGE_MAC80211_MESH    | Kernel modules / Wireless Drivers / kmod-mac80211 / Enable 802.11s mesh support | 29 KB |+CONFIG_PACKAGE_MAC80211_MESH    | Kernel modules / Wireless Drivers / kmod-mac80211 / Enable 802.11s mesh support | 29 KB |
  
 Options that can be enabled to save space. Options that can be enabled to save space.
Line 128: Line 123:
  
  
-===== LuCI的图标替换成空icon =====+===== Replace LuCI icons with a blank pixel =====
  
-LuCI的图标并非一定需要,换成空图标之后,可以节省大概15KB. This bash script will take an OpenWrt git path as parameter and replace the images with a blank using the [[docs:guide-developer:build-system:use-buildsystem#custom_files|files]] path:+The icons in LuCI are not strictly necessary and replacing them with a blank image will save about 15 KB. This bash script will take an OpenWrt git path as parameter and replace the images with a blank using the [[docs:guide-developer:build-system:use-buildsystem#custom_files|files]] path:
  
 <hidden> <hidden>
Line 150: Line 145:
 </code> </code>
 </hidden> </hidden>
- 
  • Last modified: 2021/10/15 08:26
  • by bobafetthotmail