Zyxel Armor Z2 (NBG6817) - 3GB extroot on 19.07

On Zyxel Armor Z2 (NBG6817) extroot doesn't work without this patch:

Is there a developer of openwrt? Please add this patch to master! :slight_smile:

InToSSH, you do not need kmod-fs-autofs4, kmod-fs-ext4, kmod-fs-f2fs, kmod-lib-crc32 and mount /dev/loop0 to /tmp/overlay.
Only this packages are needed: block-mount, blockd and kmod-usb-storage.

There is my own instruction:

  1. clone src and change dir to it: git clone https://github.com/openwrt/openwrt.git ~/source && cd ~/source

  2. make directory for patch: mkdir ./package/system/fstools/patches

  3. write patch content from https://patchwork.ozlabs.org/patch/1082599/ to ./package/system/fstools/patches/001-add_propper_rootfs_and_fstab_discovery_on_a_block_device_partitions.patch

  4. build image:
    ./scripts/feeds update -a
    ./scripts/feeds install -a
    export MAKEFLAGS=-j5
    make menuconfig
    system ⇒ Qualcomm Atheros IPQ806X y
    Target Profile ⇒ Zyxel NBG6817 y
    Base system ⇒
    ⇒ block-mount y (for extroot on mmcblk0p10)
    ⇒ blockd y (for extroot on mmcblk0p10)
    Kernel modules ⇒ USB Support ⇒ kmod-usb-storage y (for usb-hdd support)
    LuCI ⇒
    ⇒ Collections ⇒ luci y
    ⇒ Applications ⇒ luci-app-advanced-reboot y
    make defconfig
    make download
    ionice -c 3 nice -n19 make

results you can find in:

  1. flash this firmware to router
    scp ./bin/targets/ipq806x/generic/openwrt-ipq806x-zyxel_nbg6817-squashfs-sysupgrade.bin root@openwrt:/tmp
    ssh root@openwrt
    sysupgrade -v /tmp/openwrt-ipq806x-zyxel_nbg6817-squashfs-sysupgrade.bin

  2. set extroot:
    ssh root@openwrt
    DEVICE="$(awk -e '/\s/overlay\s/{print $1}' /etc/mtab)"
    uci -q delete fstab.rwm
    uci set fstab.rwm="mount"
    uci set fstab.rwm.device="${DEVICE}"
    uci set fstab.rwm.target="/rwm"
    uci set fstab.rwm.enabled="1"
    uci commit fstab

DEVICE="/dev/mmcblk0p10" // or if you want to use usb-hdd: DEVICE="/dev/sda1"
mkfs.ext4 -F "${DEVICE}" // Careful, formats the disk without asking for confirmation!
eval $(block info "${DEVICE}" | grep -o -e "UUID=\S*")
uci -q delete fstab.overlay
uci set fstab.overlay="mount"
uci set fstab.overlay.uuid="${UUID}"
uci set fstab.overlay.target="/overlay"
uci set fstab.overlay.enabled="1"
uci commit fstab

mount "${DEVICE}" /mnt
cp -a -f /overlay/. /mnt
umount /mnt