Skip to main content
Redhat Developers  Logo
  • AI

    Get started with AI

    • Red Hat AI
      Accelerate the development and deployment of enterprise AI solutions.
    • AI learning hub
      Explore learning materials and tools, organized by task.
    • AI interactive demos
      Click through scenarios with Red Hat AI, including training LLMs and more.
    • AI/ML learning paths
      Expand your OpenShift AI knowledge using these learning resources.
    • AI quickstarts
      Focused AI use cases designed for fast deployment on Red Hat AI platforms.
    • No-cost AI training
      Foundational Red Hat AI training.

    Featured resources

    • OpenShift AI learning
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

    Red Hat AI Factory with NVIDIA

    • Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.
    • Explore the solution
  • Learn

    Self-guided

    • Documentation
      Find answers, get step-by-step guidance, and learn how to use Red Hat products.
    • Learning paths
      Explore curated walkthroughs for common development tasks.
    • Guided learning
      Receive custom learning paths powered by our AI assistant.
    • See all learning

    Hands-on

    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.
    • Interactive labs
      Learn by doing in these hands-on, browser-based experiences.
    • Interactive demos
      Click through product features in these guided tours.

    Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics

    Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
  • Build

    Get started

    • Red Hat build of Podman Desktop
      A downloadable, local development hub to experiment with our products and builds.
    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.

    Download products

    • Access product downloads to start building and testing right away.
    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset

    References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
  • Community

    Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions

    Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github

    Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

    Join the Red Hat Developer program

    • Download Red Hat products and project builds, access support documentation, learning content, and more.
    • Explore the benefits

rebase-helper for RHEL 7

January 27, 2015
Petr Hracek
Related topics:
Linux
Related products:
Red Hat Enterprise Linux
    What is rebase-helper used for?
    Rebase-helper automates a lot of manual tasks when a new upstream version of a package is released. How to install rebase-helper on RHEL 7 system?  Use this COPR repository where RPM package is already created.
     
    http://copr-fe.cloud.fedoraproject.org/coprs/phracek/rebase-helper_EPEL/

    Download the repo file and install rebase-helper via yum command.

    yum install rebase-helper

    Rebase-helper performs several tasks during the rebase:

    1. Downloads an archive with the new sources

    2. Tries to apply all downstream patches:

      • If a patch does not apply then rebase-helper resolves the conflict, it continues doing that until all patches apply

      • Goes to the point 2 until all patches apply

    1. Builds new and old binary packages (mostly RPMs)

    2. Performs number of tests to identify possible changes

      • added/changed/removed files/binaries/headers

      • library soname version bumps

      • checks API/ABI changes

    Some of these tasks can be fully (or at least partially) automated to assist the maintainer.

    Let's introduce rebase-helper in daily work.

    Let's say that we want to update the iproute2 package from iproute2-3.12.0 version to version iproute2-3.14.0.

    For this purpose we need to know either the latest upstream version or the name of the upstream tarball. In our case 3.14.0. In Fedora this is already mentioned in a BZ generated by an upstream monitoring service.

    If the new tarball doesn't exist in the current directory then it is downloaded from an URL specified in a SPEC file. To update to the latest upstream version we execute this command: rebase-helper iproute2-3.14.0.tar.gz or rebase-helper 3.14.0 .

    ~$ rebase-helper iproute2-3.14.0.tar.gz

    After the check whether the new upstream version is in the current directory, all patches are applied to the old source and to the new sources.

    ~$ rebase-helper iproute2-3.14.0.tar.gz
    Results directory 'rebase-helper-results' exists, removing it
    Applying patch 'man-pages.patch' to 'iproute2-3.12.0'
    Applying patch 'man-pages.patch' to 'iproute2-3.14.0'
    Applying patch 'iproute2-3.4.0-kernel.patch' to 'iproute2-3.12.0'
    Applying patch 'iproute2-3.4.0-kernel.patch' to 'iproute2-3.14.0'
    Applying patch 'iproute2-3.11.0-optflags.patch' to 'iproute2-3.12.0'
    Applying patch 'iproute2-3.11.0-optflags.patch' to 'iproute2-3.14.0'
    Applying patch 'iproute2-3.9.0-IPPROTO_IP_for_SA.patch' to 'iproute2-3.12.0'
    Applying patch 'iproute2-3.9.0-IPPROTO_IP_for_SA.patch' to 'iproute2-3.14.0'
    Applying patch 'iproute2-example-cbq-service.patch' to 'iproute2-3.12.0'
    Applying patch 'iproute2-example-cbq-service.patch' to 'iproute2-3.14.0'
    Applying patch 'iproute2-2.6.35-print-route.patch' to 'iproute2-3.12.0'
    Applying patch 'iproute2-2.6.35-print-route.patch' to 'iproute2-3.14.0'
    Applying patch 'iproute2-2.6.39-create-peer-veth-without-a-name.patch' to 'iproute2-3.12.0'
    Applying patch 'iproute2-2.6.39-create-peer-veth-without-a-name.patch' to 'iproute2-3.14.0'
    Applying patch iproute2-2.6.39-create-peer-veth-without-a-name.patch to new source failed. Press Enter to start merge-tool.

    Currently rebase-helper uses the patch command for applying patches.

    On the screen we can see that some patches were applied successfully on both sources.
    In case that a patch doesn't applied properly to the new sources, we see a message that the patch has not been applied and the merge tool is started to correct the patch.

    Rebase-helper uses the merge tool for comparing patches. The merge tool displays 3 tabs which is useful for comparing source versions.

    The first tab shows the comparison between the old and the new version for the given source file without a patch (in our case ip/link_veth.c). We see how the file has been changed against the new upstream version.

    Old_and_new_sources

    In the middle tab, we see how the patch was applied on the old version. In our case, parameters were initialized on NULL.

    Old_sources_with_patch

    On the last tab, we see a merge of the source file between the new upstream version and the old patched version. We can select if we use the old patched version or the new upstream version.
    Last_tab_with_upstream_version

    In our case, we select the upstream version of course. We prefer upstream first:)

    Save_the_source

    When a new patch is regenerated, it is shown how the patch has been changed.

    gen_diff
    On the screen we see that the patch has been completely removed.

    Finally, we correct the patch for the upstream version. In next steps, rebase-helper will ask whether we want to continue with other patches. In case we don't want to continue, rebase-helper finishes.

    ~$ rebase-helper iproute2-3.14.0.tar.gz
    phracek@kiasportyw-brq-redhat-com: ~/work/Fedora/iproute (f19 %)$ rebase-helper iproute2-3.14.0.tar.gz
    Results directory 'rebase-helper-results' exists, removing it
    Applying patch 'man-pages.patch' to 'iproute2-3.12.0'
    Applying patch 'man-pages.patch' to 'iproute2-3.14.0'
    Applying patch 'iproute2-3.4.0-kernel.patch' to 'iproute2-3.12.0'
    Applying patch 'iproute2-3.4.0-kernel.patch' to 'iproute2-3.14.0'
    Applying patch 'iproute2-3.11.0-optflags.patch' to 'iproute2-3.12.0'
    Applying patch 'iproute2-3.11.0-optflags.patch' to 'iproute2-3.14.0'
    Applying patch 'iproute2-3.9.0-IPPROTO_IP_for_SA.patch' to 'iproute2-3.12.0'
    Applying patch 'iproute2-3.9.0-IPPROTO_IP_for_SA.patch' to 'iproute2-3.14.0'
    Applying patch 'iproute2-example-cbq-service.patch' to 'iproute2-3.12.0'
    Applying patch 'iproute2-example-cbq-service.patch' to 'iproute2-3.14.0'
    Applying patch 'iproute2-2.6.35-print-route.patch' to 'iproute2-3.12.0'
    Applying patch 'iproute2-2.6.35-print-route.patch' to 'iproute2-3.14.0'
    Applying patch 'iproute2-2.6.39-create-peer-veth-without-a-name.patch' to 'iproute2-3.12.0'
    Applying patch 'iproute2-2.6.39-create-peer-veth-without-a-name.patch' to 'iproute2-3.14.0'
    Applying patch iproute2-2.6.39-create-peer-veth-without-a-name.patch to new source failed. Press Enter to start merge-tool.
    Applying patch failed. Starting merge-tool to fix conflicts manually.
    Do you want to continue with another patch ([y]/n)? y

    Because we want to finish updating to the latest version, we will continue.
    If the patches are completely done then building of packages starts. First of all, SRPM packages are generated and afterwards RPM packages.
    Packages are generated for the old version and also for the new version.

    Rebase-helper uses the mock command for building packages.

    ~$ rebase-helper iproute2-3.14.0.tar.gz
    Results directory 'rebase-helper-results' exists, removing it
    Applying patch 'man-pages.patch' to 'iproute2-3.12.0'
    Applying patch 'man-pages.patch' to 'iproute2-3.14.0'
    Applying patch 'iproute2-3.4.0-kernel.patch' to 'iproute2-3.12.0'
    Applying patch 'iproute2-3.4.0-kernel.patch' to 'iproute2-3.14.0'
    Applying patch 'iproute2-3.11.0-optflags.patch' to 'iproute2-3.12.0'
    Applying patch 'iproute2-3.11.0-optflags.patch' to 'iproute2-3.14.0'
    Applying patch 'iproute2-3.9.0-IPPROTO_IP_for_SA.patch' to 'iproute2-3.12.0'
    Applying patch 'iproute2-3.9.0-IPPROTO_IP_for_SA.patch' to 'iproute2-3.14.0'
    Applying patch 'iproute2-example-cbq-service.patch' to 'iproute2-3.12.0'
    Applying patch 'iproute2-example-cbq-service.patch' to 'iproute2-3.14.0'
    Applying patch 'iproute2-2.6.35-print-route.patch' to 'iproute2-3.12.0'
    Applying patch 'iproute2-2.6.35-print-route.patch' to 'iproute2-3.14.0'
    Applying patch 'iproute2-2.6.39-create-peer-veth-without-a-name.patch' to 'iproute2-3.12.0'
    Applying patch 'iproute2-2.6.39-create-peer-veth-without-a-name.patch' to 'iproute2-3.14.0'
    Applying patch iproute2-2.6.39-create-peer-veth-without-a-name.patch to new source failed. Press Enter to start merge-tool.
    Applying patch failed. Starting merge-tool to fix conflicts manually.
    Do you want to continue with another patch ([y]/n)? y
    Applying patch 'iproute2-3.12.0-lnstat-dump-to-stdout.patch' to 'iproute2-3.12.0'
    Applying patch 'iproute2-3.12.0-lnstat-dump-to-stdout.patch' to 'iproute2-3.14.0'
    Applying patch 'iproute2-3.10.0-rtnl_send.patch' to 'iproute2-3.12.0'
    Applying patch 'iproute2-3.10.0-rtnl_send.patch' to 'iproute2-3.14.0'
    Applying patch iproute2-3.10.0-rtnl_send.patch to new source failed. Press Enter to start merge-tool.
    Applying patch failed. Starting merge-tool to fix conflicts manually.
    Do you want to continue with another patch ([y]/n)? y
    Applying patch 'iproute2-3.11.0-tc-ok.patch' to 'iproute2-3.12.0'
    Applying patch 'iproute2-3.11.0-tc-ok.patch' to 'iproute2-3.14.0'
    Applying patch 'iproute2-3.11.0-rtt.patch' to 'iproute2-3.12.0'
    Applying patch 'iproute2-3.11.0-rtt.patch' to 'iproute2-3.14.0'
    Applying patch 'iproute2-3.12.0-lnstat-interval.patch' to 'iproute2-3.12.0'
    Applying patch 'iproute2-3.12.0-lnstat-interval.patch' to 'iproute2-3.14.0'
    Building SRPM
    Building SRPM finished successfully

    Currently, the last step compares all packages generated by mock with the pkgdiff command. Detailed information is shown while rebase-helper is working. This information is shown also in case that rebase-helper fails.

    ~$ rebase-helper iproute2-3.14.0.tar.gz
    Results directory 'rebase-helper-results' exists, removing it
    Applying patch 'man-pages.patch' to 'iproute2-3.12.0'
    Applying patch 'man-pages.patch' to 'iproute2-3.14.0'
    Applying patch 'iproute2-3.4.0-kernel.patch' to 'iproute2-3.12.0'
    Applying patch 'iproute2-3.4.0-kernel.patch' to 'iproute2-3.14.0'
    Applying patch 'iproute2-3.11.0-optflags.patch' to 'iproute2-3.12.0'
    Applying patch 'iproute2-3.11.0-optflags.patch' to 'iproute2-3.14.0'
    Applying patch 'iproute2-3.9.0-IPPROTO_IP_for_SA.patch' to 'iproute2-3.12.0'
    Applying patch 'iproute2-3.9.0-IPPROTO_IP_for_SA.patch' to 'iproute2-3.14.0'
    Applying patch 'iproute2-example-cbq-service.patch' to 'iproute2-3.12.0'
    Applying patch 'iproute2-example-cbq-service.patch' to 'iproute2-3.14.0'
    Applying patch 'iproute2-2.6.35-print-route.patch' to 'iproute2-3.12.0'
    Applying patch 'iproute2-2.6.35-print-route.patch' to 'iproute2-3.14.0'
    Applying patch 'iproute2-2.6.39-create-peer-veth-without-a-name.patch' to 'iproute2-3.12.0'
    Applying patch 'iproute2-2.6.39-create-peer-veth-without-a-name.patch' to 'iproute2-3.14.0'
    Applying patch iproute2-2.6.39-create-peer-veth-without-a-name.patch to new source failed. Press Enter to start merge-tool.
    Applying patch failed. Starting merge-tool to fix conflicts manually.
    Do you want to continue with another patch ([y]/n)? y
    Applying patch 'iproute2-3.12.0-lnstat-dump-to-stdout.patch' to 'iproute2-3.12.0'
    Applying patch 'iproute2-3.12.0-lnstat-dump-to-stdout.patch' to 'iproute2-3.14.0'
    Applying patch 'iproute2-3.10.0-rtnl_send.patch' to 'iproute2-3.12.0'
    Applying patch 'iproute2-3.10.0-rtnl_send.patch' to 'iproute2-3.14.0'
    Applying patch iproute2-3.10.0-rtnl_send.patch to new source failed. Press Enter to start merge-tool.
    Applying patch failed. Starting merge-tool to fix conflicts manually.
    Do you want to continue with another patch ([y]/n)? y
    Applying patch 'iproute2-3.11.0-tc-ok.patch' to 'iproute2-3.12.0'
    Applying patch 'iproute2-3.11.0-tc-ok.patch' to 'iproute2-3.14.0'
    Applying patch 'iproute2-3.11.0-rtt.patch' to 'iproute2-3.12.0'
    Applying patch 'iproute2-3.11.0-rtt.patch' to 'iproute2-3.14.0'
    Applying patch 'iproute2-3.12.0-lnstat-interval.patch' to 'iproute2-3.12.0'
    Applying patch 'iproute2-3.12.0-lnstat-interval.patch' to 'iproute2-3.14.0'
    Building SRPM
    Building SRPM finished successfully
    Building RPMs
    Building RPM finished successfully
    Building SRPM
    Building SRPM finished successfully
    Building RPMs
    Building RPM finished successfully
    Comparing packages using pkgdiff...
    Processing /home/phracek/work/Fedora/iproute/rebase-helper-results/files.xml file.
    Processing /home/phracek/work/Fedora/iproute/rebase-helper-results/symbols.xml file.

    Summary output is also available in log: /home/phracek/work/Fedora/iproute/rebase-helper-results/rebase-helper-results.log

    Result HTML page from pkgdiff is store in: /home/phracek/work/Fedora/iproute/rebase-helper-results/pkgdiff_reports.html

    WARNING Test suite is not enabled at build time.

    Patches were neither modified nor deleted.

    Old (S)RPM packages:
    ---------------------
    SRPM package(s): are in directory :
    - iproute-3.12.0-2.fc21.src.rpm
    RPM package(s): are in directory /home/phracek/work/Fedora/iproute/rebase-helper-results/old/RPM :
    - iproute-debuginfo-3.12.0-2.fc21.x86_64.rpm
    - iproute-doc-3.12.0-2.fc21.x86_64.rpm
    - iproute-devel-3.12.0-2.fc21.x86_64.rpm
    - iproute-3.12.0-2.fc21.x86_64.rpm
    Available Old logs:
    - /home/phracek/work/Fedora/iproute/rebase-helper-results/old/SRPM/state.log
    - /home/phracek/work/Fedora/iproute/rebase-helper-results/old/SRPM/mock_output.log
    - /home/phracek/work/Fedora/iproute/rebase-helper-results/old/SRPM/root.log
    - /home/phracek/work/Fedora/iproute/rebase-helper-results/old/SRPM/build.log
    - /home/phracek/work/Fedora/iproute/rebase-helper-results/old/RPM/state.log
    - /home/phracek/work/Fedora/iproute/rebase-helper-results/old/RPM/mock_output.log
    - /home/phracek/work/Fedora/iproute/rebase-helper-results/old/RPM/root.log
    - /home/phracek/work/Fedora/iproute/rebase-helper-results/old/RPM/build.log

    New (S)RPM packages:
    ---------------------
    SRPM package(s): are in directory :
    - iproute-3.14.0-1.fc21.src.rpm
    RPM package(s): are in directory /home/phracek/work/Fedora/iproute/rebase-helper-results/new/RPM :
    - iproute-doc-3.14.0-1.fc21.x86_64.rpm
    - iproute-devel-3.14.0-1.fc21.x86_64.rpm
    - iproute-debuginfo-3.14.0-1.fc21.x86_64.rpm
    - iproute-3.14.0-1.fc21.x86_64.rpm
    Available New logs:
    - /home/phracek/work/Fedora/iproute/rebase-helper-results/new/SRPM/state.log
    - /home/phracek/work/Fedora/iproute/rebase-helper-results/new/SRPM/mock_output.log
    - /home/phracek/work/Fedora/iproute/rebase-helper-results/new/SRPM/root.log
    - /home/phracek/work/Fedora/iproute/rebase-helper-results/new/SRPM/build.log
    - /home/phracek/work/Fedora/iproute/rebase-helper-results/new/RPM/state.log
    - /home/phracek/work/Fedora/iproute/rebase-helper-results/new/RPM/mock_output.log
    - /home/phracek/work/Fedora/iproute/rebase-helper-results/new/RPM/root.log
    - /home/phracek/work/Fedora/iproute/rebase-helper-results/new/RPM/build.log
    Following files were removed:
    /usr/src/debug/iproute2-3.12.0/include/SNAPSHOT.h
    Following files were added:
    /usr/share/man/man8/tc-mqprio.8.gz
    /usr/share/man/man8/tc-pie.8.gz
    /usr/src/debug/iproute2-3.14.0/include/SNAPSHOT.h
    /usr/src/debug/iproute2-3.14.0/ip/iplink_bond.c
    /usr/src/debug/iproute2-3.14.0/ip/iplink_bond_slave.c
    /usr/src/debug/iproute2-3.14.0/ip/iplink_hsr.c
    /usr/src/debug/iproute2-3.14.0/tc/f_bpf.c
    /usr/src/debug/iproute2-3.14.0/tc/q_pie.c
    Following files were changed:
    /usr/include/libnetlink.h (17.3%)
    /usr/lib64/libnetlink.a (0.4%)
    /usr/sbin/arpd (4.1%)
    /usr/sbin/bridge (1.2%)
    /usr/sbin/cbq (0.4%)
    /usr/sbin/ifstat (1.2%)
    /usr/sbin/ip (11.5%)
    ...
    /usr/src/debug/iproute2-3.12.0/tc/q_htb.c (15.5%)
    /usr/src/debug/iproute2-3.12.0/tc/q_multiq.c (10.4%)
    /usr/src/debug/iproute2-3.12.0/tc/q_netem.c (4.2%)
    /usr/src/debug/iproute2-3.12.0/tc/q_tbf.c (19.8%)
    /usr/src/debug/iproute2-3.12.0/tc/tc_core.c (3.6%)
    /usr/src/debug/iproute2-3.12.0/tc/tc_core.h (13.2%)
    /usr/src/debug/iproute2-3.12.0/tc/tc_util.c (6.9%)
    /usr/src/debug/iproute2-3.12.0/tc/tc_util.h (1.4%)
    Detailed debug log is located in '/home/phracek/work/Fedora/iproute/rebase-helper-results/rebase-helper-debug.log'

    We can see e.g.:

    • Two patches have been deleted.

    • Where the SRPM and RPM packages are stored.

    • Where the output from pkgdiff is stored.

    If we open the pkgdiff output, we can see what has been changed against the old version.

    pkgdiff

    Future features in rebase-helper?

    • show report from the pkgdiff format

    • building packages with fedpkg

    • support more merging tools (vimdiff, ...)

    • package rebase with the git am commands

    • Integration rebase-helper into the upstream monitoring system

    [1] - https://github.com/phracek/rebase-helper

    [2] - https://www.youtube.com/watch?v=87D2_JliHuU

     

     

    Last updated: September 19, 2022

    Recent Posts

    • Deploy MemPalace MCP Server on Red Hat OpenShift AI

    • Get ready for Ansible Automation Platform 2.7

    • Manage LLM evaluation workloads at scale with EvalHub and Kueue

    • Troubleshoot application misbehavior after an OpenShift upgrade

    • Preserve OpenShift Pipelines logs with OpenTelemetry

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Chat Support

    Please log in with your Red Hat account to access chat support.