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

all in one compilations script #4

Open
fensoft opened this issue Feb 3, 2024 · 8 comments
Open

all in one compilations script #4

fensoft opened this issue Feb 3, 2024 · 8 comments

Comments

@fensoft
Copy link

fensoft commented Feb 3, 2024

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
Copy link
Owner

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

@fensoft
Copy link
Author

fensoft commented Feb 4, 2024

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
Copy link

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
Copy link
Author

fensoft commented Jun 6, 2024

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

@JostBrand
Copy link

JostBrand commented Jun 6, 2024

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.

@jeantigreros
Copy link

Thank you very much!

@JostBrand
Copy link

After building I am able to login and use the device but after a reboot I cannot get it back online. Did you encounter this / found a solution?

@fensoft
Copy link
Author

fensoft commented Aug 14, 2024

you need to wire an uart2usb adapter to show us what's going on

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants