Go to file
Beginner 678606b603
grub2: update to 2.06-rc1 (#6855)
* grub2: update to 2.06-rc1

When building GRUB with binutils 2.35.2 or later, an error occurs due to
a section .note.gnu.property that is placed at an offset such that
objcopy needs to pad the img file with zeros. This in turn causes the
following error: "error: Decompressor is too big.".

The fix accepted by upstream patches a python script that isn't executed
at all when building GRUB with OpenWrt buildroot. There's another patch
that patches the files generated by that python script directly, but by
including it we would deviate further from upstream. Instead of doing
that, simply bump to the latest release candidate.

As one of the fixes for the CVEs causes grub to crash on some x86
hardware using legacy BIOS when compiled with -O2, filter -O2 and
-O3 out of TARGET_CFLAGS.

Fixes the following CVEs:
- CVE-2020-14372
- CVE-2020-25632
- CVE-2020-25647
- CVE-2020-27749
- CVE-2020-27779
- CVE-2021-3418
- CVE-2021-20225
- CVE-2021-20233

Runtime-tested on x86/64.

Fixes: FS#3790

Suggested-by: Dirk Neukirchen <plntyk.lede@plntyk.name>
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Acked-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>

* grub2: disable liblzma dependency

Florian Ekert reported:

"I have build a fresh master branch recently, Since your last change [1]
on grub2, I have now a new dependency on liblzma for the install package
grub2-editenv.

root@st-dev-07 /usr/lib # ldd /root/grub-editenv
       /lib/ld-musl-x86_64.so.1 (0x7f684b088000)
       liblzma.so.5 => /usr/lib/liblzma.so.5 (0x7f684b06d000)
       libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x7f684b059000)
       libc.so => /lib/ld-musl-x86_64.so.1 (0x7f684b088000)

This was not the case before your update.

root@st-dev-07 /usr/sbin # ldd /usr/sbin/grub-editenv
       /lib/ld-musl-x86_64.so.1 (0x7fd970176000)
       libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x7fd970162000)
       libc.so => /lib/ld-musl-x86_64.so.1 (0x7fd970176000)

My build complains that it cannot satisfy the runtime package dependency
for grub2-editenv.

install -d -m0755 /home/feckert/workspace/openwrt/LDM-master-x86_64/build/openwrt/build_dir/target-x86_64_musl/linux-x86_64/grub-pc/grub-2.06~rc1/ipkg-x86_64/grub2-editenv/usr/sbin
install -m0755 /home/feckert/workspace/openwrt/LDM-master-x86_64/build/openwrt/build_dir/target-x86_64_musl/linux-x86_64/grub-pc/grub-2.06~rc1/grub-editenv /home/feckert/workspace/openwrt/LDM-master-x86_64/build/openwrt/build_dir/target-x86_64_musl/linux-x86_64/grub-pc/grub-2.06~rc1/ipkg-x86_64/grub2-editenv/usr/sbin/
find /home/feckert/workspace/openwrt/LDM-master-x86_64/build/openwrt/build_dir/target-x86_64_musl/linux-x86_64/grub-pc/grub-2.06~rc1/ipkg-x86_64/grub2-editenv -name 'CVS' -o -name '.svn' -o -name '.#*' -o -name '*~'| xargs -r rm -rf
Package grub2-editenv is missing dependencies for the following libraries:
liblzma.so.5
make[2]: *** [Makefile:166: /home/feckert/workspace/openwrt/LDM-master-x86_64/build/openwrt/bin/APOS/feckert/master/master-Maggie-455-ga5edc0e8e/x86_64/targets/x86/64/packages/grub2-editenv_2.06~rc1-1_x86_64.ipk] Error 1
make[2]: Leaving directory '/home/feckert/workspace/openwrt/LDM-master-x86_64/build/openwrt/package/boot/grub2'
time: package/boot/grub2/pc/compile#78.64#9.79#83.88
   ERROR: package/boot/grub2 failed to build (build variant: pc).
make[1]: *** [package/Makefile:116: package/boot/grub2/compile] Error 1
make[1]: Leaving directory '/home/feckert/workspace/openwrt/LDM-master-x86_64/build/openwrt'
make: *** [/home/feckert/workspace/openwrt/LDM-master-x86_64/build/openwrt/include/toplevel.mk:230: package/boot/grub2/compile] Error 2

If I add the following changes to the package all works as expected.

<snip>
-  DEPENDS:=@TARGET_x86
+  DEPENDS:=@TARGET_x86 +liblzma
  VARIANT:=pc
endef

This is a hotfix but I dont´t think this is the final solution, because lzma is provided by the package xz.
And This is maintained in the package feed [not the core]"

Dirk stated & offered his patch to disable liblzma and thus resolve the
'out of core dependency' problem:

"LZMA is used in mkimage.c
disabling it prints
Without liblzma (no support for XZ-compressed mips images) (explicitly disabled)
(see configure.ac)

liblzma is autodetected so this issue was present but hidden somehow

[unsure: grep/image generation does not use grub with that option]
OpenWrt does not use that feature currently

[!] some scripts and examples use --compression=xz or -C xz and those will break

grub has an internal xzlib for different "lzma" functionality
(ext. LIBLZMA from XZ (GRUB_COMPRESSION_XZ) vs. GRUB_COMPRESSION_LZMA)"

Hopefully fixes e74d81e and doesn't
break anything else.

Signed-off-by: Dirk Neukirchen <plntyk.lede@plntyk.name>
[include Florian's description of how problem 1st encountered]
[bump package release]
Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>

Co-authored-by: Stijn Tintel <stijn@linux-ipv6.be>
Co-authored-by: Dirk Neukirchen <plntyk.lede@plntyk.name>
2021-05-22 12:07:40 +08:00
.github CI: multi-asset delivery support (#5243) 2020-08-06 15:29:42 +08:00
config autocore: x86 change RPS/XPS handling to all CPUs 2020-07-06 16:13:07 +08:00
doc add Xiaoma v1 small photo 2020-05-14 15:30:44 +08:00
include kernel: bump 5.4 to 5.4.120 2021-05-20 13:04:41 +08:00
package grub2: update to 2.06-rc1 (#6855) 2021-05-22 12:07:40 +08:00
scripts kernel: bump 5.4 to 5.4.105 (#6520) 2021-03-14 11:52:33 +08:00
target ramips: add support for JCG Q20 (#6850) 2021-05-21 13:44:01 +08:00
toolchain Sync to snapshot kernel 5.4 version 2020-07-02 23:30:56 +08:00
tools kernel: bump to 4.14.193, 4.19.138, 5.4.59 (#5350) 2020-08-26 11:31:50 +08:00
.gitattributes Merge branch 'master' of https://github.com/lede-project/source 2017-09-12 01:07:20 +08:00
.gitignore 20200718-忽略文件添加*.log (#5128) 2020-07-19 13:54:52 +08:00
BSDmakefile update source 2017-09-06 19:19:45 +08:00
Config.in merge: change branding for LEDE to OpenWrt 2017-12-12 16:57:14 +08:00
feeds.conf.default feeds.conf.default: remove management feed (#6763) 2021-05-02 22:42:16 +08:00
LICENSE update source 2017-09-06 19:19:45 +08:00
Makefile Sync to snapshot kernel 5.4 version 2020-07-02 23:30:56 +08:00
README Update README (#6252) 2021-01-25 16:32:26 +08:00
README_EN.md fix mistakes for English Readme (#6846) 2021-05-18 13:33:06 +08:00
README.md Separate READMEs and minor improvements (#6472) 2021-03-06 00:29:04 +08:00
rules.mk Sync to snapshot kernel 5.4 version 2020-07-02 23:30:56 +08:00

Welcome to Lean's git source of OpenWrt and packages

How to build your Openwrt firmware.

Note:

  1. DO NOT USE root USER FOR COMPILING!!!

  2. Users within China should prepare proxy before building.

  3. Web admin panel default IP is 192.168.1.1 and default password is "password".

Let's start!

  1. First, install Ubuntu 64bit (Ubuntu 18 LTS x86 is recommended).

  2. Run sudo apt-get update in the terminal, and then run sudo apt-get -y install build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch python3 python2.7 unzip zlib1g-dev lib32gcc1 libc6-dev-i386 subversion flex uglifyjs git-core gcc-multilib p7zip p7zip-full msmtp libssl-dev texinfo libglib2.0-dev xmlto qemu-utils upx libelf-dev autoconf automake libtool autopoint device-tree-compiler g++-multilib antlr3 gperf wget curl swig rsync

  3. Run git clone https://github.com/coolsnowwolf/lede to clone the source code, and then cd lede to enter the directory

  4. ./scripts/feeds update -a
    ./scripts/feeds install -a
    make menuconfig
    
  5. Run make -j8 download V=s to download libraries and dependencies (user in China should use global proxy when possible)

  6. Run make -j1 V=s (integer following -j is the thread count, single-thread is recommended for the first build) to start building your firmware.

This source code is promised to be compiled successfully.

You can use this source code freely, but please link this GitHub repository when redistributing. Thank you for your cooperation!

Rebuild:

cd lede
git pull
./scripts/feeds update -a && ./scripts/feeds install -a
make defconfig
make -j8 download
make -j$(($(nproc) + 1)) V=s

If reconfiguration is need:

rm -rf ./tmp && rm -rf .config
make menuconfig
make -j$(($(nproc) + 1)) V=s

Build result will be produced to bin/targets directory.

Special tips:

  1. This source code doesn't contain any backdoors or close source applications that can monitor/capture your HTTPS traffic, SSL is the final castle of cyber security. Safety is what a firmware should achieve.

  2. If you have any technical problem, you may join the QQ discussion group: 297253733, link: click here

  3. Want to learn OpenWrt development but don't know how? Can't motivate yourself for self-learning? Not enough fundamental knowledge? Learn OpenWrt development with Mr. Zuo through his Beginner OpenWrt Training Course. Click here to register.

Router Recommendation

Not Sponsored: If you are finding a low power consumption, small and performance promising x86/x64 router, I personally recommend the EZPROv1 Alumium Edition (N3710 4000M): Details

xm1 xm2

Donation

If this project does help you, please consider donating to support the development of this project.

Alipay

alipay

WeChat

wechat

Note: Addition Lean's private package source code in ./package/lean directory. Use it under GPL v3.

GPLv3 is compatible with more licenses than GPLv2: it allows you to make combinations with code that has specific kinds of additional requirements that are not in GPLv3 itself. Section 7 has more information about this, including the list of additional requirements that are permitted.