ilyakurdyukov / rk3528-tvbox

Armbian config for RK3528 TV-boxes
33 stars 6 forks source link

all in one compilations script #4

Open fensoft opened 5 months ago

fensoft commented 5 months ago

Just run this:

git clone https://github.com/ilyakurdyukov/rk3528-tvbox.git
cd rk3528-tvbox
git clone --depth=1 https://github.com/armbian/build armbian-build
cp -R armbian-patch/* armbian-build/
cd armbian-build
./compile.sh build BOARD=rk3528-tvbox BRANCH=legacy BUILD_DESKTOP=no BUILD_MINIMAL=yes EXPERT=yes KERNEL_CONFIGURE=no KERNEL_GIT=shallow RELEASE=bookworm
cd ../..
cat <<EOF > rk3528-tvbox/build.sh
#!/bin/bash
cd /build
IMAGE=\`ls /build/armbian-build/output/images/*.img\`
losetup -D
losetup --partscan /dev/loop0 \$IMAGE
mount /dev/loop0p1 /mnt
cd devicetree
cp orig/*.dtsi .
patch -p1 -i rk3528-tvbox.patch
make NAME=rk3528-vontar-dq08 PRESET=LINUX
cp rk3528-vontar-dq08.dtb /mnt/dtb/rockchip
sed "s#fdtfile=.*#fdtfile=rockchip/rk3528-vontar-dq08.dtb#" -i /mnt/armbianEnv.txt
losetup -D
cat \$IMAGE | gzip > /build/\`basename \$IMAGE\`.gz
EOF
chmod a+x rk3528-tvbox/build.sh
docker run -it -v /dev:/dev --privileged=true -v `pwd`/rk3528-tvbox:/build --rm armbian.local.only/armbian-build:initial /build/build.sh
ilyakurdyukov commented 5 months ago

Yeah, good job. I hate Docker though, don’t see why it was needed here.

fensoft commented 5 months ago

docker is nearly used everywhere when speaking about building images for embedded devices (armbian, openwrt, yocto, busybox). it's also used when you need to build or run something in a controled environment without polluting your environment so i don't understand why you hate docker

JostBrand commented 1 month ago

Your script fails for me when setting up loop devices. It seems like content that is fed into grep fails. Anyone have an idea how I could fix it?

[🐳|🚸] Command failed, retrying in 5s [ check_loop_device_internal  ]
[🐳|🚸] Command failed 5 times, giving up [ check_loop_device_internal  ]
[🐳|πŸ’₯] error! [ Device node  does not exist after 5 tries.  ]
[🐳|πŸ’₯] Exiting with error 43 [ at /armbian/lib/functions/logging/traps.sh:1
                exit_with_error() --> lib/functions/logging/traps.sh:1
              check_loop_device() --> lib/functions/image/loop.sh:15
             prepare_partitions() --> lib/functions/image/partitioning.sh:234
                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 ]
fensoft commented 1 month ago

You probably won't have /dev/loop0. WSL2 ?

JostBrand commented 1 month ago

You probably won't have /dev/loop0. WSL2 ?

I am on artix/arch linux. Will run the command again and will post the lsblk.

EDIT: Found a fix in the armbian issues. When executing $ losetup -f before compiling a loop device gets created. After that the process runs smoothly.