Message ID | 20200817082450.28101-1-Quirin.Gylstorff@siemens.com |
---|---|
State | Superseded, archived |
Headers | show |
Series | [v2] u-boot: add libubootenv | expand |
On 17.08.20 10:24, [ext] Q. Gylstorff wrote: > From: Quirin Gylstorff <quirin.gylstorff@siemens.com> > > Add the new library libubootenv and remove fw_printenv and fw_setenv > form u-boot-tools as the are now part of the new library. > > libubootenv is a library that provides a hardware independent > way to access to U-Boot environment. U-Boot has its default environment > compiled board-dependently and this means that tools to access the environment > are also board specific, too. > > libubootenv conflicts with u-boot-tools from Debian 10 > as both try to install fw_printenv and fw_sentenv. This conflict is not > part of the control file as it breaks the installation of custom u-boot-tools > from the u-boot-sources. > > This patch uses dpkg-gdb to build the package from salsa.debian.org and adds > a fix for https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=967487. > > Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com> > --- > > Changes V2: > - use dpkg-gbd instead dpkg > - use salsa.debian.org as source > - add fix for https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=967487 > > meta-isar/conf/machine/de0-nano-soc.conf | 2 +- > .../0002-Add-support-GNUInstallDirs.patch | 48 +++++++++++++++++++ > .../libubootenv/libubootenv_0.2.bb | 30 ++++++++++++ > .../files/debian/u-boot-tools.conffiles | 1 - > .../u-boot/files/debian/u-boot-tools.install | 2 - > .../u-boot/files/debian/u-boot-tools.links | 1 - > 6 files changed, 79 insertions(+), 5 deletions(-) > create mode 100644 meta/recipes-bsp/libubootenv/files/0002-Add-support-GNUInstallDirs.patch > create mode 100644 meta/recipes-bsp/libubootenv/libubootenv_0.2.bb > delete mode 100644 meta/recipes-bsp/u-boot/files/debian/u-boot-tools.conffiles > delete mode 100644 meta/recipes-bsp/u-boot/files/debian/u-boot-tools.links > > diff --git a/meta-isar/conf/machine/de0-nano-soc.conf b/meta-isar/conf/machine/de0-nano-soc.conf > index 3a2c009..6558d90 100644 > --- a/meta-isar/conf/machine/de0-nano-soc.conf > +++ b/meta-isar/conf/machine/de0-nano-soc.conf > @@ -15,4 +15,4 @@ WKS_FILE ?= "de0-nano-soc.wks.in" > IMAGER_INSTALL += "u-boot-de0-nano-soc" > IMAGER_BUILD_DEPS += "u-boot-de0-nano-soc" > > -IMAGE_INSTALL += "u-boot-tools u-boot-script" > +IMAGE_INSTALL += "u-boot-tools libubootenv u-boot-script" > diff --git a/meta/recipes-bsp/libubootenv/files/0002-Add-support-GNUInstallDirs.patch b/meta/recipes-bsp/libubootenv/files/0002-Add-support-GNUInstallDirs.patch > new file mode 100644 > index 0000000..f8c3038 > --- /dev/null > +++ b/meta/recipes-bsp/libubootenv/files/0002-Add-support-GNUInstallDirs.patch > @@ -0,0 +1,48 @@ > +From b17d194bd8285a19382a902a0bec9e5e042df064 Mon Sep 17 00:00:00 2001 > +From: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp> > +Date: Tue, 16 Apr 2019 08:52:01 +0900 > +Subject: [PATCH 2/4] Add support GNUInstallDirs > + > +This adds the functionality of the module "GNUInstallDirs" to make the > +installation compatible with GNU. > + > +https://cmake.org/cmake/help/v3.14/module/GNUInstallDirs.html > + > +Signed-off-by: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp> > +--- > + CMakeLists.txt | 2 ++ > + src/CMakeLists.txt | 8 ++++---- > + 2 files changed, 6 insertions(+), 4 deletions(-) > + > +diff --git a/CMakeLists.txt b/CMakeLists.txt > +index 104969e..57477fc 100644 > +--- a/CMakeLists.txt > ++++ b/CMakeLists.txt > +@@ -10,6 +10,8 @@ add_definitions(-DVERSION="${VERSION}") > + > + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99") > + > ++include("GNUInstallDirs") > ++ > + #set(CMAKE_C_FLAGS_DEBUG "-g") > + include_directories ("${PROJECT_SOURCE_DIR}/src") > + add_subdirectory (src) > +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt > +index ea5979c..d97f221 100644 > +--- a/src/CMakeLists.txt > ++++ b/src/CMakeLists.txt > +@@ -19,7 +19,7 @@ add_executable(fw_setenv fw_setenv.c) > + target_link_libraries(fw_printenv ubootenv z) > + target_link_libraries(fw_setenv ubootenv z) > + > +-install (TARGETS ubootenv DESTINATION lib) > +-install (FILES libuboot.h DESTINATION include) > +-install (TARGETS fw_printenv DESTINATION bin) > +-install (TARGETS fw_setenv DESTINATION bin) > ++install (TARGETS ubootenv DESTINATION "${CMAKE_INSTALL_LIBDIR}") > ++install (FILES libuboot.h DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") > ++install (TARGETS fw_printenv DESTINATION "${CMAKE_INSTALL_BINDIR}") > ++install (TARGETS fw_setenv DESTINATION "${CMAKE_INSTALL_BINDIR}") > +-- > +2.20.1 > + > diff --git a/meta/recipes-bsp/libubootenv/libubootenv_0.2.bb b/meta/recipes-bsp/libubootenv/libubootenv_0.2.bb > new file mode 100644 > index 0000000..995e581 > --- /dev/null > +++ b/meta/recipes-bsp/libubootenv/libubootenv_0.2.bb > @@ -0,0 +1,30 @@ > +# libubootenv > +# > +# This software is a part of ISAR. > +# Copyright (c) Siemens AG, 2020 > +# > +# SPDX-License-Identifier: MIT > + > +DESCRIPTION = "swupdate utility for software updates" > +HOMEPAGE= "https://github.com/sbabic/swupdate" > +LICENSE = "GPL-2.0" > +LIC_FILES_CHKSUM = "file://${LAYERDIR_isar}/licenses/COPYING.GPLv2;md5=751419260aa954499f7abaabaa882bbe" > + > +inherit dpkg-gbp > + > +SRC_URI = "git://salsa.debian.org/debian/libubootenv.git;protocol=https \ > + file://0002-Add-support-GNUInstallDirs.patch;apply=no " > +SRCREV = "2c7cb6d941d906dcc1d2e447cc17e418485dff12" > + > +S = "${WORKDIR}/git" > + > +do_prepare_build() { > + cd ${S} > + export QUILT_PATCHES=debian/patches > + quilt import -f ${WORKDIR}/*.patch > + quilt push -a > +} > + > +dpkg_runbuild_prepend() { > + export DEB_BUILD_OPTIONS="nocheck" > +} Inconsitent indention of the functions. > diff --git a/meta/recipes-bsp/u-boot/files/debian/u-boot-tools.conffiles b/meta/recipes-bsp/u-boot/files/debian/u-boot-tools.conffiles > deleted file mode 100644 > index d49a8fb..0000000 > --- a/meta/recipes-bsp/u-boot/files/debian/u-boot-tools.conffiles > +++ /dev/null > @@ -1 +0,0 @@ > -/etc/fw_env.config > diff --git a/meta/recipes-bsp/u-boot/files/debian/u-boot-tools.install b/meta/recipes-bsp/u-boot/files/debian/u-boot-tools.install > index d1ae3e0..2893b9a 100644 > --- a/meta/recipes-bsp/u-boot/files/debian/u-boot-tools.install > +++ b/meta/recipes-bsp/u-boot/files/debian/u-boot-tools.install > @@ -1,5 +1,3 @@ > tools/dumpimage /usr/bin/ > -tools/env/fw_printenv /usr/bin/ > tools/mkenvimage /usr/bin/ > tools/mkimage /usr/bin/ > -tools/env/fw_env.config /etc > diff --git a/meta/recipes-bsp/u-boot/files/debian/u-boot-tools.links b/meta/recipes-bsp/u-boot/files/debian/u-boot-tools.links > deleted file mode 100644 > index 92f5a6c..0000000 > --- a/meta/recipes-bsp/u-boot/files/debian/u-boot-tools.links > +++ /dev/null > @@ -1 +0,0 @@ > -/usr/bin/fw_printenv /usr/bin/fw_setenv > Looks good to me otherwise - and we are already using it in production IIRC. Jan
On 31.08.20 18:35, [ext] Jan Kiszka wrote: > On 17.08.20 10:24, [ext] Q. Gylstorff wrote: >> From: Quirin Gylstorff <quirin.gylstorff@siemens.com> >> >> Add the new library libubootenv and remove fw_printenv and fw_setenv >> form u-boot-tools as the are now part of the new library. >> >> libubootenv is a library that provides a hardware independent >> way to access to U-Boot environment. U-Boot has its default environment >> compiled board-dependently and this means that tools to access the environment >> are also board specific, too. >> >> libubootenv conflicts with u-boot-tools from Debian 10 >> as both try to install fw_printenv and fw_sentenv. This conflict is not >> part of the control file as it breaks the installation of custom u-boot-tools >> from the u-boot-sources. >> >> This patch uses dpkg-gdb to build the package from salsa.debian.org and adds >> a fix for https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=967487. >> >> Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com> >> --- >> >> Changes V2: >> - use dpkg-gbd instead dpkg >> - use salsa.debian.org as source >> - add fix for https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=967487 >> >> meta-isar/conf/machine/de0-nano-soc.conf | 2 +- >> .../0002-Add-support-GNUInstallDirs.patch | 48 +++++++++++++++++++ >> .../libubootenv/libubootenv_0.2.bb | 30 ++++++++++++ >> .../files/debian/u-boot-tools.conffiles | 1 - >> .../u-boot/files/debian/u-boot-tools.install | 2 - >> .../u-boot/files/debian/u-boot-tools.links | 1 - >> 6 files changed, 79 insertions(+), 5 deletions(-) >> create mode 100644 meta/recipes-bsp/libubootenv/files/0002-Add-support-GNUInstallDirs.patch >> create mode 100644 meta/recipes-bsp/libubootenv/libubootenv_0.2.bb >> delete mode 100644 meta/recipes-bsp/u-boot/files/debian/u-boot-tools.conffiles >> delete mode 100644 meta/recipes-bsp/u-boot/files/debian/u-boot-tools.links >> >> diff --git a/meta-isar/conf/machine/de0-nano-soc.conf b/meta-isar/conf/machine/de0-nano-soc.conf >> index 3a2c009..6558d90 100644 >> --- a/meta-isar/conf/machine/de0-nano-soc.conf >> +++ b/meta-isar/conf/machine/de0-nano-soc.conf >> @@ -15,4 +15,4 @@ WKS_FILE ?= "de0-nano-soc.wks.in" >> IMAGER_INSTALL += "u-boot-de0-nano-soc" >> IMAGER_BUILD_DEPS += "u-boot-de0-nano-soc" >> >> -IMAGE_INSTALL += "u-boot-tools u-boot-script" >> +IMAGE_INSTALL += "u-boot-tools libubootenv u-boot-script" >> diff --git a/meta/recipes-bsp/libubootenv/files/0002-Add-support-GNUInstallDirs.patch b/meta/recipes-bsp/libubootenv/files/0002-Add-support-GNUInstallDirs.patch >> new file mode 100644 >> index 0000000..f8c3038 >> --- /dev/null >> +++ b/meta/recipes-bsp/libubootenv/files/0002-Add-support-GNUInstallDirs.patch >> @@ -0,0 +1,48 @@ >> +From b17d194bd8285a19382a902a0bec9e5e042df064 Mon Sep 17 00:00:00 2001 >> +From: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp> >> +Date: Tue, 16 Apr 2019 08:52:01 +0900 >> +Subject: [PATCH 2/4] Add support GNUInstallDirs >> + >> +This adds the functionality of the module "GNUInstallDirs" to make the >> +installation compatible with GNU. >> + >> +https://cmake.org/cmake/help/v3.14/module/GNUInstallDirs.html >> + >> +Signed-off-by: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp> >> +--- >> + CMakeLists.txt | 2 ++ >> + src/CMakeLists.txt | 8 ++++---- >> + 2 files changed, 6 insertions(+), 4 deletions(-) >> + >> +diff --git a/CMakeLists.txt b/CMakeLists.txt >> +index 104969e..57477fc 100644 >> +--- a/CMakeLists.txt >> ++++ b/CMakeLists.txt >> +@@ -10,6 +10,8 @@ add_definitions(-DVERSION="${VERSION}") >> + >> + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99") >> + >> ++include("GNUInstallDirs") >> ++ >> + #set(CMAKE_C_FLAGS_DEBUG "-g") >> + include_directories ("${PROJECT_SOURCE_DIR}/src") >> + add_subdirectory (src) >> +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt >> +index ea5979c..d97f221 100644 >> +--- a/src/CMakeLists.txt >> ++++ b/src/CMakeLists.txt >> +@@ -19,7 +19,7 @@ add_executable(fw_setenv fw_setenv.c) >> + target_link_libraries(fw_printenv ubootenv z) >> + target_link_libraries(fw_setenv ubootenv z) >> + >> +-install (TARGETS ubootenv DESTINATION lib) >> +-install (FILES libuboot.h DESTINATION include) >> +-install (TARGETS fw_printenv DESTINATION bin) >> +-install (TARGETS fw_setenv DESTINATION bin) >> ++install (TARGETS ubootenv DESTINATION "${CMAKE_INSTALL_LIBDIR}") >> ++install (FILES libuboot.h DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") >> ++install (TARGETS fw_printenv DESTINATION "${CMAKE_INSTALL_BINDIR}") >> ++install (TARGETS fw_setenv DESTINATION "${CMAKE_INSTALL_BINDIR}") >> +-- >> +2.20.1 >> + >> diff --git a/meta/recipes-bsp/libubootenv/libubootenv_0.2.bb b/meta/recipes-bsp/libubootenv/libubootenv_0.2.bb >> new file mode 100644 >> index 0000000..995e581 >> --- /dev/null >> +++ b/meta/recipes-bsp/libubootenv/libubootenv_0.2.bb >> @@ -0,0 +1,30 @@ >> +# libubootenv >> +# >> +# This software is a part of ISAR. >> +# Copyright (c) Siemens AG, 2020 >> +# >> +# SPDX-License-Identifier: MIT >> + >> +DESCRIPTION = "swupdate utility for software updates" >> +HOMEPAGE= "https://github.com/sbabic/swupdate" >> +LICENSE = "GPL-2.0" >> +LIC_FILES_CHKSUM = "file://${LAYERDIR_isar}/licenses/COPYING.GPLv2;md5=751419260aa954499f7abaabaa882bbe" >> + >> +inherit dpkg-gbp >> + >> +SRC_URI = "git://salsa.debian.org/debian/libubootenv.git;protocol=https \ >> + file://0002-Add-support-GNUInstallDirs.patch;apply=no " >> +SRCREV = "2c7cb6d941d906dcc1d2e447cc17e418485dff12" >> + >> +S = "${WORKDIR}/git" >> + >> +do_prepare_build() { >> + cd ${S} >> + export QUILT_PATCHES=debian/patches >> + quilt import -f ${WORKDIR}/*.patch >> + quilt push -a >> +} >> + >> +dpkg_runbuild_prepend() { >> + export DEB_BUILD_OPTIONS="nocheck" >> +} > > Inconsitent indention of the functions. > >> diff --git a/meta/recipes-bsp/u-boot/files/debian/u-boot-tools.conffiles b/meta/recipes-bsp/u-boot/files/debian/u-boot-tools.conffiles >> deleted file mode 100644 >> index d49a8fb..0000000 >> --- a/meta/recipes-bsp/u-boot/files/debian/u-boot-tools.conffiles >> +++ /dev/null >> @@ -1 +0,0 @@ >> -/etc/fw_env.config >> diff --git a/meta/recipes-bsp/u-boot/files/debian/u-boot-tools.install b/meta/recipes-bsp/u-boot/files/debian/u-boot-tools.install >> index d1ae3e0..2893b9a 100644 >> --- a/meta/recipes-bsp/u-boot/files/debian/u-boot-tools.install >> +++ b/meta/recipes-bsp/u-boot/files/debian/u-boot-tools.install >> @@ -1,5 +1,3 @@ >> tools/dumpimage /usr/bin/ >> -tools/env/fw_printenv /usr/bin/ >> tools/mkenvimage /usr/bin/ >> tools/mkimage /usr/bin/ >> -tools/env/fw_env.config /etc >> diff --git a/meta/recipes-bsp/u-boot/files/debian/u-boot-tools.links b/meta/recipes-bsp/u-boot/files/debian/u-boot-tools.links >> deleted file mode 100644 >> index 92f5a6c..0000000 >> --- a/meta/recipes-bsp/u-boot/files/debian/u-boot-tools.links >> +++ /dev/null >> @@ -1 +0,0 @@ >> -/usr/bin/fw_printenv /usr/bin/fw_setenv >> > > Looks good to me otherwise - and we are already using it in production IIRC. > > Jan > Could you address my comment and check if this still applies over next? Thanks, Jan
diff --git a/meta-isar/conf/machine/de0-nano-soc.conf b/meta-isar/conf/machine/de0-nano-soc.conf index 3a2c009..6558d90 100644 --- a/meta-isar/conf/machine/de0-nano-soc.conf +++ b/meta-isar/conf/machine/de0-nano-soc.conf @@ -15,4 +15,4 @@ WKS_FILE ?= "de0-nano-soc.wks.in" IMAGER_INSTALL += "u-boot-de0-nano-soc" IMAGER_BUILD_DEPS += "u-boot-de0-nano-soc" -IMAGE_INSTALL += "u-boot-tools u-boot-script" +IMAGE_INSTALL += "u-boot-tools libubootenv u-boot-script" diff --git a/meta/recipes-bsp/libubootenv/files/0002-Add-support-GNUInstallDirs.patch b/meta/recipes-bsp/libubootenv/files/0002-Add-support-GNUInstallDirs.patch new file mode 100644 index 0000000..f8c3038 --- /dev/null +++ b/meta/recipes-bsp/libubootenv/files/0002-Add-support-GNUInstallDirs.patch @@ -0,0 +1,48 @@ +From b17d194bd8285a19382a902a0bec9e5e042df064 Mon Sep 17 00:00:00 2001 +From: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp> +Date: Tue, 16 Apr 2019 08:52:01 +0900 +Subject: [PATCH 2/4] Add support GNUInstallDirs + +This adds the functionality of the module "GNUInstallDirs" to make the +installation compatible with GNU. + +https://cmake.org/cmake/help/v3.14/module/GNUInstallDirs.html + +Signed-off-by: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp> +--- + CMakeLists.txt | 2 ++ + src/CMakeLists.txt | 8 ++++---- + 2 files changed, 6 insertions(+), 4 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 104969e..57477fc 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -10,6 +10,8 @@ add_definitions(-DVERSION="${VERSION}") + + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99") + ++include("GNUInstallDirs") ++ + #set(CMAKE_C_FLAGS_DEBUG "-g") + include_directories ("${PROJECT_SOURCE_DIR}/src") + add_subdirectory (src) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index ea5979c..d97f221 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -19,7 +19,7 @@ add_executable(fw_setenv fw_setenv.c) + target_link_libraries(fw_printenv ubootenv z) + target_link_libraries(fw_setenv ubootenv z) + +-install (TARGETS ubootenv DESTINATION lib) +-install (FILES libuboot.h DESTINATION include) +-install (TARGETS fw_printenv DESTINATION bin) +-install (TARGETS fw_setenv DESTINATION bin) ++install (TARGETS ubootenv DESTINATION "${CMAKE_INSTALL_LIBDIR}") ++install (FILES libuboot.h DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") ++install (TARGETS fw_printenv DESTINATION "${CMAKE_INSTALL_BINDIR}") ++install (TARGETS fw_setenv DESTINATION "${CMAKE_INSTALL_BINDIR}") +-- +2.20.1 + diff --git a/meta/recipes-bsp/libubootenv/libubootenv_0.2.bb b/meta/recipes-bsp/libubootenv/libubootenv_0.2.bb new file mode 100644 index 0000000..995e581 --- /dev/null +++ b/meta/recipes-bsp/libubootenv/libubootenv_0.2.bb @@ -0,0 +1,30 @@ +# libubootenv +# +# This software is a part of ISAR. +# Copyright (c) Siemens AG, 2020 +# +# SPDX-License-Identifier: MIT + +DESCRIPTION = "swupdate utility for software updates" +HOMEPAGE= "https://github.com/sbabic/swupdate" +LICENSE = "GPL-2.0" +LIC_FILES_CHKSUM = "file://${LAYERDIR_isar}/licenses/COPYING.GPLv2;md5=751419260aa954499f7abaabaa882bbe" + +inherit dpkg-gbp + +SRC_URI = "git://salsa.debian.org/debian/libubootenv.git;protocol=https \ + file://0002-Add-support-GNUInstallDirs.patch;apply=no " +SRCREV = "2c7cb6d941d906dcc1d2e447cc17e418485dff12" + +S = "${WORKDIR}/git" + +do_prepare_build() { + cd ${S} + export QUILT_PATCHES=debian/patches + quilt import -f ${WORKDIR}/*.patch + quilt push -a +} + +dpkg_runbuild_prepend() { + export DEB_BUILD_OPTIONS="nocheck" +} diff --git a/meta/recipes-bsp/u-boot/files/debian/u-boot-tools.conffiles b/meta/recipes-bsp/u-boot/files/debian/u-boot-tools.conffiles deleted file mode 100644 index d49a8fb..0000000 --- a/meta/recipes-bsp/u-boot/files/debian/u-boot-tools.conffiles +++ /dev/null @@ -1 +0,0 @@ -/etc/fw_env.config diff --git a/meta/recipes-bsp/u-boot/files/debian/u-boot-tools.install b/meta/recipes-bsp/u-boot/files/debian/u-boot-tools.install index d1ae3e0..2893b9a 100644 --- a/meta/recipes-bsp/u-boot/files/debian/u-boot-tools.install +++ b/meta/recipes-bsp/u-boot/files/debian/u-boot-tools.install @@ -1,5 +1,3 @@ tools/dumpimage /usr/bin/ -tools/env/fw_printenv /usr/bin/ tools/mkenvimage /usr/bin/ tools/mkimage /usr/bin/ -tools/env/fw_env.config /etc diff --git a/meta/recipes-bsp/u-boot/files/debian/u-boot-tools.links b/meta/recipes-bsp/u-boot/files/debian/u-boot-tools.links deleted file mode 100644 index 92f5a6c..0000000 --- a/meta/recipes-bsp/u-boot/files/debian/u-boot-tools.links +++ /dev/null @@ -1 +0,0 @@ -/usr/bin/fw_printenv /usr/bin/fw_setenv