8000 babeld: Migrate from openwrt-routing by adschm · Pull Request #9408 · openwrt/packages · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

babeld: Migrate from openwrt-routing #9408

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 46 commits into from
Closed

Conversation

adschm
Copy link
Member
@adschm adschm commented Jul 6, 2019

This migrates the babeld package from openwrt-routing together with the package-specific history.


Migration tutorial:

This is an example for migrating a package with its folder-based history from openwrt-routing.

This can be done very quickly (about two minutes) and with a few commands:

Clone the source repo
git clone https://github.com/openwrt-routing/packages transfer

Enter source repo
cd transfer

Create branch for changes ("extract")
git checkout -b extract

Extract commits for one directory (here babeld) from extract branch; this will move its contents to the repo root!
git filter-branch --prune-empty --subdirectory-filter babeld extract

Create temporary directory
mkdir /data/tmp

Move stuff to the desired subfolder (here net/babeld)
git filter-branch -f --tree-filter 'mv * /data/tmp; mkdir -p net/babeld; mv /data/tmp/* net/babeld/' --prune-empty extract

Go to packages directory
cd ../openwrt-packages

Add remote for transfer project
git remote add transfer ../transfer

Pull in changes and rebase them to current master

git fetch transfer extract
git checkout transfer/extract
git rebase master

Now, add your changes and create PR
git checkout -b addbabeld
...

This PR is meant as a show-case on how packages could be transferred this way. If it is disliked, just close it again and move the package by different means.

@aparcar
Copy link
Member
aparcar commented Jul 6, 2019

Are you sure you want all these commits per package? I honour you tutorial, just think this becomes messy...

@adschm
Copy link
Member Author
adschm commented Jul 6, 2019

@aparcar I only know a small fraction of packages in openwrt-routing. From them, I have the feeling that commits affecting more than one package are rare and thus it would be still okay to duplicate them.

However, one could still just move the whole openwrt-routing master into the net subdir, without caring about individual packages, and then put this on top of openwrt/packages. This should be possible with a similar tutorial like mine here.

Still, with my approach one could keep together package history and the final changes required to merge them here.

Anyway, still was just meant as a show-case, so I won't be offended if you don't do it like this because it's not desirable.

I'm not so sure whether openwrt/packages wants to have all that crap on top of the current state anyways.

@champtar
Copy link
Member
champtar commented Jul 6, 2019

@adrianschmutzler I would have imported all the commits & packages at once, I'll try to do an example today

@aparcar
Copy link
Member
aparcar commented Jul 7, 2019

@adrianschmutzler I would have imported all the commits & packages at once, I'll try to do an example today

News? I'd be interested to see how it's done.

Apart from that, isn't it bloat to add some 1420 commits to the master branch? Instead we could move the openwrt-routing/packages to openwrt/routing and mark it as archived. In parrallel a single (or many small) PR(s) transfer (and update) the routing.git packages?

@champtar
Copy link
Member
champtar commented Jul 7, 2019

@aparcar see #9419
if we use the full history way we keep the original commit in this repo, so we can drop openwrt-routing entirely
we can then continue to use normal tools like git blame / git log to understand what happened in the recent past, and not switch back and forth between current and old repo

@adschm
Copy link
Member Author
adschm commented Jul 8, 2019

Since this is for illustration only and not meant to be actually merged, I will close this PR.

@adschm
Copy link
Member Author
adschm commented Jul 23, 2019

@kerneis @neheb @aparcar
I have reopened and added a commit on top of this which brings this (very simple) package in a state where it should be acceptable for merge.

I just need a hint on what I have to put for PKG_LICENSE_FILES.

buildpr fails due to the history, where several commits have mismatch of author and Signed-off, which I would ignore.

Some of the patches lack "babeld:" prefix, as they were treewide in openwrt-routing. I would personally just add the "babeld: " for those if agreed upon, which might be simple enough so one even does not have to add another Signed-off to those.

I intend to use this as an example case for whether this approach is acceptable. If yes, one could work on with other targets, and merge them here step-by-step.
If no, and since adding full repository has already received negative feedback, we at least have reached a decision and packages will be added without history ...

@adschm adschm changed the title net/babeld: Migrate from openwrt-routing babeld: Migrate from openwrt-routing Jul 23, 2019
@adschm
Copy link
Member Author
adschm commented Jul 23, 2019

I have also quickly done the same for batctl and batman-adv:
https://github.com/adrianschmutzler/packages/commits/addbatctl
https://github.com/adrianschmutzler/packages/commits/addbatmanadv

Since the approach is effectively doing a rebase, merge commits are lost, but history is fully supported in GitHub.


MAKE_FLAGS+= \
CFLAGS="$(TARGET_CFLAGS)" \
LDLIBS="" \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these really needed?

@diizzyy
Copy link
Contributor
diizzyy commented Aug 1, 2019

https://github.com/jech/babeld/blob/master/Makefile#L4
As far as I can tell this overrides toolchain settings?

Needs be squashed into one commit

@@ -197,6 +197,10 @@ start_service() {
procd_close_instance
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are minor warnings from shellcheck.

@aparcar
Copy link
Member
aparcar commented Aug 27, 2019

@adrianschmutzler ping

@adschm
Copy link
Member Author
adschm commented Aug 27, 2019

Next weekend...

kerneis and others added 8 commits September 2, 2019 15:34
- Update maintainer email address
- Wait for babel to die in init script (avoid race-condition on restart)

Signed-off-by: Gabriel Kerneis <gabriel@kerneis.info>
22 May 2014: babeld-1.5.0

  * Added support for an RTT-based metric -- see the description of
    "enable-timestamps" in the manual page.  This work was done by
    Baptiste Jonglez with help from Matthieu Boutier.
…ments

This is the first step toward fixing issue openwrt#33.

This still lacks some features:

- no support for "ignore" options
- no backward compatibility for option names
- no support for default interface options
Previously, we were using the name of the section as the interface name,
but this has several drawbacks:

- no "-" or other special characters are allowed in a section name,
  preventing some physical interface names to be specified this way
  (e.g. "tun-topeka" would not work)
- it is harder to support default interface options (no interface name)

This change is not backward compatible, but a later commit will fix that.
christf and others added 20 commits September 2, 2019 15:34
Signed-off-by: Christof Schulze <christof.schulze@gmx.net>
note: dependant on openwrt commit 85fabd68, adding support for null arguments.
This avoids running out of flash or RAM space if babeld logs too much.
The system log is stored on RAM by default and has a controlled size.

It is still possible to tell babeld to log to a file, by using the
following in /etc/config/babeld:

    config general
        option log_file "/var/log/babeld.log"

Signed-off-by: Baptiste Jonglez <git@bitsofnetworks.org>
This was mostly introduced by 82d9002 ("babeld: add support for dynamic
config files").

Signed-off-by: Baptiste Jonglez <git@bitsofnetworks.org>
This way, "/etc/init.d/babeld reload" will detect when one of these
dynamic config files has changed, and restart babeld only if that is the
case.

Dynamic config files where introduced by 82d9002 ("babeld: add support
for dynamic config files").

Signed-off-by: Baptiste Jonglez <git@bitsofnetworks.org>
Signed-off-by: Baptiste Jonglez <git@bitsofnetworks.org>
Signed-off-by: Baptiste Jonglez <git@bitsofnetworks.org>
Also update my email address in the main MAINTAINERS file.

Signed-off-by: Baptiste Jonglez <git@bitsofnetworks.org>
It makes the init script more readable.  It has been more than two years
since babeld 1.5.1, let's hope nobody is still using the old
(undocumented) option names.

Incidentally, this commit fixes support for the "conf_dir" option,
introduced by ac64341 ("babeld: allow changing alternative
configuration file and directory").  The default value of $OTHERCONFIGDIR
was always used, because the variable was used *before* it was (possibly)
redefined when parsing the UCI config.

Signed-off-by: Baptiste Jonglez <git@bitsofnetworks.org>
This fixes a serious bug where IPv4 routes were not being redistributed.

Signed-off-by: Baptiste Jonglez <git@bitsofnetworks.org>
)

This is a very basic cleanup, several packages needs more work
but this at least drops git for https and removes the use of
PKG_MD5SUM and some minor fixes.

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
24 September 2018: babeld-1.8.3

  * Fixed a read-only two byte buffer overflow in the packet parser.
    This is a read-only overflow, and hence most probably not exploitable.
  * Fixed an issue with creating unreachable routes on recent kernels
    (4.16 and up).  Thanks to Christof Schulze.
  * Notice interface changes faster by listening to more netlink events.
    Thanks to Christof Schulze.
  * Fixed a local interface issue when an interface has no link-local
    address.  Thanks to Christof Schulze.

Also, the init script was edited to kill babeld on stop; restart works properly now, as well.

Signed-off-by: Michael Adams <unquietwiki@gmail.com>
9 November 2018: babeld-1.8.4

  * Fixed a bug that discarded pipelined commands received on the local
    configuration interface.
* Added the per-interface option rfc6126-compatible.

Signed-off-by: Robert Marko <robimarko@gmail.com>
Killing anything with -9 is a bad idea.  When killed this way, babeld
won't be able to properly disassociate from its neighbours, withdraw its
announced routes or remove routes from the kernel.

This got introduced in bab933d ("babeld: Update to version 1.8.3 +
fix init") with an unrelated change.  The purpose of the change is unclear
because stopping and restarting babeld worked fine without this change.

Signed-off-by: Baptiste Jonglez <git@bitsofnetworks.org>
Changes:

  * Fixed a bug that caused confustion between learned routes and
    imported routes (thanks to Fabian Bläse).
  * Fixed a bug that prevented install filters from being evaluated
    (thanks to Killian Lufau).

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
This applies some style improvements to make this ready for
migration to openwrt/packages.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
20 August 2019: babeld-1.9.1

  * Fixed a crash that could happen when unicast and RTT estimation are
    both enabled on an interface.  Thanks to Dave Taht.
  * Fixed compilation under BSD.  Thanks to Dave Taht.

4 August 2019: babeld-1.9.0

  * Reworked buffering of unicast packets to use a per-neighbour buffer
    rather than a single buffer per interface.  This makes unicast as
    efficient as multicast, at the cost of slightly higher memory usage.
  * Added option "unicast" that allows sending most TLVs over unicast.
    This is necessary for the DTLS extension.
  * Implemented parsing of unicast Hellos.  This makes it possible to
    interoperate with neighbours that only speak unicast (e.g. over some
    kinds of tunnels that only do unicast).
  * Implemented sending of unscheduled unicast Hellos.  This makes the
    RTT extension work over unicast too.
  * Reworked the xroute data structures to use binary search and
    linear-time comparison.
  * Don't attempt to modify the rp_filter sysctl if it already has the
    desired value; this makes it possible to run babeld in an
    unpriviledged container.  Thanks to Christof Schulze.
  * Reinstated logging of late hellos.  Thanks to Dave Taht.
  * Don't send wildcard requests or Hellos to newish nodes.  This makes
    acquisition of new neighbours slower, but drastically reduces noise at
    startup.  Thanks to Teco Boot.
  * Remove an arbitrary limit on the number of interfaces.  Thanks to
    Christof Schulze.
  * Removed class E from martian filter.  Thanks to Dave Taht.
  * Added the ability to set the preferred source address in install filters.
    Thanks to Killian Lufau.
  * Fixed a number of read-only buffer overflows.  Thanks to Leo Stefanesco.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Signed-off-by: Baptiste Jonglez <git@bitsofnetworks.org>
More example filters are provided, and new options such as "type" or
"pref_src" are given as example.

Signed-off-by: Baptiste Jonglez <git@bitsofnetworks.org>
@adschm
Copy link
Member Author
adschm commented Sep 2, 2019

I've pushed an updated version including latest patches from routing repo.

Unaddressed comments:

Despite, I still do not see a conclusion on whether this should be with full history or squashed into a single commit (I personally prefer the former).

@zorun @aparcar @dizzy @neheb

@aparcar
Copy link
Member
aparcar commented Sep 2, 2019

Regarding full history or squashed, I'm in favor of the latter: Move routing.git to openwrt/routing.git and mark it as archived. Each package from routing.git could be added in a single clean commit, reducing confusion for others monitoring packages.git commits, not familiar with these new routing packages.

@adschm
Copy link
Member Author
adschm commented Sep 2, 2019

BTW: Is there already any plan what happens to the stable branches (19.07, 18.06, 17.01)? Should the remain in routing (and be maintained there), or are they supposed to move, too ...

@neheb
Copy link
Contributor
neheb commented Sep 2, 2019

I say remain.

@adschm
Copy link
Member Author
adschm commented Nov 4, 2019

Based on the feedback I received, the majority of responses favors merging without history. I will thus close this PR, as it was meant as proof-of-concept for the opposite and I do not want to merge this without support of the package maintainers.

@adschm adschm closed this Nov 4, 2019
@aparcar
Copy link
Member
aparcar commented Nov 5, 2019

@adrianschmutzler thanks for working on this! I'll soon create some PRs as well.

@adschm adschm deleted the addbabeld branch September 2, 2020 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0