diff --git a/device/rockchip/ok3568c/mkosi.conf b/device/rockchip/ok3568c/mkosi.conf index cc56280..7bdcdc4 100644 --- a/device/rockchip/ok3568c/mkosi.conf +++ b/device/rockchip/ok3568c/mkosi.conf @@ -1,3 +1,8 @@ +[Config] +MinimumVersion=24 +Dependencies= + u-boot + [Distribution] Distribution=rosa Release=rosa13 @@ -31,3 +36,9 @@ Timezone=Europe/Moscow Hostname=elara WithDocs=no CleanPackageMetadata=false + +[Build] +WithNetwork=yes + +BuildSources=./:mkosi + ./mkosi.images/u-boot/configuration:configuration diff --git a/device/rockchip/ok3568c/mkosi.finalize.d/10-bar.sh.finalyze b/device/rockchip/ok3568c/mkosi.finalize.d/10-bar.sh.finalyze index 0467b1e..d9cac1a 100755 --- a/device/rockchip/ok3568c/mkosi.finalize.d/10-bar.sh.finalyze +++ b/device/rockchip/ok3568c/mkosi.finalize.d/10-bar.sh.finalyze @@ -2,3 +2,4 @@ # SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL set -x env +ls -la ${SRCDIR} diff --git a/device/rockchip/ok3568c/u-boot/configuration/0001-add-rk3568-ok3568c-board.patch b/device/rockchip/ok3568c/mkosi.images/u-boot/configuration/0001-add-rk3568-ok3568c-board.patch similarity index 100% rename from device/rockchip/ok3568c/u-boot/configuration/0001-add-rk3568-ok3568c-board.patch rename to device/rockchip/ok3568c/mkosi.images/u-boot/configuration/0001-add-rk3568-ok3568c-board.patch diff --git a/device/rockchip/ok3568c/u-boot/mkosi.build b/device/rockchip/ok3568c/mkosi.images/u-boot/mkosi.build similarity index 77% rename from device/rockchip/ok3568c/u-boot/mkosi.build rename to device/rockchip/ok3568c/mkosi.images/u-boot/mkosi.build index 1341324..49b2882 100755 --- a/device/rockchip/ok3568c/u-boot/mkosi.build +++ b/device/rockchip/ok3568c/mkosi.images/u-boot/mkosi.build @@ -1,6 +1,4 @@ #!/bin/sh -set -x - echo "--- mkosi.build: args=$@" echo "--- mkosi.build: container=$container" @@ -16,7 +14,18 @@ echo "--- mkosi.build: builddir=$BUILDDIR" cd $SRCDIR echo "--- mkosi.build: clone u-boot" -dnf in -y python2 --release 13 + +if [ -f "${SRCDIR}/mkosi/idbloader.img" ]; then + echo "--- mkosi.build: idbloader.img already exist, skipping u-boot build..." + exit 0 +fi + +dnf in -y --release 13 python2 +dnf in -y --release 13 basesystem-build curl \ + dnf git gcc-aarch64-linux-gnu \ + binutils-aarch64-linux-gnu \ + wget dtc bc + git clone https://github.com/radxa/u-boot.git --depth 1 -b next-dev-v2024.03 cd u-boot git apply ${SRCDIR}/configuration/*.patch diff --git a/device/rockchip/ok3568c/mkosi.images/u-boot/mkosi.conf b/device/rockchip/ok3568c/mkosi.images/u-boot/mkosi.conf new file mode 100644 index 0000000..480be52 --- /dev/null +++ b/device/rockchip/ok3568c/mkosi.images/u-boot/mkosi.conf @@ -0,0 +1,9 @@ +[Output] +Format=directory + +[Content] +Bootable=no + +Packages=dnf + rosa-repos-contrib + rosa-repos diff --git a/device/rockchip/ok3568c/mkosi.postoutput.d/10-bar.sh.finalyze b/device/rockchip/ok3568c/mkosi.postoutput.d/10-bar.sh.finalyze index 6df1cb1..e172ede 100755 --- a/device/rockchip/ok3568c/mkosi.postoutput.d/10-bar.sh.finalyze +++ b/device/rockchip/ok3568c/mkosi.postoutput.d/10-bar.sh.finalyze @@ -1,6 +1,9 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL -set -x -env -ls -la ${SRCDIR} -ls -la ${OUTPUTDIR} +UBOOT_DIR="${SRCDIR}/mkosi" + +pushd ${OUTPUTDIR} +printf "write bootloader to the image...\n" +dd if=${UBOOT_DIR}/idbloader.img of=image.raw seek=64 conv=notrunc +dd if=${UBOOT_DIR}/u-boot.itb of=image.raw seek=16384 conv=notrunc +popd diff --git a/device/rockchip/ok3568c/u-boot/mkosi.conf b/device/rockchip/ok3568c/u-boot/mkosi.conf deleted file mode 100644 index 33f5329..0000000 --- a/device/rockchip/ok3568c/u-boot/mkosi.conf +++ /dev/null @@ -1,27 +0,0 @@ -[Distribution] -Distribution=rosa -Release=rosa13 -Architecture=x86-64 - -[Output] -Format=directory - -[Content] -Bootable=no -Packages=basesystem-build - curl - dnf - git - gcc-aarch64-linux-gnu - binutils-aarch64-linux-gnu - wget - dtc - bc - rosa-repos-contrib - rosa-repos - - -[Build] -WithNetwork=yes -BuildSources=./:mkosi - ./configuration:configuration