Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sinovip bananapi_bpi-r3 bash: 8: Bad file descriptor #11760

Open
1 task done
nejtr0n opened this issue Jan 10, 2023 · 15 comments
Open
1 task done

sinovip bananapi_bpi-r3 bash: 8: Bad file descriptor #11760

nejtr0n opened this issue Jan 10, 2023 · 15 comments
Labels
bug issue report with a confirmed bug

Comments

@nejtr0n
Copy link

nejtr0n commented Jan 10, 2023

Describe the bug

Hello.
Could not build image with some custom packages. It seems to be misconfiguration of kernel or image size.
Error:

........
FIT description: ARM64 OpenWrt FIT (Flattened Image Tree)
Created:         Mon Jan  9 10:35:20 2023
 Image 0 (kernel-1)
  Description:  ARM64 OpenWrt Linux-5.15.86
  Created:      Mon Jan  9 10:35:20 2023
  Type:         Kernel Image
  Compression:  gzip compressed
  Data Size:    5368928 Bytes = 5243.09 KiB = 5.12 MiB
  Architecture: AArch64
  OS:           Linux
  Load Address: 0x44000000
  Entry Point:  0x44000000
  Hash algo:    crc32
  Hash value:   a490238b
  Hash algo:    sha1
  Hash value:   8f3f53269f5efef723dd71b3e1998e68cc285c21
 Image 1 (fdt-1)
  Description:  ARM64 OpenWrt bananapi_bpi-r3 device tree blob
  Created:      Mon Jan  9 10:35:20 2023
  Type:         Flat Device Tree
  Compression:  uncompressed
  Data Size:    32768 Bytes = 32.00 KiB = 0.03 MiB
  Architecture: AArch64
  Load Address: 0x43ff8000
  Hash algo:    crc32
  Hash value:   63127f08
  Hash algo:    sha1
  Hash value:   a00d33951f62b33677cc0b5172fa81be816d55e5
 Image 2 (fdt-mt7986a-bananapi-bpi-r3-nor)
  Description:  ARM64 OpenWrt bananapi_bpi-r3 device tree overlay mt7986a-bananapi-bpi-r3-nor
  Created:      Mon Jan  9 10:35:20 2023
  Type:         Flat Device Tree
  Compression:  uncompressed
  Data Size:    32768 Bytes = 32.00 KiB = 0.03 MiB
  Architecture: AArch64
  Load Address: 0x43ff0000
  Hash algo:    crc32
  Hash value:   95d48956
  Hash algo:    sha1
  Hash value:   1c93f277ffa3aecc5aef781cd3d6c72297d961d5
 Image 3 (fdt-mt7986a-bananapi-bpi-r3-emmc-nor)
  Description:  ARM64 OpenWrt bananapi_bpi-r3 device tree overlay mt7986a-bananapi-bpi-r3-emmc-nor
  Created:      Mon Jan  9 10:35:20 2023
  Type:         Flat Device Tree
  Compression:  uncompressed
  Data Size:    32768 Bytes = 32.00 KiB = 0.03 MiB
  Architecture: AArch64
  Load Address: 0x43fe8000
  Hash algo:    crc32
  Hash value:   9310ba5d
  Hash algo:    sha1
  Hash value:   b6e94c2825be3781ded07624307ce50d34ad99b0
 Image 4 (fdt-mt7986a-bananapi-bpi-r3-emmc-snand)
  Description:  ARM64 OpenWrt bananapi_bpi-r3 device tree overlay mt7986a-bananapi-bpi-r3-emmc-snand
  Created:      Mon Jan  9 10:35:20 2023
  Type:         Flat Device Tree
  Compression:  uncompressed
  Data Size:    32768 Bytes = 32.00 KiB = 0.03 MiB
  Architecture: AArch64
  Load Address: 0x43fe0000
  Hash algo:    crc32
  Hash value:   da7d197c
  Hash algo:    sha1
  Hash value:   492fb21cbdbf4af0442980102056351626624123
 Image 5 (fdt-mt7986a-bananapi-bpi-r3-snand)
  Description:  ARM64 OpenWrt bananapi_bpi-r3 device tree overlay mt7986a-bananapi-bpi-r3-snand
  Created:      Mon Jan  9 10:35:20 2023
  Type:         Flat Device Tree
  Compression:  uncompressed
  Data Size:    32768 Bytes = 32.00 KiB = 0.03 MiB
  Architecture: AArch64
  Load Address: 0x43fd8000
  Hash algo:    crc32
  Hash value:   fb982ffd
  Hash algo:    sha1
  Hash value:   9285448f7112ebbe6616709a852e74de03136bda
 Image 6 (rootfs-1)
  Description:  ARM64 OpenWrt bananapi_bpi-r3 rootfs
  Created:      Mon Jan  9 10:35:20 2023
  Type:         Filesystem Image
  Compression:  uncompressed
  Data Size:    73777152 Bytes = 72048.00 KiB = 70.36 MiB
  Hash algo:    crc32
  Hash value:   142e1c63
  Hash algo:    sha1
  Hash value:   e53690f82a943db4e5b89d1b05ae94d1cdcbe930
 Default Configuration: 'config-mt7986a-bananapi-bpi-r3'
 Configuration 0 (config-mt7986a-bananapi-bpi-r3)
  Description:  OpenWrt bananapi_bpi-r3
  Kernel:       kernel-1
  FDT:          fdt-1
  Loadables:    rootfs-1
 Configuration 1 (config-mt7986a-bananapi-bpi-r3-nor)
  Description:  OpenWrt bananapi_bpi-r3 with mt7986a-bananapi-bpi-r3-nor
  Kernel:       kernel-1
  FDT:          fdt-1
                fdt-mt7986a-bananapi-bpi-r3-nor
  Loadables:    rootfs-1
 Configuration 2 (config-mt7986a-bananapi-bpi-r3-emmc-nor)
  Description:  OpenWrt bananapi_bpi-r3 with mt7986a-bananapi-bpi-r3-emmc-nor
  Kernel:       kernel-1
  FDT:          fdt-1
                fdt-mt7986a-bananapi-bpi-r3-emmc-nor
  Loadables:    rootfs-1
 Configuration 3 (config-mt7986a-bananapi-bpi-r3-emmc-snand)
  Description:  OpenWrt bananapi_bpi-r3 with mt7986a-bananapi-bpi-r3-emmc-snand
  Kernel:       kernel-1
  FDT:          fdt-1
                fdt-mt7986a-bananapi-bpi-r3-emmc-snand
  Loadables:    rootfs-1
 Configuration 4 (config-mt7986a-bananapi-bpi-r3-snand)
  Description:  OpenWrt bananapi_bpi-r3 with mt7986a-bananapi-bpi-r3-snand
  Kernel:       kernel-1
  FDT:          fdt-1
                fdt-mt7986a-bananapi-bpi-r3-snand
  Loadables:    rootfs-1
/home/user/openwrt/staging_dir/host/bin/padjffs2 /home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-squashfs-sysupgrade.itb  4 8 16 64 128 256
padding image to 04ba4000
padding image to 04bb0000
padding image to 04bc0000
echo '{  "metadata_version": "1.1", "compat_version": "1.0",   "supported_devices":["bananapi,bpi-r3"], "version": { "dist": "OpenWrt", "version": "SNAPSHOT", "revision": "r21740-0cc1c302b1", "target": "mediatek/filogic", "board": "bananapi_bpi-r3" } }' | fwtool -I - /home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-squashfs-sysupgrade.itb
sha256sum "/home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-squashfs-sysupgrade.itb" | cut -d" " -f1 > "/home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-squashfs-sysupgrade.itb.sha256sum"
[ ! -s "/home/user/openwrt/key-build" -o ! -s "/home/user/openwrt/key-build.ucert" -o ! -s "/home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-squashfs-sysupgrade.itb" ] || { cp "/home/user/openwrt/key-build.ucert" "/home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-squashfs-sysupgrade.itb.ucert" ; usign -S -m "/home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-squashfs-sysupgrade.itb" -s "/home/user/openwrt/key-build" -x "/home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-squashfs-sysupgrade.itb.sig" ; ucert -A -c "/home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-squashfs-sysupgrade.itb.ucert" -x "/home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-squashfs-sysupgrade.itb.sig" ; fwtool -S "/home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-squashfs-sysupgrade.itb.ucert" "/home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-squashfs-sysupgrade.itb" ; }
cp /home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-squashfs-sysupgrade.itb /home/user/openwrt/bin/targets/mediatek/filogic/openwrt-mediatek-filogic-bananapi_bpi-r3-squashfs-sysupgrade.itb
DEVICE_ID="bananapi_bpi-r3" SOURCE_DATE_EPOCH=1673260520 FILE_NAME="openwrt-mediatek-filogic-bananapi_bpi-r3-squashfs-sysupgrade.itb" FILE_DIR="/home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp" FILE_TYPE=sysupgrade FILE_FILESYSTEM="squashfs" DEVICE_IMG_PREFIX="openwrt-mediatek-filogic-bananapi_bpi-r3" DEVICE_VENDOR="Bananapi" DEVICE_MODEL="BPi-R3" DEVICE_VARIANT="" DEVICE_ALT0_VENDOR="" DEVICE_ALT0_MODEL="" DEVICE_ALT0_VARIANT="" DEVICE_ALT1_VENDOR="" DEVICE_ALT1_MODEL="" DEVICE_ALT1_VARIANT="" DEVICE_ALT2_VENDOR="" DEVICE_ALT2_MODEL="" DEVICE_ALT2_VARIANT="" DEVICE_TITLE="Bananapi BPi-R3" DEVICE_PACKAGES="kmod-hwmon-pwmfan kmod-i2c-gpio kmod-sfp kmod-usb3 e2fsprogs f2fsck mkf2fs " TARGET="mediatek" SUBTARGET="filogic" VERSION_NUMBER="SNAPSHOT" VERSION_CODE="r21740-0cc1c302b1" SUPPORTED_DEVICES="bananapi,bpi-r3" /home/user/openwrt/scripts/json_add_image_info.py /home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/json_info_files/openwrt-mediatek-filogic-bananapi_bpi-r3-squashfs-sysupgrade.itb.json
cat /home/user/openwrt/staging_dir/target-aarch64_cortex-a53_musl/image/mt7986-emmc-ddr4-bl2.img >> /home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-emmc-preloader.bin
cp /home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-emmc-preloader.bin /home/user/openwrt/bin/targets/mediatek/filogic/openwrt-mediatek-filogic-bananapi_bpi-r3-emmc-preloader.bin
DEVICE_ID="bananapi_bpi-r3" SOURCE_DATE_EPOCH=1673260520 FILE_NAME="openwrt-mediatek-filogic-bananapi_bpi-r3-emmc-preloader.bin" FILE_DIR="/home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp" FILE_TYPE="emmc-preloader.bin" DEVICE_IMG_PREFIX="openwrt-mediatek-filogic-bananapi_bpi-r3" DEVICE_VENDOR="Bananapi" DEVICE_MODEL="BPi-R3" DEVICE_VARIANT="" DEVICE_ALT0_VENDOR="" DEVICE_ALT0_MODEL="" DEVICE_ALT0_VARIANT="" DEVICE_ALT1_VENDOR="" DEVICE_ALT1_MODEL="" DEVICE_ALT1_VARIANT="" DEVICE_ALT2_VENDOR="" DEVICE_ALT2_MODEL="" DEVICE_ALT2_VARIANT="" DEVICE_TITLE="Bananapi BPi-R3" DEVICE_PACKAGES="kmod-hwmon-pwmfan kmod-i2c-gpio kmod-sfp kmod-usb3 e2fsprogs f2fsck mkf2fs " TARGET="mediatek" SUBTARGET="filogic" VERSION_NUMBER="SNAPSHOT" VERSION_CODE="r21740-0cc1c302b1" SUPPORTED_DEVICES="bananapi,bpi-r3" /home/user/openwrt/scripts/json_add_image_info.py /home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/json_info_files/openwrt-mediatek-filogic-bananapi_bpi-r3-emmc-preloader.bin.json
cat /home/user/openwrt/staging_dir/target-aarch64_cortex-a53_musl/image/mt7986_bananapi_bpi-r3-emmc-u-boot.fip >> /home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-emmc-bl31-uboot.fip
cp /home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-emmc-bl31-uboot.fip /home/user/openwrt/bin/targets/mediatek/filogic/openwrt-mediatek-filogic-bananapi_bpi-r3-emmc-bl31-uboot.fip
DEVICE_ID="bananapi_bpi-r3" SOURCE_DATE_EPOCH=1673260520 FILE_NAME="openwrt-mediatek-filogic-bananapi_bpi-r3-emmc-bl31-uboot.fip" FILE_DIR="/home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp" FILE_TYPE="emmc-bl31-uboot.fip" DEVICE_IMG_PREFIX="openwrt-mediatek-filogic-bananapi_bpi-r3" DEVICE_VENDOR="Bananapi" DEVICE_MODEL="BPi-R3" DEVICE_VARIANT="" DEVICE_ALT0_VENDOR="" DEVICE_ALT0_MODEL="" DEVICE_ALT0_VARIANT="" DEVICE_ALT1_VENDOR="" DEVICE_ALT1_MODEL="" DEVICE_ALT1_VARIANT="" DEVICE_ALT2_VENDOR="" DEVICE_ALT2_MODEL="" DEVICE_ALT2_VARIANT="" DEVICE_TITLE="Bananapi BPi-R3" DEVICE_PACKAGES="kmod-hwmon-pwmfan kmod-i2c-gpio kmod-sfp kmod-usb3 e2fsprogs f2fsck mkf2fs " TARGET="mediatek" SUBTARGET="filogic" VERSION_NUMBER="SNAPSHOT" VERSION_CODE="r21740-0cc1c302b1" SUPPORTED_DEVICES="bananapi,bpi-r3" /home/user/openwrt/scripts/json_add_image_info.py /home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/json_info_files/openwrt-mediatek-filogic-bananapi_bpi-r3-emmc-bl31-uboot.fip.json
cat /home/user/openwrt/staging_dir/target-aarch64_cortex-a53_musl/image/mt7986-nor-ddr4-bl2.img >> /home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-nor-preloader.bin
cp /home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-nor-preloader.bin /home/user/openwrt/bin/targets/mediatek/filogic/openwrt-mediatek-filogic-bananapi_bpi-r3-nor-preloader.bin
DEVICE_ID="bananapi_bpi-r3" SOURCE_DATE_EPOCH=1673260520 FILE_NAME="openwrt-mediatek-filogic-bananapi_bpi-r3-nor-preloader.bin" FILE_DIR="/home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp" FILE_TYPE="nor-preloader.bin" DEVICE_IMG_PREFIX="openwrt-mediatek-filogic-bananapi_bpi-r3" DEVICE_VENDOR="Bananapi" DEVICE_MODEL="BPi-R3" DEVICE_VARIANT="" DEVICE_ALT0_VENDOR="" DEVICE_ALT0_MODEL="" DEVICE_ALT0_VARIANT="" DEVICE_ALT1_VENDOR="" DEVICE_ALT1_MODEL="" DEVICE_ALT1_VARIANT="" DEVICE_ALT2_VENDOR="" DEVICE_ALT2_MODEL="" DEVICE_ALT2_VARIANT="" DEVICE_TITLE="Bananapi BPi-R3" DEVICE_PACKAGES="kmod-hwmon-pwmfan kmod-i2c-gpio kmod-sfp kmod-usb3 e2fsprogs f2fsck mkf2fs " TARGET="mediatek" SUBTARGET="filogic" VERSION_NUMBER="SNAPSHOT" VERSION_CODE="r21740-0cc1c302b1" SUPPORTED_DEVICES="bananapi,bpi-r3" /home/user/openwrt/scripts/json_add_image_info.py /home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/json_info_files/openwrt-mediatek-filogic-bananapi_bpi-r3-nor-preloader.bin.json
cat /home/user/openwrt/staging_dir/target-aarch64_cortex-a53_musl/image/mt7986_bananapi_bpi-r3-nor-u-boot.fip >> /home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-nor-bl31-uboot.fip
cp /home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-nor-bl31-uboot.fip /home/user/openwrt/bin/targets/mediatek/filogic/openwrt-mediatek-filogic-bananapi_bpi-r3-nor-bl31-uboot.fip
DEVICE_ID="bananapi_bpi-r3" SOURCE_DATE_EPOCH=1673260520 FILE_NAME="openwrt-mediatek-filogic-bananapi_bpi-r3-nor-bl31-uboot.fip" FILE_DIR="/home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp" FILE_TYPE="nor-bl31-uboot.fip" DEVICE_IMG_PREFIX="openwrt-mediatek-filogic-bananapi_bpi-r3" DEVICE_VENDOR="Bananapi" DEVICE_MODEL="BPi-R3" DEVICE_VARIANT="" DEVICE_ALT0_VENDOR="" DEVICE_ALT0_MODEL="" DEVICE_ALT0_VARIANT="" DEVICE_ALT1_VENDOR="" DEVICE_ALT1_MODEL="" DEVICE_ALT1_VARIANT="" DEVICE_ALT2_VENDOR="" DEVICE_ALT2_MODEL="" DEVICE_ALT2_VARIANT="" DEVICE_TITLE="Bananapi BPi-R3" DEVICE_PACKAGES="kmod-hwmon-pwmfan kmod-i2c-gpio kmod-sfp kmod-usb3 e2fsprogs f2fsck mkf2fs " TARGET="mediatek" SUBTARGET="filogic" VERSION_NUMBER="SNAPSHOT" VERSION_CODE="r21740-0cc1c302b1" SUPPORTED_DEVICES="bananapi,bpi-r3" /home/user/openwrt/scripts/json_add_image_info.py /home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/json_info_files/openwrt-mediatek-filogic-bananapi_bpi-r3-nor-bl31-uboot.fip.json
cp /home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-sdcard.img.gz /home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-sdcard.img.gz.tmp 2>/dev/null || true
ptgen -g -o /home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-sdcard.img.gz.tmp -a 1 -l 1024  -H -t 0x83	-N bl2		-r	-p 4079k@17k  -t 0x83	-N ubootenv	-r	-p 512k@4M -t 0x83	-N factory	-r	-p 2M@4608k -t 0xef	-N fip		-r	-p 4M@6656k -N recovery	-r	-p 32M@12M  -N install	-r	-p 20M@44M -t 0x2e -N production		-p 204M@64M  
part 17 4079
part 4096 512
part 4608 2048
part 6656 4096
part 12288 32768
part 45056 20480
part 65536 208896
17408
4176896
4194304
524288
4718592
2097152
6815744
4194304
12582912
33554432
46137344
20971520
67108864
213909504
cat /home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-sdcard.img.gz.tmp >> /home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-sdcard.img.gz
rm /home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-sdcard.img.gz.tmp
dd if=/home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-sdcard.img.gz of=/home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-sdcard.img.gz.new bs=17k conv=sync
1+0 records in
1+0 records out
17408 bytes (17 kB, 17 KiB) copied, 0.000426415 s, 40.8 MB/s
mv /home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-sdcard.img.gz.new /home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-sdcard.img.gz
cat /home/user/openwrt/staging_dir/target-aarch64_cortex-a53_musl/image/mt7986-sdmmc-ddr4-bl2.img >> /home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-sdcard.img.gz
dd if=/home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-sdcard.img.gz of=/home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-sdcard.img.gz.new bs=6656k conv=sync
0+1 records in
1+0 records out
6815744 bytes (6.8 MB, 6.5 MiB) copied, 0.0254251 s, 268 MB/s
mv /home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-sdcard.img.gz.new /home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-sdcard.img.gz
cat /home/user/openwrt/staging_dir/target-aarch64_cortex-a53_musl/image/mt7986_bananapi_bpi-r3-sdmmc-u-boot.fip >> /home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-sdcard.img.gz
dd if=/home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-sdcard.img.gz of=/home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-sdcard.img.gz.new bs=12M conv=sync
0+1 records in
1+0 records out
12582912 bytes (13 MB, 12 MiB) copied, 0.035798 s, 351 MB/s
mv /home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-sdcard.img.gz.new /home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-sdcard.img.gz
cp "/home/user/openwrt/bin/targets/mediatek/filogic/openwrt-mediatek-filogic-bananapi_bpi-r3-initramfs-recovery.itb" "/home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-sdcard.img.gz.stripmeta"
fwtool -s /dev/null -t "/home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-sdcard.img.gz.stripmeta" || :
Data not found
fwtool -i /dev/null -t "/home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-sdcard.img.gz.stripmeta" || :
Data not found
mkdir -p "/home/user/openwrt/staging_dir/target-aarch64_cortex-a53_musl/image"
dd if="/home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-sdcard.img.gz.stripmeta" of="/home/user/openwrt/staging_dir/target-aarch64_cortex-a53_musl/image/mediatek-filogic-bananapi_bpi-r3-initramfs-recovery.itb"
107648+0 records in
107648+0 records out
55115776 bytes (55 MB, 53 MiB) copied, 0.319896 s, 172 MB/s
dd if="/home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-sdcard.img.gz.stripmeta" >> "/home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-sdcard.img.gz"
107648+0 records in
107648+0 records out
55115776 bytes (55 MB, 53 MiB) copied, 0.276785 s, 199 MB/s
rm "/home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-sdcard.img.gz.stripmeta"
bash: 8: Bad file descriptor
dd if=/home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-sdcard.img.gz of=/home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-sdcard.img.gz.new bs=44M conv=sync
dd: failed to open '/home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-sdcard.img.gz': No such file or directory
make[5]: *** [Makefile:31: /home/user/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-sdcard.img.gz] Error 1
make[5]: Leaving directory '/home/user/openwrt/target/linux/mediatek/image'
make[4]: *** [Makefile:17: install] Error 2
make[4]: Leaving directory '/home/user/openwrt/target/linux/mediatek'
make[3]: *** [Makefile:11: install] Error 2
make[3]: Leaving directory '/home/user/openwrt/target/linux'
time: target/linux/install#388.75#29.65#295.99
    ERROR: target/linux failed to build.
make[2]: *** [target/Makefile:30: target/linux/install] Error 1
make[2]: Leaving directory '/home/user/openwrt'
make[1]: *** [target/Makefile:24: /home/user/openwrt/staging_dir/target-aarch64_cortex-a53_musl/stamp/.target_install] Error 2
make[1]: Leaving directory '/home/user/openwrt'
make: *** [/home/user/openwrt/include/toplevel.mk:231: world] Error 2

OpenWrt version

r21740-0cc1c302b1

OpenWrt target/subtarget

mediatek/filogic

Device

Bananapi BPI-R3

Image kind

Self-built image

Steps to reproduce

Get latest config

wget https://downloads.openwrt.org/snapshots/targets/mediatek/filogic/config.buildinfo -O .config

apply diff config

# set bpi-r3 platform
echo 'CONFIG_TARGET_mediatek_filogic_DEVICE_bananapi_bpi-r3=y' >> .config
# some kernel patching to enable k3s
# kernel
echo 'CONFIG_KERNEL_BLK_CGROUP=y' >> .config
echo 'CONFIG_KERNEL_CGROUPS=y' >> .config
echo 'CONFIG_KERNEL_CGROUP_CPUACCT=y' >> .config
echo 'CONFIG_KERNEL_CGROUP_DEVICE=y' >> .config
echo 'CONFIG_KERNEL_CGROUP_FREEZER=y' >> .config
echo 'CONFIG_KERNEL_CGROUP_PIDS=y' >> .config
echo 'CONFIG_KERNEL_CGROUP_SCHED=y' >> .config
echo 'CONFIG_KERNEL_CPUSETS=y' >> .config
echo 'CONFIG_KERNEL_DEVPTS_MULTIPLE_INSTANCES=y' >> .config
echo 'CONFIG_KERNEL_FAIR_GROUP_SCHED=y' >> .config
echo 'CONFIG_KERNEL_FREEZER=y' >> .config
echo 'CONFIG_KERNEL_IPC_NS=y' >> .config
echo 'CONFIG_KERNEL_KEYS=y' >> .config
echo 'CONFIG_KERNEL_LXC_MISC=y' >> .config
echo 'CONFIG_KERNEL_MEMCG=y' >> .config
echo 'CONFIG_KERNEL_NAMESPACES=y' >> .config
echo 'CONFIG_KERNEL_NETPRIO_CGROUP=y' >> .config
echo 'CONFIG_KERNEL_NET_CLS_CGROUP=y' >> .config
echo 'CONFIG_KERNEL_NET_NS=y' >> .config
echo 'CONFIG_KERNEL_PID_NS=y' >> .config
echo 'CONFIG_KERNEL_POSIX_MQUEUE=y' >> .config
echo 'CONFIG_KERNEL_PROC_PID_CPUSET=y' >> .config
echo 'CONFIG_KERNEL_RESOURCE_COUNTERS=y' >> .config
echo 'CONFIG_KERNEL_SECCOMP=y' >> .config
echo 'CONFIG_KERNEL_SECCOMP_FILTER=y' >> .config
echo 'CONFIG_KERNEL_USER_NS=y' >> .config
echo 'CONFIG_KERNEL_UTS_NS=y' >> .config


# nvme and fs kmods
echo 'CONFIG_PACKAGE_kmod-nvme=y' >> .config
echo 'CONFIG_PACKAGE_kmod-fs-ext4=y' >> .config
echo 'CONFIG_PACKAGE_kmod-fs-nfs=y' >> .config
echo 'CONFIG_PACKAGE_lvm2=y' >> .config
# network
echo 'CONFIG_PACKAGE_ip-bridge=y' >> .config
echo 'CONFIG_PACKAGE_ip-full=y' >> .config
echo 'CONFIG_PACKAGE_ipset=y' >> .config
echo 'CONFIG_PACKAGE_iptables-mod-conntrack-extra=y' >> .config
echo 'CONFIG_PACKAGE_iptables-mod-extra=y' >> .config
echo 'CONFIG_PACKAGE_iptables-mod-ipopt=y' >> .config
echo 'CONFIG_PACKAGE_kmod-asn1-decoder=y' >> .config
echo 'CONFIG_PACKAGE_kmod-br-netfilter=y' >> .config
echo 'CONFIG_PACKAGE_kmod-ikconfig=y' >> .config
echo 'CONFIG_PACKAGE_kmod-ipt-conntrack-extra=y' >> .config
echo 'CONFIG_PACKAGE_kmod-ipt-extra=y' >> .config
echo 'CONFIG_PACKAGE_kmod-ipt-ipopt=y' >> .config
echo 'CONFIG_PACKAGE_kmod-ipt-ipset=y' >> .config
echo 'CONFIG_PACKAGE_kmod-ipt-raw=y' >> .config
echo 'CONFIG_PACKAGE_kmod-iptunnel=y' >> .config
echo 'CONFIG_PACKAGE_kmod-nf-conntrack-netlink=y' >> .config
echo 'CONFIG_PACKAGE_kmod-nf-ipvs=y' >> .config
echo 'CONFIG_PACKAGE_kmod-nfnetlink=y' >> .config
echo 'CONFIG_PACKAGE_kmod-nls-base=y' >> .config
echo 'CONFIG_PACKAGE_kmod-udptunnel4=y' >> .config
echo 'CONFIG_PACKAGE_kmod-udptunnel6=y' >> .config
echo 'CONFIG_PACKAGE_kmod-veth=y' >> .config
echo 'CONFIG_PACKAGE_kmod-vxlan=y' >> .config
echo 'CONFIG_PACKAGE_libnetfilter-conntrack=y' >> .config
echo 'CONFIG_PACKAGE_libnfnetlink=y' >> .config
# USB
echo 'CONFIG_PACKAGE_kmod-usb-acm=y' >> .config
echo 'CONFIG_PACKAGE_kmod-usb-core=y' >> .config
echo 'CONFIG_PACKAGE_kmod-usb-net-cdc-ether=y' >> .config
echo 'CONFIG_PACKAGE_kmod-usb-ohci=y' >> .config
echo 'CONFIG_PACKAGE_kmod-usb-printer=y' >> .config
echo 'CONFIG_PACKAGE_kmod-usb-serial=y' >> .config
echo 'CONFIG_PACKAGE_kmod-usb-serial-option=y' >> .config
echo 'CONFIG_PACKAGE_kmod-usb-serial-wwan=y' >> .config
echo 'CONFIG_PACKAGE_kmod-usb-storage=y' >> .config
echo 'CONFIG_PACKAGE_kmod-usb-storage-extras=y' >> .config
echo 'CONFIG_PACKAGE_kmod-usb-uhci=y' >> .config
echo 'CONFIG_PACKAGE_kmod-usb2=y' >> .config
echo 'CONFIG_PACKAGE_kmod-usb3=y' >> .config




# utilities
echo 'CONFIG_PACKAGE_less=y' >> .config
echo 'CONFIG_PACKAGE_more=y' >> .config
echo 'CONFIG_PACKAGE_mc=y' >> .config
echo 'CONFIG_PACKAGE_usb-modeswitch=y' >> .config
echo 'CONFIG_PACKAGE_usbutils=y' >> .config


# others
echo 'CONFIG_PACKAGE_nano=y' >> .config
echo 'CONFIG_PACKAGE_vim-full=y' >> .config
echo 'CONFIG_PACKAGE_htop=y' >> .config
echo 'CONFIG_PACKAGE_block-mount=y' >> .config
echo 'CONFIG_PACKAGE_comgt=y' >> .config
echo 'CONFIG_PACKAGE_docker=y' >> .config
echo 'CONFIG_PACKAGE_docker-compose=y' >> .config
echo 'CONFIG_PACKAGE_dockerd=y' >> .config

make defconfig and build

make -j1 V=sc defconfig
./scripts/feeds update -a
./scripts/feeds install -a
make -j1 V=sc menuconfig
make -j1 V=sc 2>&1 | tee build_log.txt

Actual behaviour

Error while packing image

Expected behaviour

Image successfully build

Additional info

It seems to be kernel or image partition size.
I've tried to change
CONFIG_TARGET_ROOTFS_PARTSIZE to 204, but no success.
And there is no CONFIG_TARGET_KERNEL_PARTSIZE for that device.
(When I add it to .config and make defconfig, it disappears)

Diffconfig

CONFIG_TARGET_mediatek=y
CONFIG_TARGET_mediatek_filogic=y
CONFIG_TARGET_mediatek_filogic_DEVICE_bananapi_bpi-r3=y
CONFIG_ALL_KMODS=y
CONFIG_ALL_NONSHARED=y
CONFIG_DEVEL=y
CONFIG_AUTOREMOVE=y
CONFIG_BPF_TOOLCHAIN_BUILD_LLVM=y
# CONFIG_BPF_TOOLCHAIN_NONE is not set
CONFIG_BUILDBOT=y
CONFIG_COLLECT_KERNEL_DEBUG=y
CONFIG_HAS_BPF_TOOLCHAIN=y
CONFIG_IB=y
CONFIG_KERNEL_BUILD_DOMAIN="buildhost"
CONFIG_KERNEL_BUILD_USER="builder"
CONFIG_KERNEL_CGROUP_DEVICE=y
CONFIG_KERNEL_CGROUP_FREEZER=y
CONFIG_KERNEL_NET_CLS_CGROUP=y
CONFIG_KERNEL_PROC_PID_CPUSET=y
CONFIG_LIBSSH2_OPENSSL=y
CONFIG_LUA_ECO_DEFAULT_OPENSSL=y
CONFIG_LUA_ECO_OPENSSL=y
# CONFIG_LUA_ECO_WOLFSSL is not set
CONFIG_MAKE_TOOLCHAIN=y
CONFIG_MC_CHARSET=y
CONFIG_MC_EDITOR=y
CONFIG_MC_SUBSHELL=y
CONFIG_MC_VFS=y
CONFIG_OPENSSL_ENGINE=y
CONFIG_OPENSSL_WITH_ASM=y
CONFIG_OPENSSL_WITH_CHACHA_POLY1305=y
CONFIG_OPENSSL_WITH_CMS=y
CONFIG_OPENSSL_WITH_DEPRECATED=y
CONFIG_OPENSSL_WITH_ERROR_MESSAGES=y
CONFIG_OPENSSL_WITH_PSK=y
CONFIG_OPENSSL_WITH_SRP=y
CONFIG_OPENSSL_WITH_TLS13=y
CONFIG_PACKAGE_block-mount=y
CONFIG_PACKAGE_btrfs-progs=y
CONFIG_PACKAGE_ca-certificates=y
CONFIG_PACKAGE_chat=y
CONFIG_PACKAGE_comgt=y
CONFIG_PACKAGE_containerd=y
CONFIG_PACKAGE_docker=y
CONFIG_PACKAGE_docker-compose=y
CONFIG_PACKAGE_dockerd=y
CONFIG_PACKAGE_glib2=y
CONFIG_PACKAGE_htop=y
CONFIG_PACKAGE_ip-bridge=y
CONFIG_PACKAGE_ip-full=y
CONFIG_PACKAGE_ip6tables-nft=y
CONFIG_PACKAGE_ipset=y
CONFIG_PACKAGE_iptables-mod-conntrack-extra=y
CONFIG_PACKAGE_iptables-mod-extra=y
CONFIG_PACKAGE_iptables-mod-ipopt=y
CONFIG_PACKAGE_iptables-nft=y
CONFIG_PACKAGE_kmod-asn1-decoder=y
CONFIG_PACKAGE_kmod-asn1-encoder=y
CONFIG_PACKAGE_kmod-br-netfilter=y
CONFIG_PACKAGE_kmod-crypto-cbc=y
CONFIG_PACKAGE_kmod-dax=y
CONFIG_PACKAGE_kmod-dm=y
CONFIG_PACKAGE_kmod-dnsresolver=y
CONFIG_PACKAGE_kmod-fs-btrfs=y
CONFIG_PACKAGE_kmod-fs-ext4=y
CONFIG_PACKAGE_kmod-fs-nfs=y
CONFIG_PACKAGE_kmod-fs-nfs-common=y
CONFIG_PACKAGE_kmod-ikconfig=y
CONFIG_PACKAGE_kmod-ip6tables=y
CONFIG_PACKAGE_kmod-ipt-conntrack=y
CONFIG_PACKAGE_kmod-ipt-conntrack-extra=y
CONFIG_PACKAGE_kmod-ipt-core=y
CONFIG_PACKAGE_kmod-ipt-extra=y
CONFIG_PACKAGE_kmod-ipt-ipopt=y
CONFIG_PACKAGE_kmod-ipt-ipset=y
CONFIG_PACKAGE_kmod-ipt-nat=y
CONFIG_PACKAGE_kmod-ipt-nat6=y
CONFIG_PACKAGE_kmod-ipt-physdev=y
CONFIG_PACKAGE_kmod-ipt-raw=y
CONFIG_PACKAGE_kmod-iptunnel=y
CONFIG_PACKAGE_kmod-keys-encrypted=y
CONFIG_PACKAGE_kmod-keys-trusted=y
CONFIG_PACKAGE_kmod-lib-crc16=y
CONFIG_PACKAGE_kmod-lib-raid6=y
CONFIG_PACKAGE_kmod-lib-xor=y
CONFIG_PACKAGE_kmod-lib-zlib-deflate=y
CONFIG_PACKAGE_kmod-lib-zlib-inflate=y
CONFIG_PACKAGE_kmod-lib-zstd=y
CONFIG_PACKAGE_kmod-mii=y
CONFIG_PACKAGE_kmod-nf-conntrack-netlink=y
CONFIG_PACKAGE_kmod-nf-ipt=y
CONFIG_PACKAGE_kmod-nf-ipt6=y
CONFIG_PACKAGE_kmod-nf-ipvs=y
CONFIG_PACKAGE_kmod-nf-nat6=y
CONFIG_PACKAGE_kmod-nft-compat=y
CONFIG_PACKAGE_kmod-nvme=y
CONFIG_PACKAGE_kmod-oid-registry=y
CONFIG_PACKAGE_kmod-random-core=y
CONFIG_PACKAGE_kmod-scsi-core=y
CONFIG_PACKAGE_kmod-tpm=y
CONFIG_PACKAGE_kmod-udptunnel4=y
CONFIG_PACKAGE_kmod-udptunnel6=y
CONFIG_PACKAGE_kmod-usb-acm=y
CONFIG_PACKAGE_kmod-usb-ehci=y
CONFIG_PACKAGE_kmod-usb-net=y
CONFIG_PACKAGE_kmod-usb-net-cdc-ether=y
CONFIG_PACKAGE_kmod-usb-ohci=y
CONFIG_PACKAGE_kmod-usb-printer=y
CONFIG_PACKAGE_kmod-usb-serial=y
CONFIG_PACKAGE_kmod-usb-serial-option=y
CONFIG_PACKAGE_kmod-usb-serial-wwan=y
CONFIG_PACKAGE_kmod-usb-storage=y
CONFIG_PACKAGE_kmod-usb-storage-extras=y
CONFIG_PACKAGE_kmod-usb-uhci=y
CONFIG_PACKAGE_kmod-usb2=y
CONFIG_PACKAGE_kmod-veth=y
CONFIG_PACKAGE_kmod-vxlan=y
CONFIG_PACKAGE_less=y
CONFIG_PACKAGE_libaio=y
CONFIG_PACKAGE_libatomic=y
CONFIG_PACKAGE_libattr=y
CONFIG_PACKAGE_libbpf=y
CONFIG_PACKAGE_libdevmapper=y
CONFIG_PACKAGE_libelf=y
CONFIG_PACKAGE_libevdev=y
CONFIG_PACKAGE_libffi=y
CONFIG_PACKAGE_libipset=y
CONFIG_PACKAGE_libiptext=y
CONFIG_PACKAGE_libiptext-nft=y
CONFIG_PACKAGE_libiptext6=y
CONFIG_PACKAGE_liblzo=y
CONFIG_PACKAGE_libmount=y
CONFIG_PACKAGE_libncurses=y
CONFIG_PACKAGE_libnetfilter-conntrack=y
CONFIG_PACKAGE_libnetwork=y
CONFIG_PACKAGE_libnfnetlink=y
CONFIG_PACKAGE_libopenssl=y
CONFIG_PACKAGE_libpcap=m
CONFIG_PACKAGE_libpcre2=y
CONFIG_PACKAGE_libreadline=y
CONFIG_PACKAGE_libseccomp=y
CONFIG_PACKAGE_libssh2=y
CONFIG_PACKAGE_libudev-zero=y
CONFIG_PACKAGE_libusb-1.0=y
CONFIG_PACKAGE_libxdp=m
CONFIG_PACKAGE_libxtables=y
CONFIG_PACKAGE_lvm2=y
CONFIG_PACKAGE_mc=y
CONFIG_PACKAGE_more=y
CONFIG_PACKAGE_nano=y
CONFIG_PACKAGE_qosify=m
CONFIG_PACKAGE_runc=y
CONFIG_PACKAGE_tc-tiny=m
CONFIG_PACKAGE_terminfo=y
CONFIG_PACKAGE_tini=y
CONFIG_PACKAGE_usb-modeswitch=y
CONFIG_PACKAGE_usbutils=y
CONFIG_PACKAGE_vim-full=y
CONFIG_PACKAGE_xdp-filter=m
CONFIG_PACKAGE_xdp-loader=m
CONFIG_PACKAGE_xdpdump=m
CONFIG_PACKAGE_xtables-nft=y
CONFIG_PACKAGE_zlib=y
CONFIG_REPRODUCIBLE_DEBUG_INFO=y
CONFIG_SDK=y
CONFIG_SDK_LLVM_BPF=y
CONFIG_USE_LLVM_BUILD=y

Terms

  • I am reporting an issue for OpenWrt, not an unsupported fork.
@nejtr0n nejtr0n added the bug issue report with a confirmed bug label Jan 10, 2023
@nejtr0n nejtr0n changed the title bananapi_bpi-r3 bash: 8: Bad file descriptor sinovip bananapi_bpi-r3 bash: 8: Bad file descriptor Jan 10, 2023
@polskafan
Copy link

I experience the same issue when trying to build the sdcard image. I already looked at target/linux/mediatek/image/filogic.mk where the artifact gets defined, but couldn't quite figure it out.

https://github.com/openwrt/openwrt/blob/a96382c1bb204698cd43e82193877c10e4b63027/target/linux/mediatek/image/filogic.mk (initial support)
https://github.com/openwrt/openwrt/blob/master/target/linux/mediatek/image/filogic.mk (master)

Seems there were some changes and it now checks for some config settings.

My config has both settings enabled:
CONFIG_TARGET_ROOTFS_INITRAMFS=y
CONFIG_TARGET_ROOTFS_SQUASHFS=y

Not sure, where it goes wrong.

@polskafan
Copy link

polskafan commented Jan 10, 2023

The image might be too big. "bash: 8: Bad file descriptor" seems to be a failed call to an error message in the check-size routine:
#11301 (comment)

So, if I get it right, the trick might be to build with CONFIG_TARGET_ROOTFS_INITRAMFS=n. According to 1a6f6a1 the image size can be bigger then.

EDIT I just successfully built the image by deselecting "Target Images" / "ramdisk" (CONFIG_TARGET_ROOTFS_INITRAMFS: embed the root filesystem into the kernel initramfs).

@nejtr0n
Copy link
Author

nejtr0n commented Jan 11, 2023

It seems to my image compiled too with CONFIG_TARGET_ROOTFS_INITRAMFS=n.

I've tried to increase partitions, but no succeed
https://github.com/openwrt/openwrt/blob/master/target/linux/mediatek/image/filogic.mk

.....
				$(if $(CONFIG_TARGET_ROOTFS_INITRAMFS),\
				   pad-to 12M | append-image-stage initramfs-recovery.itb | check-size 64m |\
				) \
				   pad-to 64M | bl2 spim-nand-ddr4 |\
				   pad-to 65M | bl31-uboot bananapi_bpi-r3-snand |\
				   pad-to 69M | bl2 nor-ddr4 |\
				   pad-to 70M | bl31-uboot bananapi_bpi-r3-nor |\
				   pad-to 71M | bl2 emmc-ddr4 |\
				   pad-to 72M | bl31-uboot bananapi_bpi-r3-emmc |\
				   pad-to 76M | mt7986-gpt emmc |\
				$(if $(CONFIG_TARGET_ROOTFS_SQUASHFS),\
				   pad-to 84M | append-image squashfs-sysupgrade.itb | check-size | gzip \
				)
  IMAGE_SIZE := $$(shell expr 84 + $$(CONFIG_TARGET_ROOTFS_PARTSIZE))m
....

@nejtr0n
Copy link
Author

nejtr0n commented Jan 11, 2023

May be there are some other places, where we need to change initramfs size ....

@polskafan
Copy link

polskafan commented Jan 11, 2023

Partition table is defined at lines 19-39. Guess that needs to be adjusted too.

Do you need the initramfs partition for testing in your setup? It don't think I need the features it provides: https://openwrt.org/docs/techref/image.format#initramfs

So just disabling it might be the easiest way to go forward.

@polskafan
Copy link

polskafan commented Jan 11, 2023

I looked at the image that is provided by Sinovoip. If I understand correctly, their kernel partition has a size of 64M:
https://github.com/BPI-SINOVOIP/BPI-R3-OPENWRT-V21.02.3/blob/e17fcb9e479b481222798dffe9ff186e3527db9c/target/linux/mediatek/image/make_bpi-r3_bundle_image.sh
and
https://github.com/BPI-SINOVOIP/BPI-R3-OPENWRT-V21.02.3/blob/e17fcb9e479b481222798dffe9ff186e3527db9c/target/linux/mediatek/image/Makefile

So it should be possible to adjust the partition size.

@nejtr0n
Copy link
Author

nejtr0n commented Jan 11, 2023

I need Initramfs to boot from lvm in the future.
And there is no way to burn image to emmc.
Seems, that initramfs is used in uboot too.
https://github.com/openwrt/openwrt/blob/master/package/boot/uboot-mediatek/patches/430-add-bpi-r3.patch

From my point of view exclude it is not right way.
I think partion sizes should be calculated from compiled parts like initramfs dynamically.
But I need more info about boot process of bpir3

@polskafan
Copy link

I successfully installed the resulting image without the initramfs using the SD card -> NAND -> eMMC way, that is described here:
https://forum.openwrt.org/t/how-to-flash-emmc-on-banana-pi-r3/137418/35

If you have access to the serial console, you can also do a TFTP boot from the bootloader. But yeah, expanding the partition would just make that issue go away completely.

@nejtr0n
Copy link
Author

nejtr0n commented Jan 12, 2023

I've tried to do it too, but when I'm booting from nand, there is no
fw_setenv command in image. Dunno why that happened.

@polskafan do you know how to erase nand from sdcard boot?

I'll try to one more time

@polskafan
Copy link

I first tried this, until I realized the official openwrt doesn't build an image for NAND:
https://wiki.banana-pi.org/Getting_Started_with_BPI-R3

The command to erase flash is mtd erase /dev/mtd0

So I had to stop after the NAND erase and follow the other set of instructions.

@nejtr0n
Copy link
Author

nejtr0n commented Jan 14, 2023

@polskafan , yeah, after erasing NAND everything seems to be working.

Flased fresh image to emmc with uart from boot menu.

Thank you very much bro!! I think we could close issue?

@nejtr0n
Copy link
Author

nejtr0n commented Jan 14, 2023

But all settings are wiped after reboot =)

root@OpenWrt:~# df -h
Filesystem Size Used Available Use% Mounted on
/dev/root 70.5M 70.5M 0 100% /rom
tmpfs 997.9M 100.0K 997.8M 0% /tmp
tmpfs 997.9M 224.0K 997.7M 0% /tmp/root
overlayfs:/tmp/root 997.9M 224.0K 997.7M 0% /
tmpfs 512.0K 0 512.0K 0% /dev
overlayfs:/tmp/root 997.9M 224.0K 997.7M 0% /opt/docker

@polskafan
Copy link

I have read that this can happen, when using the eMMC. But settings are saved for me. I build my image with the script from the OpenMPTCPRouter repository, maybe something is different there. So I don't know whats going on there.

I guess this issue could be closed for me, even though the "Bad file descriptor" message is clearly a bug.

@tidalf
Copy link

tidalf commented Jan 17, 2023

it affects the bpi-r3 updates through auc or attendedsysupgrade too (for some days) :

bash: line 1: 8: Bad file descriptor
gzip: /home/aparcar/asu/worker1/cache/SNAPSHOT/mediatek/filogic/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-e8d66c515999-mediatek-filogic-bananapi_bpi-r3-sdcard.img.gz: No such file or directory
make[3]: *** [Makefile:31: /home/aparcar/asu/worker1/cache/SNAPSHOT/mediatek/filogic/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/tmp/openwrt-e8d66c515999-mediatek-filogic-bananapi_bpi-r3-sdcard.img.gz] Error 1
make[2]: *** [Makefile:204: build_image] Error 2
make[1]: *** [Makefile:142: _call_image] Error 2
make: *** [Makefile:258: image] Error 2
Error: Error while building firmware. See stdout/stderr
Bad message (74)

@nejtr0n
Copy link
Author

nejtr0n commented Mar 2, 2023

I've noticed, that it is dockerd related issue.

When I include dockerd in firmware, root mounting on ram

root@OpenWrt:~# df -h
Filesystem Size Used Available Use% Mounted on
/dev/root 70.5M 70.5M 0 100% /rom
tmpfs 997.9M 100.0K 997.8M 0% /tmp
tmpfs 997.9M 224.0K 997.7M 0% /tmp/root
overlayfs:/tmp/root 997.9M 224.0K 997.7M 0% /
tmpfs 512.0K 0 512.0K 0% /dev
overlayfs:/tmp/root 997.9M 224.0K 997.7M 0% /opt/docker

So I compiled dockerd with module option, and install it after flashing openwrt to sdcard.
Everything seems to be good except docker data-dir (/opt/docker) have to be mounted on ext4 partition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug issue report with a confirmed bug
Projects
None yet
Development

No branches or pull requests

3 participants