From Fedora Project Wiki

No edit summary
 
(108 intermediate revisions by 3 users not shown)
Line 1: Line 1:
Please look at the [[Networking]] wiki page. It links to many other interesting wiki pages about linux networking. Any help appreciated.
Mail: psimerda AT redhat DOT com, pavlix AT pavlix DOT net
 
Jabber: pavlix AT pavlix DOT net
 
IRC Freenode: pavlix (#nm, #gentoo, ...)
 
Timezone: Europe/Prague (CET), sometimes available through later hours
 
== About ==
 
After learning a bit of programming, I was attracted by the networking world. I got from petty Pascal/C++ projects through web development using PHP and later Python, to years of freelancing work with most of the projects in server administration, network equipment configuration and a bit of programming. I was active in the community, wrote articles and spoke at conferences which finally led to my joining Red Hat in May 2012 to work on NetworkManager. I was already a Fedora user and package maintainer at that time. Since August 2013 I'm working on various network related packages and projects.


=== About me ===
== Projects ==


I have been using Fedora for some time. My primary interest is computer networking and I didn't like many things
Fedora projects:
in linux networking and particularly in NetworkManager. I've been talking about it and watching and filing bug reports
for too long. When I recieved an offer to work regularly on NetworkManager, it was natural to accept.


At the time I joined NetworkManager development, I already had a history of articles, talks and trainings on IPv6
* [https://github.com/pavlix/network-testing User space networking test suite] (owner)
so I started fixing IPv6 automatic configuration. In NetworkManager 0.9.6 it connects to any standard IPv6 networks.
* [https://github.com/pavlix/netresolve Non-blocking network name resolution library and tools] (owner)
* [https://github.com/pavlix/gentoo-rpm Gentoo ebuilds for Fedora and CentOS development] (owner)
* [https://github.com/pavlix/fptool Wrapper over Fedora package maintainance tools] (owner)
* DNSSEC in Fedora (contributor)
* IPv6 and dual-stack networking (contributor)
* [https://wiki.gnome.org/Projects/NetworkManager NetworkManager development] (contributor, former developer


I didn't particularly like how NetworkManager works so after learning a bit about it, I started working on some
Fedora wiki documentation:
larger-scale changes in a separate branch called 'pavlix/next' that is described below. All of the modifications
are made with the goal of making NetworkManager more robust, testable, debuggable and useful for all sorts of use
cases including server, virtualization and desktop.


During my work on NetworkManager, I see more and more problems with other network-related tools including kernel,
* [[Networking]] – A starting point for information related to networking.
glibc, avahi, nss-mdns but also with the IETF standards. We have many more things to be fixed (or replaced, if
* [[Tools/NetworkManager]] – NetworkManager information page.
anyone likes that better) than just NetworkManager.
* [[QA/Networking]] – Dual-stack networking issues in Fedora.


=== What we need for proper Linux networking ===
(Contributions are welcome.)


* Interface for static IPv4 and IPv6 configuration (kernel)
Packages:
* Interface for bridging/bonding/vlan configuration (kernel)
* Interface for DNS configuration (/etc/resolv.conf)
* DHCP client implementation for IPv4 automatic configuration (dhclient)
* RA client implementation for IPv6 address configuration (kernel, with workarounds in NetworkManager)
* RDNSS/DNSSL client implementation for IPv6 DNS configuration (NetworkManager through kernel, with workarounds)
* DHCP client implementation for IPv6 address/DNS/other configuration (dhclient)
* IPsec, VPN and tunneling implementations (various daemons)
* A network management daemon to properly manage all of the above together with user configuration (NetworkManager)
* Networking API for applications (glibc, with many problems)


I may have missed something but the objective is to show that networking is rather complex and the various tools need
[https://admin.fedoraproject.org/pkgdb/packager/pavlix/ Fedora Package Database].
to be centrally managed by a network management service in order to make users and administrators happy.


You can only live without network configuration daemons if you use static IP configuration and you avoid encrypted
== Other resources ==
wireless networks at the same time. You can live with just wpa_supplicant and dhclient only if you are used to do
most of the stuff yourself. Virtually all linux distributions now converge to network solutions based on network
configuration daemons.


Examples of such daemons (without feature comparison):
Fedora features:


* NetworkManager
* [[Changes/Default_Local_DNS_Resolver]]
* connman (MeeGo)
* WICD
* netifd (OpenWRT)
* netcfg (Archlinux)
* wicked


Yeah, it's a lot of fun writing new and new network configuration daemons.
Ideas:


=== NetworkManager ===
* [[Networking/Ideas/ServiceOrdering]]
* [[Networking/Ideas/NameResolution]]
* [[Networking/Ideas/NetworkManagerMethods]]
* [[Networking/Ideas/NetworkManagerRuntimeConfiguration]]
* [[Networking/Ideas/ConfigurationService]]
* [[Networking/Ideas/AutomaticConfiguration]]
* [[Networking/Ideas/NetworkNameResolution]]
* [[Networking/Ideas/NetworkManagerBugReporting]]
* [[Networking/Ideas/NetworkManagerOnServers]]


When working on NetworkManager, the following projects cause me headache:
== Fedora notes ==


* NetworkManager itself: I need to test NM in a virtual environment with bridges. These are not supported in the current release. I hope to make the next release mature enough to support its own development.
=== Simple maintainance tasks ===
* Kernel: The kernel IPv6 networking layer is somewhat unmanagable. The rtnetlink interface doesn't provide enough funcionality to support IPv6 networking.
* GLIBC: The <code>getaddrinfo()</code> function doesn't work properly and is not supported in nsswitch.conf. It breaks whenever my development machine happens to be on an IPv4-only network.
* nss-mdns (Avahi nsswitch plugin): Can't implement link-local name resolution because of the above problem in GLIBC.
* IETF networking standards: For some reasons many IPv6-related standards have serious design flaws that prevent them from working properly.


I'm currently maintaining a patchset in a separate NetworkManager branch called 'pavlix/next'. It has a lot of improvements over the
==== Make a fix and a build ====
current release of NetworkManager but also over the 'master' branch. The reason for keeping a separate branch is that
I need to do a lot of interdependent stuff to fullfil a big picture of how things should work. Many changes I'm making
are quite big.


I am often rebasing this branch and rewriting its history. It is not currently possible to merge it into 'master' and it is not possible
<pre>
to continuously marge your local changes without a considerable amount of 'rebase' magic.
bug=123456
message="do something"


The current patchset includes the following changes:
# ... add/modify files ...
rpmdev-bumpspec *.spec -c "Resolves: #$bug - $message"
fedpkg commit -c
# ... check using gitk ...
fedpkg push && fedpkg build
</pre>


* Add a '''new subsystem for kernel network configuration''' (bgo #683173)
==== Make a scratch build from locally generated SRPM ====
* Remove distribution-specific initscripts
* '''Build on any linux distribution''' without special options (bgo #663602)
* Remove unnecessary '--with-distro' values (some distributors may need to remove it from their package builds)
* Move NM-specific DHCP leases to /var/lib/NetworkManager (may need selinux policy changes)
* Add support for IPv4 dhclient.conf overrides in /etc/NetworkManager
* Don't ask 'nscd' to reload configuration (it uses inotify to watch it)
* Add support for '''bridges''' with manual and automatic IPv4/IPv6 configuration (bgo #546197)
* Fix support for '''bonds''' with manual and automatic IPv4/IPv6 configuration (bgo #540995)
* Read IPv4 addresses also in CIDR format in keyfile


Other stuff:
<pre>
fedpkg build --scratch --srpm
</pre>


* I'm trying to keep NetworkManager bugzilla (at least the 'general' component) in a good state
==== Bump a rawhide package to a newer version ====
* I fixed various IPv6-related so that IPv6 autoconfigures in all common scenarios


=== GLIBC ===
In the package git directory:


* getaddrinfo(127.0.0.1, AI_ADDRCONFIG) fails on hosts without global IPv4 (e.g. notebooks not connected to any networks)
<pre>
* getaddrinfo(::1, AI_ADDRCONFIG) fails on hosts without any other IPv6 address
version=...
* getaddrinfo(link-local-address, AI_ADDRCONFIG) fails on hosts without global IPv6 (hopefully solved)


Temporary patch: https://bugzilla.redhat.com/attachment.cgi?id=615840
# Prepare a commit
fedpkg switch-branch master
rpmdev-bumpspec --new="$version" --comment="new version $version" *.spec
spectool -g *.spec && fedpkg new-sources `spectool -l *.spec | grep / | sed 's/.*\///'`
fedpkg commit -c


=== IETF standards ===
# Test it
fedpkg build --scratch --srpm


* RFC 6106 (RA DNS): [http://tools.ietf.org/html/draft-gont-6man-slaac-dns-config-issues-00 Relies on a false assuption that every (even multicast) IP packet is delivered to its destination.]
# Create a public build
* RFC 4861 (NDP): Doesn't specify how zero lifetimes should be used and lets implementations rely on the same false assumption.
fedpkg push && fedpkg build
* RFC 3493 (socket interfce): Breaks both IPv4 and IPv6 localhost and link-local networking depending on available global addresses.
</pre>


=== POSIX standards ===
Requires development version, see:


* POSIX.1-2008: [https://bugzilla.redhat.com/show_bug.cgi?id=721350#c8 Defines the AI_ADDRCONFIG in a bad way]
* https://fedorahosted.org/rpmdevtools/attachment/ticket/14


=== Proposed features ===
==== Prepare rawhide to replace branches ====


* [[Features/DualstackNetworking]]
Warning: This method discards changes in all branches and should only be used after all of the important changes are incorporated into master. Also, it is only suitable for packages where it's practical to maintain the same version in branches as in rawhide.
* [[Features/ZeroconfNetworking]]
* [[Features/NetworkManagerBonding]]
* [[Features/NetworkManagerBridging]]
* [[Features/NetworkManagerAdvancedIPv6]]
* [[Features/NetworkManagerCLI]]


=== Contact ===
<pre>
branches="f20 f19"


Mail: psimerda AT redhat DOT com, pavlix AT pavlix DOT net
# Fake-merge all branches into master:
for branch in $branches; do
    fedpkg switch-branch master
    git merge -s ours $branch
done
 
# Build a new release
rpmdev-bumpspec
fedpkg commit -c
fedpkg push
fedpkg build
</pre>
 
==== Update branches to match rawhide and build them ====
 
Use the above technique to prepare rawhide if branches can't be fast forwarded to rawhide.
 
<pre>
branches="f21 f20"
 
# Fast-forward all branches to master HEAD:
for branch in $branches; do
    fedpkg switch-branch $branch
    git merge --ff-only master
    fedpkg push
    fedpkg build --nowait
done
 
# Switch back to master
fedpkg switch-branch master
</pre>
 
==== Issue updates ====
 
<pre>
branches="f21 f20"
type=bugfix
bugs=
comment="Bug fix update."
 
# Create updates for all branches
for branch in $branches; do
    fedpkg switch-branch $branch
    bodhi --new --type="$type" --bugs="$bugs" --notes="$comment" --close-bugs `fedpkg verrel`
done
 
# Switch back to master
fedpkg switch-branch master
</pre>
 
Resources:
 
* [https://apps.fedoraproject.org/packages/ Package version in Fedora and EPEL]
* [https://admin.fedoraproject.org/updates/ Package updates]
 
=== Patchwork ===
 
==== Using vim ====
 
Open three panes containing (1) patch to be edited, (2) patched file and (3) rejected hunks.
 
<pre>
package=...
version=...
patch=...
file=...
 
vim -O $patch $package-$version/$file{,.rej}
</pre>
 
==== Using git ====
 
Warning: Untested. I used a similar command but lost it.
 
 
<pre>
package=...
version=...
dir=/path/to/upstream/workdir
 
(echo cd $dir; for patch in `awk '/^Patch[0-9]*: / { print $2 }' *.spec`; do echo -n "git apply --index "; realpath $patch; echo git commit -m $patch; done) | sh
</pre>
 
=== New package ===
 
==== Create a local Git repository ====
 
<pre>
package=...
editor=...
 
git init $package
cd $package
 
$editor $package.spec
git add $package.spec
 
fedpkg new-sources `spectool -l *.spec | grep / | sed 's/.*\///'`
 
rpmdev-bumpspec $package.spec -m 'initial build'
fedpkg commit -c
</pre>
 
==== Create a review request ====
 
<pre>
rawhide=f22
 
fedpkg --dist $rawhide srpm
fedora-create-review --no-scratch-build *.spec *.src.rpm
</pre>
 
==== Update a review request ====
 
<pre>
rawhide=f22
message="incorporated review feedback"
 
rpmdev-bumpspec *.spec -m "$message"
fedpkg commit -c
 
fedpkg --dist $rawhide srpm
fedora-create-review --amend --no-scratch-build *.spec *.src.rpm
</pre>
 
Requires:
 
* https://fedorahosted.org/FedoraReview/ticket/237
 
=== Review a new package ===
 
System configuration:
 
<pre>
yum install @fedora-packager fedora-review
ln -s /etc/mock/fedora-devel-x86_64.cfg /etc/mock/default.cfg
 
mockuser=...
 
usermod -a -G mock $mockuser
</pre>
 
Review local files:
 
<pre>
name=...
 
fedora-review -n $name
</pre>
 
Review bugzilla:
 
<pre>
bz=...


Jabber: pavlix AT pavlix DOT net
fedora-review -b $bz
</pre>


IRC Freenode: pavlix (#nm and a couple of other channels)
== Fedora tools on Gentoo ==


Phone: +420 775 996 256
<pre>
emerge -av layman
echo source /var/lib/layman/make.conf > /etc/portage.make.conf
layman -a ixit
mkdir -p /etc/portage/sets
cat > /etc/portage/sets/fedora-packaging <<EOF
dev-util/fedora-packager
dev-util/quilt
EOF
emerge -av @fedora-packaging
</pre>

Latest revision as of 14:31, 26 August 2024

Mail: psimerda AT redhat DOT com, pavlix AT pavlix DOT net

Jabber: pavlix AT pavlix DOT net

IRC Freenode: pavlix (#nm, #gentoo, ...)

Timezone: Europe/Prague (CET), sometimes available through later hours

About

After learning a bit of programming, I was attracted by the networking world. I got from petty Pascal/C++ projects through web development using PHP and later Python, to years of freelancing work with most of the projects in server administration, network equipment configuration and a bit of programming. I was active in the community, wrote articles and spoke at conferences which finally led to my joining Red Hat in May 2012 to work on NetworkManager. I was already a Fedora user and package maintainer at that time. Since August 2013 I'm working on various network related packages and projects.

Projects

Fedora projects:

Fedora wiki documentation:

(Contributions are welcome.)

Packages:

Fedora Package Database.

Other resources

Fedora features:

Ideas:

Fedora notes

Simple maintainance tasks

Make a fix and a build

bug=123456
message="do something"

# ... add/modify files ...
rpmdev-bumpspec *.spec -c "Resolves: #$bug - $message"
fedpkg commit -c
# ... check using gitk ...
fedpkg push && fedpkg build

Make a scratch build from locally generated SRPM

fedpkg build --scratch --srpm

Bump a rawhide package to a newer version

In the package git directory:

version=...

# Prepare a commit
fedpkg switch-branch master
rpmdev-bumpspec --new="$version" --comment="new version $version" *.spec
spectool -g *.spec && fedpkg new-sources `spectool -l *.spec | grep / | sed 's/.*\///'`
fedpkg commit -c

# Test it
fedpkg build --scratch --srpm

# Create a public build
fedpkg push && fedpkg build

Requires development version, see:

Prepare rawhide to replace branches

Warning: This method discards changes in all branches and should only be used after all of the important changes are incorporated into master. Also, it is only suitable for packages where it's practical to maintain the same version in branches as in rawhide.

branches="f20 f19"

# Fake-merge all branches into master:
for branch in $branches; do
    fedpkg switch-branch master
    git merge -s ours $branch
done

# Build a new release
rpmdev-bumpspec
fedpkg commit -c
fedpkg push
fedpkg build

Update branches to match rawhide and build them

Use the above technique to prepare rawhide if branches can't be fast forwarded to rawhide.

branches="f21 f20"

# Fast-forward all branches to master HEAD:
for branch in $branches; do
    fedpkg switch-branch $branch
    git merge --ff-only master
    fedpkg push
    fedpkg build --nowait
done

# Switch back to master
fedpkg switch-branch master

Issue updates

branches="f21 f20"
type=bugfix
bugs=
comment="Bug fix update."

# Create updates for all branches
for branch in $branches; do
    fedpkg switch-branch $branch
    bodhi --new --type="$type" --bugs="$bugs" --notes="$comment" --close-bugs `fedpkg verrel`
done

# Switch back to master
fedpkg switch-branch master

Resources:

Patchwork

Using vim

Open three panes containing (1) patch to be edited, (2) patched file and (3) rejected hunks.

package=...
version=...
patch=...
file=...

vim -O $patch $package-$version/$file{,.rej}

Using git

Warning: Untested. I used a similar command but lost it.


package=...
version=...
dir=/path/to/upstream/workdir

(echo cd $dir; for patch in `awk '/^Patch[0-9]*: / { print $2 }' *.spec`; do echo -n "git apply --index "; realpath $patch; echo git commit -m $patch; done) | sh

New package

Create a local Git repository

package=...
editor=...

git init $package
cd $package

$editor $package.spec
git add $package.spec

fedpkg new-sources `spectool -l *.spec | grep / | sed 's/.*\///'`

rpmdev-bumpspec $package.spec -m 'initial build'
fedpkg commit -c

Create a review request

rawhide=f22

fedpkg --dist $rawhide srpm
fedora-create-review --no-scratch-build *.spec *.src.rpm

Update a review request

rawhide=f22
message="incorporated review feedback"

rpmdev-bumpspec *.spec -m "$message"
fedpkg commit -c

fedpkg --dist $rawhide srpm
fedora-create-review --amend --no-scratch-build *.spec *.src.rpm

Requires:

Review a new package

System configuration:

yum install @fedora-packager fedora-review
ln -s /etc/mock/fedora-devel-x86_64.cfg /etc/mock/default.cfg

mockuser=...

usermod -a -G mock $mockuser

Review local files:

name=...

fedora-review -n $name

Review bugzilla:

bz=...

fedora-review -b $bz

Fedora tools on Gentoo

emerge -av layman
echo source /var/lib/layman/make.conf > /etc/portage.make.conf
layman -a ixit
mkdir -p /etc/portage/sets
cat > /etc/portage/sets/fedora-packaging <<EOF
dev-util/fedora-packager
dev-util/quilt
EOF
emerge -av @fedora-packaging