kernel/kernel-rt/debian/deb_patches/0018-hyperv-daemons-Update-for-upstream-removal-of-hv_fco.patch
Jiping Ma 443773aaa9 kernel: upgrade the Linux kernel to 6.12.18
This commit upgrades the Linux kernel to 6.12.18 from 6.6.x, which comes
from the linux-yocto upstream.

The following changes we made to support the kernel upgrade.

For linux debian package deb_patches folder.
 We adapt the kernel related patch for 6.12.18, and cherry pick the
 following 8 commits to support to build the kernel 6.12.x.
 1) commit f77deecbb5d4 "d/rules.real: Unset KBUILD_HOSTCFLAGS etc.
    instead of overriding to be empty"
    https://salsa.debian.org/kernel-team/linux/-/commit/f77deecbb5d4
 2) commit 0d0d62b7d1cc "d/rules.d/Makefile.inc: Add scripts/include to
    header include path"
    https://salsa.debian.org/kernel-team/linux/-/commit/0d0d62b7d1cc
 3) commit 4ad01663251d "[x86] linux-cpupower: Update turbostat Makefile
    to define BUILD_BUG_HEADER"
    https://salsa.debian.org/kernel-team/linux/-/commit/4ad01663251d
 4) commit fced95b415be "hyperv-daemons: Update for upstream removal of
    hv_fcopy_daemon"
    https://salsa.debian.org/kernel-team/linux/-/commit/fced95b415be
 5) commit 3a17dcbfe0be "d/rules.d/certs: Add newly required include
    directory to CPPFLAGS"
    https://salsa.debian.org/kernel-team/linux/-/commit/3a17dcbfe0be
 6) commit 15b6859742d4 "Disable building rtla, since bullseye's
    libtraceevent and libtracefs are too old"
    https://salsa.debian.org/kernel-team/linux/-/commit/15b6859742d4
 7) commit b4b93560d441 "[ia64] Drop all ia64 configs due to upstream
    dropping IA64 arch"
    https://salsa.debian.org/kernel-team/linux/-/commit/b4b93560d441
 8) commit b93faa99519d "linux-kbuild: Add scripts/module-common.c
    (Closes: #1087495)"
    https://salsa.debian.org/kernel-team/linux/-/commit/b93faa99519d

For the Linux source code patches folder.
 1) We adapt the patch 0001, 0003, 0005, 0006, 0010, 0014 and 0017 based
    on kernel-6.12.18.
 2) Remove all the ice port back patches because that has been included
    in our source code.

For the kernel config.
  We enable CONFIG_CPUSETS_V1 and CONFIG_MEMCG_V1 to fix install issue.

Verification:
- Build kernel and out of tree modules success for rt and std.
- Build iso success for rt and std.
- Install success onto a All-in-One lab with rt kernel, and can
  switch to std kernel.
- Boot up successfully in the lab.
- The sanity testing was run and the test results PASS.
- The cyclictest benchmark was also run on the starlingx lab, the result
  is "samples: 43199996 avg: 1656.295 std_dev: 67.617	max: 8827
  99.9999th percentile: 8652“,It is worse than linux-6.6.x.
- The network performance test had been done. For TCP, better than
  kernel-6.6.x, for UDP, a little worse than kernel-6.6.x, for STCP,
  can not do the test that is same with kernel-6.6.x.

Story: 2011384
Task: 51856

Change-Id: I06ff2f3ab3620fe887f1e5e72ea9022a0cea6102
Signed-off-by: Jiping Ma <jiping.ma2@windriver.com>
2025-04-17 02:43:35 +00:00

253 lines
8.3 KiB
Diff

From 6e811f58e0ba18b827893b56f10d30632fca72de Mon Sep 17 00:00:00 2001
From: Ben Hutchings <benh@debian.org>
Date: Sat, 6 Jul 2024 06:28:03 +0200
Subject: [PATCH 17/20] hyperv-daemons: Update for upstream removal of
hv_fcopy_daemon
- Don't try to build it.
- Remove the init script, service file, and udev rule.
- Use dpkg-maintscript rm_conffile to remove the init script on
upgrade.
- In preinst, stop the service only if upgrading from an older
version. In postinst do nothing with it.
- Remove it from the package description.
(cherry picked from commit fced95b415be4c1fbeec29e02a667168f00ee8e4)
Signed-off-by: Jiping Ma <jiping.ma2@windriver.com>
---
debian/hyperv-daemons.hv-fcopy-daemon.init | 109 ------------------
debian/hyperv-daemons.hv-fcopy-daemon.service | 10 --
debian/hyperv-daemons.maintscript | 1 +
debian/hyperv-daemons.postinst | 2 +-
debian/hyperv-daemons.preinst | 6 +-
debian/hyperv-daemons.udev | 1 -
debian/rules.d/tools/hv/Makefile | 1 -
debian/rules.real | 2 +-
debian/templates/tools-unversioned.control.in | 5 +-
9 files changed, 9 insertions(+), 128 deletions(-)
delete mode 100644 debian/hyperv-daemons.hv-fcopy-daemon.init
delete mode 100644 debian/hyperv-daemons.hv-fcopy-daemon.service
diff --git a/debian/hyperv-daemons.hv-fcopy-daemon.init b/debian/hyperv-daemons.hv-fcopy-daemon.init
deleted file mode 100644
index 5866dc6..0000000
--- a/debian/hyperv-daemons.hv-fcopy-daemon.init
+++ /dev/null
@@ -1,109 +0,0 @@
-#! /bin/sh
-### BEGIN INIT INFO
-# Provides: hv-fcopy-daemon
-# Required-Start: $remote_fs $syslog
-# Required-Stop: $remote_fs $syslog
-# Default-Start: 2 3 4 5
-# Default-Stop: 0 1 6
-# Short-Description: Hyper-V file copy service (FCOPY) daemon
-### END INIT INFO
-
-PATH=/sbin:/usr/sbin:/bin:/usr/bin
-DESC="Hyper-V file copy service (FCOPY) daemon"
-NAME=hv_fcopy_daemon
-DAEMON=/usr/sbin/$NAME
-PIDFILE=/run/$NAME.pid
-SCRIPTNAME=/etc/init.d/hv-fcopy-daemon
-
-# Exit if the package is not installed
-[ -x "$DAEMON" ] || exit 0
-
-# Exit if the kernel device does not exist
-[ -e "/dev/vmbus/hv_fcopy" ] || exit 0
-
-# Load the VERBOSE setting and other rcS variables
-. /lib/init/vars.sh
-
-# Define LSB log_* functions.
-. /lib/lsb/init-functions
-
-#
-# Function that starts the daemon/service
-#
-do_start()
-{
- # Return
- # 0 if daemon has been started
- # 1 if daemon was already running
- # 2 if daemon could not be started
- start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
- || return 1
- start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --background --make-pidfile -- -n \
- || return 2
-}
-
-#
-# Function that stops the daemon/service
-#
-do_stop()
-{
- # Return
- # 0 if daemon has been stopped
- # 1 if daemon was already stopped
- # 2 if daemon could not be stopped
- # other if a failure occurred
- start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
- [ "$?" = 2 ] && return 2
- start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
- RETVAL=$?
- [ "$RETVAL" = 2 ] && return 2
- # Many daemons don't delete their pidfiles when they exit.
- rm -f $PIDFILE
- return "$RETVAL"
-}
-
-case "$1" in
- start)
- [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
- do_start
- case "$?" in
- 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
- 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
- esac
- ;;
- stop)
- [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
- do_stop
- case "$?" in
- 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
- 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
- esac
- ;;
- status)
- status_of_proc -p "$PIDFILE" "$DAEMON" "$NAME"
- ;;
- restart|force-reload)
- log_daemon_msg "Restarting $DESC" "$NAME"
- do_stop
- case "$?" in
- 0|1)
- do_start
- case "$?" in
- 0) log_end_msg 0 ;;
- 1) log_end_msg 1 ;; # Old process is still running
- *) log_end_msg 1 ;; # Failed to start
- esac
- ;;
- *)
- # Failed to stop
- log_end_msg 1
- ;;
- esac
- ;;
- *)
- echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
- exit 3
- ;;
-esac
-
-:
diff --git a/debian/hyperv-daemons.hv-fcopy-daemon.service b/debian/hyperv-daemons.hv-fcopy-daemon.service
deleted file mode 100644
index d8e4d3b..0000000
--- a/debian/hyperv-daemons.hv-fcopy-daemon.service
+++ /dev/null
@@ -1,10 +0,0 @@
-[Unit]
-Description=Hyper-V file copy service (FCOPY) daemon
-Conflicts=hyperv-daemons.hv-fcopy-daemon.service
-BindsTo=sys-devices-virtual-misc-vmbus\x21hv_fcopy.device
-
-[Service]
-ExecStart=/usr/sbin/hv_fcopy_daemon -n
-
-[Install]
-WantedBy=multi-user.target
diff --git a/debian/hyperv-daemons.maintscript b/debian/hyperv-daemons.maintscript
index a2f28e4..96ed55f 100644
--- a/debian/hyperv-daemons.maintscript
+++ b/debian/hyperv-daemons.maintscript
@@ -1,3 +1,4 @@
mv_conffile /etc/init.d/hyperv-daemons.hv-fcopy-daemon /etc/init.d/hv-fcopy-daemon 5.8~rc7-1~exp1
+rm_conffile /etc/init.d/hv-fcopy-daemon 6.10~rc6-1~exp1
mv_conffile /etc/init.d/hyperv-daemons.hv-kvp-daemon /etc/init.d/hv-kvp-daemon 5.8~rc7-1~exp1
mv_conffile /etc/init.d/hyperv-daemons.hv-vss-daemon /etc/init.d/hv-vss-daemon 5.8~rc7-1~exp1
diff --git a/debian/hyperv-daemons.postinst b/debian/hyperv-daemons.postinst
index 3573c9c..9bee3f6 100644
--- a/debian/hyperv-daemons.postinst
+++ b/debian/hyperv-daemons.postinst
@@ -8,7 +8,7 @@ if [ "$1" = "configure" ]; then
udevadm trigger || true
else
# On upgrade make sure running daemons are restarted
- systemctl try-restart hv-fcopy-daemon.service hv-kvp-daemon.service hv-vss-daemon.service
+ systemctl try-restart hv-kvp-daemon.service hv-vss-daemon.service
fi
fi
fi
diff --git a/debian/hyperv-daemons.preinst b/debian/hyperv-daemons.preinst
index 5810d29..fc13e51 100644
--- a/debian/hyperv-daemons.preinst
+++ b/debian/hyperv-daemons.preinst
@@ -2,7 +2,11 @@
set -e
if [ "$1" = "upgrade" ]; then
- for i in fcopy kvp vss; do
+ services='kvp vss'
+ if dpkg --compare-versions "$2" lt 6.10~rc6-1~exp1; then
+ services="fcopy $services"
+ fi
+ for i in $services; do
if [ -d /run/systemd/system ]; then
systemctl stop hyperv-daemons.hv-$i-daemon.service 2>/dev/null || true
fi
diff --git a/debian/hyperv-daemons.udev b/debian/hyperv-daemons.udev
index 1daacac..60e9102 100644
--- a/debian/hyperv-daemons.udev
+++ b/debian/hyperv-daemons.udev
@@ -1,3 +1,2 @@
-KERNEL=="vmbus/hv_fcopy", TAG+="systemd", ENV{SYSTEMD_WANTS}+="hv-fcopy-daemon.service"
KERNEL=="vmbus/hv_kvp", TAG+="systemd", ENV{SYSTEMD_WANTS}+="hv-kvp-daemon.service"
KERNEL=="vmbus/hv_vss", TAG+="systemd", ENV{SYSTEMD_WANTS}+="hv-vss-daemon.service"
diff --git a/debian/rules.d/tools/hv/Makefile b/debian/rules.d/tools/hv/Makefile
index 5f00f55..8e4c305 100644
--- a/debian/rules.d/tools/hv/Makefile
+++ b/debian/rules.d/tools/hv/Makefile
@@ -6,7 +6,6 @@ include $(top_rulesdir)/Makefile.inc
else
PROGS = \
- hv_fcopy_daemon \
hv_kvp_daemon \
hv_vss_daemon
diff --git a/debian/rules.real b/debian/rules.real
index 00f2a33..0e681da 100644
--- a/debian/rules.real
+++ b/debian/rules.real
@@ -714,7 +714,7 @@ binary_hyperv-daemons: build_hyperv-daemons
ifeq (,$(filter nodoc,$(DEB_BUILD_PROFILES)))
dh_installdocs
endif
- for service in fcopy kvp vss; do \
+ for service in kvp vss; do \
dh_installsystemd --name hv-$$service-daemon --no-enable --no-start \
|| break; \
dh_installinit --name hv-$$service-daemon \
diff --git a/debian/templates/tools-unversioned.control.in b/debian/templates/tools-unversioned.control.in
index e899567..b4ff16f 100644
--- a/debian/templates/tools-unversioned.control.in
+++ b/debian/templates/tools-unversioned.control.in
@@ -124,10 +124,7 @@ Depends: ${shlibs:Depends}, ${misc:Depends}
Section: admin
Description: Support daemons for Linux running on Hyper-V
Suite of daemons for Linux guests running on Hyper-V, consisting of
- hv_fcopy_daemon, hv_kvp_daemon and hv_vss_daemon.
- .
- hv_fcopy_daemon provides the file copy service, allowing the host to
- copy files into the guest.
+ hv_kvp_daemon and hv_vss_daemon.
.
hv_kvp_daemon provides the key-value pair (KVP) service, allowing the
host to get and set the IP networking configuration of the guest.
--
2.47.1