User:Needle/iproute2-native-gentoo
Removal of sys-apps/net-tools from portage
net-tools team drops development in favour of iproute2:
Test to remove net-tools rollback possible at any time. For more technical information, read the bug report:
TL;DR: - Testing - Is it safe for gentoo to remove hostname USE flag system dependency from net-tools for all times.
Tested of 3 gentoo machines. works here.
Get USE flags
Test current settings set for:
- net-tools
- coreutils
Verify net-tools
- All linux IP kernel networking is done by iproute2 already
- only operative USE flag left is
hostname
user $
eix -I net-tools
[I] sys-apps/net-tools Available versions: 2.10{tbz2,gpkg} **9999*l {+arp +hostname ipv6 nis nls plipconfig selinux slattach static} Installed versions: 2.10{tbz2,gpkg}(11:26:49 12/11/23)(arp hostname ipv6 nls -nis -plipconfig -selinux -slattach -static) Homepage: https://net-tools.sourceforge.io/ Description: Standard Linux networking tool
State:
USE hostname
- set
Verify coreutils settings
hostname USE flag will be mandatory here, currently it is unset:
user $
eix -I coreutils
[I] sys-apps/coreutils Available versions: 8.32-r1^t 9.1-r2^t{tbz2} 9.3-r2^t 9.3-r3^t{tbz2,gpkg} 9.4^t{gpkg} **9999*l^t {acl caps gmp hostname kill multicall nls +openssl selinux +split-usr static test vanilla verify-sig xattr} Installed versions: 9.4^t{gpkg}(12:56:01 16/01/24)(acl nls openssl split-usr xattr -caps -gmp -hostname -kill -multicall -selinux -static -test -vanilla -verify-sig) Homepage: https://www.gnu.org/software/coreutils/ Description: Standard GNU utilities (chmod, cp, dd, ls, sort, tr, head, wc, who,...)
State:
USE hostname
- unset
Set USE flags
Apply mandatory USE flags for the test for hostname
:
Set coreutils
Set the USE flag hostname to sys-apps/coreutils:
root #
echo "sys-apps/coreutils hostname" > /etc/portage/package.use/coreutils
Unset net-tools
Unset all existing USE flags for package net-tools:
root #
echo "sys-apps/net-tools -arp -hostname -ipv6 -nis -nls -plipconfig -selinux -slattach -static" > /etc/portage/package.use/net-tools
The same as above, different template:
echo "sys-apps/net-tools -arp -hostname -ipv6 -nis -nls -plipconfig -selinux -slattach -static" > /etc/portage/package.use/net-tools
Migration
In order to move hostname
USE flag to coreutils. Remove the net-tools. Portage will display blocking USE flags for:
Overview
Get quick overview over potentional breakage:
user $
cd /etc
Grep for following entries in your /etc, or other placec where especially home-backed networkings scripts are stored:
grep netstat -R * grep ifconfig -R * grep route -R * grep iptunnel -R * grep ipmaddr -R * grep mii-tool -R * grep nameif -R *
Do not get exited about the amount of displayed matches. Most of that should and will be already working using iproute2 only
If you know your linux network scripts, here the URL to Iproute2#iproute2_for_net-tools_swappers. Table overview how to swap net-tools commands with corelating iproute2 commands. drop-in replacement of commands overview.
- Change your script
- Test
Client
Client have simple IP networking setups. No breakage.
Server
Server setups, setup scripts, network check scripts, containing following:
- netstat
- ifconfig
- route
- iptunnel
- ipmaddr
- mii-tool
- nameif
Remove net-tools
Remove sys-apps/net-tools for
Potentional portage breakage notificiation.
root #
emerge -C sys-apps/net-tools
emerge -C sys-apps/net-tools * This action can remove important packages! In order to be safer, use * `emerge -pv --depclean <atom>` to check for reverse dependencies before * removing packages. !!! 'sys-apps/net-tools' is part of your system profile. !!! Unmerging it may be damaging to your system. sys-apps/net-tools selected: 2.10 protected: none omitted: none All selected packages: =sys-apps/net-tools-2.10 >>> 'Selected' packages are slated for removal. >>> 'Protected' and 'omitted' packages will not be removed. >>> Waiting 5 seconds before starting... >>> (Control-C to abort)... >>> Unmerging in: 5 4 3 2 1 >>> Unmerging (1 of 1) sys-apps/net-tools-2.10... * GNU info directory index is up-to-date.
Emerge coreutils, portage will build now the package using the hostname
USE flag.
root #
emerge -vaUD sys-apps/coreutils
Tests
Run 3 basic tests while net-tools is not available on the system:
hostname
Verify using the hostmame --version command, if hostname has (GNU coreutils)
root #
hostname --version
hostname --version hostname (GNU coreutils) 9.4 Packaged by Gentoo (9.4 (p0)) Copyright (C) 2023 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by Jim Meyering.
TCP/IP
Verify the linux TCP/IP stack works:
user $
ping localhost
user $
ping 1.1.1.1
user $
ip route
No need to test IPv6 here, it will be working as before.
DNS
Check if your gentoo box is now able to reach IP targets out there. net-tools is gone.
user $
ping gentoo.org
Comands should run without any problems.
Install net-tools (again)
Now emerge net-utils package again. All USE flags will be disabled. It will build some binaries..
root #
emerge -va sys-apps/net-toolkit
Now portage builds net-tools with 0 USE flags enabled. but still installs:
>>> /bin/netstat >>> /bin/ifconfig >>> /bin/route --- /sbin/ >>> /sbin/iptunnel >>> /sbin/ipmaddr >>> /sbin/mii-tool >>> /sbin/nameif
But the binary hostname is now build from sys-apps/coreutils.
You are done here.
Test 2
While everything is build, reboot the gentoo box.
root #
reboot
Verify during the booting sequence and look for potential, networking setup, NIC etc. related errors. Using a workstation or laptop, there will be no bigger problems.
Final state
Stable portage will still pull both packages currently. The most important detail is, that **all** USE flags are disabled on net-tools:
user $
eix -I net-tools
eix -I net-tools [I] sys-apps/net-tools Available versions: 2.10{tbz2,gpkg} **9999*l {+arp +hostname ipv6 nis nls plipconfig selinux slattach static} Installed versions: 2.10{tbz2,gpkg}(21:24:45 17/01/24)(-arp -hostname -ipv6 -nis -nls -plipconfig -selinux -slattach -static) Homepage: https://net-tools.sourceforge.io/ Description: Standard Linux networking tools
State:
USE hostname
- unset
Experienced gentoo users can now sys-apps/net-tools play around blocking or soft-blocking the package.
Final test is here:
root #
emerge -C net-tools
root #
reboot
Verify everything runs w/o net-tools. Portage will pull net-tools anyway. If this all works good, gentoo can start planning removal of that particular net-tools package.
Blocking net-tools
Apply following steps only if you are really gentoo experienced.
Removing the package completely. Create a /etc/portage/profile/package.provided/net-tools file
Create the path
root #
mkdir -p /etc/portage/profile/package.provided/
Block the sys-apps/net-tools
root #
echo "sys-apps/net-tools-2.10" > /etc/portage/profile/package.provided/net-tools
Remove net-tools:
root #
emerge -C sys-apps/net-tools
Now test workstion if everything works as it should w/o this ebuild.
root #
reboot
Test