Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (â‹®) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[Armbian build PR] - build script: configuration: Check if ROOTFS_TYPE is supported by build host

Featured Replies

Description

When trying to build an image with FIXED_IMAGE_SIZE=3000 ROOTFS_TYPE=f2fs with WSL2 as build host, I stumbled on an error pretty late in the build process when trying to mount the rootfs:

[💲|🌿] Creating rootfs [ f2fs on /dev/loop2p2 ]
[💲|🔨]
[💲|🔨]         F2FS-tools: mkfs.f2fs Ver: 1.14.0 (2020-08-24)
[💲|🔨]
[💲|🔨]   Info: Disable heap-based policy
[💲|🔨]   Info: Debug level = 0
[💲|🔨]   Info: Label = armbi_root
[💲|🔨]   Info: Trim is enabled
[💲|🔨]   Info: Segments per section = 1
[💲|🔨]   Info: Sections per zone = 1
[💲|🔨]   Info: sector size = 512
[💲|🔨]   Info: total sectors = 5586911 (2727 MB)
[💲|🔨]   Info: zone aligned segment0 blkaddr: 512
[💲|🔨]   Info: format version with
[💲|🔨]     "Linux version 6.1.21.2-microsoft-standard-WSL2+ (flash@DESKTOP-2VA4T55) (gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #1 SMP Wed Jan 31 20:29:07 CET 2024"
[💲|🔨]   Info: [/dev/loop2p2] Discarding device
[💲|🔨]   Info: This device doesn't support BLKSECDISCARD
[💲|🔨]   Info: Discarded 2727 MB
[💲|🔨]   Info: Overprovision ratio = 3.860%
[💲|🔨]   Info: Overprovision segments = 108 (GC reserved = 59)
[💲|🔨]   Info: format successful
[💲|🌿] Mounting rootfs [ /dev/loop2p2 (UUID=02dfb13e-172d-44b1-b71c-25164f29cc0b) ]
[💲|🔨]   mount: /home/user/build-fork/.tmp/mount-bfedd4e1-02f1-4bac-99c1-88d420d40809: unknown filesystem type 'f2fs'.
[💲|💥] Error 32 occurred in main shell [ at /home/flash/build-fork/lib/functions/logging/runners.sh:211
    run_host_command_logged_raw() --> lib/functions/logging/runners.sh:211
        run_host_command_logged() --> lib/functions/logging/runners.sh:193
             prepare_partitions() --> lib/functions/image/partitioning.sh:275
                do_with_logging() --> lib/functions/logging/section-logging.sh:81
         build_rootfs_and_image() --> lib/functions/main/rootfs-image.sh:86
   full_build_packages_rootfs_and_image() --> lib/functions/main/default-build.sh:36
          do_with_default_build() --> lib/functions/main/default-build.sh:42
         cli_standard_build_run() --> lib/functions/cli/cli-build.sh:25
        armbian_cli_run_command() --> lib/functions/cli/utils-cli.sh:136
                 cli_entrypoint() --> lib/functions/cli/entrypoint.sh:176
                           main() --> compile.sh:50
 ]
[💲|💥] Cleaning up [ please wait for cleanups to finish ]

I found out that this is because the WSL2 kernel does not have support for the F2FS filesystem. f2fs-tools could be installed normally though. To make the build script exit at the beginning instead of at a late stage and to tell the user a more exact reason why it failed, I added a check if the chosen ROOTFS_TYPE is supported by the host the build script is running on.

The check checks /proc/filesystems which should be present in all Linux distros. But just in case /proc/filesystems is not present, the build won't fail and instead print a warning that the build might fail just like if it can't install python2.

How Has This Been Tested?

Build host: Linux version 6.1.21.2-microsoft-standard-WSL2+ (no F2FS support, but BTRFS and EXT4 support) Command: ./compile.sh build BOARD=nanopi-r5c BRANCH=edge BUILD_DESKTOP=no BUILD_MINIMAL=no KERNEL_CONFIGURE=no RELEASE=bookworm FIXED_IMAGE_SIZE=3000 ROOTFS_TYPE=f2fs

  • [x] Ran build with FIXED_IMAGE_SIZE=3000 ROOTFS_TYPE=f2fs --> build exits at an early stage with [💲|💥] error! [ Filesystem type unsupported by build host: f2fs ]
  • [x] Ran build with ROOTFS_TYPE=btrfs --> build success
  • [x] Ran build without ROOTFS_TYPE option --> build success

Might need some testing with other more exotic build hosts like Docker.

Checklist:

  • [x] My code follows the style guidelines of this project
  • [x] I have performed a self-review of my own code
  • [x] I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [x] My changes generate no new warnings

View the full article

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.