openSUSE Commits
Threads by month
- ----- 2024 -----
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
June 2024
- 2 participants
- 1219 discussions
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package kf6-extra-cmake-modules for openSUSE:Factory checked in at 2024-06-09 20:19:10
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/kf6-extra-cmake-modules (Old)
and /work/SRC/openSUSE:Factory/.kf6-extra-cmake-modules.new.19518 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kf6-extra-cmake-modules"
Sun Jun 9 20:19:10 2024 rev:4 rq:1179254 version:6.3.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/kf6-extra-cmake-modules/kf6-extra-cmake-modules.changes 2024-05-11 18:21:52.491693108 +0200
+++ /work/SRC/openSUSE:Factory/.kf6-extra-cmake-modules.new.19518/kf6-extra-cmake-modules.changes 2024-06-09 20:22:04.933525111 +0200
@@ -1,0 +2,12 @@
+Wed Jun 5 10:11:18 UTC 2024 - Christophe Marin <christophe(a)krop.fr>
+
+- Update to 6.3.0
+ * New feature release
+ * For more details please see:
+ * https://kde.org/announcements/frameworks/6/6.3.0/
+- Changes since 6.2.0:
+ * Skip app template packaging when cross-compiling
+ * Remove explicit maintainer from metainfo
+ * ECMQueryQt: Provide better error message when Qt6 qpaths is not found
+
+-------------------------------------------------------------------
Old:
----
extra-cmake-modules-6.2.0.tar.xz
extra-cmake-modules-6.2.0.tar.xz.sig
New:
----
extra-cmake-modules-6.3.0.tar.xz
extra-cmake-modules-6.3.0.tar.xz.sig
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ kf6-extra-cmake-modules.spec ++++++
--- /var/tmp/diff_new_pack.5R4Ncu/_old 2024-06-09 20:22:05.389541566 +0200
+++ /var/tmp/diff_new_pack.5R4Ncu/_new 2024-06-09 20:22:05.389541566 +0200
@@ -23,14 +23,14 @@
%define rname extra-cmake-modules
-# Full KF6 version (e.g. 6.2.0)
+# Full KF6 version (e.g. 6.3.0)
%{!?_kf6_version: %global _kf6_version %{version}}
# Last major and minor KF6 version (e.g. 6.0)
%{!?_kf6_bugfix_version: %define _kf6_bugfix_version %(echo %{_kf6_version} | awk -F. '{print $1"."$2}')}
%bcond_without doc
%bcond_without released
Name: kf6-extra-cmake-modules%{?pkg_suffix}
-Version: 6.2.0
+Version: 6.3.0
Release: 0
Summary: CMake modules
License: BSD-3-Clause
++++++ extra-cmake-modules-6.2.0.tar.xz -> extra-cmake-modules-6.3.0.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extra-cmake-modules-6.2.0/CMakeLists.txt new/extra-cmake-modules-6.3.0/CMakeLists.txt
--- old/extra-cmake-modules-6.2.0/CMakeLists.txt 2024-05-03 14:23:08.000000000 +0200
+++ new/extra-cmake-modules-6.3.0/CMakeLists.txt 2024-05-31 15:23:48.000000000 +0200
@@ -11,7 +11,7 @@
# Preliminary setup
#
-set(VERSION "6.2.0") # handled by release scripts
+set(VERSION "6.3.0") # handled by release scripts
project(ECM
VERSION "${VERSION}"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extra-cmake-modules-6.2.0/kde-modules/KDEPackageAppTemplates.cmake new/extra-cmake-modules-6.3.0/kde-modules/KDEPackageAppTemplates.cmake
--- old/extra-cmake-modules-6.2.0/kde-modules/KDEPackageAppTemplates.cmake 2024-05-03 14:23:08.000000000 +0200
+++ new/extra-cmake-modules-6.3.0/kde-modules/KDEPackageAppTemplates.cmake 2024-05-31 15:23:48.000000000 +0200
@@ -64,11 +64,17 @@
Multiple templates can be passed at once.
+This function does nothing when cross-compiling.
+
Since 5.18
#]=======================================================================]
function(kde_package_app_templates)
+ if (CMAKE_CROSSCOMPILING)
+ return()
+ endif()
+
set(_oneValueArgs INSTALL_DIR)
set(_multiValueArgs TEMPLATES)
cmake_parse_arguments(ARG "" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN} )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extra-cmake-modules-6.2.0/metainfo.yaml new/extra-cmake-modules-6.3.0/metainfo.yaml
--- old/extra-cmake-modules-6.2.0/metainfo.yaml 2024-05-03 14:23:08.000000000 +0200
+++ new/extra-cmake-modules-6.3.0/metainfo.yaml 2024-05-31 15:23:48.000000000 +0200
@@ -1,4 +1,3 @@
-maintainer: skelly
description: Extra CMake modules
tier: 1
type: functional
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extra-cmake-modules-6.2.0/modules/ECMQueryQt.cmake new/extra-cmake-modules-6.3.0/modules/ECMQueryQt.cmake
--- old/extra-cmake-modules-6.2.0/modules/ECMQueryQt.cmake 2024-05-03 14:23:08.000000000 +0200
+++ new/extra-cmake-modules-6.3.0/modules/ECMQueryQt.cmake 2024-05-31 15:23:48.000000000 +0200
@@ -47,23 +47,23 @@
if (QT_MAJOR_VERSION STREQUAL "5")
# QUIET to accommodate the TRY option
find_package(Qt${QT_MAJOR_VERSION}Core QUIET)
+ set(_exec_name_text "Qt5 qmake")
if(TARGET Qt5::qmake)
get_target_property(_qmake_executable_default Qt5::qmake LOCATION)
set(QUERY_EXECUTABLE ${_qmake_executable_default}
CACHE FILEPATH "Location of the Qt5 qmake executable")
- set(_exec_name_text "Qt5 qmake")
set(_cli_option "-query")
endif()
elseif(QT_MAJOR_VERSION STREQUAL "6")
# QUIET to accommodate the TRY option
find_package(Qt6 COMPONENTS CoreTools QUIET CONFIG)
+ set(_exec_name_text "Qt6 qtpaths")
if (TARGET Qt6::qtpaths)
get_target_property(_qtpaths_executable Qt6::qtpaths LOCATION)
set(QUERY_EXECUTABLE ${_qtpaths_executable}
CACHE FILEPATH "Location of the Qt6 qtpaths executable")
- set(_exec_name_text "Qt6 qtpaths")
set(_cli_option "--query")
endif()
endif()
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package kf6-bluez-qt for openSUSE:Factory checked in at 2024-06-09 20:19:08
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/kf6-bluez-qt (Old)
and /work/SRC/openSUSE:Factory/.kf6-bluez-qt.new.19518 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kf6-bluez-qt"
Sun Jun 9 20:19:08 2024 rev:4 rq:1179252 version:6.3.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/kf6-bluez-qt/kf6-bluez-qt.changes 2024-05-11 18:19:21.374190276 +0200
+++ /work/SRC/openSUSE:Factory/.kf6-bluez-qt.new.19518/kf6-bluez-qt.changes 2024-06-09 20:19:27.787914672 +0200
@@ -1,0 +2,10 @@
+Wed Jun 5 10:11:16 UTC 2024 - Christophe Marin <christophe(a)krop.fr>
+
+- Update to 6.3.0
+ * New feature release
+ * For more details please see:
+ * https://kde.org/announcements/frameworks/6/6.3.0/
+- Changes since 6.2.0:
+ * Remove explicit maintainer from metainfo
+
+-------------------------------------------------------------------
Old:
----
bluez-qt-6.2.0.tar.xz
bluez-qt-6.2.0.tar.xz.sig
New:
----
bluez-qt-6.3.0.tar.xz
bluez-qt-6.3.0.tar.xz.sig
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ kf6-bluez-qt.spec ++++++
--- /var/tmp/diff_new_pack.zNiQKP/_old 2024-06-09 20:19:28.263931278 +0200
+++ /var/tmp/diff_new_pack.zNiQKP/_new 2024-06-09 20:19:28.267931417 +0200
@@ -19,13 +19,13 @@
%define qt6_version 6.6.0
%define rname bluez-qt
-# Full KF6 version (e.g. 6.2.0)
+# Full KF6 version (e.g. 6.3.0)
%{!?_kf6_version: %global _kf6_version %{version}}
# Last major and minor KF6 version (e.g. 6.0)
%{!?_kf6_bugfix_version: %define _kf6_bugfix_version %(echo %{_kf6_version} | awk -F. '{print $1"."$2}')}
%bcond_without released
Name: kf6-bluez-qt
-Version: 6.2.0
+Version: 6.3.0
Release: 0
Summary: Async Bluez wrapper library
License: LGPL-2.1-or-later
++++++ bluez-qt-6.2.0.tar.xz -> bluez-qt-6.3.0.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bluez-qt-6.2.0/CMakeLists.txt new/bluez-qt-6.3.0/CMakeLists.txt
--- old/bluez-qt-6.2.0/CMakeLists.txt 2024-05-03 14:22:59.000000000 +0200
+++ new/bluez-qt-6.3.0/CMakeLists.txt 2024-05-31 15:23:35.000000000 +0200
@@ -1,10 +1,10 @@
cmake_minimum_required(VERSION 3.16)
-set(KF_VERSION "6.2.0") # handled by release scripts
+set(KF_VERSION "6.3.0") # handled by release scripts
project(BluezQt VERSION ${KF_VERSION})
include(FeatureSummary)
-find_package(ECM 6.2.0 NO_MODULE)
+find_package(ECM 6.3.0 NO_MODULE)
set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://commits.kde.org/extra-cmake-modules")
feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bluez-qt-6.2.0/metainfo.yaml new/bluez-qt-6.3.0/metainfo.yaml
--- old/bluez-qt-6.2.0/metainfo.yaml 2024-05-03 14:22:59.000000000 +0200
+++ new/bluez-qt-6.3.0/metainfo.yaml 2024-05-31 15:23:35.000000000 +0200
@@ -1,4 +1,3 @@
-maintainer: drosca
description: Qt wrapper for BlueZ 5 DBus API
tier: 1
type: integration
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package ruby3.3 for openSUSE:Factory checked in at 2024-06-09 20:19:02
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ruby3.3 (Old)
and /work/SRC/openSUSE:Factory/.ruby3.3.new.19518 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ruby3.3"
Sun Jun 9 20:19:02 2024 rev:5 rq:1179323 version:3.3.2
Changes:
--------
--- /work/SRC/openSUSE:Factory/ruby3.3/ruby3.3.changes 2024-06-04 12:50:59.295515523 +0200
+++ /work/SRC/openSUSE:Factory/.ruby3.3.new.19518/ruby3.3.changes 2024-06-09 20:19:21.683701739 +0200
@@ -1,0 +2,5 @@
+Tue Jun 5 11:59:12 UTC 2024 - José Gómez <jose.gomez(a)suse.com>
+
+- Add Provides for yjit-enabled builds.
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ruby3.3.spec ++++++
--- /var/tmp/diff_new_pack.pGyudy/_old 2024-06-09 20:19:22.339724623 +0200
+++ /var/tmp/diff_new_pack.pGyudy/_new 2024-06-09 20:19:22.343724762 +0200
@@ -128,6 +128,9 @@
%if %{with yjit}
BuildRequires: cargo >= 1.56.0
BuildRequires: rust >= 1.56.0
+Provides: %{name}-with-yjit = %{version}-%{release}
+%else
+Provides: %{name}-without-yjit = %{version}-%{release}
%endif
%if %{with system_ruby}
BuildRequires: ruby
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package ruby-common for openSUSE:Factory checked in at 2024-06-09 20:19:02
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ruby-common (Old)
and /work/SRC/openSUSE:Factory/.ruby-common.new.19518 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ruby-common"
Sun Jun 9 20:19:02 2024 rev:28 rq:1179322 version:3.2.1
Changes:
--------
--- /work/SRC/openSUSE:Factory/ruby-common/ruby-common.changes 2023-11-23 21:38:44.135264468 +0100
+++ /work/SRC/openSUSE:Factory/.ruby-common.new.19518/ruby-common.changes 2024-06-09 20:19:20.687666994 +0200
@@ -1,0 +2,7 @@
+Fri Jun 7 13:52:41 UTC 2024 - Marcus Rueckert <mrueckert(a)suse.de>
+
+- refactor the jemalloc requires code so that it can accomodate
+ more feature flags
+- add requires for yjit enabled ruby
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ gem_packages.spec.erb ++++++
--- /var/tmp/diff_new_pack.PsJBwX/_old 2024-06-09 20:19:21.371690856 +0200
+++ /var/tmp/diff_new_pack.PsJBwX/_new 2024-06-09 20:19:21.375690995 +0200
@@ -13,28 +13,29 @@
path
end
- def self.rpm_jemalloc_prefix
- jemalloc_prefix = nil
+
+ def self.rpm_suffix_for_feature(feature)
+ rpm_prefix = nil
package_name = RbConfig::CONFIG['RUBY_SO_NAME']
IO.popen("rpm -q --provides #{package_name}") {|rpm_io|
rpm_provides = rpm_io.read
- mo = /(?<jemalloc_prefix>with(out)?-jemalloc)/.match(rpm_provides)
+ mo = /(?<rpm_prefix>with(out)?-#{feature})/.match(rpm_provides)
if mo
- jemalloc_prefix = mo[:jemalloc_prefix]
+ rpm_prefix = mo[:rpm_prefix]
end
}
- jemalloc_prefix
+ rpm_prefix
end
- def self.jemalloc_requires
- jemalloc_prefix = rpm_jemalloc_prefix
+ def self.requires_for_feature(feature)
+ found_rpm_prefix = rpm_suffix_for_feature(feature)
- if jemalloc_prefix
- return "Requires: #{RbConfig::CONFIG['RUBY_SO_NAME']}-#{jemalloc_prefix} >= #{RbConfig::CONFIG['RUBY_PROGRAM_VERSION']}"
+ if found_rpm_prefix
+ return "Requires: #{RbConfig::CONFIG['RUBY_SO_NAME']}-#{found_rpm_prefix} >= #{RbConfig::CONFIG['RUBY_PROGRAM_VERSION']}"
end
#
return ""
@@ -149,7 +150,8 @@
<% end -%>
# /MANUAL
<% unless spec.extensions.empty? -%>
-<%= jemalloc_requires %>
+<%= requires_for_feature('jemalloc') %>
+<%= requires_for_feature('yjit') %>
<% end -%>
Summary: <%= config[:summary] or spec.summary %>
Group: Development/Languages/Ruby
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package libiscsi for openSUSE:Factory checked in at 2024-06-09 20:19:00
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libiscsi (Old)
and /work/SRC/openSUSE:Factory/.libiscsi.new.19518 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libiscsi"
Sun Jun 9 20:19:00 2024 rev:25 rq:1179242 version:1.20.0+git.20240530
Changes:
--------
--- /work/SRC/openSUSE:Factory/libiscsi/libiscsi.changes 2024-03-01 23:34:58.912105856 +0100
+++ /work/SRC/openSUSE:Factory/.libiscsi.new.19518/libiscsi.changes 2024-06-09 20:19:19.643630576 +0200
@@ -1,0 +2,13 @@
+Fri Jun 7 13:49:23 UTC 2024 - Martin Pluskal <mpluskal(a)suse.com>
+
+- Update to version 1.20.0+git.20240530:
+ * fix use after free in recent commit
+ * Add support for Data Digest
+ * login: add support for gnutls
+ * login: do not try to "emulate" the libgcrypt API
+ * configure: add --with-libgcrypt option
+ * A possible 'fix' for https://github.com/sahlberg/libiscsi/issues/415 This patch adds a timestamp before each logged line. That could help correlating a logging to a network-trace. Because of offsets in time between the tracer and the test and the DUT, this does not always help.
+ * Manually set task to null after free to avoid double free issue
+ * lun_reset cancelling lun tasks only
+
+-------------------------------------------------------------------
Old:
----
libiscsi-1.20.0+git.20240206.obscpio
New:
----
libiscsi-1.20.0+git.20240530.obscpio
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ libiscsi.spec ++++++
--- /var/tmp/diff_new_pack.qKerhJ/_old 2024-06-09 20:19:20.191649692 +0200
+++ /var/tmp/diff_new_pack.qKerhJ/_new 2024-06-09 20:19:20.195649831 +0200
@@ -18,7 +18,7 @@
%define sover 10
Name: libiscsi
-Version: 1.20.0+git.20240206
+Version: 1.20.0+git.20240530
Release: 0
Summary: iSCSI client library and utilities
License: GPL-2.0-only AND LGPL-2.1-only
++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.qKerhJ/_old 2024-06-09 20:19:20.235651227 +0200
+++ /var/tmp/diff_new_pack.qKerhJ/_new 2024-06-09 20:19:20.239651366 +0200
@@ -3,6 +3,6 @@
<param name="url">git@github.com:sahlberg/libiscsi.git</param>
<param name="changesrevision">e6bcdf5fdbf39729399c4f0914661ca1055107a1</param></service><service name="tar_scm">
<param name="url">https://github.com/sahlberg/libiscsi.git</param>
- <param name="changesrevision">fef688aa99804588c09beb6ef7a3313dc9cf7492</param></service></servicedata>
+ <param name="changesrevision">b25ee4f0c4e6a27c2f1fa6b9734d6244295a9ac4</param></service></servicedata>
(No newline at EOF)
++++++ libiscsi-1.20.0+git.20240206.obscpio -> libiscsi-1.20.0+git.20240530.obscpio ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libiscsi-1.20.0+git.20240206/README.md new/libiscsi-1.20.0+git.20240530/README.md
--- old/libiscsi-1.20.0+git.20240206/README.md 2024-02-06 00:51:38.000000000 +0100
+++ new/libiscsi-1.20.0+git.20240530/README.md 2024-05-29 23:49:48.000000000 +0200
@@ -45,6 +45,7 @@
target_user=<account>
target_password=<password>
header_digest=<crc32c|none>
+data_digest=<crc32c|none>
Transport:
iser
@@ -125,6 +126,15 @@
application wants to force a specific setting.
+Data Digest
+===========
+
+Libiscsi supports DataDigest. By default, libiscsi will offer None so that
+Data digest will not be used, no matter what the target setting is. This can
+be overridden by an application by calling iscsi_set_data_digest() if the
+application wants to force a specific setting.
+
+
Patches
=======
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libiscsi-1.20.0+git.20240206/configure.ac new/libiscsi-1.20.0+git.20240530/configure.ac
--- old/libiscsi-1.20.0+git.20240206/configure.ac 2024-02-06 00:51:38.000000000 +0100
+++ new/libiscsi-1.20.0+git.20240530/configure.ac 2024-05-29 23:49:48.000000000 +0200
@@ -78,8 +78,43 @@
AC_CONFIG_HEADERS([config.h])
-AC_CHECK_LIB([gcrypt], [gcry_control])
-AM_CONDITIONAL([HAVE_LIBGCRYPT], [test $ac_cv_lib_gcrypt_gcry_control = yes])
+AC_ARG_WITH([gnutls],
+ [AS_HELP_STRING([--with-gnutls],
+ [Use gnutls to compute MD5])],
+ [WITH_GNUTLS=$withval],
+ [WITH_GNUTLS=auto])
+
+AC_ARG_WITH([libgcrypt],
+ [AS_HELP_STRING([--with-libgcrypt],
+ [Use libgcrypt to compute MD5])],
+ [WITH_LIBGCRYPT=$withval],
+ [WITH_LIBGCRYPT=auto])
+
+if test "$WITH_GNUTLS" != no; then
+ AC_CHECK_LIB([gnutls], [gnutls_hash_init])
+ if test "$WITH_GNUTLS" = yes && test "$ac_cv_lib_gnutls_gnutls_hash_init" != yes; then
+ AC_MSG_ERROR([gnutls not found])
+ fi
+ WITH_GNUTLS=$ac_cv_lib_gnutls_gnutls_hash_init
+fi
+if test "$WITH_GNUTLS" = yes; then
+ WITH_LIBGCRYPT=no
+fi
+
+if test "$WITH_LIBGCRYPT" != no; then
+ AC_CHECK_LIB([gcrypt], [gcry_control])
+ if test "$WITH_LIBGCRYPT" = yes && test "$ac_cv_lib_gcrypt_gcry_control" != yes; then
+ AC_MSG_ERROR([libgcrypt not found])
+ fi
+ WITH_LIBGCRYPT=$ac_cv_lib_gcrypt_gcry_control
+fi
+
+NEED_MD5=no
+if test "$WITH_GNUTLS" = no && test "$WITH_LIBGCRYPT" = no; then
+ NEED_MD5=yes
+fi
+AM_CONDITIONAL([NEED_MD5],
+ [expr "$NEED_MD5" : yes > /dev/null 2>&1])
# For MinGW.
AC_CHECK_LIB([ws2_32], [gethostbyname])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libiscsi-1.20.0+git.20240206/include/iscsi-private.h new/libiscsi-1.20.0+git.20240530/include/iscsi-private.h
--- old/libiscsi-1.20.0+git.20240206/include/iscsi-private.h 2024-02-06 00:51:38.000000000 +0100
+++ new/libiscsi-1.20.0+git.20240530/include/iscsi-private.h 2024-05-29 23:49:48.000000000 +0200
@@ -61,6 +61,13 @@
long long data_pos;
unsigned char *data;
+
+ /*
+ * Some data structures wrt Data Digest (if negociated)
+ */
+ unsigned char data_digest_buf[ISCSI_DIGEST_SIZE];
+ int received_data_digest_bytes;
+ uint32_t calculated_data_digest;
};
void iscsi_free_iscsi_in_pdu(struct iscsi_context *iscsi, struct iscsi_in_pdu *in);
@@ -105,6 +112,8 @@
uint32_t statsn;
enum iscsi_header_digest want_header_digest;
enum iscsi_header_digest header_digest;
+ enum iscsi_data_digest want_data_digest;
+ enum iscsi_data_digest data_digest;
int fd;
int is_connected;
@@ -272,6 +281,8 @@
struct iscsi_scsi_cbdata scsi_cbdata;
time_t scsi_timeout;
uint32_t expxferlen;
+
+ uint32_t calculated_data_digest;
};
struct iscsi_pdu *iscsi_allocate_pdu(struct iscsi_context *iscsi,
@@ -293,6 +304,7 @@
void iscsi_pdu_set_datasn(struct iscsi_pdu *pdu, uint32_t datasn);
void iscsi_pdu_set_bufferoffset(struct iscsi_pdu *pdu, uint32_t bufferoffset);
void iscsi_cancel_pdus(struct iscsi_context *iscsi);
+void iscsi_cancel_lun_pdus(struct iscsi_context *iscsi, uint32_t lun);
int iscsi_pdu_add_data(struct iscsi_context *iscsi, struct iscsi_pdu *pdu,
const unsigned char *dptr, int dsize);
int iscsi_queue_pdu(struct iscsi_context *iscsi, struct iscsi_pdu *pdu);
@@ -350,6 +362,9 @@
void iscsi_sfree(struct iscsi_context *iscsi, void* ptr);
uint32_t crc32c(uint8_t *buf, int len);
+void crc32c_init(uint32_t *crc_ptr);
+uint32_t crc32c_chain(uint32_t crc, uint8_t *buf, int len);
+uint32_t crc32c_chain_done(uint32_t crc);
struct scsi_task *iscsi_scsi_get_task_from_pdu(struct iscsi_pdu *pdu);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libiscsi-1.20.0+git.20240206/include/iscsi.h new/libiscsi-1.20.0+git.20240530/include/iscsi.h
--- old/libiscsi-1.20.0+git.20240206/include/iscsi.h 2024-02-06 00:51:38.000000000 +0100
+++ new/libiscsi-1.20.0+git.20240530/include/iscsi.h 2024-05-29 23:49:48.000000000 +0200
@@ -336,6 +336,29 @@
enum iscsi_header_digest header_digest);
/*
+ * Types of data digest we support. Default is NONE
+ */
+enum iscsi_data_digest {
+ ISCSI_DATA_DIGEST_NONE = 0,
+ ISCSI_DATA_DIGEST_NONE_CRC32C = 1,
+ ISCSI_DATA_DIGEST_CRC32C_NONE = 2,
+ ISCSI_DATA_DIGEST_CRC32C = 3,
+ ISCSI_DATA_DIGEST_LAST = ISCSI_DATA_DIGEST_CRC32C
+};
+
+/*
+ * Set the desired data digest for a scsi context.
+ * Data digest can only be set/changed before the context
+ * is logged in to the target.
+ *
+ * Returns:
+ * 0: success
+ * <0: error
+ */
+EXTERN int iscsi_set_data_digest(struct iscsi_context *iscsi,
+ enum iscsi_data_digest data_digest);
+
+/*
* Specify the username and password to use for chap authentication
*/
EXTERN int iscsi_set_initiator_username_pwd(struct iscsi_context *iscsi,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libiscsi-1.20.0+git.20240206/lib/Makefile.am new/libiscsi-1.20.0+git.20240530/lib/Makefile.am
--- old/libiscsi-1.20.0+git.20240206/lib/Makefile.am 2024-02-06 00:51:38.000000000 +0100
+++ new/libiscsi-1.20.0+git.20240530/lib/Makefile.am 2024-05-29 23:49:48.000000000 +0200
@@ -12,7 +12,7 @@
libiscsipriv_la_SOURCES += ../win32/win32_compat.c
endif
-if !HAVE_LIBGCRYPT
+if NEED_MD5
libiscsipriv_la_SOURCES += md5.c
endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libiscsi-1.20.0+git.20240206/lib/connect.c new/libiscsi-1.20.0+git.20240530/lib/connect.c
--- old/libiscsi-1.20.0+git.20240206/lib/connect.c 2024-02-06 00:51:38.000000000 +0100
+++ new/libiscsi-1.20.0+git.20240530/lib/connect.c 2024-05-29 23:49:48.000000000 +0200
@@ -431,6 +431,7 @@
iscsi_set_targetname(tmp_iscsi, iscsi->target_name);
iscsi_set_header_digest(tmp_iscsi, iscsi->want_header_digest);
+ iscsi_set_data_digest(tmp_iscsi, iscsi->want_data_digest);
iscsi_set_initiator_username_pwd(tmp_iscsi, iscsi->user, iscsi->passwd);
iscsi_set_target_username_pwd(tmp_iscsi, iscsi->target_user, iscsi->target_passwd);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libiscsi-1.20.0+git.20240206/lib/crc32c.c new/libiscsi-1.20.0+git.20240530/lib/crc32c.c
--- old/libiscsi-1.20.0+git.20240206/lib/crc32c.c 2024-02-06 00:51:38.000000000 +0100
+++ new/libiscsi-1.20.0+git.20240530/lib/crc32c.c 2024-05-29 23:49:48.000000000 +0200
@@ -118,3 +118,22 @@
return crc^0xffffffff;
}
+void crc32c_init(uint32_t *crc_ptr)
+{
+ if (crc_ptr)
+ *crc_ptr = 0xffffffff;
+}
+
+uint32_t crc32c_chain(uint32_t crc, uint8_t *buf, int len)
+{
+ while (len-- > 0) {
+ crc = (crc>>8) ^ crctable[(crc ^ (*buf++)) & 0xFF];
+ }
+ return crc;
+}
+
+uint32_t crc32c_chain_done(uint32_t crc)
+{
+ return crc^0xffffffff;
+}
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libiscsi-1.20.0+git.20240206/lib/init.c new/libiscsi-1.20.0+git.20240530/lib/init.c
--- old/libiscsi-1.20.0+git.20240206/lib/init.c 2024-02-06 00:51:38.000000000 +0100
+++ new/libiscsi-1.20.0+git.20240530/lib/init.c 2024-05-29 23:49:48.000000000 +0200
@@ -244,6 +244,7 @@
iscsi->want_immediate_data = ISCSI_IMMEDIATE_DATA_YES;
iscsi->use_immediate_data = ISCSI_IMMEDIATE_DATA_YES;
iscsi->want_header_digest = ISCSI_HEADER_DIGEST_NONE_CRC32C;
+ iscsi->want_data_digest = ISCSI_DATA_DIGEST_NONE;
iscsi->tcp_keepcnt=3;
iscsi->tcp_keepintvl=30;
@@ -493,6 +494,25 @@
}
int
+iscsi_set_data_digest(struct iscsi_context *iscsi,
+ enum iscsi_data_digest data_digest)
+{
+ if (iscsi->is_loggedin) {
+ iscsi_set_error(iscsi, "trying to set data digest while "
+ "logged in");
+ return -1;
+ }
+ if ((unsigned)data_digest > ISCSI_DATA_DIGEST_LAST) {
+ iscsi_set_error(iscsi, "invalid data digest value");
+ return -1;
+ }
+
+ iscsi->want_data_digest = data_digest;
+
+ return 0;
+}
+
+int
iscsi_is_logged_in(struct iscsi_context *iscsi)
{
return iscsi->is_loggedin;
@@ -602,19 +622,32 @@
if (value != NULL) {
*value++ = 0;
}
- if (!strcmp(key, "header_digest")) {
- if (!strcmp(value, "crc32c")) {
- iscsi_set_header_digest(
- iscsi, ISCSI_HEADER_DIGEST_CRC32C);
- } else if (!strcmp(value, "none")) {
- iscsi_set_header_digest(
- iscsi, ISCSI_HEADER_DIGEST_NONE);
- } else {
- iscsi_set_error(iscsi,
- "Invalid URL argument for header_digest: %s", value);
- return NULL;
- }
- }
+ if (!strcmp(key, "header_digest")) {
+ if (!strcmp(value, "crc32c")) {
+ iscsi_set_header_digest(
+ iscsi, ISCSI_HEADER_DIGEST_CRC32C);
+ } else if (!strcmp(value, "none")) {
+ iscsi_set_header_digest(
+ iscsi, ISCSI_HEADER_DIGEST_NONE);
+ } else {
+ iscsi_set_error(iscsi,
+ "Invalid URL argument for header_digest: %s", value);
+ return NULL;
+ }
+ }
+ if (!strcmp(key, "data_digest")) {
+ if (!strcmp(value, "crc32c")) {
+ iscsi_set_data_digest(
+ iscsi, ISCSI_DATA_DIGEST_CRC32C);
+ } else if (!strcmp(value, "none")) {
+ iscsi_set_data_digest(
+ iscsi, ISCSI_DATA_DIGEST_NONE);
+ } else {
+ iscsi_set_error(iscsi,
+ "Invalid URL argument for data_digest: %s", value);
+ return NULL;
+ }
+ }
if (!strcmp(key, "target_user")) {
target_user = value;
} else if (!strcmp(key, "target_password")) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libiscsi-1.20.0+git.20240206/lib/libiscsi.def new/libiscsi-1.20.0+git.20240530/lib/libiscsi.def
--- old/libiscsi-1.20.0+git.20240206/lib/libiscsi.def 2024-02-06 00:51:38.000000000 +0100
+++ new/libiscsi-1.20.0+git.20240530/lib/libiscsi.def 2024-05-29 23:49:48.000000000 +0200
@@ -115,6 +115,7 @@
iscsi_set_log_level
iscsi_set_log_fn
iscsi_set_header_digest
+iscsi_set_data_digest
iscsi_set_initiator_username_pwd
iscsi_set_isid_en
iscsi_set_isid_oui
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libiscsi-1.20.0+git.20240206/lib/libiscsi.syms.in new/libiscsi-1.20.0+git.20240530/lib/libiscsi.syms.in
--- old/libiscsi-1.20.0+git.20240206/lib/libiscsi.syms.in 2024-02-06 00:51:38.000000000 +0100
+++ new/libiscsi-1.20.0+git.20240530/lib/libiscsi.syms.in 2024-05-29 23:49:48.000000000 +0200
@@ -116,6 +116,7 @@
iscsi_set_bind_interfaces
iscsi_set_cache_allocations
iscsi_set_header_digest
+iscsi_set_data_digest
iscsi_set_immediate_data
iscsi_set_initial_r2t
iscsi_set_initiator_username_pwd
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libiscsi-1.20.0+git.20240206/lib/login.c new/libiscsi-1.20.0+git.20240530/lib/login.c
--- old/libiscsi-1.20.0+git.20240206/lib/login.c 2024-02-06 00:51:38.000000000 +0100
+++ new/libiscsi-1.20.0+git.20240530/lib/login.c 2024-05-29 23:49:48.000000000 +0200
@@ -44,6 +44,10 @@
#include "iscsi-private.h"
#include "scsi-lowlevel.h"
#include "md5.h"
+
+#ifdef HAVE_LIBGNUTLS
+#include <gnutls/crypto.h>
+#endif
#ifdef HAVE_LIBGCRYPT
#include <gcrypt.h>
#endif
@@ -202,7 +206,24 @@
return 0;
}
- strncpy(str,"DataDigest=None",MAX_STRING_SIZE);
+ switch (iscsi->want_data_digest) {
+ case ISCSI_DATA_DIGEST_NONE:
+ strncpy(str,"DataDigest=None",MAX_STRING_SIZE);
+ break;
+ case ISCSI_DATA_DIGEST_NONE_CRC32C:
+ strncpy(str,"DataDigest=None,CRC32C",MAX_STRING_SIZE);
+ break;
+ case ISCSI_DATA_DIGEST_CRC32C_NONE:
+ strncpy(str,"DataDigest=CRC32C,None",MAX_STRING_SIZE);
+ break;
+ case ISCSI_DATA_DIGEST_CRC32C:
+ strncpy(str,"DataDigest=CRC32C",MAX_STRING_SIZE);
+ break;
+ default:
+ iscsi_set_error(iscsi, "invalid data digest value");
+ return -1;
+ }
+
if (iscsi_pdu_add_data(iscsi, pdu, (unsigned char *)str, strlen(str)+1)
!= 0) {
iscsi_set_error(iscsi, "Out-of-memory: pdu add data failed.");
@@ -681,41 +702,61 @@
return i + '0';
}
-#ifndef HAVE_LIBGCRYPT
-typedef struct MD5Context *gcry_md_hd_t;
-#define gcry_md_write MD5Update
-#define GCRY_MD_MD5 1
+#if defined HAVE_LIBGNUTLS
+#define md5_context_t gnutls_hash_hd_t
+#define md5_open(hd) gnutls_hash_init(hd, GNUTLS_DIG_MD5)
+#define md5_write gnutls_hash
+#define md5_read gnutls_hash_output
+
+static void md5_close(md5_context_t h)
+{
+ unsigned char digest[16];
+
+ gnutls_hash_deinit(h, digest);
+}
+
+#elif defined HAVE_LIBGCRYPT
+typedef gcry_md_hd_t md5_context_t;
+#define md5_open(hd) gcry_md_open(hd, GCRY_MD_MD5, 0)
+#define md5_write gcry_md_write
+#define md5_close gcry_md_close
+
+static void md5_read(md5_context_t h, uint8_t *result)
+{
+ memcpy(result, gcry_md_read(h, 0), 16);
+}
+#else
+typedef struct MD5Context *md5_context_t;
+#define md5_write MD5Update
-static void gcry_md_open(gcry_md_hd_t *hd, int algo, unsigned int flags)
+static void md5_open(md5_context_t *hd)
{
- assert(algo == GCRY_MD_MD5 && flags == 0);
*hd = malloc(sizeof(struct MD5Context));
if (*hd) {
MD5Init(*hd);
}
}
-static void gcry_md_putc(gcry_md_hd_t h, unsigned char c)
-{
- MD5Update(h, &c, 1);
-}
-
-static char *gcry_md_read(gcry_md_hd_t h, int algo)
+static void md5_read(md5_context_t h, uint8_t *result)
{
unsigned char digest[16];
- assert(algo == 0 || algo == GCRY_MD_MD5);
MD5Final(digest, h);
- return memcpy(h->buf, digest, sizeof(digest));
+ memcpy(result, digest, sizeof(digest));
}
-static void gcry_md_close(gcry_md_hd_t h)
+static void md5_close(md5_context_t h)
{
memset(h, 0, sizeof(*h));
free(h);
}
#endif
+static inline void md5_putc(md5_context_t h, unsigned char c)
+{
+ md5_write(h, &c, 1);
+}
+
/* size of the challenge used for bidirectional chap */
#define TARGET_CHAP_C_SIZE 32
@@ -726,7 +767,7 @@
char * strp;
unsigned char c, cc[2];
unsigned char digest[CHAP_R_SIZE];
- gcry_md_hd_t ctx;
+ md5_context_t ctx;
int i;
if (iscsi->current_phase != ISCSI_PDU_LOGIN_CSG_SECNEG
@@ -739,22 +780,22 @@
return -1;
}
- gcry_md_open(&ctx, GCRY_MD_MD5, 0);
+ md5_open(&ctx);
if (ctx == NULL) {
iscsi_set_error(iscsi, "Cannot create MD5 algorithm");
return -1;
}
- gcry_md_putc(ctx, iscsi->chap_i);
- gcry_md_write(ctx, (unsigned char *)iscsi->passwd, strlen(iscsi->passwd));
+ md5_putc(ctx, iscsi->chap_i);
+ md5_write(ctx, (unsigned char *)iscsi->passwd, strlen(iscsi->passwd));
strp = iscsi->chap_c;
while (*strp != 0) {
c = (h2i(strp[0]) << 4) | h2i(strp[1]);
strp += 2;
- gcry_md_putc(ctx, c);
+ md5_putc(ctx, c);
}
- memcpy(digest, gcry_md_read(ctx, 0), sizeof(digest));
- gcry_md_close(ctx);
+ md5_read(ctx, digest);
+ md5_close(ctx);
strncpy(str,"CHAP_R=0x",MAX_STRING_SIZE);
if (iscsi_pdu_add_data(iscsi, pdu, (unsigned char *)str, strlen(str))
@@ -822,20 +863,19 @@
return -1;
}
- gcry_md_open(&ctx, GCRY_MD_MD5, 0);
+ md5_open(&ctx);
if (ctx == NULL) {
iscsi_set_error(iscsi, "Cannot create MD5 algorithm");
return -1;
}
- gcry_md_putc(ctx, iscsi->target_chap_i);
- gcry_md_write(ctx, (unsigned char *)iscsi->target_passwd,
+ md5_putc(ctx, iscsi->target_chap_i);
+ md5_write(ctx, (unsigned char *)iscsi->target_passwd,
strlen(iscsi->target_passwd));
- gcry_md_write(ctx, (unsigned char *)target_chap_c,
+ md5_write(ctx, (unsigned char *)target_chap_c,
TARGET_CHAP_C_SIZE);
- memcpy(iscsi->target_chap_r, gcry_md_read(ctx, 0),
- sizeof(iscsi->target_chap_r));
- gcry_md_close(ctx);
+ md5_read(ctx, iscsi->target_chap_r);
+ md5_close(ctx);
}
return 0;
@@ -1200,6 +1240,16 @@
}
}
+ if (!strncmp(ptr, "DataDigest=", 11)) {
+ if (!strcmp(ptr + 11, "CRC32C")) {
+ iscsi->want_data_digest
+ = ISCSI_DATA_DIGEST_CRC32C;
+ } else {
+ iscsi->want_data_digest
+ = ISCSI_DATA_DIGEST_NONE;
+ }
+ }
+
if (!strncmp(ptr, "FirstBurstLength=", 17)) {
iscsi->first_burst_length = strtol(ptr + 17, NULL, 10);
}
@@ -1370,6 +1420,7 @@
iscsi->is_loggedin = 1;
iscsi_itt_post_increment(iscsi);
iscsi->header_digest = iscsi->want_header_digest;
+ iscsi->data_digest = iscsi->want_data_digest;
ISCSI_LOG(iscsi, 2, "login successful");
pdu->callback(iscsi, SCSI_STATUS_GOOD, NULL, pdu->private_data);
} else {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libiscsi-1.20.0+git.20240206/lib/pdu.c new/libiscsi-1.20.0+git.20240530/lib/pdu.c
--- old/libiscsi-1.20.0+git.20240206/lib/pdu.c 2024-02-06 00:51:38.000000000 +0100
+++ new/libiscsi-1.20.0+git.20240530/lib/pdu.c 2024-05-29 23:49:48.000000000 +0200
@@ -225,6 +225,9 @@
/* flags */
pdu->flags = flags;
+ /* DataDigest - may or may not be calculated. Initialize anyway. */
+ crc32c_init(&pdu->calculated_data_digest);
+
return pdu;
}
@@ -537,6 +540,25 @@
}
}
+ /* verify data checksum ... */
+ if (iscsi->data_digest != ISCSI_DATA_DIGEST_NONE) {
+ int dsl = scsi_get_uint32(&in->hdr[4]) & 0x00ffffff;
+ /* ... but only if some data is present. */
+ if (dsl) {
+ uint32_t crc_rcvd = 0;
+ uint32_t crc = crc32c_chain_done(in->calculated_data_digest);
+
+ crc_rcvd |= in->data_digest_buf[0];
+ crc_rcvd |= in->data_digest_buf[1] << 8;
+ crc_rcvd |= in->data_digest_buf[2] << 16;
+ crc_rcvd |= in->data_digest_buf[3] << 24;
+ if (crc != crc_rcvd) {
+ iscsi_set_error(iscsi, "data checksum verification failed: calculated 0x%" PRIx32 " received 0x%" PRIx32, crc, crc_rcvd);
+ return -1;
+ }
+ }
+ }
+
if (ahslen != 0) {
iscsi_set_error(iscsi, "cant handle expanded headers yet");
return -1;
@@ -946,4 +968,37 @@
}
iscsi->drv->free_pdu(iscsi, pdu);
}
+}
+
+void
+iscsi_cancel_lun_pdus(struct iscsi_context *iscsi, uint32_t lun)
+{
+ struct iscsi_pdu *pdu;
+ struct iscsi_pdu *next_pdu;
+ uint32_t cmdsn_gap = 0;
+ struct scsi_task * task = NULL;
+
+ for (pdu = iscsi->outqueue; pdu; pdu = next_pdu) {
+ next_pdu = pdu->next;
+ task = iscsi_scsi_get_task_from_pdu(pdu);
+
+ if (cmdsn_gap > 0) {
+ iscsi_pdu_set_cmdsn(pdu, pdu->cmdsn - cmdsn_gap);
+ }
+ if (task == NULL || task->lun != lun) {
+ continue;
+ }
+ if (!(pdu->outdata.data[0] & ISCSI_PDU_IMMEDIATE) &&
+ (pdu->outdata.data[0] & 0x3f) != ISCSI_PDU_DATA_OUT) {
+ iscsi->cmdsn--;
+ cmdsn_gap++;
+ }
+ ISCSI_LIST_REMOVE(&iscsi->outqueue, pdu);
+ iscsi_set_error(iscsi, "command cancelled");
+ if (pdu->callback) {
+ pdu->callback(iscsi, SCSI_STATUS_CANCELLED,
+ NULL, pdu->private_data);
+ }
+ iscsi->drv->free_pdu(iscsi, pdu);
+ }
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libiscsi-1.20.0+git.20240206/lib/scsi-lowlevel.c new/libiscsi-1.20.0+git.20240530/lib/scsi-lowlevel.c
--- old/libiscsi-1.20.0+git.20240206/lib/scsi-lowlevel.c 2024-02-06 00:51:38.000000000 +0100
+++ new/libiscsi-1.20.0+git.20240530/lib/scsi-lowlevel.c 2024-05-29 23:49:48.000000000 +0200
@@ -79,7 +79,9 @@
}
free(task->datain.data);
+ task->datain.data = NULL;
free(task);
+ task = NULL;
}
struct scsi_task *
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libiscsi-1.20.0+git.20240206/lib/socket.c new/libiscsi-1.20.0+git.20240530/lib/socket.c
--- old/libiscsi-1.20.0+git.20240206/lib/socket.c 2024-02-06 00:51:38.000000000 +0100
+++ new/libiscsi-1.20.0+git.20240530/lib/socket.c 2024-05-29 23:49:48.000000000 +0200
@@ -62,6 +62,7 @@
#include <sys/uio.h>
#endif
+#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
@@ -514,7 +515,7 @@
}
ssize_t
-iscsi_iovector_readv_writev(struct iscsi_context *iscsi, struct scsi_iovector *iovector, uint32_t pos, ssize_t count, int do_write)
+iscsi_iovector_readv_writev(struct iscsi_context *iscsi, struct scsi_iovector *iovector, uint32_t pos, ssize_t count, uint32_t *data_digest_ptr, int do_write)
{
struct scsi_iovec *iov, *iov2;
int niov;
@@ -598,6 +599,19 @@
n = readv(iscsi->fd, (struct iovec*) iov, niov);
}
+ /* Update the data digest */
+ if (data_digest_ptr && n > 0) {
+ int i;
+ size_t bytes_to_crc = n;
+ struct iovec *iov_ptr = (struct iovec*)iov;
+
+ for ( i=0; iov_ptr && i<niov && bytes_to_crc; iov_ptr++, i++) {
+ size_t chunk = MIN(bytes_to_crc, iov_ptr->iov_len);
+ *data_digest_ptr = crc32c_chain(*data_digest_ptr, iov_ptr->iov_base, chunk);
+ bytes_to_crc -= chunk;
+ }
+ }
+
/* restore original values */
iov->iov_base = (void*) ((uintptr_t)iov->iov_base - pos);
iov->iov_len += pos;
@@ -619,6 +633,7 @@
{
struct iscsi_in_pdu *in;
ssize_t hdr_size, data_size, count, padding_size;
+ bool do_data_digest = (iscsi->data_digest != ISCSI_DATA_DIGEST_NONE);
do {
hdr_size = ISCSI_HEADER_SIZE(iscsi->header_digest);
@@ -628,6 +643,7 @@
iscsi_set_error(iscsi, "Out-of-memory: failed to malloc iscsi_in_pdu");
return -1;
}
+ crc32c_init(&(iscsi->incoming->calculated_data_digest));
iscsi->incoming->hdr = iscsi_smalloc(iscsi, hdr_size);
if (iscsi->incoming->hdr == NULL) {
iscsi_set_error(iscsi, "Out-of-memory");
@@ -682,7 +698,7 @@
iovector_in = iscsi_get_scsi_task_iovector_in(iscsi, in);
if (iovector_in != NULL && count > padding_size) {
uint32_t offset = scsi_get_uint32(&in->hdr[40]);
- count = iscsi_iovector_readv_writev(iscsi, iovector_in, in->data_pos + offset, count - padding_size, 0);
+ count = iscsi_iovector_readv_writev(iscsi, iovector_in, in->data_pos + offset, count - padding_size, do_data_digest ? &(in->calculated_data_digest) : NULL, 0);
} else {
if (iovector_in == NULL) {
if (in->data == NULL) {
@@ -695,6 +711,8 @@
buf = &in->data[in->data_pos];
}
count = recv(iscsi->fd, (void *)buf, count, 0);
+ if (do_data_digest && count > 0)
+ in->calculated_data_digest = crc32c_chain(in->calculated_data_digest, buf, count);
}
if (count == 0) {
/* remote side has closed the socket. */
@@ -713,6 +731,28 @@
break;
}
+ /* Handle Data Digest receive */
+ if (data_size != 0 && do_data_digest &&
+ in->received_data_digest_bytes < ISCSI_DIGEST_SIZE) {
+
+ count = recv(iscsi->fd, (void *)(in->data_digest_buf + in->received_data_digest_bytes), ISCSI_DIGEST_SIZE - in->received_data_digest_bytes, 0);
+ if (count == 0) {
+ /* remote side has closed the socket. */
+ return -1;
+ }
+ if (count < 0) {
+ if (errno == EINTR || errno == EAGAIN) {
+ break;
+ }
+ return -1;
+ }
+ in->received_data_digest_bytes += count;
+
+ if (in->received_data_digest_bytes < ISCSI_DIGEST_SIZE) {
+ break;
+ }
+ }
+
iscsi->incoming = NULL;
if (iscsi_process_pdu(iscsi, in) != 0) {
iscsi_free_iscsi_in_pdu(iscsi, in);
@@ -751,6 +791,7 @@
struct iscsi_pdu *pdu;
static char padding_buf[3];
int socket_flags = 0;
+ bool do_data_digest = (iscsi->data_digest != ISCSI_DATA_DIGEST_NONE);
#ifdef MSG_NOSIGNAL
socket_flags |= MSG_NOSIGNAL;
@@ -848,7 +889,7 @@
count = iscsi_iovector_readv_writev(iscsi,
iovector_out,
pdu->payload_offset + pdu->payload_written,
- pdu->payload_len - pdu->payload_written, 1);
+ pdu->payload_len - pdu->payload_written, do_data_digest ? &(pdu->calculated_data_digest) : NULL, 1);
if (count == -1) {
if (errno == EAGAIN || errno == EWOULDBLOCK) {
return 0;
@@ -873,12 +914,56 @@
"socket :%d", errno);
return -1;
}
+
+ if (do_data_digest)
+ pdu->calculated_data_digest = crc32c_chain(pdu->calculated_data_digest, (uint8_t *)padding_buf, count);
+
pdu->payload_written += count;
}
+
/* if we havent written the full padding yet. */
+ if (pdu->payload_written < total) {
+ return 0;
+ }
+
+ /*
+ * Maybe update the total again, and write the digest, but only if
+ * 1. DataDigest has been negociated, and
+ * 2. We have actually written some data
+ */
+ if (do_data_digest && pdu->payload_written) {
+ uint32_t data_digest = crc32c_chain_done(pdu->calculated_data_digest);
+ char data_digest_buf[ISCSI_DIGEST_SIZE];
+
+ total += ISCSI_DIGEST_SIZE;
+
+ data_digest_buf[3] = (data_digest >> 24);
+ data_digest_buf[2] = (data_digest >> 16);
+ data_digest_buf[1] = (data_digest >> 8);
+ data_digest_buf[0] = (data_digest);
+
+ /* Write data digest */
+ if (pdu->payload_written < total) {
+ int todo = total - pdu->payload_written;
+ count = send(iscsi->fd, data_digest_buf + (ISCSI_DIGEST_SIZE - todo), todo, socket_flags);
+ if (count == -1) {
+ if (errno == EAGAIN || errno == EWOULDBLOCK) {
+ return 0;
+ }
+ iscsi_set_error(iscsi, "Error when writing to "
+ "socket :%d", errno);
+ return -1;
+ }
+
+ pdu->payload_written += count;
+ }
+ }
+
+ /* if we havent written everything yet. */
if (pdu->payload_written != total) {
return 0;
}
+
if (pdu->flags & ISCSI_PDU_CORK_WHEN_SENT) {
iscsi->is_corked = 1;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libiscsi-1.20.0+git.20240206/lib/task_mgmt.c new/libiscsi-1.20.0+git.20240530/lib/task_mgmt.c
--- old/libiscsi-1.20.0+git.20240206/lib/task_mgmt.c 2024-02-06 00:51:38.000000000 +0100
+++ new/libiscsi-1.20.0+git.20240530/lib/task_mgmt.c 2024-05-29 23:49:48.000000000 +0200
@@ -130,7 +130,7 @@
uint32_t lun,
iscsi_command_cb cb, void *private_data)
{
- iscsi_scsi_cancel_all_tasks(iscsi);
+ iscsi_cancel_lun_pdus(iscsi, lun);
return iscsi_task_mgmt_async(iscsi,
lun, ISCSI_TM_LUN_RESET,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libiscsi-1.20.0+git.20240206/test-tool/iscsi-support.c new/libiscsi-1.20.0+git.20240530/test-tool/iscsi-support.c
--- old/libiscsi-1.20.0+git.20240206/test-tool/iscsi-support.c 2024-02-06 00:51:38.000000000 +0100
+++ new/libiscsi-1.20.0+git.20240530/test-tool/iscsi-support.c 2024-05-29 23:49:48.000000000 +0200
@@ -457,6 +457,8 @@
va_list ap;
static char message[1024];
int ret;
+ struct timespec ts;
+ struct tm tm;
if (loglevel < level) {
return;
@@ -467,6 +469,17 @@
return;
}
+ if (clock_gettime(CLOCK_REALTIME, &ts) == -1) {
+ return;
+ }
+
+ if (!localtime_r(&ts.tv_sec, &tm)) {
+ return;
+ }
+
+ printf(" %04d-%02d-%02d %02d:%02d:%02d.%06d ",
+ tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec, (int)ts.tv_nsec / 1000);
+
va_start(ap, format);
ret = vsnprintf(message, 1024, format, ap);
va_end(ap);
++++++ libiscsi.obsinfo ++++++
--- /var/tmp/diff_new_pack.qKerhJ/_old 2024-06-09 20:19:20.491660157 +0200
+++ /var/tmp/diff_new_pack.qKerhJ/_new 2024-06-09 20:19:20.495660297 +0200
@@ -1,5 +1,5 @@
name: libiscsi
-version: 1.20.0+git.20240206
-mtime: 1707177098
-commit: fef688aa99804588c09beb6ef7a3313dc9cf7492
+version: 1.20.0+git.20240530
+mtime: 1717019388
+commit: b25ee4f0c4e6a27c2f1fa6b9734d6244295a9ac4
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package libsolv for openSUSE:Factory checked in at 2024-06-09 20:18:59
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libsolv (Old)
and /work/SRC/openSUSE:Factory/.libsolv.new.19518 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libsolv"
Sun Jun 9 20:18:59 2024 rev:95 rq:1179240 version:0.7.29
Changes:
--------
--- /work/SRC/openSUSE:Factory/libsolv/libsolv.changes 2024-05-14 13:37:50.697456219 +0200
+++ /work/SRC/openSUSE:Factory/.libsolv.new.19518/libsolv.changes 2024-06-09 20:19:17.967572110 +0200
@@ -1,0 +2,8 @@
+Fri Jun 7 11:33:19 CEST 2024 - mls(a)suse.de
+
+- add a conflict to older libsolv-tools to libsolv-tools-base
+- report unsupported compression in solv_xfopen() with errno
+- fix return value of repodata.add_solv() in the bindings
+- fix SHA-224 oid in solv_pgpvrfy
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ libsolv.spec ++++++
--- /var/tmp/diff_new_pack.1rSzi9/_old 2024-06-09 20:19:18.447588854 +0200
+++ /var/tmp/diff_new_pack.1rSzi9/_new 2024-06-09 20:19:18.451588994 +0200
@@ -171,6 +171,7 @@
Summary: Utilities used by libzypp to manage .solv files
Group: System/Management
Provides: libsolv-tools:%{_bindir}/repo2solv
+Conflicts: libsolv-tools < %{version}
%description tools-base
This subpackage contains utilities used by libzypp to manage solv files.
++++++ libsolv-0.7.29.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.7.29/bindings/solv.i new/libsolv-0.7.29/bindings/solv.i
--- old/libsolv-0.7.29/bindings/solv.i 2024-03-27 13:50:05.000000000 +0100
+++ new/libsolv-0.7.29/bindings/solv.i 2024-05-21 13:50:06.000000000 +0200
@@ -4476,7 +4476,7 @@
r = repo_add_solv(data->repo, fp, flags | REPO_USE_LOADING);
if (r || data->state == REPODATA_LOADING)
data->state = oldstate;
- return r;
+ return r == 0;
}
void extend_to_repo() {
Repodata *data = repo_id2repodata($self->repo, $self->id);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.7.29/ext/solv_pgpvrfy.c new/libsolv-0.7.29/ext/solv_pgpvrfy.c
--- old/libsolv-0.7.29/ext/solv_pgpvrfy.c 2023-07-19 11:52:42.000000000 +0200
+++ new/libsolv-0.7.29/ext/solv_pgpvrfy.c 2024-05-16 15:50:06.000000000 +0200
@@ -476,7 +476,7 @@
break;
case 11:
hashl = 28; /* SHA-224 */
- oid = (unsigned char *)"\023\060\061\060\015\006\011\140\206\110\001\145\003\004\002\004\005\000\004\034";
+ oid = (unsigned char *)"\023\060\055\060\015\006\011\140\206\110\001\145\003\004\002\004\005\000\004\034";
break;
default:
return 0; /* unsupported hash algo */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.7.29/ext/solv_xfopen.c new/libsolv-0.7.29/ext/solv_xfopen.c
--- old/libsolv-0.7.29/ext/solv_xfopen.c 2023-07-19 11:52:42.000000000 +0200
+++ new/libsolv-0.7.29/ext/solv_xfopen.c 2024-05-16 15:50:06.000000000 +0200
@@ -11,6 +11,7 @@
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
+#include <errno.h>
#ifdef _WIN32
#include "fmemopen.c"
@@ -660,7 +661,10 @@
char *suf;
if (!fn)
- return 0;
+ {
+ errno = EINVAL;
+ return 0;
+ }
if (!mode)
mode = "r";
suf = strrchr(fn, '.');
@@ -669,7 +673,10 @@
return mygzfopen(fn, mode);
#else
if (suf && !strcmp(suf, ".gz"))
- return 0;
+ {
+ errno = ENOTSUP;
+ return 0;
+ }
#endif
#ifdef ENABLE_LZMA_COMPRESSION
if (suf && !strcmp(suf, ".xz"))
@@ -678,30 +685,45 @@
return mylzfopen(fn, mode);
#else
if (suf && !strcmp(suf, ".xz"))
- return 0;
+ {
+ errno = ENOTSUP;
+ return 0;
+ }
if (suf && !strcmp(suf, ".lzma"))
- return 0;
+ {
+ errno = ENOTSUP;
+ return 0;
+ }
#endif
#ifdef ENABLE_BZIP2_COMPRESSION
if (suf && !strcmp(suf, ".bz2"))
return mybzfopen(fn, mode);
#else
if (suf && !strcmp(suf, ".bz2"))
- return 0;
+ {
+ errno = ENOTSUP;
+ return 0;
+ }
#endif
#ifdef ENABLE_ZSTD_COMPRESSION
if (suf && !strcmp(suf, ".zst"))
return myzstdfopen(fn, mode);
#else
if (suf && !strcmp(suf, ".zst"))
- return 0;
+ {
+ errno = ENOTSUP;
+ return 0;
+ }
#endif
#ifdef ENABLE_ZCHUNK_COMPRESSION
if (suf && !strcmp(suf, ".zck"))
return myzchunkfopen(fn, mode);
#else
if (suf && !strcmp(suf, ".zck"))
- return 0;
+ {
+ errno = ENOTSUP;
+ return 0;
+ }
#endif
return fopen(fn, mode);
}
@@ -742,7 +764,10 @@
return mygzfdopen(fd, simplemode);
#else
if (suf && !strcmp(suf, ".gz"))
- return 0;
+ {
+ errno = ENOTSUP;
+ return 0;
+ }
#endif
#ifdef ENABLE_LZMA_COMPRESSION
if (suf && !strcmp(suf, ".xz"))
@@ -751,9 +776,15 @@
return mylzfdopen(fd, simplemode);
#else
if (suf && !strcmp(suf, ".xz"))
- return 0;
+ {
+ errno = ENOTSUP;
+ return 0;
+ }
if (suf && !strcmp(suf, ".lzma"))
- return 0;
+ {
+ errno = ENOTSUP;
+ return 0;
+ }
#endif
#ifdef ENABLE_BZIP2_COMPRESSION
if (suf && !strcmp(suf, ".bz2"))
@@ -767,14 +798,20 @@
return myzstdfdopen(fd, simplemode);
#else
if (suf && !strcmp(suf, ".zst"))
- return 0;
+ {
+ errno = ENOTSUP;
+ return 0;
+ }
#endif
#ifdef ENABLE_ZCHUNK_COMPRESSION
if (suf && !strcmp(suf, ".zck"))
return myzchunkfdopen(fd, simplemode);
#else
if (suf && !strcmp(suf, ".zck"))
- return 0;
+ {
+ errno = ENOTSUP;
+ return 0;
+ }
#endif
return fdopen(fd, mode);
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.7.29/package/libsolv.changes new/libsolv-0.7.29/package/libsolv.changes
--- old/libsolv-0.7.29/package/libsolv.changes 2024-04-30 15:30:06.000000000 +0200
+++ new/libsolv-0.7.29/package/libsolv.changes 2024-06-07 15:40:06.000000000 +0200
@@ -1,4 +1,12 @@
-------------------------------------------------------------------
+Fri Jun 7 11:33:19 CEST 2024 - mls(a)suse.de
+
+- add a conflict to older libsolv-tools to libsolv-tools-base
+- report unsupported compression in solv_xfopen() with errno
+- fix return value of repodata.add_solv() in the bindings
+- fix SHA-224 oid in solv_pgpvrfy
+
+-------------------------------------------------------------------
Tue Apr 30 15:15:45 CEST 2024 - mls(a)suse.de
- improve updating of installed multiversion packages
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.7.29/package/libsolv.spec.in new/libsolv-0.7.29/package/libsolv.spec.in
--- old/libsolv-0.7.29/package/libsolv.spec.in 2024-04-30 15:10:06.000000000 +0200
+++ new/libsolv-0.7.29/package/libsolv.spec.in 2024-06-07 11:35:52.000000000 +0200
@@ -171,6 +171,7 @@
Summary: Utilities used by libzypp to manage .solv files
Group: System/Management
Provides: libsolv-tools:%{_bindir}/repo2solv
+Conflicts: libsolv-tools < %{version}
%description tools-base
This subpackage contains utilities used by libzypp to manage solv files.
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package kbuild for openSUSE:Factory checked in at 2024-06-09 20:18:56
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/kbuild (Old)
and /work/SRC/openSUSE:Factory/.kbuild.new.19518 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kbuild"
Sun Jun 9 20:18:56 2024 rev:42 rq:1179187 version:0.1.9998svn3427
Changes:
--------
--- /work/SRC/openSUSE:Factory/kbuild/kbuild.changes 2024-02-23 16:41:31.495062378 +0100
+++ /work/SRC/openSUSE:Factory/.kbuild.new.19518/kbuild.changes 2024-06-09 20:19:10.891325270 +0200
@@ -1,0 +2,11 @@
+Fri Jun 7 11:04:30 UTC 2024 - Martin Jambor <mjambor(a)suse.com>
+
+- Make kbuild buildable with GCC 14 (boo#1225792)
+ * Changes to configure machinery so that it does not fail and detect
+ what it has detected with previous GCC versions.
+ (kBuild-configure-c99.patch, kBuild-configure-c99-2.patch)
+ * Add many missing includes (kBuild-c99.patch).
+ * Fix an actual bug in a call to eval_buffer that also manifests as
+ a C99 violation (kBuild-c99-2.patch).
+
+-------------------------------------------------------------------
New:
----
kBuild-c99-2.patch
kBuild-c99.patch
kBuild-configure-c99-2.patch
kBuild-configure-c99.patch
BETA DEBUG BEGIN:
New: * Fix an actual bug in a call to eval_buffer that also manifests as
a C99 violation (kBuild-c99-2.patch).
New: (kBuild-configure-c99.patch, kBuild-configure-c99-2.patch)
* Add many missing includes (kBuild-c99.patch).
* Fix an actual bug in a call to eval_buffer that also manifests as
New: what it has detected with previous GCC versions.
(kBuild-configure-c99.patch, kBuild-configure-c99-2.patch)
* Add many missing includes (kBuild-c99.patch).
New: what it has detected with previous GCC versions.
(kBuild-configure-c99.patch, kBuild-configure-c99-2.patch)
* Add many missing includes (kBuild-c99.patch).
BETA DEBUG END:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ kbuild.spec ++++++
--- /var/tmp/diff_new_pack.JK6Uih/_old 2024-06-09 20:19:11.511346898 +0200
+++ /var/tmp/diff_new_pack.JK6Uih/_new 2024-06-09 20:19:11.515347037 +0200
@@ -1,7 +1,7 @@
#
# spec file for package kbuild
#
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -34,6 +34,17 @@
Patch9: ppc64le.patch
Patch10: aarch64.patch
Patch13: glob-lstat.patch
+
+# C99 compatibility patches to resolve boo#1225792:
+# From from https://bugzilla.redhat.com/show_bug.cgi?id=2154544
+Patch14: kBuild-configure-c99.patch
+# Somehow RedHat did not need this one:
+Patch15: kBuild-configure-c99-2.patch
+# From from https://bugzilla.redhat.com/show_bug.cgi?id=2154544
+Patch16: kBuild-c99.patch
+# From from https://bugzilla.redhat.com/show_bug.cgi?id=2154544
+Patch17: kBuild-c99-2.patch
+
BuildRequires: automake
BuildRequires: bison
BuildRequires: byacc
@@ -66,6 +77,10 @@
%patch -P 9 -p1
%patch -P 10 -p1
%patch -P 13 -p1
+%patch -P 14 -p1
+%patch -P 15 -p1
+%patch -P 16 -p1
+%patch -P 17 -p0
%build
export CFLAGS="%{optflags} -fno-strict-aliasing"
++++++ kBuild-c99-2.patch ++++++
The eval_buffer function expects the end of the string as the
(optional) last argument, not its length.
Index: src/kmk/loadapi.c
===================================================================
--- src/kmk/loadapi.c (revision 3600)
+++ src/kmk/loadapi.c (working copy)
@@ -59,7 +59,7 @@
install_variable_buffer (&pbuf, &plen);
s = xstrdup (buffer);
- eval_buffer (s, flp IF_WITH_VALUE_LENGTH_PARAM (strlen (s) /** @todo suboptimal */));
+ eval_buffer (s, flp IF_WITH_VALUE_LENGTH_PARAM (s + strlen (s) /** @todo suboptimal */));
free (s);
restore_variable_buffer (pbuf, plen);
++++++ kBuild-c99.patch ++++++
Do not treat <strings.h> as an umbrella header for <string.h>
The two are distinct on GNU/Linux.
Also add missing #include <string.h> in some files.
Index: kbuild-0.1.9998svn3427/src/sed/lib/getline.c
===================================================================
--- kbuild-0.1.9998svn3427.orig/src/sed/lib/getline.c
+++ kbuild-0.1.9998svn3427/src/sed/lib/getline.c
@@ -9,10 +9,10 @@
#include <stdio.h>
#undef getline /* bird */
+#include <string.h>
+
#ifdef HAVE_STRINGS_H
# include <strings.h>
-#else
-# include <string.h>
#endif /* HAVE_STRINGS_H */
#ifdef HAVE_STDLIB_H
Index: kbuild-0.1.9998svn3427/src/sed/lib/mkstemp.c
===================================================================
--- kbuild-0.1.9998svn3427.orig/src/sed/lib/mkstemp.c
+++ kbuild-0.1.9998svn3427/src/sed/lib/mkstemp.c
@@ -2,10 +2,10 @@
#include "config.h"
#endif
+#include <string.h>
+
#ifdef HAVE_STRINGS_H
# include <strings.h>
-#else
-# include <string.h>
#endif /* HAVE_STRINGS_H */
#ifdef HAVE_STDLIB_H
Index: kbuild-0.1.9998svn3427/src/sed/lib/utils.c
===================================================================
--- kbuild-0.1.9998svn3427.orig/src/sed/lib/utils.c
+++ kbuild-0.1.9998svn3427/src/sed/lib/utils.c
@@ -19,16 +19,17 @@
#include "config.h"
#include <stdio.h>
+#include <unistd.h>
#include <errno.h>
#ifndef errno
extern int errno;
#endif
+#include <string.h>
+
#ifdef HAVE_STRINGS_H
# include <strings.h>
-#else
-# include <string.h>
#endif /* HAVE_STRINGS_H */
#ifdef HAVE_STDLIB_H
Index: kbuild-0.1.9998svn3427/src/sed/sed/compile.c
===================================================================
--- kbuild-0.1.9998svn3427.orig/src/sed/sed/compile.c
+++ kbuild-0.1.9998svn3427/src/sed/sed/compile.c
@@ -22,14 +22,13 @@
#include "strverscmp.h"
#include <stdio.h>
#include <ctype.h>
+#include <string.h>
#ifdef HAVE_STRINGS_H
# include <strings.h>
# ifdef HAVE_MEMORY_H
# include <memory.h>
# endif
-#else
-# include <string.h>
#endif /* HAVE_STRINGS_H */
#ifdef HAVE_STDLIB_H
Index: kbuild-0.1.9998svn3427/src/sed/sed/execute.c
===================================================================
--- kbuild-0.1.9998svn3427.orig/src/sed/sed/execute.c
+++ kbuild-0.1.9998svn3427/src/sed/sed/execute.c
@@ -24,6 +24,7 @@
#include <stdio.h>
#include <ctype.h>
+#include <string.h>
#include <errno.h>
#ifndef errno
@@ -46,8 +47,6 @@ extern int errno;
#ifdef HAVE_STRINGS_H
# include <strings.h>
-#else
-# include <string.h>
#endif /*HAVE_STRINGS_H*/
#ifdef HAVE_MEMORY_H
# include <memory.h>
Index: kbuild-0.1.9998svn3427/src/sed/sed/fmt.c
===================================================================
--- kbuild-0.1.9998svn3427.orig/src/sed/sed/fmt.c
+++ kbuild-0.1.9998svn3427/src/sed/sed/fmt.c
@@ -22,6 +22,7 @@
#include <stdio.h>
#include <ctype.h>
#include <sys/types.h>
+#include <string.h>
#if HAVE_LIMITS_H
# include <limits.h>
Index: kbuild-0.1.9998svn3427/src/sed/sed/mbcs.c
===================================================================
--- kbuild-0.1.9998svn3427.orig/src/sed/sed/mbcs.c
+++ kbuild-0.1.9998svn3427/src/sed/sed/mbcs.c
@@ -17,6 +17,7 @@
#include "sed.h"
#include <stdlib.h>
+#include <string.h>
int mb_cur_max;
Index: kbuild-0.1.9998svn3427/src/sed/sed/regexp.c
===================================================================
--- kbuild-0.1.9998svn3427.orig/src/sed/sed/regexp.c
+++ kbuild-0.1.9998svn3427/src/sed/sed/regexp.c
@@ -19,6 +19,7 @@
#include <ctype.h>
#include <stdio.h>
+#include <string.h>
#ifdef HAVE_STDLIB_H
# include <stdlib.h>
#endif
Index: kbuild-0.1.9998svn3427/src/sed/sed/sed.c
===================================================================
--- kbuild-0.1.9998svn3427.orig/src/sed/sed/sed.c
+++ kbuild-0.1.9998svn3427/src/sed/sed/sed.c
@@ -22,12 +22,10 @@
#include "sed.h"
-
#include <stdio.h>
+#include <string.h>
#ifdef HAVE_STRINGS_H
# include <strings.h>
-#else
-# include <string.h>
#endif /*HAVE_STRINGS_H*/
#ifdef HAVE_MEMORY_H
# include <memory.h>
++++++ kBuild-configure-c99-2.patch ++++++
Index: kbuild-0.1.9998svn3427/src/kmk/configure.ac
===================================================================
--- kbuild-0.1.9998svn3427.orig/src/kmk/configure.ac
+++ kbuild-0.1.9998svn3427/src/kmk/configure.ac
@@ -121,6 +121,7 @@ pds_AC_DOS_PATHS
AC_CACHE_CHECK([for standard gettimeofday], [ac_cv_func_gettimeofday],
[ac_cv_func_gettimeofday=no
AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <sys/time.h>
+ #include <stdlib.h>
int main ()
{
struct timeval t; t.tv_sec = -1; t.tv_usec = -1;
++++++ kBuild-configure-c99.patch ++++++
Fix some typical C99 compatibility issues in old configure scripts.
diff --git a/src/sed/config/getline.m4 b/src/sed/config/getline.m4
index ff8b5f4b..52d2e3e7 100644
--- a/src/sed/config/getline.m4
+++ b/src/sed/config/getline.m4
@@ -27,7 +27,7 @@ AC_DEFUN([AM_FUNC_GETLINE],
if (!in)
return 1;
len = getline (&line, &siz, in);
- exit ((len == 4 && line && strcmp (line, "foo\n") == 0) ? 0 : 1);
+ return (len == 4 && line && strcmp (line, "foo\n") == 0) ? 0 : 1;
}
], am_cv_func_working_getline=yes dnl The library version works.
, am_cv_func_working_getline=no dnl The library version does NOT work.
diff --git a/src/sed/configure b/src/sed/configure
index 0b01618f..b1172113 100755
--- a/src/sed/configure
+++ b/src/sed/configure
@@ -2593,7 +2593,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
for ac_declaration in \
- '' \
+ '#include <stdlib.h>' \
'extern "C" void std::exit (int) throw (); using std::exit;' \
'extern "C" void std::exit (int); using std::exit;' \
'extern "C" void exit (int) throw ();' \
@@ -3378,8 +3378,8 @@ main ()
for (i = 0; i < 256; i++)
if (XOR (islower (i), ISLOWER (i))
|| toupper (i) != TOUPPER (i))
- exit(2);
- exit (0);
+ return 2;
+ return 0;
}
_ACEOF
rm -f conftest$ac_exeext
@@ -5747,7 +5747,7 @@ cat >>conftest.$ac_ext <<_ACEOF
if (!in)
return 1;
len = getline (&line, &siz, in);
- exit ((len == 4 && line && strcmp (line, "foo\n") == 0) ? 0 : 1);
+ return (len == 4 && line && strcmp (line, "foo\n") == 0) ? 0 : 1;
}
_ACEOF
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package php8 for openSUSE:Factory checked in at 2024-06-09 20:18:51
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/php8 (Old)
and /work/SRC/openSUSE:Factory/.php8.new.19518 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "php8"
Sun Jun 9 20:18:51 2024 rev:68 rq:1179157 version:8.3.8
Changes:
--------
--- /work/SRC/openSUSE:Factory/php8/php8.changes 2024-05-11 18:19:08.885735517 +0200
+++ /work/SRC/openSUSE:Factory/.php8.new.19518/php8.changes 2024-06-09 20:19:03.755076335 +0200
@@ -1,0 +2,39 @@
+Fri Jun 7 07:02:10 UTC 2024 - pgajdos(a)suse.com
+
+- version update to 8.3.8 [bsc#1226073]
+ CGI:
+ Fixed buffer limit on Windows, replacing read call usage by _read.
+ Fixed bug GHSA-3qgc-jrrr-25jv (Bypass of CVE-2012-1823, Argument Injection in PHP-CGI). (CVE-2024-4577)
+ CLI:
+ Fixed bug GH-14189 (PHP Interactive shell input state incorrectly handles quoted heredoc literals.).
+ Core:
+ Fixed bug GH-13970 (Incorrect validation of #[Attribute] flags type for non-compile-time expressions).
+ DOM:
+ Fix crashes when entity declaration is removed while still having entity references.
+ Fix references not handled correctly in C14N.
+ Fix crash when calling childNodes next() when iterator is exhausted.
+ Fix crash in ParentNode::append() when dealing with a fragment containing text nodes.
+ Filter:
+ Fixed bug GHSA-w8qr-v226-r27w (Filter bypass in filter_var FILTER_VALIDATE_URL). (CVE-2024-5458)
+ FPM:
+ Fix bug GH-14175 (Show decimal number instead of scientific notation in systemd status).
+ Hash:
+ ext/hash: Swap the checking order of `__has_builtin` and `__GNUC__` (Saki Takamachi)
+ Intl:
+ Fixed build regression on systems without C++17 compilers.
+ MySQLnd:
+ Fix bug GH-14255 (mysqli_fetch_assoc reports error from nested query).
+ Opcache:
+ Fixed bug GH-14109 (Fix accidental persisting of internal class constant in shm).
+ OpenSSL:
+ The openssl_private_decrypt function in PHP and Marvin attack.
+ Standard:
+ Fixed bug GHSA-9fcc-425m-g385 (Bypass of CVE-2024-1874). (CVE-2024-5585)
+ XML:
+ Fixed bug GH-14124 (Segmentation fault with XML extension under certain memory limit).
+ XMLReader:
+ Fixed bug GH-14183 (XMLReader::open() can't be overridden).
+- modified patches
+ % php-build-reproducible-phar.patch (refreshed)
+
+-------------------------------------------------------------------
Old:
----
php-8.3.7.tar.xz
php-8.3.7.tar.xz.asc
New:
----
php-8.3.8.tar.xz
php-8.3.8.tar.xz.asc
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ php8.spec ++++++
--- /var/tmp/diff_new_pack.JsLbnm/_old 2024-06-09 20:19:06.891185732 +0200
+++ /var/tmp/diff_new_pack.JsLbnm/_new 2024-06-09 20:19:06.911186430 +0200
@@ -57,7 +57,7 @@
%bcond_without sodium
Name: %{pprefix}%{php_name}%{psuffix}
-Version: 8.3.7
+Version: 8.3.8
Release: 0
Summary: Interpreter for the PHP scripting language version 8
License: MIT AND PHP-3.01
++++++ php-8.3.7.tar.xz -> php-8.3.8.tar.xz ++++++
/work/SRC/openSUSE:Factory/php8/php-8.3.7.tar.xz /work/SRC/openSUSE:Factory/.php8.new.19518/php-8.3.8.tar.xz differ: char 26, line 1
++++++ php-ar-flags.patch ++++++
--- /var/tmp/diff_new_pack.JsLbnm/_old 2024-06-09 20:19:07.363202197 +0200
+++ /var/tmp/diff_new_pack.JsLbnm/_new 2024-06-09 20:19:07.367202337 +0200
@@ -1,8 +1,8 @@
-Index: php-8.3.2/configure.ac
+Index: php-8.3.8/configure.ac
===================================================================
---- php-8.3.2.orig/configure.ac
-+++ php-8.3.2/configure.ac
-@@ -1657,7 +1657,7 @@ PHP_CONFIGURE_PART(Configuring libtool)
+--- php-8.3.8.orig/configure.ac
++++ php-8.3.8/configure.ac
+@@ -1660,7 +1660,7 @@ PHP_CONFIGURE_PART(Configuring libtool)
dnl Silence warning: `ar: 'u' modifier ignored since 'D' is the default`
dnl See https://github.com/php/php-src/pull/3017
++++++ php-build-reproducible-phar.patch ++++++
--- /var/tmp/diff_new_pack.JsLbnm/_old 2024-06-09 20:19:07.379202756 +0200
+++ /var/tmp/diff_new_pack.JsLbnm/_new 2024-06-09 20:19:07.383202895 +0200
@@ -16,11 +16,11 @@
ext/phar/zip.c | 2 +-
6 files changed, 18 insertions(+), 5 deletions(-)
-Index: php-8.3.3/ext/phar/phar.c
+Index: php-8.3.8/ext/phar/phar.c
===================================================================
---- php-8.3.3.orig/ext/phar/phar.c
-+++ php-8.3.3/ext/phar/phar.c
-@@ -2993,7 +2993,7 @@ int phar_flush(phar_archive_data *phar,
+--- php-8.3.8.orig/ext/phar/phar.c
++++ php-8.3.8/ext/phar/phar.c
+@@ -2996,7 +2996,7 @@ int phar_flush(phar_archive_data *phar,
4: metadata-len
+: metadata
*/
@@ -29,10 +29,10 @@
phar_set_32(entry_buffer, entry->uncompressed_filesize);
phar_set_32(entry_buffer+4, mytime);
phar_set_32(entry_buffer+8, entry->compressed_filesize);
-Index: php-8.3.3/ext/phar/phar_internal.h
+Index: php-8.3.8/ext/phar/phar_internal.h
===================================================================
---- php-8.3.3.orig/ext/phar/phar_internal.h
-+++ php-8.3.3/ext/phar/phar_internal.h
+--- php-8.3.8.orig/ext/phar/phar_internal.h
++++ php-8.3.8/ext/phar/phar_internal.h
@@ -427,6 +427,21 @@ static inline enum phar_fp_type phar_get
return PHAR_G(cached_fp)[entry->phar->phar_pos].manifest[entry->manifest_pos].fp_type;
}
@@ -55,10 +55,10 @@
static inline zend_off_t phar_get_fp_offset(phar_entry_info *entry)
{
if (!entry->is_persistent) {
-Index: php-8.3.3/ext/phar/stream.c
+Index: php-8.3.8/ext/phar/stream.c
===================================================================
---- php-8.3.3.orig/ext/phar/stream.c
-+++ php-8.3.3/ext/phar/stream.c
+--- php-8.3.8.orig/ext/phar/stream.c
++++ php-8.3.8/ext/phar/stream.c
@@ -474,7 +474,7 @@ static int phar_stream_flush(php_stream
phar_entry_data *data = (phar_entry_data *) stream->abstract;
@@ -68,10 +68,10 @@
ret = phar_flush(data->phar, 0, 0, 0, &error);
if (error) {
php_stream_wrapper_log_error(stream->wrapper, REPORT_ERRORS, "%s", error);
-Index: php-8.3.3/ext/phar/tar.c
+Index: php-8.3.8/ext/phar/tar.c
===================================================================
---- php-8.3.3.orig/ext/phar/tar.c
-+++ php-8.3.3/ext/phar/tar.c
+--- php-8.3.8.orig/ext/phar/tar.c
++++ php-8.3.8/ext/phar/tar.c
@@ -965,7 +965,7 @@ int phar_tar_flush(phar_archive_data *ph
char halt_stub[] = "__HALT_COMPILER();";
@@ -81,10 +81,10 @@
entry.is_modified = 1;
entry.is_crc_checked = 1;
entry.is_tar = 1;
-Index: php-8.3.3/ext/phar/util.c
+Index: php-8.3.8/ext/phar/util.c
===================================================================
---- php-8.3.3.orig/ext/phar/util.c
-+++ php-8.3.3/ext/phar/util.c
+--- php-8.3.8.orig/ext/phar/util.c
++++ php-8.3.8/ext/phar/util.c
@@ -584,7 +584,7 @@ phar_entry_data *phar_get_or_create_entr
phar_add_virtual_dirs(phar, path, path_len);
@@ -94,10 +94,10 @@
etemp.is_crc_checked = 1;
etemp.phar = phar;
etemp.filename = estrndup(path, path_len);
-Index: php-8.3.3/ext/phar/zip.c
+Index: php-8.3.8/ext/phar/zip.c
===================================================================
---- php-8.3.3.orig/ext/phar/zip.c
-+++ php-8.3.3/ext/phar/zip.c
+--- php-8.3.8.orig/ext/phar/zip.c
++++ php-8.3.8/ext/phar/zip.c
@@ -1236,7 +1236,7 @@ int phar_zip_flush(phar_archive_data *ph
pass.error = &temperr;
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package grub2 for openSUSE:Factory checked in at 2024-06-09 20:18:50
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/grub2 (Old)
and /work/SRC/openSUSE:Factory/.grub2.new.19518 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "grub2"
Sun Jun 9 20:18:50 2024 rev:331 rq:1179115 version:2.12
Changes:
--------
--- /work/SRC/openSUSE:Factory/grub2/grub2.changes 2024-05-21 18:33:18.359532247 +0200
+++ /work/SRC/openSUSE:Factory/.grub2.new.19518/grub2.changes 2024-06-09 20:18:58.054877493 +0200
@@ -1,0 +2,14 @@
+Fri Jun 7 02:13:08 UTC 2024 - Michael Chang <mchang(a)suse.com>
+
+- Add blscfg support
+ * 0001-blscfg-add-blscfg-module-to-parse-Boot-Loader-Specif.patch
+ * 0002-Add-BLS-support-to-grub-mkconfig.patch
+ * 0003-Add-grub2-switch-to-blscfg.patch
+ * 0004-blscfg-Don-t-root-device-in-emu-builds.patch
+ * 0005-blscfg-check-for-mounted-boot-in-emu.patch
+ * 0006-Follow-the-device-where-blscfg-is-discovered.patch
+ * 0007-grub-switch-to-blscfg-adapt-to-openSUSE.patch
+ * 0008-blscfg-reading-bls-fragments-if-boot-present.patch
+ * 0009-10_linux-Some-refinement-for-BLS.patch
+
+-------------------------------------------------------------------
New:
----
0001-blscfg-add-blscfg-module-to-parse-Boot-Loader-Specif.patch
0002-Add-BLS-support-to-grub-mkconfig.patch
0003-Add-grub2-switch-to-blscfg.patch
0004-blscfg-Don-t-root-device-in-emu-builds.patch
0005-blscfg-check-for-mounted-boot-in-emu.patch
0006-Follow-the-device-where-blscfg-is-discovered.patch
0007-grub-switch-to-blscfg-adapt-to-openSUSE.patch
0008-blscfg-reading-bls-fragments-if-boot-present.patch
0009-10_linux-Some-refinement-for-BLS.patch
BETA DEBUG BEGIN:
New:- Add blscfg support
* 0001-blscfg-add-blscfg-module-to-parse-Boot-Loader-Specif.patch
* 0002-Add-BLS-support-to-grub-mkconfig.patch
New: * 0001-blscfg-add-blscfg-module-to-parse-Boot-Loader-Specif.patch
* 0002-Add-BLS-support-to-grub-mkconfig.patch
* 0003-Add-grub2-switch-to-blscfg.patch
New: * 0002-Add-BLS-support-to-grub-mkconfig.patch
* 0003-Add-grub2-switch-to-blscfg.patch
* 0004-blscfg-Don-t-root-device-in-emu-builds.patch
New: * 0003-Add-grub2-switch-to-blscfg.patch
* 0004-blscfg-Don-t-root-device-in-emu-builds.patch
* 0005-blscfg-check-for-mounted-boot-in-emu.patch
New: * 0004-blscfg-Don-t-root-device-in-emu-builds.patch
* 0005-blscfg-check-for-mounted-boot-in-emu.patch
* 0006-Follow-the-device-where-blscfg-is-discovered.patch
New: * 0005-blscfg-check-for-mounted-boot-in-emu.patch
* 0006-Follow-the-device-where-blscfg-is-discovered.patch
* 0007-grub-switch-to-blscfg-adapt-to-openSUSE.patch
New: * 0006-Follow-the-device-where-blscfg-is-discovered.patch
* 0007-grub-switch-to-blscfg-adapt-to-openSUSE.patch
* 0008-blscfg-reading-bls-fragments-if-boot-present.patch
New: * 0007-grub-switch-to-blscfg-adapt-to-openSUSE.patch
* 0008-blscfg-reading-bls-fragments-if-boot-present.patch
* 0009-10_linux-Some-refinement-for-BLS.patch
New: * 0008-blscfg-reading-bls-fragments-if-boot-present.patch
* 0009-10_linux-Some-refinement-for-BLS.patch
BETA DEBUG END:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ grub2.spec ++++++
--- /var/tmp/diff_new_pack.sYjgBs/_old 2024-06-09 20:19:01.210987588 +0200
+++ /var/tmp/diff_new_pack.sYjgBs/_new 2024-06-09 20:19:01.210987588 +0200
@@ -395,6 +395,15 @@
Patch205: 0001-10_linux-Ensure-persistence-of-root-file-system-moun.patch
Patch206: 0001-util-bash-completion-Fix-for-bash-completion-2.12.patch
Patch207: 0001-util-enable-grub-protect-only-for-EFI-systems.patch
+Patch208: 0001-blscfg-add-blscfg-module-to-parse-Boot-Loader-Specif.patch
+Patch209: 0002-Add-BLS-support-to-grub-mkconfig.patch
+Patch210: 0003-Add-grub2-switch-to-blscfg.patch
+Patch211: 0004-blscfg-Don-t-root-device-in-emu-builds.patch
+Patch212: 0005-blscfg-check-for-mounted-boot-in-emu.patch
+Patch213: 0006-Follow-the-device-where-blscfg-is-discovered.patch
+Patch214: 0007-grub-switch-to-blscfg-adapt-to-openSUSE.patch
+Patch215: 0008-blscfg-reading-bls-fragments-if-boot-present.patch
+Patch216: 0009-10_linux-Some-refinement-for-BLS.patch
Requires: gettext-runtime
%if 0%{?suse_version} >= 1140
@@ -697,7 +706,7 @@
PXE_MODULES="tftp http"
CRYPTO_MODULES="luks luks2 gcry_rijndael gcry_sha1 gcry_sha256 gcry_sha512 crypttab"
%ifarch %{efi}
-CD_MODULES="${CD_MODULES} chain efifwsetup efinet read tpm tpm2 memdisk tar squash4 xzio"
+CD_MODULES="${CD_MODULES} chain efifwsetup efinet read tpm tpm2 memdisk tar squash4 xzio blscfg"
PXE_MODULES="${PXE_MODULES} efinet"
%else
CD_MODULES="${CD_MODULES} net ofnet"
@@ -1180,6 +1189,7 @@
%{_sbindir}/%{name}-probe
%{_sbindir}/%{name}-reboot
%{_sbindir}/%{name}-set-default
+%{_sbindir}/%{name}-switch-to-blscfg
%{_sbindir}/%{name}-check-default
%{_bindir}/%{name}-editenv
%{_bindir}/%{name}-file
@@ -1232,6 +1242,7 @@
%{_mandir}/man8/%{name}-probe.8.*
%{_mandir}/man8/%{name}-reboot.8.*
%{_mandir}/man8/%{name}-set-default.8.*
+%{_mandir}/man8/%{name}-switch-to-blscfg.8.*
%if %{emu}
%{_bindir}/%{name}-emu
%{_mandir}/man1/%{name}-emu.1.*
++++++ 0001-blscfg-add-blscfg-module-to-parse-Boot-Loader-Specif.patch ++++++
++++ 1614 lines (skipped)
++++++ 0002-Add-BLS-support-to-grub-mkconfig.patch ++++++
From 439de947262b0d8d4a02ca5afb1ef4f15853962c Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones(a)redhat.com>
Date: Fri, 9 Dec 2016 15:40:29 -0500
Subject: [PATCH 2/9] Add BLS support to grub-mkconfig
GRUB now has BootLoaderSpec support, the user can choose to use this by
setting GRUB_ENABLE_BLSCFG to true in /etc/default/grub. On this setup,
the boot menu entries are not added to the grub.cfg, instead BLS config
files are parsed by blscfg command and the entries created dynamically.
A 10_linux_bls grub.d snippet to generate menu entries from BLS files
is also added that can be used on platforms where the bootloader doesn't
have BLS support and only can parse a normal grub configuration file.
Portions of the 10_linux_bls were taken from the ostree-grub-generator
script that's included in the OSTree project.
Fixes to support multi-devices and generate a BLS section even if no
kernels are found in the boot directory were proposed by Yclept Nemo
and Tom Gundersen respectively.
Signed-off-by: Peter Jones <pjones(a)redhat.com>
[javierm: remove outdated URL for BLS document]
Signed-off-by: Javier Martinez Canillas <javierm(a)redhat.com>
[iwienand(a)redhat.com: skip machine ID check when updating entries]
Signed-off-by: Ian Wienand <iwienand(a)redhat.com>
[rharwood: commit message composits, drop man pages]
Signed-off-by: Robbie Harwood <rharwood(a)redhat.com>
---
util/grub-mkconfig.in | 9 +-
util/grub-mkconfig_lib.in | 22 +++-
util/grub.d/10_linux.in | 244 +++++++++++++++++++++++++++++++++++++-
3 files changed, 269 insertions(+), 6 deletions(-)
diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in
index cf5b79342..7af15df94 100644
--- a/util/grub-mkconfig.in
+++ b/util/grub-mkconfig.in
@@ -49,6 +49,8 @@ grub_script_check="${bindir}/@grub_script_check@"
export TEXTDOMAIN=@PACKAGE@
export TEXTDOMAINDIR="@localedir@"
+export GRUB_GRUBENV_UPDATE="yes"
+
. "${pkgdatadir}/grub-mkconfig_lib"
# Usage: usage
@@ -58,6 +60,7 @@ usage () {
gettext "Generate a grub config file"; echo
echo
print_option_help "-o, --output=$(gettext FILE)" "$(gettext "output generated config to FILE [default=stdout]")"
+ print_option_help "--no-grubenv-update" "$(gettext "do not update variables in the grubenv file")"
print_option_help "-h, --help" "$(gettext "print this message and exit")"
print_option_help "-V, --version" "$(gettext "print the version information and exit")"
echo
@@ -93,6 +96,9 @@ do
--output=*)
grub_cfg=`echo "$option" | sed 's/--output=//'`
;;
+ --no-grubenv-update)
+ GRUB_GRUBENV_UPDATE="no"
+ ;;
-*)
gettext_printf "Unrecognized option \`%s'\n" "$option" 1>&2
usage
@@ -300,7 +306,8 @@ export GRUB_DEFAULT \
GRUB_DISABLE_SUBMENU \
SUSE_BTRFS_SNAPSHOT_BOOTING \
SUSE_CMDLINE_XENEFI \
- SUSE_REMOVE_LINUX_ROOT_PARAM
+ SUSE_REMOVE_LINUX_ROOT_PARAM \
+ GRUB_ENABLE_BLSCFG
if test "x${grub_cfg}" != "x"; then
rm -f "${grub_cfg}.new"
diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in
index 22fb7668f..5db4337c6 100644
--- a/util/grub-mkconfig_lib.in
+++ b/util/grub-mkconfig_lib.in
@@ -30,6 +30,9 @@ fi
if test "x$grub_file" = x; then
grub_file="${bindir}/@grub_file@"
fi
+if test "x$grub_editenv" = x; then
+ grub_editenv="${bindir}/@grub_editenv@"
+fi
if test "x$grub_mkrelpath" = x; then
grub_mkrelpath="${bindir}/@grub_mkrelpath@"
fi
@@ -123,8 +126,19 @@ EOF
fi
}
+prepare_grub_to_access_device_with_variable ()
+{
+ device_variable="$1"
+ shift
+ prepare_grub_to_access_device "$@"
+ unset "device_variable"
+}
+
prepare_grub_to_access_device ()
{
+ if [ -z "$device_variable" ]; then
+ device_variable="root"
+ fi
old_ifs="$IFS"
IFS='
'
@@ -159,18 +173,18 @@ prepare_grub_to_access_device ()
# otherwise set root as per value in device.map.
fs_hint="`"${grub_probe}" --device $@ --target=compatibility_hint`"
if [ "x$fs_hint" != x ]; then
- echo "set root='$fs_hint'"
+ echo "set ${device_variable}='$fs_hint'"
fi
if [ "x${GRUB_DISABLE_UUID}" != "xtrue" ] && fs_uuid="`"${grub_probe}" --device $@ --target=fs_uuid 2> /dev/null`" ; then
hints="`"${grub_probe}" --device $@ --target=hints_string 2> /dev/null`" || hints=
if [ "x$hints" != x ]; then
echo "if [ x\$feature_platform_search_hint = xy ]; then"
- echo " search --no-floppy --fs-uuid --set=root ${hints} ${fs_uuid}"
+ echo " search --no-floppy --fs-uuid --set=${device_variable} ${hints} ${fs_uuid}"
echo "else"
- echo " search --no-floppy --fs-uuid --set=root ${fs_uuid}"
+ echo " search --no-floppy --fs-uuid --set=${device_variable} ${fs_uuid}"
echo "fi"
else
- echo "search --no-floppy --fs-uuid --set=root ${fs_uuid}"
+ echo "search --no-floppy --fs-uuid --set=${device_variable} ${fs_uuid}"
fi
fi
IFS="$old_ifs"
diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
index 5531239eb..49eccbeaf 100644
--- a/util/grub.d/10_linux.in
+++ b/util/grub.d/10_linux.in
@@ -91,6 +91,244 @@ if [ "x$SUSE_REMOVE_LINUX_ROOT_PARAM" = "xtrue" ]; then
LINUX_ROOT_DEVICE=""
fi
+populate_header_warn()
+{
+if [ "x${BLS_POPULATE_MENU}" = "xtrue" ]; then
+ bls_parser="10_linux script"
+else
+ bls_parser="blscfg command"
+fi
+cat <<EOF
+
+# This section was generated by a script. Do not modify the generated file - all changes
+# will be lost the next time file is regenerated. Instead edit the BootLoaderSpec files.
+#
+# The $bls_parser parses the BootLoaderSpec files stored in /boot/loader/entries and
+# populates the boot menu. Please refer to the Boot Loader Specification documentation
+# for the files format: https://systemd.io/BOOT_LOADER_SPECIFICATION/.
+
+EOF
+}
+
+read_config()
+{
+ config_file=${1}
+ title=""
+ initrd=""
+ options=""
+ linux=""
+ grub_arg=""
+
+ while read -r line
+ do
+ record=$(echo ${line} | cut -f 1 -d ' ')
+ value=$(echo ${line} | cut -s -f2- -d ' ')
+ case "${record}" in
+ "title")
+ title=${value}
+ ;;
+ "initrd")
+ initrd=${value}
+ ;;
+ "linux")
+ linux=${value}
+ ;;
+ "options")
+ options=${value}
+ ;;
+ "grub_arg")
+ grub_arg=${value}
+ ;;
+ esac
+ done < ${config_file}
+}
+
+blsdir="/boot/loader/entries"
+
+get_sorted_bls()
+{
+ if ! [ -d "${blsdir}" ]; then
+ return
+ fi
+
+ local IFS=$'\n'
+
+ files=($(for bls in ${blsdir}/*.conf; do
+ if ! [[ -e "${bls}" ]] ; then
+ continue
+ fi
+ bls="${bls%.conf}"
+ bls="${bls##*/}"
+ echo "${bls}"
+ done | ${kernel_sort} 2>/dev/null | tac)) || :
+
+ echo "${files[@]}"
+}
+
+update_bls_cmdline()
+{
+ local cmdline="root=${LINUX_ROOT_DEVICE} ro ${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
+ local -a files=($(get_sorted_bls))
+
+ for bls in "${files[@]}"; do
+ local options="${cmdline}"
+ if [ -z "${bls##*debug*}" ]; then
+ options="${options} ${GRUB_CMDLINE_LINUX_DEBUG}"
+ fi
+ options="$(echo "${options}" | sed -e 's/\//\\\//g')"
+ sed -i -e "s/^options.*/options ${options}/" "${blsdir}/${bls}.conf"
+ done
+}
+
+populate_menu()
+{
+ local -a files=($(get_sorted_bls))
+
+ gettext_printf "Generating boot entries from BLS files...\n" >&2
+
+ for bls in "${files[@]}"; do
+ read_config "${blsdir}/${bls}.conf"
+
+ menu="${menu}menuentry '${title}' ${grub_arg} --id=${bls} {\n"
+ menu="${menu}\t linux ${linux} ${options}\n"
+ if [ -n "${initrd}" ] ; then
+ menu="${menu}\t initrd ${boot_prefix}${initrd}\n"
+ fi
+ menu="${menu}}\n\n"
+ done
+ # The printf command seems to be more reliable across shells for special character (\n, \t) evaluation
+ printf "$menu"
+}
+
+# Make BLS the default if GRUB_ENABLE_BLSCFG was not set and grubby is not installed.
+if [ -z "${GRUB_ENABLE_BLSCFG}" ] && ! command -v new-kernel-pkg >/dev/null; then
+ GRUB_ENABLE_BLSCFG="true"
+fi
+
+if [ "x${GRUB_ENABLE_BLSCFG}" = "xtrue" ]; then
+ if [ x$dirname = x/ ]; then
+ if [ -z "${prepare_root_cache}" ]; then
+ prepare_grub_to_access_device ${GRUB_DEVICE}
+ fi
+ else
+ if [ -z "${prepare_boot_cache}" ]; then
+ prepare_grub_to_access_device ${GRUB_DEVICE_BOOT}
+ fi
+ fi
+
+ if [ -d /sys/firmware/efi ]; then
+ bootefi_device="`${grub_probe} --target=device /boot/efi/`"
+ prepare_grub_to_access_device_with_variable boot ${bootefi_device}
+ else
+ boot_device="`${grub_probe} --target=device /boot/`"
+ prepare_grub_to_access_device_with_variable boot ${boot_device}
+ fi
+
+ arch="$(uname -m)"
+ if [ "x${arch}" = "xppc64le" ] && [ -d /sys/firmware/opal ]; then
+
+ BLS_POPULATE_MENU="true"
+ petitboot_path="/sys/firmware/devicetree/base/ibm,firmware-versions/petitboot"
+
+ if test -e ${petitboot_path}; then
+ read -r -d '' petitboot_version < ${petitboot_path}
+ petitboot_version="$(echo ${petitboot_version//v})"
+
+ if test -n ${petitboot_version}; then
+ major_version="$(echo ${petitboot_version} | cut -d . -f1)"
+ minor_version="$(echo ${petitboot_version} | cut -d . -f2)"
+
+ re='^[0-9]+$'
+ if [[ $major_version =~ $re ]] && [[ $minor_version =~ $re ]] &&
+ ([[ ${major_version} -gt 1 ]] ||
+ [[ ${major_version} -eq 1 &&
+ ${minor_version} -ge 8 ]]); then
+ BLS_POPULATE_MENU="false"
+ fi
+ fi
+ fi
+ fi
+
+ populate_header_warn
+
+ cat << EOF
+# The kernelopts variable should be defined in the grubenv file. But to ensure that menu
+# entries populated from BootLoaderSpec files that use this variable work correctly even
+# without a grubenv file, define a fallback kernelopts variable if this has not been set.
+#
+# The kernelopts variable in the grubenv file can be modified using the grubby tool or by
+# executing the grub2-mkconfig tool. For the latter, the values of the GRUB_CMDLINE_LINUX
+# and GRUB_CMDLINE_LINUX_DEFAULT options from /etc/default/grub file are used to set both
+# the kernelopts variable in the grubenv file and the fallback kernelopts variable.
+if [ -z "\${kernelopts}" ]; then
+ set kernelopts="root=${LINUX_ROOT_DEVICE} ro ${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
+fi
+EOF
+
+ update_bls_cmdline
+
+ if [ "x${BLS_POPULATE_MENU}" = "xtrue" ]; then
+ populate_menu
+ else
+ cat << EOF
+
+insmod blscfg
+blscfg
+EOF
+ fi
+
+ if [ "x${GRUB_GRUBENV_UPDATE}" = "xyes" ]; then
+ blsdir="/boot/loader/entries"
+ [ -d "${blsdir}" ] && GRUB_BLS_FS="$(${grub_probe} --target=fs ${blsdir})"
+ if [ "x${GRUB_BLS_FS}" = "xbtrfs" ] || [ "x${GRUB_BLS_FS}" = "xzfs" ]; then
+ blsdir=$(make_system_path_relative_to_its_root "${blsdir}")
+ if [ "x${blsdir}" != "x/loader/entries" ] && [ "x${blsdir}" != "x/boot/loader/entries" ]; then
+ ${grub_editenv} - set blsdir="${blsdir}"
+ fi
+ fi
+
+ if [ -n "${GRUB_EARLY_INITRD_LINUX_CUSTOM}" ]; then
+ ${grub_editenv} - set early_initrd="${GRUB_EARLY_INITRD_LINUX_CUSTOM}"
+ fi
+
+ if [ -n "${GRUB_DEFAULT_DTB}" ]; then
+ ${grub_editenv} - set devicetree="${GRUB_DEFAULT_DTB}"
+ fi
+
+ if [ -n "${GRUB_SAVEDEFAULT}" ]; then
+ ${grub_editenv} - set save_default="${GRUB_SAVEDEFAULT}"
+ fi
+ fi
+
+ exit 0
+fi
+
+mktitle ()
+{
+ local title_type
+ local version
+ local OS_NAME
+ local OS_VERS
+
+ title_type=$1 && shift
+ version=$1 && shift
+
+ OS_NAME="$(eval $(grep ^NAME= /etc/os-release) ; echo ${NAME})"
+ OS_VERS="$(eval $(grep ^VERSION= /etc/os-release) ; echo ${VERSION})"
+
+ case $title_type in
+ recovery)
+ title=$(printf '%s (%s) %s (recovery mode)' \
+ "${OS_NAME}" "${version}" "${OS_VERS}")
+ ;;
+ *)
+ title=$(printf '%s (%s) %s' \
+ "${OS_NAME}" "${version}" "${OS_VERS}")
+ ;;
+ esac
+ echo -n ${title}
+}
+
title_correction_code=
hotkey=1
@@ -124,6 +362,7 @@ linux_entry ()
if [ -z "$boot_device_id" ]; then
boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")"
fi
+
if [ x$type != xsimple ] ; then
case $type in
recovery)
@@ -298,6 +537,7 @@ fi
is_top_level=true
for linux in ${reverse_sorted_list}; do
gettext_printf "Found linux image: %s\n" "$linux" >&2
+
basename=`basename $linux`
dirname=`dirname $linux`
rel_dirname=`make_system_path_relative_to_its_root $dirname`
@@ -348,7 +588,9 @@ for linux in ${reverse_sorted_list}; do
for i in ${initrd}; do
initrd_display="${initrd_display} ${dirname}/${i}"
done
- gettext_printf "Found initrd image: %s\n" "$(echo $initrd_display)" >&2
+ if [ "x${GRUB_ENABLE_BLSCFG}" != "xtrue" ]; then
+ gettext_printf "Found initrd image: %s\n" "$(echo $initrd_display)" >&2
+ fi
fi
config=
--
2.44.0
++++++ 0003-Add-grub2-switch-to-blscfg.patch ++++++
From 90153f1c9631498723450d84e014e25865fecc1b Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones(a)redhat.com>
Date: Thu, 15 Mar 2018 14:12:40 -0400
Subject: [PATCH 3/9] Add grub2-switch-to-blscfg
Signed-off-by: Peter Jones <pjones(a)redhat.com>
Signed-off-by: Javier Martinez Canillas <javierm(a)redhat.com>
[jhlavac: Use ${etcdefaultgrub} instead of /etc/default/grub]
Signed-off-by: Jan Hlavac <jhlavac(a)redhat.com>
[rharwood: skip on ostree installations, migrate man to h2m]
Signed-off-by: Robbie Harwood <rharwood(a)redhat.com>
---
Makefile.util.def | 7 +
docs/man/grub-switch-to-blscfg.h2m | 2 +
util/grub-switch-to-blscfg.in | 317 +++++++++++++++++++++++++++++
util/grub.d/10_linux.in | 2 +-
4 files changed, 327 insertions(+), 1 deletion(-)
create mode 100644 docs/man/grub-switch-to-blscfg.h2m
create mode 100644 util/grub-switch-to-blscfg.in
diff --git a/Makefile.util.def b/Makefile.util.def
index 6bb30c165..ffedea24a 100644
--- a/Makefile.util.def
+++ b/Makefile.util.def
@@ -1460,6 +1460,13 @@ program = {
ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
};
+script = {
+ name = grub-switch-to-blscfg;
+ common = util/grub-switch-to-blscfg.in;
+ mansection = 8;
+ installdir = sbin;
+};
+
program = {
name = grub-glue-efi;
mansection = 1;
diff --git a/docs/man/grub-switch-to-blscfg.h2m b/docs/man/grub-switch-to-blscfg.h2m
new file mode 100644
index 000000000..fa341426a
--- /dev/null
+++ b/docs/man/grub-switch-to-blscfg.h2m
@@ -0,0 +1,2 @@
+[NAME]
+grub-switch-to-blscfg \- switch to using BLS config files
diff --git a/util/grub-switch-to-blscfg.in b/util/grub-switch-to-blscfg.in
new file mode 100644
index 000000000..a851424be
--- /dev/null
+++ b/util/grub-switch-to-blscfg.in
@@ -0,0 +1,317 @@
+#! /bin/sh
+#
+# Set a default boot entry for GRUB.
+# Copyright (C) 2004,2009 Free Software Foundation, Inc.
+#
+# GRUB is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# GRUB is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GRUB. If not, see <http://www.gnu.org/licenses/>.
+
+#set -eu
+
+# Initialize some variables.
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+sbindir=@sbindir@
+bindir=@bindir@
+sysconfdir="@sysconfdir@"
+PACKAGE_NAME=@PACKAGE_NAME@
+PACKAGE_VERSION=@PACKAGE_VERSION@
+datarootdir="@datarootdir@"
+datadir="@datadir@"
+if [ ! -v pkgdatadir ]; then
+ pkgdatadir="${datadir}/@PACKAGE@"
+fi
+
+self=`basename $0`
+
+grub_get_kernel_settings="${sbindir}/@grub_get_kernel_settings@"
+grub_editenv=${bindir}/@grub_editenv@
+etcdefaultgrub=/etc/default/grub
+
+eval "$("${grub_get_kernel_settings}")" || true
+
+EFIDIR=$(grep ^ID= /etc/os-release | sed -e 's/^ID=//' -e 's/rhel/redhat/' -e 's/\"//g')
+if [ -d /sys/firmware/efi/efivars/ ]; then
+ startlink=/etc/grub2-efi.cfg
+ grubdir=`echo "/@bootdirname@/efi/EFI/${EFIDIR}/" | sed 's,//*,/,g'`
+else
+ startlink=/etc/grub2.cfg
+ grubdir=`echo "/@bootdirname@/@grubdirname@" | sed 's,//*,/,g'`
+fi
+
+blsdir=`echo "/@bootdirname@/loader/entries" | sed 's,//*,/,g'`
+
+backupsuffix=.bak
+
+arch="$(uname -m)"
+
+export TEXTDOMAIN=@PACKAGE@
+export TEXTDOMAINDIR="@localedir@"
+
+. "${pkgdatadir}/grub-mkconfig_lib"
+
+# Usage: usage
+# Print the usage.
+usage () {
+ gettext_printf "Usage: %s\n" "$self"
+ gettext "Switch to BLS config files.\n"; echo
+ echo
+ print_option_help "-h, --help" "$(gettext "print this message and exit")"
+ print_option_help "-V, --version" "$(gettext "print the version information and exit")"
+ echo
+ print_option_help "--backup-suffix=$(gettext "SUFFIX")" "$backupsuffix"
+ print_option_help "--bls-directory=$(gettext "DIR")" "$blsdir"
+ print_option_help "--config-file=$(gettext "FILE")" "$startlink"
+ print_option_help "--grub-defaults=$(gettext "FILE")" "$etcdefaultgrub"
+ print_option_help "--grub-directory=$(gettext "DIR")" "$grubdir"
+ # echo
+ # gettext "Report bugs to <bug-grub(a)gnu.org>."; echo
+}
+
+argument () {
+ opt=$1
+ shift
+
+ if test $# -eq 0; then
+ gettext_printf "%s: option requires an argument -- \`%s'\n" "$self" "$opt" 1>&2
+ exit 1
+ fi
+ echo $1
+}
+
+# Check the arguments.
+while test $# -gt 0
+do
+ option=$1
+ shift
+
+ case "$option" in
+ -h | --help)
+ usage
+ exit 0 ;;
+ -V | --version)
+ echo "$self (${PACKAGE_NAME}) ${PACKAGE_VERSION}"
+ exit 0 ;;
+
+ --backup-suffix)
+ backupsuffix=`argument $option "$@"`
+ shift
+ ;;
+ --backup-suffix=*)
+ backupsuffix=`echo "$option" | sed 's/--backup-suffix=//'`
+ ;;
+
+ --bls-directory)
+ blsdir=`argument $option "$@"`
+ shift
+ ;;
+ --bls-directory=*)
+ blsdir=`echo "$option" | sed 's/--bls-directory=//'`
+ ;;
+
+ --config-file)
+ startlink=`argument $option "$@"`
+ shift
+ ;;
+ --config-file=*)
+ startlink=`echo "$option" | sed 's/--config-file=//'`
+ ;;
+
+ --grub-defaults)
+ etcdefaultgrub=`argument $option "$@"`
+ shift
+ ;;
+ --grub-defaults=*)
+ etcdefaultgrub=`echo "$option" | sed 's/--grub-defaults=//'`
+ ;;
+
+ --grub-directory)
+ grubdir=`argument $option "$@"`
+ shift
+ ;;
+ --grub-directory=*)
+ grubdir=`echo "$option" | sed 's/--grub-directory=//'`
+ ;;
+
+ *)
+ gettext_printf "Unrecognized option \`%s'\n" "$option" 1>&2
+ usage
+ exit 1
+ ;;
+ esac
+done
+
+find_grub_cfg() {
+ local candidate=""
+ while [ -e "${candidate}" -o $# -gt 0 ]
+ do
+ if [ ! -e "${candidate}" ] ; then
+ candidate="$1"
+ shift
+ fi
+
+ if [ -L "${candidate}" ]; then
+ candidate="$(realpath "${candidate}")"
+ fi
+
+ if [ -f "${candidate}" ]; then
+ export GRUB_CONFIG_FILE="${candidate}"
+ return 0
+ fi
+ done
+ return 1
+}
+
+if ! find_grub_cfg ${startlink} ${grubdir}/grub.cfg ; then
+ gettext_printf "Couldn't find config file\n" 1>&2
+ exit 1
+fi
+
+if [ ! -d "${blsdir}" ]; then
+ install -m 700 -d "${blsdir}"
+fi
+
+if [ -f /etc/machine-id ]; then
+ MACHINE_ID=$(cat /etc/machine-id)
+else
+ MACHINE_ID=$(dmesg | sha256sum)
+fi
+
+mkbls() {
+ local kernelver=$1 && shift
+ local datetime=$1 && shift
+ local kernelopts=$1 && shift
+
+ local debugname=""
+ local debugid=""
+ local flavor=""
+
+ if [ "$kernelver" == *\+* ] ; then
+ local flavor=-"${kernelver##*+}"
+ if [ "${flavor}" == "-debug" ]; then
+ local debugname=" with debugging"
+ local debugid="-debug"
+ fi
+ fi
+ (
+ source /etc/os-release
+
+ cat <<EOF
+title ${NAME} (${kernelver}) ${VERSION}${debugname}
+version ${kernelver}${debugid}
+linux /vmlinuz-${kernelver}
+initrd /initramfs-${kernelver}.img
+options ${kernelopts}
+grub_users \$grub_users
+grub_arg --unrestricted
+grub_class kernel${flavor}
+EOF
+ ) | cat
+}
+
+copy_bls() {
+ for kernelver in $(cd /lib/modules/ ; ls -1) "" ; do
+ bls_target="${blsdir}/${MACHINE_ID}-${kernelver}.conf"
+ linux="/vmlinuz-${kernelver}"
+ linux_path="/boot${linux}"
+ kernel_dir="/lib/modules/${kernelver}"
+
+ if [ ! -d "${kernel_dir}" ] ; then
+ continue
+ fi
+ if [ ! -f "${linux_path}" ]; then
+ continue
+ fi
+
+ linux_relpath="$("${grub_mkrelpath}" "${linux_path}")"
+ bootprefix="${linux_relpath%%"${linux}"}"
+ cmdline="root=${LINUX_ROOT_DEVICE} ro ${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
+
+ mkbls "${kernelver}" \
+ "$(date -u +%Y%m%d%H%M%S -d "$(stat -c '%y' "${kernel_dir}")")" \
+ "${bootprefix}" "${cmdline}" >"${bls_target}"
+
+ if [ "x$GRUB_LINUX_MAKE_DEBUG" = "xtrue" ]; then
+ bls_debug="$(echo ${bls_target} | sed -e "s/${kernelver}/${kernelver}~debug/")"
+ cp -aT "${bls_target}" "${bls_debug}"
+ title="$(grep '^title[ \t]' "${bls_debug}" | sed -e 's/^title[ \t]*//')"
+ options="$(echo "${cmdline} ${GRUB_CMDLINE_LINUX_DEBUG}" | sed -e 's/\//\\\//g')"
+ sed -i -e "s/^title.*/title ${title}${GRUB_LINUX_DEBUG_TITLE_POSTFIX}/" "${bls_debug}"
+ sed -i -e "s/^options.*/options ${options}/" "${bls_debug}"
+ fi
+ done
+
+ if [ -f "/boot/vmlinuz-0-rescue-${MACHINE_ID}" ]; then
+ mkbls "0-rescue-${MACHINE_ID}" "0" "${bootprefix}" >"${blsdir}/${MACHINE_ID}-0-rescue.conf"
+ fi
+}
+
+# The grub2 EFI binary is not copied to the ESP as a part of an ostree
+# transaction. Make sure a grub2 version with BLS support is installed
+# but only do this if the blsdir is not set, to make sure that the BLS
+# parsing module will search for the BLS snippets in the default path.
+if test -f /run/ostree-booted && test -d /sys/firmware/efi/efivars && \
+ ! ${grub_editenv} - list | grep -q blsdir && \
+ mountpoint -q /boot; then
+ grub_binary="$(find /usr/lib/ostree-boot/efi/EFI/${EFIDIR}/ -name grub*.efi)"
+ install -m 700 ${grub_binary} ${grubdir} || exit 1
+ # Create a hidden file to indicate that grub2 now has BLS support.
+ touch /boot/grub2/.grub2-blscfg-supported
+fi
+
+GENERATE=0
+if grep '^GRUB_ENABLE_BLSCFG=.*' "${etcdefaultgrub}" \
+ | grep -vq '^GRUB_ENABLE_BLSCFG="*true"*\s*$' ; then
+ if ! sed -i"${backupsuffix}" \
+ -e 's,^GRUB_ENABLE_BLSCFG=.*,GRUB_ENABLE_BLSCFG=true,' \
+ "${etcdefaultgrub}" ; then
+ gettext_printf "Updating %s failed\n" "${etcdefaultgrub}"
+ exit 1
+ fi
+ GENERATE=1
+elif ! grep -q '^GRUB_ENABLE_BLSCFG=.*' "${etcdefaultgrub}" ; then
+ if ! echo 'GRUB_ENABLE_BLSCFG=true' >> "${etcdefaultgrub}" ; then
+ gettext_printf "Updating %s failed\n" "${etcdefaultgrub}"
+ exit 1
+ fi
+ GENERATE=1
+fi
+
+if [ "${GENERATE}" -eq 1 ] ; then
+ copy_bls
+
+ if [ $arch = "x86_64" ] && [ ! -d /sys/firmware/efi ]; then
+ mod_dir="i386-pc"
+ elif [ $arch = "ppc64" -o $arch = "ppc64le" ] && [ ! -d /sys/firmware/opal ]; then
+ mod_dir="powerpc-ieee1275"
+ fi
+
+ if [ -n "${mod_dir}" ]; then
+ for mod in blscfg increment; do
+ install -m 700 ${prefix}/lib/grub/${mod_dir}/${mod}.mod ${grubdir}/$mod_dir/ || exit 1
+ done
+ fi
+
+ cp -af "${GRUB_CONFIG_FILE}" "${GRUB_CONFIG_FILE}${backupsuffix}"
+ if ! grub2-mkconfig -o "${GRUB_CONFIG_FILE}" ; then
+ install -m 700 "${GRUB_CONFIG_FILE}${backupsuffix}" "${GRUB_CONFIG_FILE}"
+ sed -i"${backupsuffix}" \
+ -e 's,^GRUB_ENABLE_BLSCFG=.*,GRUB_ENABLE_BLSCFG=false,' \
+ "${etcdefaultgrub}"
+ gettext_printf "Updating %s failed\n" "${GRUB_CONFIG_FILE}"
+ exit 1
+ fi
+fi
+
+# Bye.
+exit 0
diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
index 49eccbeaf..45eefb332 100644
--- a/util/grub.d/10_linux.in
+++ b/util/grub.d/10_linux.in
@@ -147,7 +147,7 @@ blsdir="/boot/loader/entries"
get_sorted_bls()
{
- if ! [ -d "${blsdir}" ]; then
+ if ! [ -d "${blsdir}" ] || [ -f /run/ostree-booted ] || [ -d /ostree/repo ]; then
return
fi
--
2.44.0
++++++ 0004-blscfg-Don-t-root-device-in-emu-builds.patch ++++++
From 2fccb958910afaaf03cbec1a6b98ad197d088ad4 Mon Sep 17 00:00:00 2001
From: Robbie Harwood <rharwood(a)redhat.com>
Date: Thu, 25 Aug 2022 17:57:55 -0400
Subject: [PATCH 4/9] blscfg: Don't root device in emu builds
Otherwise, we end up looking for kernel/initrd in /boot/boot which
doesn't work at all. Non-emu builds need to be looking in
($root)/boot/, which is what this is for.
Signed-off-by: Robbie Harwood <rharwood(a)redhat.com>
---
grub-core/commands/blscfg.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/grub-core/commands/blscfg.c b/grub-core/commands/blscfg.c
index 7132555df..150ca96f4 100644
--- a/grub-core/commands/blscfg.c
+++ b/grub-core/commands/blscfg.c
@@ -41,7 +41,7 @@ GRUB_MOD_LICENSE ("GPLv3+");
#define GRUB_BLS_CONFIG_PATH "/loader/entries/"
#ifdef GRUB_MACHINE_EMU
-#define GRUB_BOOT_DEVICE "/boot"
+#define GRUB_BOOT_DEVICE ""
#else
#define GRUB_BOOT_DEVICE "($root)"
#endif
--
2.44.0
++++++ 0005-blscfg-check-for-mounted-boot-in-emu.patch ++++++
From 6d33393fd3c538aaead2698777c02d6d6d0221c9 Mon Sep 17 00:00:00 2001
From: Robbie Harwood <rharwood(a)redhat.com>
Date: Tue, 7 Mar 2023 18:59:40 -0500
Subject: [PATCH 5/9] blscfg: check for mounted /boot in emu
Irritatingly, BLS defines paths relatives to the mountpoint of the
filesystem which contains its snippets, not / or any other fixed
location. So grub2-emu needs to know whether /boot is a separate
filesysem from / and conditionally prepend a path.
Signed-off-by: Robbie Harwood <rharwood(a)redhat.com>
---
grub-core/commands/blscfg.c | 54 +++++++++++++++++++++++++++++++++----
1 file changed, 49 insertions(+), 5 deletions(-)
diff --git a/grub-core/commands/blscfg.c b/grub-core/commands/blscfg.c
index 150ca96f4..6495891b9 100644
--- a/grub-core/commands/blscfg.c
+++ b/grub-core/commands/blscfg.c
@@ -40,8 +40,9 @@ GRUB_MOD_LICENSE ("GPLv3+");
#include "loadenv.h"
#define GRUB_BLS_CONFIG_PATH "/loader/entries/"
+
#ifdef GRUB_MACHINE_EMU
-#define GRUB_BOOT_DEVICE ""
+#define GRUB_BOOT_DEVICE "/boot"
#else
#define GRUB_BOOT_DEVICE "($root)"
#endif
@@ -54,8 +55,50 @@ struct keyval
static struct bls_entry *entries = NULL;
+/* Cache probing in frob_boot_device(). Used for linux entry also.
+ * Always true in non-emu, meaning to prefix things with GRUB_BOOT_DEVICE. */
+static int separate_boot = -1;
+
#define FOR_BLS_ENTRIES(var) FOR_LIST_ELEMENTS (var, entries)
+/* BLS appears to make paths relative to the filesystem that snippets are
+ * on, not /. Attempt to cope. */
+static char *frob_boot_device(char *tmp)
+{
+#ifdef GRUB_MACHINE_EMU
+ grub_file_t f;
+ char *line = NULL;
+
+ if (separate_boot != -1)
+ goto probed;
+
+ separate_boot = 0;
+
+ f = grub_file_open ("/proc/mounts", GRUB_FILE_TYPE_CONFIG);
+ if (f == NULL)
+ goto probed;
+
+ while ((line = grub_file_getline (f)))
+ {
+ if (grub_strstr (line, " " GRUB_BOOT_DEVICE " "))
+ {
+ separate_boot = 1;
+ grub_free (line);
+ break;
+ }
+
+ grub_free(line);
+ }
+
+ grub_file_close (f);
+ probed:
+ if (!separate_boot)
+ return grub_stpcpy (tmp, " ");
+#endif
+
+ return grub_stpcpy (tmp, " " GRUB_BOOT_DEVICE);
+}
+
static int bls_add_keyval(struct bls_entry *entry, char *key, char *val)
{
char *k, *v;
@@ -842,7 +885,7 @@ static void create_entry (struct bls_entry *entry)
for (i = 0; early_initrds != NULL && early_initrds[i] != NULL; i++)
{
grub_dprintf ("blscfg", "adding early initrd %s\n", early_initrds[i]);
- tmp = grub_stpcpy (tmp, " " GRUB_BOOT_DEVICE);
+ tmp = frob_boot_device (tmp);
tmp = grub_stpcpy (tmp, initrd_prefix);
tmp = grub_stpcpy (tmp, early_initrds[i]);
grub_free(early_initrds[i]);
@@ -851,7 +894,7 @@ static void create_entry (struct bls_entry *entry)
for (i = 0; initrds != NULL && initrds[i] != NULL; i++)
{
grub_dprintf ("blscfg", "adding initrd %s\n", initrds[i]);
- tmp = grub_stpcpy (tmp, " " GRUB_BOOT_DEVICE);
+ tmp = frob_boot_device (tmp);
tmp = grub_stpcpy (tmp, initrds[i]);
}
tmp = grub_stpcpy (tmp, "\n");
@@ -888,7 +931,7 @@ static void create_entry (struct bls_entry *entry)
}
char *tmp = dt;
tmp = grub_stpcpy (dt, "devicetree");
- tmp = grub_stpcpy (tmp, " " GRUB_BOOT_DEVICE);
+ tmp = frob_boot_device (tmp);
if (add_dt_prefix)
tmp = grub_stpcpy (tmp, prefix);
tmp = grub_stpcpy (tmp, devicetree);
@@ -907,7 +950,8 @@ static void create_entry (struct bls_entry *entry)
"linux %s%s%s%s\n"
"%s%s",
savedefault ? "savedefault\n" : "",
- GRUB_BOOT_DEVICE, clinux, options ? " " : "", options ? options : "",
+ separate_boot ? GRUB_BOOT_DEVICE : "",
+ clinux, options ? " " : "", options ? options : "",
initrd ? initrd : "", dt ? dt : "");
grub_normal_add_menu_entry (argc, argv, classes, id, users, hotkey, NULL, src, 0, 0, &index, entry);
--
2.44.0
++++++ 0006-Follow-the-device-where-blscfg-is-discovered.patch ++++++
From 6523d493b0772316a3fbb249eb070ada5d266a98 Mon Sep 17 00:00:00 2001
From: Michael Chang <mchang(a)suse.com>
Date: Wed, 28 Jun 2023 14:32:40 +0800
Subject: [PATCH 6/9] Follow the device where blscfg is discovered
Previously, the code assumed that GRUB_BOOT_DEVICE "($root)" was always
the correct device for the discovered bls menu. However, this assumption
could lead to inaccuracies when attempting to load bls for devices other
than $root.
This patch introduces a more robust approach by utilizing the `struct
find_entry_info *info->devid` parameter, representing the device used to
discover the bls directory. This change ensures consistency in
subsequent translations to native GRUB commands, eliminating potential
discrepancies in device identification during the blscfg process.
Signed-off-by: Michael Chang <mchang(a)suse.com>
---
grub-core/commands/blscfg.c | 40 +++++++++++++++++++++++++------------
include/grub/menu.h | 1 +
2 files changed, 28 insertions(+), 13 deletions(-)
diff --git a/grub-core/commands/blscfg.c b/grub-core/commands/blscfg.c
index 6495891b9..c872bcef0 100644
--- a/grub-core/commands/blscfg.c
+++ b/grub-core/commands/blscfg.c
@@ -55,15 +55,18 @@ struct keyval
static struct bls_entry *entries = NULL;
-/* Cache probing in frob_boot_device(). Used for linux entry also.
- * Always true in non-emu, meaning to prefix things with GRUB_BOOT_DEVICE. */
-static int separate_boot = -1;
-
#define FOR_BLS_ENTRIES(var) FOR_LIST_ELEMENTS (var, entries)
/* BLS appears to make paths relative to the filesystem that snippets are
* on, not /. Attempt to cope. */
-static char *frob_boot_device(char *tmp)
+#ifdef GRUB_MACHINE_EMU
+/* Cache probing in frob_boot_device(). Used for linux entry also.
+ * Unused in non-emu, meaning to prefix things with device of parent blsdir. */
+static int separate_boot = -1;
+static char *frob_boot_device(char *tmp, const char *bootdev UNUSED)
+#else
+static char *frob_boot_device(char *tmp, const char *bootdev)
+#endif
{
#ifdef GRUB_MACHINE_EMU
grub_file_t f;
@@ -94,9 +97,11 @@ static char *frob_boot_device(char *tmp)
probed:
if (!separate_boot)
return grub_stpcpy (tmp, " ");
-#endif
-
return grub_stpcpy (tmp, " " GRUB_BOOT_DEVICE);
+#else
+ tmp = grub_stpcpy (tmp, " ");
+ return grub_stpcpy (tmp, bootdev);
+#endif
}
static int bls_add_keyval(struct bls_entry *entry, char *key, char *val)
@@ -568,6 +573,9 @@ static int read_entry (
if (rc < 0)
break;
}
+
+ if (info->devid)
+ entry->devid = grub_strdup(info->devid);
if (!rc)
bls_add_entry(entry);
@@ -772,6 +780,7 @@ static void create_entry (struct bls_entry *entry)
char *id = entry->filename;
char *dotconf = id;
char *hotkey = NULL;
+ char *bootdev = entry->devid ? grub_xasprintf("(%s)", entry->devid) : grub_strdup (GRUB_BOOT_DEVICE);
char *users = NULL;
char **classes = NULL;
@@ -865,12 +874,12 @@ static void create_entry (struct bls_entry *entry)
char *tmp;
for (i = 0; early_initrds != NULL && early_initrds[i] != NULL; i++)
- initrd_size += sizeof (" " GRUB_BOOT_DEVICE) \
+ initrd_size += sizeof (" ") + grub_strlen (bootdev) \
+ grub_strlen(initrd_prefix) \
+ grub_strlen (early_initrds[i]) + 1;
for (i = 0; initrds != NULL && initrds[i] != NULL; i++)
- initrd_size += sizeof (" " GRUB_BOOT_DEVICE) \
+ initrd_size += sizeof (" ") + grub_strlen (bootdev) \
+ grub_strlen (initrds[i]) + 1;
initrd_size += 1;
@@ -885,7 +894,7 @@ static void create_entry (struct bls_entry *entry)
for (i = 0; early_initrds != NULL && early_initrds[i] != NULL; i++)
{
grub_dprintf ("blscfg", "adding early initrd %s\n", early_initrds[i]);
- tmp = frob_boot_device (tmp);
+ tmp = frob_boot_device (tmp, bootdev);
tmp = grub_stpcpy (tmp, initrd_prefix);
tmp = grub_stpcpy (tmp, early_initrds[i]);
grub_free(early_initrds[i]);
@@ -894,7 +903,7 @@ static void create_entry (struct bls_entry *entry)
for (i = 0; initrds != NULL && initrds[i] != NULL; i++)
{
grub_dprintf ("blscfg", "adding initrd %s\n", initrds[i]);
- tmp = frob_boot_device (tmp);
+ tmp = frob_boot_device (tmp, bootdev);
tmp = grub_stpcpy (tmp, initrds[i]);
}
tmp = grub_stpcpy (tmp, "\n");
@@ -916,7 +925,7 @@ static void create_entry (struct bls_entry *entry)
}
}
- dt_size = sizeof("devicetree " GRUB_BOOT_DEVICE) + grub_strlen(devicetree) + 1;
+ dt_size = sizeof("devicetree ") + grub_strlen(bootdev) + grub_strlen(devicetree) + 1;
if (add_dt_prefix)
{
@@ -931,7 +940,7 @@ static void create_entry (struct bls_entry *entry)
}
char *tmp = dt;
tmp = grub_stpcpy (dt, "devicetree");
- tmp = frob_boot_device (tmp);
+ tmp = frob_boot_device (tmp, bootdev);
if (add_dt_prefix)
tmp = grub_stpcpy (tmp, prefix);
tmp = grub_stpcpy (tmp, devicetree);
@@ -950,7 +959,11 @@ static void create_entry (struct bls_entry *entry)
"linux %s%s%s%s\n"
"%s%s",
savedefault ? "savedefault\n" : "",
+#ifdef GRUB_MACHINE_EMU
separate_boot ? GRUB_BOOT_DEVICE : "",
+#else
+ bootdev,
+#endif
clinux, options ? " " : "", options ? options : "",
initrd ? initrd : "", dt ? dt : "");
@@ -969,6 +982,7 @@ finish:
grub_free (args);
grub_free (argv);
grub_free (src);
+ grub_free (bootdev);
}
struct find_entry_info {
diff --git a/include/grub/menu.h b/include/grub/menu.h
index 43080828c..76b191c33 100644
--- a/include/grub/menu.h
+++ b/include/grub/menu.h
@@ -28,6 +28,7 @@ struct bls_entry
int nkeyvals;
char *filename;
int visible;
+ const char *devid;
};
struct grub_menu_entry_class
--
2.44.0
++++++ 0007-grub-switch-to-blscfg-adapt-to-openSUSE.patch ++++++
From 855b3e5cd4d672e961a366ff0f53e3a09a1ad0cc Mon Sep 17 00:00:00 2001
From: Michael Chang <mchang(a)suse.com>
Date: Fri, 30 Jun 2023 14:37:41 +0800
Subject: [PATCH 7/9] grub-switch-to-blscfg: adapt to openSUSE
A few tweaks to make it 'just works' for openSUSE:
- remove RHEL specific $grub_get_kernel_settings and all reference to it.
- make $grubdir and $startlink to the path in openSUSE
- change the bls template to openSUSE
- make $cmdline account for btrfs subvolumes, among others
- remove RHEL specific $GRUB_LINUX_MAKE_DEBUG and all related code
- remove ostree specific hack
- ignore increment.mod
Signed-off-by: Michael Chang <mchang(a)suse.com>
---
util/grub-switch-to-blscfg.in | 144 ++++++++++++++++++++--------------
1 file changed, 87 insertions(+), 57 deletions(-)
diff --git a/util/grub-switch-to-blscfg.in b/util/grub-switch-to-blscfg.in
index a851424be..66ecc0cae 100644
--- a/util/grub-switch-to-blscfg.in
+++ b/util/grub-switch-to-blscfg.in
@@ -34,21 +34,18 @@ fi
self=`basename $0`
-grub_get_kernel_settings="${sbindir}/@grub_get_kernel_settings@"
grub_editenv=${bindir}/@grub_editenv@
-etcdefaultgrub=/etc/default/grub
+grub_probe="${sbindir}/@grub_probe@"
+etcdefaultgrub=${sysconfdir}/default/grub
-eval "$("${grub_get_kernel_settings}")" || true
-
-EFIDIR=$(grep ^ID= /etc/os-release | sed -e 's/^ID=//' -e 's/rhel/redhat/' -e 's/\"//g')
-if [ -d /sys/firmware/efi/efivars/ ]; then
- startlink=/etc/grub2-efi.cfg
- grubdir=`echo "/@bootdirname@/efi/EFI/${EFIDIR}/" | sed 's,//*,/,g'`
-else
- startlink=/etc/grub2.cfg
- grubdir=`echo "/@bootdirname@/@grubdirname@" | sed 's,//*,/,g'`
+if test -f "$etcdefaultgrub" ; then
+ # shellcheck source=/etc/default/grub
+ . "$etcdefaultgrub"
fi
+grubdir=`echo "/@bootdirname@/@grubdirname@" | sed 's,//*,/,g'`
+startlink="${grubdir}/grub.cfg"
+
blsdir=`echo "/@bootdirname@/loader/entries" | sed 's,//*,/,g'`
backupsuffix=.bak
@@ -58,19 +55,80 @@ arch="$(uname -m)"
export TEXTDOMAIN=@PACKAGE@
export TEXTDOMAINDIR="@localedir@"
+# shellcheck source=/usr/share/grub2/grub-mkconfig_lib
. "${pkgdatadir}/grub-mkconfig_lib"
+# FIXME: Abort if grub_probe fails
+
+GRUB_DEVICE="`${grub_probe} --target=device /`"
+GRUB_DEVICE_UUID="`${grub_probe} --device ${GRUB_DEVICE} --target=fs_uuid 2> /dev/null`" || true
+GRUB_DEVICE_PARTUUID="`${grub_probe} --device ${GRUB_DEVICE} --target=partuuid 2> /dev/null`" || true
+GRUB_FS="`${grub_probe} --device ${GRUB_DEVICE} --target=fs 2> /dev/null || echo unknown`"
+
+# loop-AES arranges things so that /dev/loop/X can be our root device, but
+# the initrds that Linux uses don't like that.
+case ${GRUB_DEVICE} in
+ /dev/loop/*|/dev/loop[0-9])
+ GRUB_DEVICE=$(losetup "${GRUB_DEVICE}" | sed -e "s/^[^(]*(\([^)]\+\)).*/\1/")
+ ;;
+esac
+
+# Default to disabling partition uuid support to maintian compatibility with
+# older kernels.
+GRUB_DISABLE_LINUX_PARTUUID=${GRUB_DISABLE_LINUX_PARTUUID-true}
+
+# btrfs may reside on multiple devices. We cannot pass them as value of root= parameter
+# and mounting btrfs requires user space scanning, so force UUID in this case.
+if ( [ "x${GRUB_DEVICE_UUID}" = "x" ] && [ "x${GRUB_DEVICE_PARTUUID}" = "x" ] ) \
+ || ( [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \
+ && [ "x${GRUB_DISABLE_LINUX_PARTUUID}" = "xtrue" ] ) \
+ || ( ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \
+ && ! test -e "/dev/disk/by-partuuid/${GRUB_DEVICE_PARTUUID}" ) \
+ || ( test -e "${GRUB_DEVICE}" && uses_abstraction "${GRUB_DEVICE}" lvm ); then
+ LINUX_ROOT_DEVICE=${GRUB_DEVICE}
+elif [ "x${GRUB_DEVICE_UUID}" = "x" ] \
+ || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ]; then
+ LINUX_ROOT_DEVICE=PARTUUID=${GRUB_DEVICE_PARTUUID}
+else
+ LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
+fi
+
+if [ "x$GRUB_CONMODE" != "x" ]; then
+ GRUB_CMDLINE_LINUX="conmode=${GRUB_CONMODE} ${GRUB_CMDLINE_LINUX}"
+fi
+
+case x"$GRUB_FS" in
+ xbtrfs)
+ if [ "x${SUSE_BTRFS_SNAPSHOT_BOOTING}" != "xtrue" ]; then
+ rootsubvol="`make_system_path_relative_to_its_root /`"
+ rootsubvol="${rootsubvol#/}"
+ if [ "x${rootsubvol}" != x ] && [ "x$SUSE_REMOVE_LINUX_ROOT_PARAM" != "xtrue" ]; then
+ GRUB_CMDLINE_LINUX="rootflags=subvol=${rootsubvol} ${GRUB_CMDLINE_LINUX}"
+ fi
+ fi
+ ;;
+ xzfs)
+ rpool=`${grub_probe} --device ${GRUB_DEVICE} --target=fs_label 2>/dev/null || true`
+ bootfs="`make_system_path_relative_to_its_root / | sed -e "s,@$,,"`"
+ LINUX_ROOT_DEVICE="ZFS=${rpool}${bootfs%/}"
+ ;;
+esac
+
+if [ "x$SUSE_REMOVE_LINUX_ROOT_PARAM" = "xtrue" ]; then
+ LINUX_ROOT_DEVICE=""
+fi
+
# Usage: usage
# Print the usage.
usage () {
gettext_printf "Usage: %s\n" "$self"
- gettext "Switch to BLS config files.\n"; echo
+ gettext "Switch to BLS config files. Only for testing purpose !!!\n"; echo
echo
print_option_help "-h, --help" "$(gettext "print this message and exit")"
print_option_help "-V, --version" "$(gettext "print the version information and exit")"
echo
print_option_help "--backup-suffix=$(gettext "SUFFIX")" "$backupsuffix"
- print_option_help "--bls-directory=$(gettext "DIR")" "$blsdir"
+ print_option_help "--bls-directory=$(gettext "DIR")" "Noop, always $blsdir"
print_option_help "--config-file=$(gettext "FILE")" "$startlink"
print_option_help "--grub-defaults=$(gettext "FILE")" "$etcdefaultgrub"
print_option_help "--grub-directory=$(gettext "DIR")" "$grubdir"
@@ -112,11 +170,15 @@ do
;;
--bls-directory)
- blsdir=`argument $option "$@"`
+ # blsdir=`argument $option "$@"`
+ gettext_printf "WARN: --bls-directory is currently disabled, it's always $blsdir !!!\n"
+ gettext_printf "WARN: use kernel-install instead if you want to test bls directory on ESP !!!\n"
shift
;;
--bls-directory=*)
- blsdir=`echo "$option" | sed 's/--bls-directory=//'`
+ # blsdir=`echo "$option" | sed 's/--bls-directory=//'`
+ gettext_printf "WARN: --bls-directory is currently disabled, it's always $blsdir !!!\n"
+ gettext_printf "WARN: use kernel-install instead if you want to test bls directory on ESP !!!\n"
;;
--config-file)
@@ -172,7 +234,7 @@ find_grub_cfg() {
return 1
}
-if ! find_grub_cfg ${startlink} ${grubdir}/grub.cfg ; then
+if ! find_grub_cfg "${startlink}" ; then
gettext_printf "Couldn't find config file\n" 1>&2
exit 1
fi
@@ -190,27 +252,22 @@ fi
mkbls() {
local kernelver=$1 && shift
local datetime=$1 && shift
+ local prefix=$1 && shift
local kernelopts=$1 && shift
- local debugname=""
- local debugid=""
local flavor=""
if [ "$kernelver" == *\+* ] ; then
local flavor=-"${kernelver##*+}"
- if [ "${flavor}" == "-debug" ]; then
- local debugname=" with debugging"
- local debugid="-debug"
- fi
fi
(
source /etc/os-release
cat <<EOF
-title ${NAME} (${kernelver}) ${VERSION}${debugname}
-version ${kernelver}${debugid}
-linux /vmlinuz-${kernelver}
-initrd /initramfs-${kernelver}.img
+title ${NAME} (${kernelver}) ${VERSION}
+version ${kernelver}$
+linux ${prefix}/vmlinuz-${kernelver}
+initrd ${prefix}/initrd-${kernelver}
options ${kernelopts}
grub_users \$grub_users
grub_arg --unrestricted
@@ -233,42 +290,15 @@ copy_bls() {
continue
fi
- linux_relpath="$("${grub_mkrelpath}" "${linux_path}")"
- bootprefix="${linux_relpath%%"${linux}"}"
+ bootprefix="$(make_system_path_relative_to_its_root /boot)"
cmdline="root=${LINUX_ROOT_DEVICE} ro ${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
mkbls "${kernelver}" \
"$(date -u +%Y%m%d%H%M%S -d "$(stat -c '%y' "${kernel_dir}")")" \
"${bootprefix}" "${cmdline}" >"${bls_target}"
-
- if [ "x$GRUB_LINUX_MAKE_DEBUG" = "xtrue" ]; then
- bls_debug="$(echo ${bls_target} | sed -e "s/${kernelver}/${kernelver}~debug/")"
- cp -aT "${bls_target}" "${bls_debug}"
- title="$(grep '^title[ \t]' "${bls_debug}" | sed -e 's/^title[ \t]*//')"
- options="$(echo "${cmdline} ${GRUB_CMDLINE_LINUX_DEBUG}" | sed -e 's/\//\\\//g')"
- sed -i -e "s/^title.*/title ${title}${GRUB_LINUX_DEBUG_TITLE_POSTFIX}/" "${bls_debug}"
- sed -i -e "s/^options.*/options ${options}/" "${bls_debug}"
- fi
done
-
- if [ -f "/boot/vmlinuz-0-rescue-${MACHINE_ID}" ]; then
- mkbls "0-rescue-${MACHINE_ID}" "0" "${bootprefix}" >"${blsdir}/${MACHINE_ID}-0-rescue.conf"
- fi
}
-# The grub2 EFI binary is not copied to the ESP as a part of an ostree
-# transaction. Make sure a grub2 version with BLS support is installed
-# but only do this if the blsdir is not set, to make sure that the BLS
-# parsing module will search for the BLS snippets in the default path.
-if test -f /run/ostree-booted && test -d /sys/firmware/efi/efivars && \
- ! ${grub_editenv} - list | grep -q blsdir && \
- mountpoint -q /boot; then
- grub_binary="$(find /usr/lib/ostree-boot/efi/EFI/${EFIDIR}/ -name grub*.efi)"
- install -m 700 ${grub_binary} ${grubdir} || exit 1
- # Create a hidden file to indicate that grub2 now has BLS support.
- touch /boot/grub2/.grub2-blscfg-supported
-fi
-
GENERATE=0
if grep '^GRUB_ENABLE_BLSCFG=.*' "${etcdefaultgrub}" \
| grep -vq '^GRUB_ENABLE_BLSCFG="*true"*\s*$' ; then
@@ -297,9 +327,7 @@ if [ "${GENERATE}" -eq 1 ] ; then
fi
if [ -n "${mod_dir}" ]; then
- for mod in blscfg increment; do
- install -m 700 ${prefix}/lib/grub/${mod_dir}/${mod}.mod ${grubdir}/$mod_dir/ || exit 1
- done
+ install -m 700 "${pkgdatadir}/${mod_dir}/blscfg.mod" "${grubdir}/$mod_dir/" || exit 1
fi
cp -af "${GRUB_CONFIG_FILE}" "${GRUB_CONFIG_FILE}${backupsuffix}"
@@ -311,6 +339,8 @@ if [ "${GENERATE}" -eq 1 ] ; then
gettext_printf "Updating %s failed\n" "${GRUB_CONFIG_FILE}"
exit 1
fi
+else
+ gettext_printf "Do nothing because \$GRUB_ENABLE_BLSCFG is already true in %s\n" "${GRUB_CONFIG_FILE}"
fi
# Bye.
--
2.44.0
++++++ 0008-blscfg-reading-bls-fragments-if-boot-present.patch ++++++
From 2b0e6effc31ec166bbbe35a3cd2b4c73051f38bb Mon Sep 17 00:00:00 2001
From: Michael Chang <mchang(a)suse.com>
Date: Fri, 16 Jun 2023 15:54:50 +0800
Subject: [PATCH 8/9] blscfg: reading bls fragments if boot present
The Boot Loader Specification (BLS) designates the EFI System Partition
(ESP) as a primary location for $BOOT, where boot menu entries can be
stored. The specification encourages boot loaders to retrieve menu
entries from the ESP, even when XBOOTLDR is present.
This commit aligns with the BLS specification by introducing the
capability to search for the ESP in addition to the default root
partition or any specified location via blscfg's command line. The $boot
environment variable is utilized as a reference to the ESP device for
the blscfg command. Initialization of $boot in grub.cfg is demonstrated
as follows:
insmod part_gpt
insmod fat
search --no-floppy --fs-uuid --set=boot F414-5A9F
If $boot is unset, no additional search for the BLS location will be
performed.
Signed-off-by: Michael Chang <mchang(a)suse.com>
---
grub-core/commands/blscfg.c | 10 ++++++++++
util/grub.d/10_linux.in | 3 ++-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/grub-core/commands/blscfg.c b/grub-core/commands/blscfg.c
index c872bcef0..cbe2a289e 100644
--- a/grub-core/commands/blscfg.c
+++ b/grub-core/commands/blscfg.c
@@ -1186,6 +1186,7 @@ grub_cmd_blscfg (grub_extcmd_context_t ctxt UNUSED,
char *entry_id = NULL;
bool show_default = true;
bool show_non_default = true;
+ const char *boot = NULL;
if (argc == 1) {
if (grub_strcmp (args[0], "default") == 0) {
@@ -1205,6 +1206,15 @@ grub_cmd_blscfg (grub_extcmd_context_t ctxt UNUSED,
if (r)
return r;
+ boot = grub_env_get("boot");
+ path = (boot) ? grub_xasprintf("(%s)" GRUB_BLS_CONFIG_PATH, boot) : NULL;
+ if (path)
+ {
+ bls_load_entries(path);
+ grub_print_error();
+ }
+ grub_free(path);
+
return bls_create_entries(show_default, show_non_default, entry_id);
}
diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
index 45eefb332..edf0fca55 100644
--- a/util/grub.d/10_linux.in
+++ b/util/grub.d/10_linux.in
@@ -201,7 +201,8 @@ populate_menu()
}
# Make BLS the default if GRUB_ENABLE_BLSCFG was not set and grubby is not installed.
-if [ -z "${GRUB_ENABLE_BLSCFG}" ] && ! command -v new-kernel-pkg >/dev/null; then
+# FIXME: The test should be aligned to openSUSE, grubby is not our default tool
+if [ -z "${GRUB_ENABLE_BLSCFG}" ] && ! command -v new-kernel-pkg >/dev/null && false; then
GRUB_ENABLE_BLSCFG="true"
fi
--
2.44.0
++++++ 0009-10_linux-Some-refinement-for-BLS.patch ++++++
From 72a72facc6cbaf58fda136286af78bbbd48bd88c Mon Sep 17 00:00:00 2001
From: Michael Chang <mchang(a)suse.com>
Date: Wed, 13 Mar 2024 15:26:42 +0800
Subject: [PATCH 9/9] 10_linux: Some refinement for BLS
Remove BLS_POPULATE_MENU as it is not being used currently and removing
kernelopts assignment in the grub boot config itself to fully delegate
the responsibility of generating kernel options to a functioning BLS
generator.
Signed-off-by: Michael Chang <mchang(a)suse.com>
---
util/grub.d/10_linux.in | 29 -----------------------------
1 file changed, 29 deletions(-)
diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
index edf0fca55..7cbff7466 100644
--- a/util/grub.d/10_linux.in
+++ b/util/grub.d/10_linux.in
@@ -93,11 +93,7 @@ fi
populate_header_warn()
{
-if [ "x${BLS_POPULATE_MENU}" = "xtrue" ]; then
- bls_parser="10_linux script"
-else
bls_parser="blscfg command"
-fi
cat <<EOF
# This section was generated by a script. Do not modify the generated file - all changes
@@ -200,11 +196,6 @@ populate_menu()
printf "$menu"
}
-# Make BLS the default if GRUB_ENABLE_BLSCFG was not set and grubby is not installed.
-# FIXME: The test should be aligned to openSUSE, grubby is not our default tool
-if [ -z "${GRUB_ENABLE_BLSCFG}" ] && ! command -v new-kernel-pkg >/dev/null && false; then
- GRUB_ENABLE_BLSCFG="true"
-fi
if [ "x${GRUB_ENABLE_BLSCFG}" = "xtrue" ]; then
if [ x$dirname = x/ ]; then
@@ -252,31 +243,11 @@ if [ "x${GRUB_ENABLE_BLSCFG}" = "xtrue" ]; then
populate_header_warn
- cat << EOF
-# The kernelopts variable should be defined in the grubenv file. But to ensure that menu
-# entries populated from BootLoaderSpec files that use this variable work correctly even
-# without a grubenv file, define a fallback kernelopts variable if this has not been set.
-#
-# The kernelopts variable in the grubenv file can be modified using the grubby tool or by
-# executing the grub2-mkconfig tool. For the latter, the values of the GRUB_CMDLINE_LINUX
-# and GRUB_CMDLINE_LINUX_DEFAULT options from /etc/default/grub file are used to set both
-# the kernelopts variable in the grubenv file and the fallback kernelopts variable.
-if [ -z "\${kernelopts}" ]; then
- set kernelopts="root=${LINUX_ROOT_DEVICE} ro ${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
-fi
-EOF
-
- update_bls_cmdline
-
- if [ "x${BLS_POPULATE_MENU}" = "xtrue" ]; then
- populate_menu
- else
cat << EOF
insmod blscfg
blscfg
EOF
- fi
if [ "x${GRUB_GRUBENV_UPDATE}" = "xyes" ]; then
blsdir="/boot/loader/entries"
--
2.44.0
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package 000update-repos for openSUSE:Factory checked in at 2024-06-07 21:01:58
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/000update-repos (Old)
and /work/SRC/openSUSE:Factory/.000update-repos.new.24587 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "000update-repos"
Fri Jun 7 21:01:58 2024 rev:2514 rq: version:unknown
Changes:
--------
New Changes file:
NO CHANGES FILE!!!
New:
----
factory:non-oss_4038.2.packages.zst
factory_20240606.packages.zst
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
1
0