[kteam-tools][PATCH v2 0/7] git-build-kernel: source pkg features

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|

[kteam-tools][PATCH v2 0/7] git-build-kernel: source pkg features

Kamal Mostafa-2
Fixes and features relating to construction of source packages via the
'git push remote commit-ish:source' method.

New (optional) feature: "SOURCE_PACKAGE_CHROOT=series" can be specified in
debian.env to force a particular chroot for source package contstruction.
We could could this to override the default behavior (building the source
package in a chroot matching the target series) if ever needed.

New behavior: The source package _source.changes file is now built with
the suitable 'dpkg-genchanges -vversion' relative to -updates as determined
by rmadison.

Fixed: The push :source method now works for arbitrary source package names,
not just "linux".

[PATCH v2] adds:
  + no orig tarball for -meta (or -signed); otherwise, verify tarball exists
  + special-case debuild -v handling for backport kernels with "~" versions
  + sanitize debuild -v handling when building already-published src pkgs
  + note in README: main kernel build repo can be used for -meta and -signed

 -Kamal

----

Kamal Mostafa (7):
  git-build-kernel: extract the correct source package name
  git-build-kernel: improve results summary for source packages
  git-build-kernel: support SOURCE_PACKAGE_CHROOT=series via debian.env
  git-build-kernel: debuild source packages with suitable -vversion
  git-build-kernel: squelch output noise when there is no
    debian/debian.env
  git-build-kernel: special case no-orig-tarball src packages
  git-build-kernel: add README notes about meta and signed

 git-build-kernel/README           |  4 ++
 git-build-kernel/git-build-kernel | 84 +++++++++++++++++++++++++++++++--------
 2 files changed, 72 insertions(+), 16 deletions(-)

--
2.7.4


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[kteam-tools][PATCH v2 1/7] git-build-kernel: extract the correct source package name

Kamal Mostafa-2
And use it to find the correct .orig tarball when building source packages.

Signed-off-by: Kamal Mostafa <[hidden email]>
---
 git-build-kernel/git-build-kernel | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/git-build-kernel/git-build-kernel b/git-build-kernel/git-build-kernel
index df95e12..44e38c8 100755
--- a/git-build-kernel/git-build-kernel
+++ b/git-build-kernel/git-build-kernel
@@ -80,6 +80,7 @@ DISTRO=$(
     do [ "$DISTRO" != "UNRELEASED" ] && { echo $DISTRO; break; }
     done
     )
+SRCPKG=$(git show $GITBRANCH:$DEBIAN/changelog | sed 's/^\(.*\) (.*/\1/;q')
 CHROOT="$DISTRO"
 CHROOT="${CHROOT%-proposed}"
 if [ "$CHROOT" = "UNRELEASED" -o -z "$CHROOT" ]
@@ -116,7 +117,7 @@ touch "$WORKDIR/building"
 trap "rm -rf $WORKDIR/building $BUILDDIR" 0
 
 [ $do_source_pkg = 1 ] && {
-    orig_tarball="linux_${VERSION%%-*}.orig.tar.gz"
+    orig_tarball="${SRCPKG}_${VERSION%%-*}.orig.tar.gz"
     # Careful: $ORIG_TARBALLS_DIR must be accessible from within the chroot.
     # (Alternately, use "cp -p" instead of "ln -s" if that's not an option)
     ln -s $ORIG_TARBALLS_DIR/$orig_tarball $WORKDIR/
--
2.7.4


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[kteam-tools][PATCH v2 2/7] git-build-kernel: improve results summary for source packages

Kamal Mostafa-2
In reply to this post by Kamal Mostafa-2
Add a 'debsign -r' cut-n-paste fragment.  Be more explicit about which
chroot is used.

Signed-off-by: Kamal Mostafa <[hidden email]>
---
 git-build-kernel/git-build-kernel | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/git-build-kernel/git-build-kernel b/git-build-kernel/git-build-kernel
index 44e38c8..6dd0792 100755
--- a/git-build-kernel/git-build-kernel
+++ b/git-build-kernel/git-build-kernel
@@ -131,10 +131,11 @@ trap "rm -rf $WORKDIR/building $BUILDDIR" 0
 ###     run the standard debian/rules invocations like a pkgbuilder would
 ###
 
-echo "git-build-kernel ($CHROOT)"
-echo "      version: $DISTRO ($VERSION)"
+echo "git-build-kernel"
+echo "      package: $SRCPKG ($VERSION) $DISTRO"
 echo "      targets: $TARGETS"
 echo "         arch: $ARCH"
+echo "       chroot: $CHROOT"
 echo "  starting build in $HOSTNAME:$WORKDIR ..."
 
 function show_elapsed
@@ -214,10 +215,17 @@ echo "      $HOSTNAME:$LOG"
 
 # cat $LOG
 
-if [ $STATUS = 0 ]
+[ $STATUS != 0 ] && exit $STATUS
+
+if [ $do_source_pkg = 1 ]
 then
+    changesfile=$(ls "$WORKDIR"/*_source.changes)
+    echo "  source package files:"
+    echo "      $HOSTNAME:${WORKDIR}"
+    echo "  ready for debsign and upload:"
+    echo "      debsign -r $HOSTNAME ${changesfile}"
+else
     echo "  binary packages:"
     echo "      $HOSTNAME:$WORKDIR/"
 fi
 
-exit $STATUS
--
2.7.4


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[kteam-tools][PATCH v2 3/7] git-build-kernel: support SOURCE_PACKAGE_CHROOT=series via debian.env

Kamal Mostafa-2
In reply to this post by Kamal Mostafa-2
When building a source package via the "git push commit-ish:source"
method...

If debian/debian.env contains a "SOURCE_PACKAGE_CHROOT=series" line
(where series is a distro series like 'xenial') then git-build-kernel
will build the source package in a chroot of that specified series.

If no SOURCE_PACKAGE_CHROOT line exists, then git-build-kernel will use
a chroot of the series indicated by debian/changelog.

The SOURCE_PACKAGE_CHROOT feature applies only to *source* package
builds; binary packages are always built in a chroot of the series
indicated by debian/changelog.

Signed-off-by: Kamal Mostafa <[hidden email]>
---
 git-build-kernel/git-build-kernel | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/git-build-kernel/git-build-kernel b/git-build-kernel/git-build-kernel
index 6dd0792..cfad062 100755
--- a/git-build-kernel/git-build-kernel
+++ b/git-build-kernel/git-build-kernel
@@ -83,6 +83,10 @@ DISTRO=$(
 SRCPKG=$(git show $GITBRANCH:$DEBIAN/changelog | sed 's/^\(.*\) (.*/\1/;q')
 CHROOT="$DISTRO"
 CHROOT="${CHROOT%-proposed}"
+[ $do_source_pkg = 1 ] && {
+    eval `git show $GITBRANCH:debian/debian.env | grep SOURCE_PACKAGE_CHROOT=`
+    [ -z "$SOURCE_PACKAGE_CHROOT" ] || CHROOT="$SOURCE_PACKAGE_CHROOT"
+}
 if [ "$CHROOT" = "UNRELEASED" -o -z "$CHROOT" ]
 then
     GITREPOBASE="${GITREPO%/*}" # e.g. /home/kamal/src/linux
--
2.7.4


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[kteam-tools][PATCH v2 4/7] git-build-kernel: debuild source packages with suitable -vversion

Kamal Mostafa-2
In reply to this post by Kamal Mostafa-2
Determine latest released package version in <series>-updates and supply
it to dpkg-genchanges via debuild -vversion.

Special case: If rmadison reports that the version published in -updates
is the same or newer than the source package version being built, then
just do not pass any -v<updates_version> to debuild.  dpkg-genchanges
does actually detect such out-of-order versions but misbehaves if the
updates_version doesn't exist in the changelog at all (as with our
derivative kernels).  This situation only occurs when test-building
source packages which have already been published; the resulting source
package could not be re-uploaded anyway, so the contents of
_source.changes are not critical.

Signed-off-by: Kamal Mostafa <[hidden email]>
---
 git-build-kernel/git-build-kernel | 40 ++++++++++++++++++++++++++++++++-------
 1 file changed, 33 insertions(+), 7 deletions(-)

diff --git a/git-build-kernel/git-build-kernel b/git-build-kernel/git-build-kernel
index cfad062..a683ad4 100755
--- a/git-build-kernel/git-build-kernel
+++ b/git-build-kernel/git-build-kernel
@@ -95,6 +95,31 @@ then
     CHROOT="${CHROOT%.git}"
 fi
 
+### Get the source package version number
+chg="`git show $GITBRANCH:$DEBIAN/changelog | head -1`"
+VERSION=`echo "$chg" | sed -n -e '1s/^.*(\([^)]*\)).*$/\1/p'`
+
+### Find the appropriate -v{version} value for dpkg-genchanges
+[ $do_source_pkg = 1 ] && {
+    updates_version=$(rmadison -s ${DISTRO}-updates $SRCPKG | grep 'source$' | awk '{print $3}')
+    if [ -n "$updates_version" ]
+    then
+ dpkg --compare-versions "$updates_version" ge $VERSION && {
+    echo "WARNING: ${DISTRO}-updates version ($updates_version) >= this version; skipping -v!" 1>&2
+    updates_version=""
+ }
+    else
+ echo "WARNING: cannot determine ${DISTRO}-updates version for $SRCPKG" 1>&2
+    fi
+    if [ -n "$updates_version" ]
+    then
+ ### Special case for backport kernel versions: strip the e.g. "~16.04.1"
+ ### suffix from the updates_version
+ updates_version="${updates_version%~*}"
+ srcpkg_debopts="-v$updates_version $srcpkg_debopts"
+    fi
+}
+
 ### Compile amd64 and i386 in a native chroot.
 ### Cross-compile ARM in an amd64 chroot (for dramatically better performance).
 if [ "$ARCH" = "amd64" -o "$ARCH" = "i386" ]
@@ -104,10 +129,6 @@ else
  CHROOT="$CHROOT-amd64"
 fi
 
-### Get the version number - we need it to locate the orig tarball
-chg="`git show $GITBRANCH:$DEBIAN/changelog | head -1`"
-VERSION=`echo "$chg" | sed -n -e '1s/^.*(\([^)]*\)).*$/\1/p'`
-
 
 ### Set up the /tmp work directory
 
@@ -138,7 +159,12 @@ trap "rm -rf $WORKDIR/building $BUILDDIR" 0
 echo "git-build-kernel"
 echo "      package: $SRCPKG ($VERSION) $DISTRO"
 echo "      targets: $TARGETS"
-echo "         arch: $ARCH"
+if [ $do_source_pkg = 1 ]
+then
+    echo "    changes-v: $updates_version"
+else
+    echo "         arch: $ARCH"
+fi
 echo "       chroot: $CHROOT"
 echo "  starting build in $HOSTNAME:$WORKDIR ..."
 
@@ -180,7 +206,7 @@ show_elapsed &
  fakeroot debian/rules clean
  if [ $do_source_pkg = 1 ]
  then
-    debuild -S -I -i -uc -us
+    debuild $srcpkg_debopts -S -I -i -uc -us
  else
     debian/rules build
     fakeroot debian/rules $TARGETS
@@ -194,7 +220,7 @@ XXEOFXX
  fakeroot debian/rules clean
  if [ $do_source_pkg = 1 ]
  then
-    debuild -S -I -i -uc -us
+    debuild $srcpkg_debopts -S -I -i -uc -us
  else
     debian/rules build
     fakeroot debian/rules $TARGETS
--
2.7.4


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[kteam-tools][PATCH v2 5/7] git-build-kernel: squelch output noise when there is no debian/debian.env

Kamal Mostafa-2
In reply to this post by Kamal Mostafa-2
Signed-off-by: Kamal Mostafa <[hidden email]>
---
 git-build-kernel/git-build-kernel | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/git-build-kernel/git-build-kernel b/git-build-kernel/git-build-kernel
index a683ad4..3c19587 100755
--- a/git-build-kernel/git-build-kernel
+++ b/git-build-kernel/git-build-kernel
@@ -68,7 +68,7 @@ GITSHASHORT="`git log -1 --pretty=%h ${GITBRANCH%%refs/heads/} --`"
 }
 
 ### Get the var "DEBIAN=debian.master" from debian/debian.env
-eval `git show $GITBRANCH:debian/debian.env | grep DEBIAN=`
+eval `git show $GITBRANCH:debian/debian.env 2>&- | grep DEBIAN=`
 [ -z "$DEBIAN" ] && DEBIAN=debian
 
 
@@ -84,7 +84,7 @@ SRCPKG=$(git show $GITBRANCH:$DEBIAN/changelog | sed 's/^\(.*\) (.*/\1/;q')
 CHROOT="$DISTRO"
 CHROOT="${CHROOT%-proposed}"
 [ $do_source_pkg = 1 ] && {
-    eval `git show $GITBRANCH:debian/debian.env | grep SOURCE_PACKAGE_CHROOT=`
+    eval `git show $GITBRANCH:debian/debian.env 2>&- | grep SOURCE_PACKAGE_CHROOT=`
     [ -z "$SOURCE_PACKAGE_CHROOT" ] || CHROOT="$SOURCE_PACKAGE_CHROOT"
 }
 if [ "$CHROOT" = "UNRELEASED" -o -z "$CHROOT" ]
--
2.7.4


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[kteam-tools][PATCH v2 6/7] git-build-kernel: special case no-orig-tarball src packages

Kamal Mostafa-2
In reply to this post by Kamal Mostafa-2
The "meta" and "signed" source packages do not use an orig tarball, so
do not try to symlink to one, and do use --no-tgz-check to inhibit checking
for one (the latter is explicitly required just for "signed" since its
non-Debian-native version number implies that there will be a orig tarball).

Signed-off-by: Kamal Mostafa <[hidden email]>
---
 git-build-kernel/git-build-kernel | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/git-build-kernel/git-build-kernel b/git-build-kernel/git-build-kernel
index 3c19587..02994db 100755
--- a/git-build-kernel/git-build-kernel
+++ b/git-build-kernel/git-build-kernel
@@ -142,10 +142,23 @@ touch "$WORKDIR/building"
 trap "rm -rf $WORKDIR/building $BUILDDIR" 0
 
 [ $do_source_pkg = 1 ] && {
-    orig_tarball="${SRCPKG}_${VERSION%%-*}.orig.tar.gz"
-    # Careful: $ORIG_TARBALLS_DIR must be accessible from within the chroot.
-    # (Alternately, use "cp -p" instead of "ln -s" if that's not an option)
-    ln -s $ORIG_TARBALLS_DIR/$orig_tarball $WORKDIR/
+    ### Special case for linux-signed and linux-meta packages, which
+    ### have no .orig tarball
+    [ ${SRCPKG/-signed} != $SRCPKG ] && no_orig_tarball=1
+    [ ${SRCPKG/-meta} != $SRCPKG ] && no_orig_tarball=1
+    if [ "$no_orig_tarball" = 1 ]
+    then
+ srcpkg_debopts="--no-tgz-check $srcpkg_debopts"
+    else
+ orig_tarball="${SRCPKG}_${VERSION%%-*}.orig.tar.gz"
+ # Careful: $ORIG_TARBALLS_DIR must be accessible from within the chroot.
+ # (Alternately, use "cp -p" instead of "ln -s" if that's not an option)
+ [ -e "$ORIG_TARBALLS_DIR/$orig_tarball" ] || {
+    echo "fatal: missing $ORIG_TARBALLS_DIR/$orig_tarball" 1>&2
+    exit 1
+ }
+ ln -s $ORIG_TARBALLS_DIR/$orig_tarball $WORKDIR/
+    fi
 }
 
 ###
--
2.7.4


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[kteam-tools][PATCH v2 7/7] git-build-kernel: add README notes about meta and signed

Kamal Mostafa-2
In reply to this post by Kamal Mostafa-2
Signed-off-by: Kamal Mostafa <[hidden email]>
---
 git-build-kernel/README | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/git-build-kernel/README b/git-build-kernel/README
index 875ffb9..ab2b8f7 100644
--- a/git-build-kernel/README
+++ b/git-build-kernel/README
@@ -85,6 +85,10 @@ To set up your git push auto-builder
    (Do that for each ubuntu-* repo that you'll want to push to).
    (Works fine for repo dir's named "ubuntu-something.git" also).
 
+   For the small repos like -meta or -signed, you need not bother setting
+   up a specific builder repo at all.  For each of those, just add a remote
+   (as below) to the main kernel repo on your build server.
+
 2. On your local machine, if you haven't already, set up a git remote
    to point to your repo on the build server, e.g:
 
--
2.7.4


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

Re: [kteam-tools][PATCH v2 4/7] git-build-kernel: debuild source packages with suitable -vversion

Andy Whitcroft-3
In reply to this post by Kamal Mostafa-2
On Thu, Aug 02, 2018 at 03:40:32PM -0700, Kamal Mostafa wrote:

> Determine latest released package version in <series>-updates and supply
> it to dpkg-genchanges via debuild -vversion.
>
> Special case: If rmadison reports that the version published in -updates
> is the same or newer than the source package version being built, then
> just do not pass any -v<updates_version> to debuild.  dpkg-genchanges
> does actually detect such out-of-order versions but misbehaves if the
> updates_version doesn't exist in the changelog at all (as with our
> derivative kernels).  This situation only occurs when test-building
> source packages which have already been published; the resulting source
> package could not be re-uploaded anyway, so the contents of
> _source.changes are not critical.
>
> Signed-off-by: Kamal Mostafa <[hidden email]>
> ---
>  git-build-kernel/git-build-kernel | 40 ++++++++++++++++++++++++++++++++-------
>  1 file changed, 33 insertions(+), 7 deletions(-)
>
> diff --git a/git-build-kernel/git-build-kernel b/git-build-kernel/git-build-kernel
> index cfad062..a683ad4 100755
> --- a/git-build-kernel/git-build-kernel
> +++ b/git-build-kernel/git-build-kernel
> @@ -95,6 +95,31 @@ then
>      CHROOT="${CHROOT%.git}"
>  fi
>  
> +### Get the source package version number
> +chg="`git show $GITBRANCH:$DEBIAN/changelog | head -1`"
> +VERSION=`echo "$chg" | sed -n -e '1s/^.*(\([^)]*\)).*$/\1/p'`
> +
> +### Find the appropriate -v{version} value for dpkg-genchanges
> +[ $do_source_pkg = 1 ] && {
> +    updates_version=$(rmadison -s ${DISTRO}-updates $SRCPKG | grep 'source$' | awk '{print $3}')
> +    if [ -n "$updates_version" ]
> +    then
> + dpkg --compare-versions "$updates_version" ge $VERSION && {
> +    echo "WARNING: ${DISTRO}-updates version ($updates_version) >= this version; skipping -v!" 1>&2
> +    updates_version=""
> + }
> +    else
> + echo "WARNING: cannot determine ${DISTRO}-updates version for $SRCPKG" 1>&2
> +    fi
> +    if [ -n "$updates_version" ]
> +    then
> + ### Special case for backport kernel versions: strip the e.g. "~16.04.1"
> + ### suffix from the updates_version
> + updates_version="${updates_version%~*}"
> + srcpkg_debopts="-v$updates_version $srcpkg_debopts"

It is quite upsetting that we have to have this vileness in here.  I
have a proposal to avoid this which I will discuss as a potential follow
on.

> +    fi
> +}
> +
>  ### Compile amd64 and i386 in a native chroot.
>  ### Cross-compile ARM in an amd64 chroot (for dramatically better performance).
>  if [ "$ARCH" = "amd64" -o "$ARCH" = "i386" ]
> @@ -104,10 +129,6 @@ else
>   CHROOT="$CHROOT-amd64"
>  fi
>  
> -### Get the version number - we need it to locate the orig tarball
> -chg="`git show $GITBRANCH:$DEBIAN/changelog | head -1`"
> -VERSION=`echo "$chg" | sed -n -e '1s/^.*(\([^)]*\)).*$/\1/p'`
> -
>  
>  ### Set up the /tmp work directory
>  
> @@ -138,7 +159,12 @@ trap "rm -rf $WORKDIR/building $BUILDDIR" 0
>  echo "git-build-kernel"
>  echo "      package: $SRCPKG ($VERSION) $DISTRO"
>  echo "      targets: $TARGETS"
> -echo "         arch: $ARCH"
> +if [ $do_source_pkg = 1 ]
> +then
> +    echo "    changes-v: $updates_version"
> +else
> +    echo "         arch: $ARCH"
> +fi
>  echo "       chroot: $CHROOT"
>  echo "  starting build in $HOSTNAME:$WORKDIR ..."
>  
> @@ -180,7 +206,7 @@ show_elapsed &
>   fakeroot debian/rules clean
>   if [ $do_source_pkg = 1 ]
>   then
> -    debuild -S -I -i -uc -us
> +    debuild $srcpkg_debopts -S -I -i -uc -us
>   else
>      debian/rules build
>      fakeroot debian/rules $TARGETS
> @@ -194,7 +220,7 @@ XXEOFXX
>   fakeroot debian/rules clean
>   if [ $do_source_pkg = 1 ]
>   then
> -    debuild -S -I -i -uc -us
> +    debuild $srcpkg_debopts -S -I -i -uc -us
>   else
>      debian/rules build
>      fakeroot debian/rules $TARGETS
> --
> 2.7.4
>
>
> --
> kernel-team mailing list
> [hidden email]
> https://lists.ubuntu.com/mailman/listinfo/kernel-team

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

Re: [kteam-tools][PATCH v2 5/7] git-build-kernel: squelch output noise when there is no debian/debian.env

Andy Whitcroft-3
In reply to this post by Kamal Mostafa-2
On Thu, Aug 02, 2018 at 03:40:33PM -0700, Kamal Mostafa wrote:

> Signed-off-by: Kamal Mostafa <[hidden email]>
> ---
>  git-build-kernel/git-build-kernel | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/git-build-kernel/git-build-kernel b/git-build-kernel/git-build-kernel
> index a683ad4..3c19587 100755
> --- a/git-build-kernel/git-build-kernel
> +++ b/git-build-kernel/git-build-kernel
> @@ -68,7 +68,7 @@ GITSHASHORT="`git log -1 --pretty=%h ${GITBRANCH%%refs/heads/} --`"
>  }
>  
>  ### Get the var "DEBIAN=debian.master" from debian/debian.env
> -eval `git show $GITBRANCH:debian/debian.env | grep DEBIAN=`
> +eval `git show $GITBRANCH:debian/debian.env 2>&- | grep DEBIAN=`

I am not used to seeing stderr being closed.  That could lead to
applications failing when they attempt to report an error.  Which in the
general case might lead to unexpected behaviour.  I am wondering why
this is not 2>/dev/null which feels like a more normal approach.

-apw

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

Re: [kteam-tools][PATCH v2 6/7] git-build-kernel: special case no-orig-tarball src packages

Andy Whitcroft-3
In reply to this post by Kamal Mostafa-2
On Thu, Aug 02, 2018 at 03:40:34PM -0700, Kamal Mostafa wrote:

> The "meta" and "signed" source packages do not use an orig tarball, so
> do not try to symlink to one, and do use --no-tgz-check to inhibit checking
> for one (the latter is explicitly required just for "signed" since its
> non-Debian-native version number implies that there will be a orig tarball).
>
> Signed-off-by: Kamal Mostafa <[hidden email]>
> ---
>  git-build-kernel/git-build-kernel | 21 +++++++++++++++++----
>  1 file changed, 17 insertions(+), 4 deletions(-)
>
> diff --git a/git-build-kernel/git-build-kernel b/git-build-kernel/git-build-kernel
> index 3c19587..02994db 100755
> --- a/git-build-kernel/git-build-kernel
> +++ b/git-build-kernel/git-build-kernel
> @@ -142,10 +142,23 @@ touch "$WORKDIR/building"
>  trap "rm -rf $WORKDIR/building $BUILDDIR" 0
>  
>  [ $do_source_pkg = 1 ] && {
> -    orig_tarball="${SRCPKG}_${VERSION%%-*}.orig.tar.gz"
> -    # Careful: $ORIG_TARBALLS_DIR must be accessible from within the chroot.
> -    # (Alternately, use "cp -p" instead of "ln -s" if that's not an option)
> -    ln -s $ORIG_TARBALLS_DIR/$orig_tarball $WORKDIR/
> +    ### Special case for linux-signed and linux-meta packages, which
> +    ### have no .orig tarball
> +    [ ${SRCPKG/-signed} != $SRCPKG ] && no_orig_tarball=1
> +    [ ${SRCPKG/-meta} != $SRCPKG ] && no_orig_tarball=1

This feels like it is going to become a problem.  For example in devel
we don't always have an orig as there isn't one yet as upstream has not
yet released the thing.  I think we need to think of a better way to
make this determination.

> +    if [ "$no_orig_tarball" = 1 ]
> +    then
> + srcpkg_debopts="--no-tgz-check $srcpkg_debopts"
> +    else
> + orig_tarball="${SRCPKG}_${VERSION%%-*}.orig.tar.gz"
> + # Careful: $ORIG_TARBALLS_DIR must be accessible from within the chroot.
> + # (Alternately, use "cp -p" instead of "ln -s" if that's not an option)
> + [ -e "$ORIG_TARBALLS_DIR/$orig_tarball" ] || {
> +    echo "fatal: missing $ORIG_TARBALLS_DIR/$orig_tarball" 1>&2
> +    exit 1
> + }
> + ln -s $ORIG_TARBALLS_DIR/$orig_tarball $WORKDIR/
> +    fi
>  }
>  
>  ###

-apw

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[Acked] [kteam-tools][PATCH v2 0/7] git-build-kernel: source pkg features

Andy Whitcroft-3
In reply to this post by Kamal Mostafa-2
On Thu, Aug 02, 2018 at 03:40:28PM -0700, Kamal Mostafa wrote:

> Fixes and features relating to construction of source packages via the
> 'git push remote commit-ish:source' method.
>
> New (optional) feature: "SOURCE_PACKAGE_CHROOT=series" can be specified in
> debian.env to force a particular chroot for source package contstruction.
> We could could this to override the default behavior (building the source
> package in a chroot matching the target series) if ever needed.
>
> New behavior: The source package _source.changes file is now built with
> the suitable 'dpkg-genchanges -vversion' relative to -updates as determined
> by rmadison.
>
> Fixed: The push :source method now works for arbitrary source package names,
> not just "linux".
>
> [PATCH v2] adds:
>   + no orig tarball for -meta (or -signed); otherwise, verify tarball exists
>   + special-case debuild -v handling for backport kernels with "~" versions
>   + sanitize debuild -v handling when building already-published src pkgs
>   + note in README: main kernel build repo can be used for -meta and -signed
>
>  -Kamal
>
> ----
>
> Kamal Mostafa (7):
>   git-build-kernel: extract the correct source package name
>   git-build-kernel: improve results summary for source packages
>   git-build-kernel: support SOURCE_PACKAGE_CHROOT=series via debian.env
>   git-build-kernel: debuild source packages with suitable -vversion
>   git-build-kernel: squelch output noise when there is no
>     debian/debian.env
>   git-build-kernel: special case no-orig-tarball src packages
>   git-build-kernel: add README notes about meta and signed
>
>  git-build-kernel/README           |  4 ++
>  git-build-kernel/git-build-kernel | 84 +++++++++++++++++++++++++++++++--------
>  2 files changed, 72 insertions(+), 16 deletions(-)

I have made some comments inline, but overall it seems like an
improvement even without those:

Acked-by: Andy Whitcroft <[hidden email]>

-apw

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

ACK: [kteam-tools][PATCH v2 0/7] git-build-kernel: source pkg features

Kleber Souza
In reply to this post by Kamal Mostafa-2
On 08/03/18 00:40, Kamal Mostafa wrote:

> Fixes and features relating to construction of source packages via the
> 'git push remote commit-ish:source' method.
>
> New (optional) feature: "SOURCE_PACKAGE_CHROOT=series" can be specified in
> debian.env to force a particular chroot for source package contstruction.
> We could could this to override the default behavior (building the source
> package in a chroot matching the target series) if ever needed.
>
> New behavior: The source package _source.changes file is now built with
> the suitable 'dpkg-genchanges -vversion' relative to -updates as determined
> by rmadison.
>
> Fixed: The push :source method now works for arbitrary source package names,
> not just "linux".
>
> [PATCH v2] adds:
>   + no orig tarball for -meta (or -signed); otherwise, verify tarball exists
>   + special-case debuild -v handling for backport kernels with "~" versions
>   + sanitize debuild -v handling when building already-published src pkgs
>   + note in README: main kernel build repo can be used for -meta and -signed
>
>  -Kamal
>
> ----
>
> Kamal Mostafa (7):
>   git-build-kernel: extract the correct source package name
>   git-build-kernel: improve results summary for source packages
>   git-build-kernel: support SOURCE_PACKAGE_CHROOT=series via debian.env
>   git-build-kernel: debuild source packages with suitable -vversion
>   git-build-kernel: squelch output noise when there is no
>     debian/debian.env
>   git-build-kernel: special case no-orig-tarball src packages
>   git-build-kernel: add README notes about meta and signed
>
>  git-build-kernel/README           |  4 ++
>  git-build-kernel/git-build-kernel | 84 +++++++++++++++++++++++++++++++--------
>  2 files changed, 72 insertions(+), 16 deletions(-)
>

Acked-by: Kleber Sacilotto de Souza <[hidden email]>

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

Re: [kteam-tools][PATCH v2 5/7] git-build-kernel: squelch output noise when there is no debian/debian.env

Kamal Mostafa-2
In reply to this post by Andy Whitcroft-3
On Mon, Aug 06, 2018 at 04:33:47PM +0100, Andy Whitcroft wrote:

> On Thu, Aug 02, 2018 at 03:40:33PM -0700, Kamal Mostafa wrote:
> > Signed-off-by: Kamal Mostafa <[hidden email]>
> > ---
> >  git-build-kernel/git-build-kernel | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/git-build-kernel/git-build-kernel b/git-build-kernel/git-build-kernel
> > index a683ad4..3c19587 100755
> > --- a/git-build-kernel/git-build-kernel
> > +++ b/git-build-kernel/git-build-kernel
> > @@ -68,7 +68,7 @@ GITSHASHORT="`git log -1 --pretty=%h ${GITBRANCH%%refs/heads/} --`"
> >  }
> >  
> >  ### Get the var "DEBIAN=debian.master" from debian/debian.env
> > -eval `git show $GITBRANCH:debian/debian.env | grep DEBIAN=`
> > +eval `git show $GITBRANCH:debian/debian.env 2>&- | grep DEBIAN=`
>
> I am not used to seeing stderr being closed.  That could lead to
> applications failing when they attempt to report an error.  Which in the
> general case might lead to unexpected behaviour.  I am wondering why
> this is not 2>/dev/null which feels like a more normal approach.

I'll change it to 2>/dev/null before committing.

 -Kamal

P.S. I close stderr all the time and have never observed any app having
a problem with that.  If any did, I'd call that a bug in that app.


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

Re: [kteam-tools][PATCH v2 6/7] git-build-kernel: special case no-orig-tarball src packages

Kamal Mostafa-2
In reply to this post by Andy Whitcroft-3
On Mon, Aug 06, 2018 at 04:51:48PM +0100, Andy Whitcroft wrote:

> On Thu, Aug 02, 2018 at 03:40:34PM -0700, Kamal Mostafa wrote:
> > The "meta" and "signed" source packages do not use an orig tarball, so
> > do not try to symlink to one, and do use --no-tgz-check to inhibit checking
> > for one (the latter is explicitly required just for "signed" since its
> > non-Debian-native version number implies that there will be a orig tarball).
> >
> > Signed-off-by: Kamal Mostafa <[hidden email]>
> > ---
> >  git-build-kernel/git-build-kernel | 21 +++++++++++++++++----
> >  1 file changed, 17 insertions(+), 4 deletions(-)
> >
> > diff --git a/git-build-kernel/git-build-kernel b/git-build-kernel/git-build-kernel
> > index 3c19587..02994db 100755
> > --- a/git-build-kernel/git-build-kernel
> > +++ b/git-build-kernel/git-build-kernel
> > @@ -142,10 +142,23 @@ touch "$WORKDIR/building"
> >  trap "rm -rf $WORKDIR/building $BUILDDIR" 0
> >  
> >  [ $do_source_pkg = 1 ] && {
> > -    orig_tarball="${SRCPKG}_${VERSION%%-*}.orig.tar.gz"
> > -    # Careful: $ORIG_TARBALLS_DIR must be accessible from within the chroot.
> > -    # (Alternately, use "cp -p" instead of "ln -s" if that's not an option)
> > -    ln -s $ORIG_TARBALLS_DIR/$orig_tarball $WORKDIR/
> > +    ### Special case for linux-signed and linux-meta packages, which
> > +    ### have no .orig tarball
> > +    [ ${SRCPKG/-signed} != $SRCPKG ] && no_orig_tarball=1
> > +    [ ${SRCPKG/-meta} != $SRCPKG ] && no_orig_tarball=1
>
> This feels like it is going to become a problem.  For example in devel
> we don't always have an orig as there isn't one yet as upstream has not
> yet released the thing.  I think we need to think of a better way to
> make this determination.

I'll look into using debian/source/format to determine this instead,
which I will submit as a follow-up patch.

 -Kamal

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

Applied: [kteam-tools][PATCH v2 0/7] git-build-kernel: source pkg features

Kamal Mostafa-2
In reply to this post by Kamal Mostafa-2
Applied to kteam-tools.

 -Kamal

On Thu, Aug 02, 2018 at 03:40:28PM -0700, Kamal Mostafa wrote:

> Fixes and features relating to construction of source packages via the
> 'git push remote commit-ish:source' method.
>
> New (optional) feature: "SOURCE_PACKAGE_CHROOT=series" can be specified in
> debian.env to force a particular chroot for source package contstruction.
> We could could this to override the default behavior (building the source
> package in a chroot matching the target series) if ever needed.
>
> New behavior: The source package _source.changes file is now built with
> the suitable 'dpkg-genchanges -vversion' relative to -updates as determined
> by rmadison.
>
> Fixed: The push :source method now works for arbitrary source package names,
> not just "linux".
>
> [PATCH v2] adds:
>   + no orig tarball for -meta (or -signed); otherwise, verify tarball exists
>   + special-case debuild -v handling for backport kernels with "~" versions
>   + sanitize debuild -v handling when building already-published src pkgs
>   + note in README: main kernel build repo can be used for -meta and -signed
>
>  -Kamal
>
> ----
>
> Kamal Mostafa (7):
>   git-build-kernel: extract the correct source package name
>   git-build-kernel: improve results summary for source packages
>   git-build-kernel: support SOURCE_PACKAGE_CHROOT=series via debian.env
>   git-build-kernel: debuild source packages with suitable -vversion
>   git-build-kernel: squelch output noise when there is no
>     debian/debian.env
>   git-build-kernel: special case no-orig-tarball src packages
>   git-build-kernel: add README notes about meta and signed
>
>  git-build-kernel/README           |  4 ++
>  git-build-kernel/git-build-kernel | 84 +++++++++++++++++++++++++++++++--------
>  2 files changed, 72 insertions(+), 16 deletions(-)
>
> --
> 2.7.4
>
>
> --
> kernel-team mailing list
> [hidden email]
> https://lists.ubuntu.com/mailman/listinfo/kernel-team

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team