From 9d4e0408c524fcf3e0b501be48ce1791f94df7df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20Pe=C4=8Dovnik?= Date: Wed, 7 Jul 2021 16:06:00 +0200 Subject: [PATCH] Improvements for BSP creation (#2975) * Improvements for BSP creation - add support for the same principle found in desktop creation. For CLI package we are copying content from "bsp-cli" folders. - moving bsp* copy function to image-helpers - improve readme --- README.md | 2 ++ lib/desktop.sh | 23 ++--------------------- lib/general.sh | 1 - lib/image-helpers.sh | 20 ++++++++++++++++++++ lib/makeboarddeb.sh | 6 ++++-- packages/README.md | 3 ++- 6 files changed, 30 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index c2e6b9662..3b2b5cf67 100644 --- a/README.md +++ b/README.md @@ -160,6 +160,8 @@ Armbian [releases](https://docs.armbian.com/Release_Changelog/) quarterly at the │   └── patch Created patches location ├── packages Support scripts, binary blobs, packages │   ├── blobs Wallpapers, various configs, closed source bootloaders +│   ├── bsp-cli Automatically added to armbian-bsp-cli package +│   ├── bsp-desktop Automatically added to armbian-bsp-desktopo package │   ├── bsp Scripts and configs overlay for rootfs │   └── extras-buildpkgs Optional compilation and packaging engine ├── patch Collection of patches diff --git a/lib/desktop.sh b/lib/desktop.sh index 2bc594e39..dee4d19c6 100644 --- a/lib/desktop.sh +++ b/lib/desktop.sh @@ -91,7 +91,6 @@ create_desktop_package () eval "${aggregated_content}" [[ $? -ne 0 ]] && display_alert "create_desktop_package.sh exec error" "" "wrn" - # create board DEB file display_alert "Building desktop package" "${CHOSEN_DESKTOP}_${REVISION}_all" "info" mkdir -p "${DEB_STORAGE}/${RELEASE}" @@ -108,26 +107,11 @@ create_desktop_package () -copy_all_packages_files_for() -{ - local package_name="${1}" - for package_src_dir in ${PACKAGES_SEARCH_ROOT_ABSOLUTE_DIRS}; - do - local package_dirpath="${package_src_dir}/${package_name}" - if [ -d "${package_dirpath}" ]; - then - cp -r "${package_dirpath}/"* "${destination}/" 2> /dev/null - display_alert ">>> adding files from" "${package_dirpath}" - fi - done -} - - - - create_bsp_desktop_package () { + display_alert "Creating board support package for desktop" "${package_name}" "info" + local package_name="${BSP_DESKTOP_PACKAGE_FULLNAME}" local destination tmp_dir @@ -173,9 +157,6 @@ create_bsp_desktop_package () eval "${aggregated_content}" [[ $? -ne 0 ]] && display_alert "prepare.sh exec error" "" "wrn" - # create board DEB file - display_alert "Building desktop package" "${package_name}" "info" - mkdir -p "${DEB_STORAGE}/${RELEASE}" cd "${destination}"; cd .. fakeroot dpkg-deb -b "${destination}" "${DEB_STORAGE}/${RELEASE}/${package_name}.deb" >/dev/null diff --git a/lib/general.sh b/lib/general.sh index 472aed11c..302d99815 100644 --- a/lib/general.sh +++ b/lib/general.sh @@ -446,7 +446,6 @@ display_alert() #-------------------------------------------------------------------------------------------------------------------------------- fingerprint_image() { - display_alert "Fingerprinting" cat <<-EOF > "${1}" -------------------------------------------------------------------------------- Title: ${VENDOR} $REVISION ${BOARD^} $DISTRIBUTION $RELEASE $BRANCH diff --git a/lib/image-helpers.sh b/lib/image-helpers.sh index 7f4ff1e88..a596596ab 100644 --- a/lib/image-helpers.sh +++ b/lib/image-helpers.sh @@ -17,6 +17,7 @@ # check_loop_device # install_external_applications # write_uboot +# copy_all_packages_files_for # customize_image # install_deb_chroot # run_on_sdcard @@ -133,6 +134,25 @@ write_uboot() +# copy_all_packages_files_for to package +# +copy_all_packages_files_for() +{ + local package_name="${1}" + for package_src_dir in ${PACKAGES_SEARCH_ROOT_ABSOLUTE_DIRS}; + do + local package_dirpath="${package_src_dir}/${package_name}" + if [ -d "${package_dirpath}" ]; + then + cp -r "${package_dirpath}/"* "${destination}/" 2> /dev/null + display_alert "Adding files from" "${package_dirpath}" + fi + done +} + + + + customize_image() { diff --git a/lib/makeboarddeb.sh b/lib/makeboarddeb.sh index bf6a46541..04662dd34 100644 --- a/lib/makeboarddeb.sh +++ b/lib/makeboarddeb.sh @@ -18,7 +18,7 @@ create_board_package() { - display_alert "Creating board support package" "$BOARD $BRANCH" "info" + display_alert "Creating board support package for CLI" "$CHOSEN_ROOTFS" "info" bsptempdir=$(mktemp -d) chmod 700 ${bsptempdir} @@ -27,6 +27,9 @@ create_board_package() mkdir -p "${destination}"/DEBIAN cd $destination + # copy general overlay from packages/bsp-cli + copy_all_packages_files_for "bsp-cli" + # install copy of boot script & environment file local bootscript_src=${BOOTSCRIPT%%:*} local bootscript_dst=${BOOTSCRIPT##*:} @@ -317,7 +320,6 @@ fi find "${destination}" ! -type l -print0 2>/dev/null | xargs -0r chmod 'go=rX,u+rw,a-s' # create board DEB file - display_alert "Building package" "$CHOSEN_ROOTFS" "info" fakeroot dpkg-deb -b "${destination}" "${destination}.deb" >> "${DEST}"/debug/install.log 2>&1 mkdir -p "${DEB_STORAGE}/${RELEASE}/" rsync --remove-source-files -rq "${destination}.deb" "${DEB_STORAGE}/${RELEASE}/" diff --git a/packages/README.md b/packages/README.md index 19de0f2e5..69a11e8ba 100644 --- a/packages/README.md +++ b/packages/README.md @@ -3,5 +3,6 @@ |armbian|kernel deb packaging scripts| |blobs|| |bsp|| -|bsp-desktop | common desktop board support packages overlay| +|bsp-cli | common files which are copied in armbian-cli-* package | +|bsp-desktop | common files which are copied in armbian-desktop-* package | |extras-buildpkgs||