Compare commits
No commits in common. "rawhide" and "f30" have entirely different histories.
14 changed files with 223 additions and 1152 deletions
13
.gitignore
vendored
13
.gitignore
vendored
|
|
@ -5,5 +5,14 @@ src_vipa-2.0.4.tar.gz
|
|||
/lib-zfcp-hbaapi-2.1.tar.gz
|
||||
/src_vipa-2.1.0.tar.gz
|
||||
/s390-tools-*.tar.bz2
|
||||
/s390-tools-*.tar.gz
|
||||
/s390-tools-*-rust-vendor.tar.xz
|
||||
/s390-tools-2.0.0.tar.gz
|
||||
/s390-tools-2.1.0.tar.gz
|
||||
/s390-tools-2.2.0.tar.gz
|
||||
/s390-tools-2.3.0.tar.gz
|
||||
/s390-tools-2.4.0.tar.gz
|
||||
/s390-tools-2.5.0.tar.gz
|
||||
/s390-tools-2.6.0.tar.gz
|
||||
/s390-tools-2.7.0.tar.gz
|
||||
/s390-tools-2.7.1.tar.gz
|
||||
/s390-tools-2.8.0.tar.gz
|
||||
/s390-tools-2.9.0.tar.gz
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ KERNEL_DIR="${KERNEL_IMAGE%/*}"
|
|||
MACHINE_ID=$KERNEL_INSTALL_MACHINE_ID
|
||||
|
||||
BLS_DIR="/boot/loader/entries"
|
||||
ZIPLCFG="/etc/zipl.conf"
|
||||
CMDLINE_LINUX_DEBUG=" systemd.log_level=debug systemd.log_target=kmsg"
|
||||
LINUX_DEBUG_VERSION_POSTFIX="_with_debugging"
|
||||
LINUX_DEBUG_TITLE_POSTFIX=" with debugging"
|
||||
|
|
@ -54,31 +53,27 @@ EOF
|
|||
case "$COMMAND" in
|
||||
add)
|
||||
if [[ "${KERNEL_DIR}" != "/boot" ]]; then
|
||||
# rename to match the name used in the pseudo-BLS snippet above
|
||||
cp --remove-destination --preserve=timestamps -T "${KERNEL_IMAGE}" "/boot/vmlinuz-${KERNEL_VERSION}"
|
||||
command -v restorecon &>/dev/null && \
|
||||
restorecon -R "/boot/vmlinuz-${KERNEL_VERSION}"
|
||||
|
||||
for i in \
|
||||
"$KERNEL_IMAGE" \
|
||||
"$KERNEL_DIR"/System.map \
|
||||
"$KERNEL_DIR"/config \
|
||||
"$KERNEL_DIR"/zImage.stub
|
||||
do
|
||||
[[ -e "$i" ]] || continue
|
||||
cp --preserve=timestamps -T "$i" "/boot/${i##*/}-${KERNEL_VERSION}"
|
||||
cp -aT "$i" "/boot/${i##*/}-${KERNEL_VERSION}"
|
||||
command -v restorecon &>/dev/null && \
|
||||
restorecon -R "/boot/${i##*/}-${KERNEL_VERSION}"
|
||||
done
|
||||
# hmac is .vmlinuz-<version>.hmac so needs a special treatment
|
||||
i="$KERNEL_DIR/.${KERNEL_IMAGE##*/}.hmac"
|
||||
if [[ -e "$i" ]]; then
|
||||
cp --preserve=timestamps "$i" "/boot/.${KERNEL_IMAGE##*/}-${KERNEL_VERSION}.hmac"
|
||||
cp -a "$i" "/boot/.${KERNEL_IMAGE##*/}-${KERNEL_VERSION}.hmac"
|
||||
command -v restorecon &>/dev/null && \
|
||||
restorecon "/boot/.${KERNEL_IMAGE##*/}-${KERNEL_VERSION}.hmac"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ ! -f /sbin/new-kernel-pkg || -d "${BLS_DIR}" ]]; then
|
||||
if [[ ! -f /sbin/new-kernel-pkg ]]; then
|
||||
declare -a BOOT_OPTIONS
|
||||
if [[ -f /etc/kernel/cmdline ]]; then
|
||||
read -r -d '' -a BOOT_OPTIONS < /etc/kernel/cmdline
|
||||
|
|
@ -87,15 +82,21 @@ case "$COMMAND" in
|
|||
if ! [[ ${BOOT_OPTIONS[*]} ]]; then
|
||||
read -r -d '' -a line < /proc/cmdline
|
||||
for i in "${line[@]}"; do
|
||||
[[ "${i#initrd=*}" != "$i" || "${i#BOOT_IMAGE=*}" != "$i" ]] && continue
|
||||
[[ "${i#initrd=*}" != "$i" ]] && continue
|
||||
BOOT_OPTIONS+=("$i")
|
||||
done
|
||||
fi
|
||||
|
||||
if ! [[ ${BOOT_OPTIONS[*]} ]]; then
|
||||
echo "Could not determine the kernel command line parameters." >&2
|
||||
echo "Please specify the kernel command line in /etc/kernel/cmdline!" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
[[ -d "$BLS_DIR" ]] || mkdir -m 0700 -p "$BLS_DIR"
|
||||
BLS_TARGET="${BLS_DIR}/${MACHINE_ID}-${KERNEL_VERSION}.conf"
|
||||
if [[ -f "${KERNEL_DIR}/bls.conf" ]]; then
|
||||
cp --preserve=timestamps -T "${KERNEL_DIR}/bls.conf" "${BLS_TARGET}" || exit $?
|
||||
cp -aT "${KERNEL_DIR}/bls.conf" "${BLS_TARGET}" || exit $?
|
||||
sed -i -e "s,^linux.*,linux /boot/vmlinuz-${KERNEL_VERSION},g" "${BLS_TARGET}"
|
||||
sed -i -e "s,^initrd.*,initrd /boot/initramfs-${KERNEL_VERSION}.img,g" "${BLS_TARGET}"
|
||||
sed -i -e "s#^options.*#options ${BOOT_OPTIONS[*]}#g" "${BLS_TARGET}"
|
||||
|
|
@ -105,18 +106,9 @@ case "$COMMAND" in
|
|||
"${BOOT_OPTIONS[*]}" >"${BLS_TARGET}"
|
||||
fi
|
||||
|
||||
if [[ "$KERNEL_VERSION" == *\+* ]] && [ "x$DEFAULTDEBUG" != "xyes" ]; then
|
||||
UPDATEDEFAULT="no"
|
||||
fi
|
||||
|
||||
if [[ "x$UPDATEDEFAULT" = "xyes" ]]; then
|
||||
TITLE="$(grep '^title[ \t]' "${BLS_TARGET}" | sed -e 's/^title[ \t]*//')"
|
||||
NEWDEFAULT="${TITLE}"
|
||||
fi
|
||||
|
||||
if [ "x${MAKEDEBUG}" = "xyes" ]; then
|
||||
BLS_DEBUG="$(echo ${BLS_TARGET} | sed -e "s/${KERNEL_VERSION}/${KERNEL_VERSION}~debug/")"
|
||||
cp --preserve=timestamps -T "${BLS_TARGET}" "${BLS_DEBUG}"
|
||||
cp -aT "${BLS_TARGET}" "${BLS_DEBUG}"
|
||||
TITLE="$(grep '^title[ \t]' "${BLS_DEBUG}" | sed -e 's/^title[ \t]*//')"
|
||||
VERSION="$(grep '^version[ \t]' "${BLS_DEBUG}" | sed -e 's/^version[ \t]*//')"
|
||||
BLSID="$(grep '^id[ \t]' "${BLS_DEBUG}" | sed -e "s/${KERNEL_VERSION}/${KERNEL_VERSION}~debug/")"
|
||||
|
|
@ -124,20 +116,8 @@ case "$COMMAND" in
|
|||
sed -i -e "s/^version.*/version ${VERSION}${LINUX_DEBUG_VERSION_POSTFIX}/" "${BLS_DEBUG}"
|
||||
sed -i -e "s/^id.*/${BLSID}/" "${BLS_DEBUG}"
|
||||
sed -i -e "s#^options.*#options ${BOOT_OPTIONS[*]}${CMDLINE_LINUX_DEBUG}#" "${BLS_DEBUG}"
|
||||
if [ -n "$NEWDEFAULT" -a "x$DEFAULTDEBUG" = "xyes" ]; then
|
||||
TITLE="$(grep '^title[ \t]' "${BLS_DEBUG}" | sed -e 's/^title[ \t]*//')"
|
||||
NEWDEFAULT="${TITLE}"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -n "$NEWDEFAULT" ] && [ -f "${ZIPLCFG}" ]; then
|
||||
if grep -q "^default=" "${ZIPLCFG}"; then
|
||||
sed -i -e "s,^default=.*,default=${NEWDEFAULT}," "${ZIPLCFG}"
|
||||
else
|
||||
echo "default=${NEWDEFAULT}" >> "${ZIPLCFG}"
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
|
@ -148,21 +128,10 @@ case "$COMMAND" in
|
|||
exit 77
|
||||
;;
|
||||
remove)
|
||||
if [[ ! -f /sbin/new-kernel-pkg || -d "${BLS_DIR}" ]]; then
|
||||
if [[ ! -f /sbin/new-kernel-pkg ]]; then
|
||||
ARCH="$(uname -m)"
|
||||
BLS_TARGET="${BLS_DIR}/${MACHINE_ID}-${KERNEL_VERSION}.conf"
|
||||
BLS_DEBUG="$(echo ${BLS_TARGET} | sed -e "s/${KERNEL_VERSION}/${KERNEL_VERSION}~debug/")"
|
||||
|
||||
if [ -f "${BLS_TARGET}" ] && [ -f "${ZIPLCFG}" ]; then
|
||||
TITLE="$(grep '^title[ \t]' "${BLS_TARGET}" | sed -e 's/^title[ \t]*//')"
|
||||
sed -i -e "/^default=${TITLE}/d" "${ZIPLCFG}"
|
||||
fi
|
||||
|
||||
if [[ -f "${BLS_DEBUG}" ]]; then
|
||||
TITLE="$(grep '^title[ \t]' "${BLS_DEBUG}" | sed -e 's/^title[ \t]*//')"
|
||||
sed -i -e "/^default=${TITLE}/d" "${ZIPLCFG}"
|
||||
fi
|
||||
|
||||
BLS_DEBUG="$(echo ${BLS_TARGET} | sed -e "s/\.${ARCH}/-debug.${ARCH}/")"
|
||||
rm -f "${BLS_TARGET}" "${BLS_DEBUG}"
|
||||
|
||||
for i in vmlinuz System.map config zImage.stub dtb; do
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ BLS_DIR="/boot/loader/entries"
|
|||
[[ "$KERNEL_VERSION" == *\+* ]] && flavor=-"${KERNEL_VERSION##*+}"
|
||||
case "$COMMAND" in
|
||||
add)
|
||||
if [[ ! -f /sbin/new-kernel-pkg || -d "${BLS_DIR}" ]]; then
|
||||
if [[ ! -f /sbin/new-kernel-pkg ]]; then
|
||||
declare -a BOOT_OPTIONS
|
||||
if [[ -f /etc/kernel/cmdline ]]; then
|
||||
read -r -d '' -a BOOT_OPTIONS < /etc/kernel/cmdline
|
||||
|
|
@ -29,6 +29,12 @@ case "$COMMAND" in
|
|||
done
|
||||
fi
|
||||
|
||||
if ! [[ ${BOOT_OPTIONS[*]} ]]; then
|
||||
echo "Could not determine the kernel command line parameters." >&2
|
||||
echo "Please specify the kernel command line in /etc/kernel/cmdline!" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
BLS_RESCUE="${BLS_DIR}/${MACHINE_ID}-0-rescue.conf"
|
||||
if [[ -f "${BLS_RESCUE}" ]] && grep -q '^options.*$kernelopts' "${BLS_RESCUE}"; then
|
||||
sed -i -e "s,^linux.*,linux /boot/vmlinuz-0-rescue-${MACHINE_ID},g" "${BLS_RESCUE}"
|
||||
|
|
|
|||
13
ccw.udev
13
ccw.udev
|
|
@ -1,4 +1,13 @@
|
|||
ACTION!="add|bind|change", GOTO="ccw_end"
|
||||
ACTION!="add|change", GOTO="ccw_end"
|
||||
SUBSYSTEM!="ccw", GOTO="ccw_end"
|
||||
DRIVER=="ctcm|lcs|qeth", RUN+="ccw_init"
|
||||
ATTRS{cutype}=="1731/01", RUN+="ccw_init"
|
||||
ATTRS{cutype}=="1731/02", RUN+="ccw_init"
|
||||
ATTRS{cutype}=="1731/05", RUN+="ccw_init"
|
||||
ATTRS{cutype}=="1731/06", RUN+="ccw_init"
|
||||
ATTRS{cutype}=="3088/01", RUN+="ccw_init"
|
||||
ATTRS{cutype}=="3088/08", RUN+="ccw_init"
|
||||
ATTRS{cutype}=="3088/60", RUN+="ccw_init"
|
||||
ATTRS{cutype}=="3088/61", RUN+="ccw_init"
|
||||
ATTRS{cutype}=="3088/1e", RUN+="ccw_init"
|
||||
ATTRS{cutype}=="3088/1f", RUN+="ccw_init"
|
||||
LABEL="ccw_end"
|
||||
|
|
|
|||
30
ccw_init
30
ccw_init
|
|
@ -24,25 +24,6 @@ get_config_line_by_subchannel()
|
|||
return 1
|
||||
}
|
||||
|
||||
# borrowed from network-scrips, initscripts along with the get_config_by_subchannel
|
||||
[ -z "$__sed_discard_ignored_files" ] && __sed_discard_ignored_files='/\(~\|\.bak\|\.old\|\.orig\|\.rpmnew\|\.rpmorig\|\.rpmsave\)$/d'
|
||||
|
||||
get_config_by_subchannel ()
|
||||
{
|
||||
LANG=C grep -E -i -l \
|
||||
"^[[:space:]]*SUBCHANNELS=['\"]?([0-9]\.[0-9]\.[a-f0-9]+,){0,2}${1}(,[0-9]\.[0-9]\.[a-f0-9]+){0,2}['\"]?([[:space:]]+#|[[:space:]]*$)" \
|
||||
/etc/sysconfig/network-scripts/ifcfg-* \
|
||||
| LC_ALL=C sed -e "$__sed_discard_ignored_files"
|
||||
}
|
||||
|
||||
get_config_by_subchannel_nm ()
|
||||
{
|
||||
LANG=C grep -E -i -l \
|
||||
"^s390-subchannels=([0-9]\.[0-9]\.[a-f0-9]+;){0,2}${1};([0-9]\.[0-9]\.[a-f0-9]+;){0,2}$" \
|
||||
/etc/NetworkManager/system-connections/*.nmconnection \
|
||||
| LC_ALL=C sed -e "$__sed_discard_ignored_files"
|
||||
}
|
||||
|
||||
CHANNEL=${DEVPATH##*/}
|
||||
|
||||
if [ $MODE = "dracut" ]; then
|
||||
|
|
@ -68,19 +49,14 @@ if [ $MODE = "dracut" ]; then
|
|||
elif [ $MODE = "normal" ]; then
|
||||
NOLOCALE="yes"
|
||||
|
||||
. /etc/sysconfig/network-scripts/network-functions
|
||||
|
||||
CONFIG_FILE=$(get_config_by_subchannel $CHANNEL)
|
||||
|
||||
if [ -n "$CONFIG_FILE" ]; then
|
||||
. $CONFIG_FILE
|
||||
else
|
||||
CONFIG_FILE=$(get_config_by_subchannel_nm $CHANNEL)
|
||||
if [ -n "$CONFIG_FILE" ]; then
|
||||
NETTYPE=$(sed -nr "/^\[ethernet\]/ { :l /^s390-nettype[ ]*=/ { s/.*=[ ]*//; p; q;}; n; b l;}" $CONFIG_FILE)
|
||||
SUBCHANNELS=$(sed -nr "/^\[ethernet\]/ { :l /^s390-subchannels[ ]*=/ { s/.*=[ ]*//; p; q;}; n; b l;}" $CONFIG_FILE | sed -e "s/;/,/g" -e "s/,$//")
|
||||
LAYER2=$(sed -nr "/^\[ethernet-s390-options\]/ { :l /^layer2[ ]*=/ { s/.*=[ ]*//; p; q;}; n; b l;}" $CONFIG_FILE)
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "Unknown mode=$MODE"
|
||||
|
|
|
|||
|
|
@ -306,14 +306,6 @@ if [ $MODE_ZNET ]; then
|
|||
eval "$line"
|
||||
free_device $SUBCHANNELS
|
||||
done
|
||||
for line in $(LANG=C grep -E -i -h \
|
||||
"^s390-subchannels=([0-9]\.[0-9]\.[a-f0-9]+;){2,3}$" \
|
||||
$( (ls /etc/NetworkManager/system-connections/*.nmconnection 2> /dev/null || echo "__no_config_file") | \
|
||||
LC_ALL=C sed -e "$__sed_discard_ignored_files") 2> /dev/null)
|
||||
do
|
||||
SUBCHANNELS="$(echo $line | sed -e "s/s390-subchannels=//" -e "s/;/,/g")"
|
||||
free_device $SUBCHANNELS
|
||||
done
|
||||
fi
|
||||
|
||||
[ -z "$ALL_DEVICES" ] && exit 0
|
||||
|
|
|
|||
|
|
@ -1,12 +1,13 @@
|
|||
[Unit]
|
||||
Description=Free all devices on startup
|
||||
DefaultDependencies=no
|
||||
Before=sysinit.target systemd-udev-trigger.service
|
||||
Before=sysinit.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
ExecStart=/usr/sbin/device_cio_free
|
||||
StandardOutput=syslog
|
||||
|
||||
[Install]
|
||||
WantedBy=sysinit.target
|
||||
|
|
|
|||
|
|
@ -1,9 +0,0 @@
|
|||
---
|
||||
pathmigration:
|
||||
excluded_paths:
|
||||
- /lib/s390-tools
|
||||
|
||||
badfuncs:
|
||||
allowed:
|
||||
/usr/bin/qethqoat:
|
||||
- inet_ntoa
|
||||
|
|
@ -1,234 +1,19 @@
|
|||
From b2daaa34776ba6afec879e362378f6f7563590a6 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
|
||||
Date: Mon, 20 Jun 2022 17:43:05 +0200
|
||||
Subject: [PATCH 1/2] Revert "zipl/src: Implement sorting bls entries by
|
||||
versions"
|
||||
|
||||
This reverts commit a0dba6bfdb50ff373fa710ffe2a307cc0748f18b.
|
||||
---
|
||||
zipl/src/scan.c | 139 ++----------------------------------------------
|
||||
1 file changed, 3 insertions(+), 136 deletions(-)
|
||||
|
||||
diff --git a/zipl/src/scan.c b/zipl/src/scan.c
|
||||
index 0cea1d4..9352f76 100644
|
||||
--- a/zipl/src/scan.c
|
||||
+++ b/zipl/src/scan.c
|
||||
@@ -10,7 +10,6 @@
|
||||
*
|
||||
*/
|
||||
diff -up s390-tools-2.9.0/zipl/src/Makefile.blscfg-rpm-nvr-sort s390-tools-2.9.0/zipl/src/Makefile
|
||||
--- s390-tools-2.9.0/zipl/src/Makefile.blscfg-rpm-nvr-sort 2019-05-22 08:16:17.317273801 -0400
|
||||
+++ s390-tools-2.9.0/zipl/src/Makefile 2019-05-22 08:18:02.947273801 -0400
|
||||
@@ -7,7 +7,7 @@ ALL_CPPFLAGS += -I../include -I../boot \
|
||||
-D_FILE_OFFSET_BITS=64 $(NO_PIE_CFLAGS)
|
||||
ALL_LDFLAGS += -Wl,-z,noexecstack $(NO_PIE_LDFLAGS)
|
||||
|
||||
-static const char *VERSION_KEYWORD = "version";
|
||||
-libs = $(rootdir)/libutil/libutil.a
|
||||
+libs = $(rootdir)/libutil/libutil.a -lrpm
|
||||
|
||||
/* Need ISOC99 function isblank() in ctype.h */
|
||||
#ifndef __USE_ISOC99
|
||||
@@ -646,7 +645,7 @@ scan_file(const char* filename, struct scan_token** token)
|
||||
|
||||
|
||||
static int
|
||||
-bls_filter_by_names(const struct dirent *ent)
|
||||
+bls_filter(const struct dirent *ent)
|
||||
{
|
||||
int offset = strlen(ent->d_name) - strlen(".conf");
|
||||
|
||||
@@ -656,111 +655,13 @@ bls_filter_by_names(const struct dirent *ent)
|
||||
return strncmp(ent->d_name + offset, ".conf", strlen(".conf")) == 0;
|
||||
}
|
||||
|
||||
-struct version {
|
||||
- char *line; /* pointer to a line with version keyword */
|
||||
- int offset; /* offset of version value in the line */
|
||||
-};
|
||||
-
|
||||
-/*
|
||||
- * Locate version in bls file represented by ENT
|
||||
- */
|
||||
-static void get_version(const struct dirent *ent, struct version *v)
|
||||
-{
|
||||
- char *line = NULL;
|
||||
- size_t len = 0;
|
||||
- char *d_name;
|
||||
- FILE *stream;
|
||||
- ssize_t read;
|
||||
-
|
||||
- memset(v, 0, sizeof(*v));
|
||||
- d_name = misc_make_path((char *)blsdir, (char *)ent->d_name);
|
||||
- if (!d_name)
|
||||
- return;
|
||||
-
|
||||
- stream = fopen(d_name, "r");
|
||||
- free(d_name);
|
||||
- if (!stream)
|
||||
- return;
|
||||
-
|
||||
- while ((read = getline(&line, &len, stream)) != -1) {
|
||||
- if (line[read - 1] == '\n') {
|
||||
- line[read - 1] = '\0';
|
||||
- read--;
|
||||
- }
|
||||
- if ((size_t)read <= strlen(VERSION_KEYWORD) + 1)
|
||||
- continue;
|
||||
- if (strcmp(VERSION_KEYWORD, line) > 0)
|
||||
- continue;
|
||||
- if (!isblank(line[strlen(VERSION_KEYWORD)]))
|
||||
- continue;
|
||||
- /* skip blanks */
|
||||
- v->offset = strlen(VERSION_KEYWORD) + 1;
|
||||
- while (v->offset < read - 1 && isblank(line[v->offset]))
|
||||
- v->offset++;
|
||||
- if (isblank(line[v->offset]))
|
||||
- /*
|
||||
- * all characters after the keyword
|
||||
- * are blanks. Invalid version
|
||||
- */
|
||||
- continue;
|
||||
- v->line = line;
|
||||
- fclose(stream);
|
||||
- return;
|
||||
- }
|
||||
- free(line);
|
||||
- fclose(stream);
|
||||
-}
|
||||
-
|
||||
-static void put_version(struct version *v)
|
||||
-{
|
||||
- free(v->line);
|
||||
-}
|
||||
-
|
||||
-/**
|
||||
- * Check version in bls file represented by ENT.
|
||||
- * Return 1 if version is valid. Otherwise return 0
|
||||
- */
|
||||
-static int bls_filter_by_versions(const struct dirent *ent)
|
||||
-{
|
||||
- struct version v;
|
||||
-
|
||||
- if (bls_filter_by_names(ent) == 0)
|
||||
- return 0;
|
||||
-
|
||||
- get_version(ent, &v);
|
||||
- if (v.line) {
|
||||
- put_version(&v);
|
||||
- return 1;
|
||||
- }
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
|
||||
static int
|
||||
-bls_sort_by_names(const struct dirent **ent_a, const struct dirent **ent_b)
|
||||
+bls_sort(const struct dirent **ent_a, const struct dirent **ent_b)
|
||||
{
|
||||
return strverscmp((*ent_a)->d_name, (*ent_b)->d_name);
|
||||
}
|
||||
|
||||
-static int
|
||||
-bls_sort_by_versions(const struct dirent **ent_a, const struct dirent **ent_b)
|
||||
-{
|
||||
- struct version v1, v2;
|
||||
- int ret;
|
||||
-
|
||||
- get_version(*ent_a, &v1);
|
||||
- get_version(*ent_b, &v2);
|
||||
- /*
|
||||
- * Both versions are valid.
|
||||
- * It is guaranteed by bls_filter_by_versions()
|
||||
- */
|
||||
- ret = strverscmp(v1.line + v1.offset, v2.line + v2.offset);
|
||||
-
|
||||
- put_version(&v1);
|
||||
- put_version(&v2);
|
||||
-
|
||||
- return ret;
|
||||
-}
|
||||
|
||||
static int
|
||||
scan_append_section_heading(struct scan_token* scan, int* index, char* name);
|
||||
@@ -1110,40 +1011,6 @@ scan_count_target_keywords(char* keyword[])
|
||||
return num;
|
||||
}
|
||||
|
||||
-static int bls_scandir(struct dirent ***bls_entries)
|
||||
-{
|
||||
- struct dirent **entries1;
|
||||
- struct dirent **entries2;
|
||||
- int n1, n2;
|
||||
-
|
||||
- /* arrange by names */
|
||||
- n1 = scandir(blsdir, &entries1,
|
||||
- bls_filter_by_names, bls_sort_by_names);
|
||||
- if (n1 <= 0)
|
||||
- return n1;
|
||||
- /* arrange by versions */
|
||||
- n2 = scandir(blsdir, &entries2,
|
||||
- bls_filter_by_versions, bls_sort_by_versions);
|
||||
-
|
||||
- if (n2 <= 0 || n2 < n1) {
|
||||
- /*
|
||||
- * failed to sort by versions,
|
||||
- * fall back to sorting by filenames
|
||||
- */
|
||||
- *bls_entries = entries1;
|
||||
- while (n2--)
|
||||
- free(entries2[n2]);
|
||||
- free(entries2);
|
||||
- return n1;
|
||||
- }
|
||||
- /* use arrangement by versions */
|
||||
- *bls_entries = entries2;
|
||||
- while (n1--)
|
||||
- free(entries1[n1]);
|
||||
- free(entries1);
|
||||
- return n2;
|
||||
-}
|
||||
-
|
||||
int
|
||||
scan_check_target_data(char* keyword[], int* line)
|
||||
{
|
||||
@@ -1464,7 +1331,7 @@ int scan_bls(struct scan_token **token, int scan_size)
|
||||
if (!(stat(blsdir, &sb) == 0 && S_ISDIR(sb.st_mode)))
|
||||
return 0;
|
||||
|
||||
- n = bls_scandir(&bls_entries);
|
||||
+ n = scandir(blsdir, &bls_entries, bls_filter, bls_sort);
|
||||
if (n <= 0)
|
||||
return n;
|
||||
|
||||
--
|
||||
2.39.2
|
||||
|
||||
|
||||
From 692e70bcfc32a05e30146bd7077c41e0eaceff03 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Jones <pjones@redhat.com>
|
||||
Date: Mon, 20 Jun 2022 17:46:59 +0200
|
||||
Subject: [PATCH 2/2] blscfg: sort like rpm nvr, not like a single version
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Signed-off-by: Peter Jones <pjones@redhat.com>
|
||||
Signed-off-by: Dan Horák <dan@danny.cz>
|
||||
---
|
||||
zipl/src/Makefile | 1 +
|
||||
zipl/src/scan.c | 96 ++++++++++++++++++++++++++++++++++++++++++++++-
|
||||
2 files changed, 95 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/zipl/src/Makefile b/zipl/src/Makefile
|
||||
index cab5655..7ec215d 100644
|
||||
--- a/zipl/src/Makefile
|
||||
+++ b/zipl/src/Makefile
|
||||
@@ -9,6 +9,7 @@ ALL_LDFLAGS += -Wl,-z,noexecstack $(NO_PIE_LDFLAGS)
|
||||
|
||||
libs = $(rootdir)/libutil/libutil.a \
|
||||
$(rootdir)/libvtoc/libvtoc.a \
|
||||
+ -lrpmio -lrpm
|
||||
|
||||
objects = misc.o error.o scan.o job.o boot.o bootmap.o fs-map.o disk.o \
|
||||
bootmap_header.o envblk.o install.o zipl.o
|
||||
diff --git a/zipl/src/scan.c b/zipl/src/scan.c
|
||||
index 9352f76..3327e2d 100644
|
||||
--- a/zipl/src/scan.c
|
||||
+++ b/zipl/src/scan.c
|
||||
@@ -35,6 +35,8 @@
|
||||
objects = misc.o error.o scan.o job.o boot.o bootmap.o disk.o \
|
||||
install.o zipl.o $(rootdir)/zipl/boot/data.o
|
||||
diff -up s390-tools-2.9.0/zipl/src/scan.c.blscfg-rpm-nvr-sort s390-tools-2.9.0/zipl/src/scan.c
|
||||
--- s390-tools-2.9.0/zipl/src/scan.c.blscfg-rpm-nvr-sort 2019-05-21 09:13:36.000000000 -0400
|
||||
+++ s390-tools-2.9.0/zipl/src/scan.c 2019-05-22 08:16:17.317273801 -0400
|
||||
@@ -33,6 +33,8 @@
|
||||
|
||||
#include "lib/util_base.h"
|
||||
|
||||
|
|
@ -237,7 +22,7 @@ index 9352f76..3327e2d 100644
|
|||
#include "boot.h"
|
||||
#include "error.h"
|
||||
#include "misc.h"
|
||||
@@ -655,13 +657,103 @@ bls_filter(const struct dirent *ent)
|
||||
@@ -653,13 +655,103 @@ bls_filter(const struct dirent *ent)
|
||||
return strncmp(ent->d_name + offset, ".conf", strlen(".conf")) == 0;
|
||||
}
|
||||
|
||||
|
|
@ -343,6 +128,3 @@ index 9352f76..3327e2d 100644
|
|||
|
||||
static int
|
||||
scan_append_section_heading(struct scan_token* scan, int* index, char* name);
|
||||
--
|
||||
2.39.2
|
||||
|
||||
|
|
|
|||
|
|
@ -61,10 +61,10 @@ index 871935c783f..d8d5eca5867 100755
|
|||
;;
|
||||
--)
|
||||
shift
|
||||
diff --git a/scripts/zipl-switch-to-blscfg.8 b/scripts/zipl-switch-to-blscfg.8
|
||||
diff --git a/scripts/zipl-switch-to-blscfg.1 b/scripts/zipl-switch-to-blscfg.1
|
||||
index 6bd14d00d14..71b904ffd1c 100644
|
||||
--- a/scripts/zipl-switch-to-blscfg.8
|
||||
+++ b/scripts/zipl-switch-to-blscfg.8
|
||||
--- a/scripts/zipl-switch-to-blscfg.1
|
||||
+++ b/scripts/zipl-switch-to-blscfg.1
|
||||
@@ -37,9 +37,9 @@ The DIRECTORY where the BLS fragments will be generated. The directory is create
|
||||
The FILE used for zipl configuration file, defaults to /etc/zipl.conf.
|
||||
|
||||
|
|
|
|||
945
s390utils.spec
945
s390utils.spec
File diff suppressed because it is too large
Load diff
4
sources
4
sources
|
|
@ -1,2 +1,2 @@
|
|||
SHA512 (s390-tools-2.40.0.tar.gz) = 1943429581b280bf9ea370da3700a234d509837cb45b2354cdf79b38db87d2183010d18d9132defd77b9d8e11b7e002c447ffd7c912e20a50da4cb6877758c0e
|
||||
SHA512 (s390-tools-2.40.0-rust-vendor.tar.xz) = fd1894c4e950a3c51054432731a3aeef4318e794aa4af2dc5fed31da16dce2020f014a64241e44766fb40b0fd6c1ac5943366e38dcfebf264875220ecf1285b5
|
||||
SHA512 (src_vipa-2.1.0.tar.gz) = 8f6048e82b4bcc479dfb09d62da64b9519f66efc31889ff795ee6ca107e262167df57628c305f1b899c41bb3f035e6309552d8548c890855d319e8e60d6a6cf7
|
||||
SHA512 (s390-tools-2.9.0.tar.gz) = 23315e8914a5c797b0678298ff51fd95a3c9f065b0fa9f6cf954573fd5ad394890d7f8dbd9cf2501d845c76c3fe31952b25cb7c2b2d59744305b2f37cf3a65bb
|
||||
|
|
|
|||
27
zfcpconf.sh
27
zfcpconf.sh
|
|
@ -2,12 +2,10 @@
|
|||
|
||||
# config file syntax:
|
||||
# deviceno WWPN FCPLUN
|
||||
# deviceno # allowed when auto LUN scan is enabled and port is in NPIV mode
|
||||
#
|
||||
# Example:
|
||||
# 0.0.4000 0x5005076300C213e9 0x5022000000000000
|
||||
# 0.0.4001 0x5005076300c213e9 0x5023000000000000
|
||||
# 0.0.5000
|
||||
#
|
||||
#
|
||||
# manual setup:
|
||||
|
|
@ -23,20 +21,12 @@
|
|||
CONFIG=/etc/zfcp.conf
|
||||
PATH=/bin:/sbin
|
||||
|
||||
set_online()
|
||||
{
|
||||
DEVICE=$1
|
||||
|
||||
[ `cat /sys/bus/ccw/drivers/zfcp/${DEVICE}/online` = "0" ] \
|
||||
&& echo 1 > /sys/bus/ccw/drivers/zfcp/${DEVICE}/online
|
||||
}
|
||||
|
||||
if [ -f "$CONFIG" ]; then
|
||||
if [ ! -d /sys/bus/ccw/drivers/zfcp ]; then
|
||||
modprobe zfcp
|
||||
fi
|
||||
if [ ! -d /sys/bus/ccw/drivers/zfcp ]; then
|
||||
exit 1
|
||||
return
|
||||
fi
|
||||
sed 'y/ABCDEF/abcdef/' < $CONFIG | while read line; do
|
||||
case $line in
|
||||
|
|
@ -44,17 +34,6 @@ if [ -f "$CONFIG" ]; then
|
|||
*)
|
||||
[ -z "$line" ] && continue
|
||||
set $line
|
||||
if [ $# -eq 1 ]; then
|
||||
DEVICE=${1##*0x}
|
||||
if [ `cat /sys/module/zfcp/parameters/allow_lun_scan` = "Y" ]; then
|
||||
set_online ${DEVICE}
|
||||
grep -q NPIV /sys/bus/ccw/devices/${DEVICE}/host*/fc_host/host*/port_type || \
|
||||
echo "Error: Only device ID (${DEVICE}) given, but port not in NPIV mode"
|
||||
else
|
||||
echo "Error: Only device ID (${DEVICE}) given, but LUN scan is disabled for the zfcp module"
|
||||
fi
|
||||
continue
|
||||
fi
|
||||
if [ $# -eq 5 ]; then
|
||||
DEVICE=$1
|
||||
SCSIID=$2
|
||||
|
|
@ -67,11 +46,11 @@ if [ -f "$CONFIG" ]; then
|
|||
WWPN=$2
|
||||
FCPLUN=$3
|
||||
fi
|
||||
set_online ${DEVICE}
|
||||
[ `cat /sys/bus/ccw/drivers/zfcp/${DEVICE}/online` = "0" ] \
|
||||
&& echo 1 > /sys/bus/ccw/drivers/zfcp/${DEVICE}/online
|
||||
[ ! -d /sys/bus/ccw/drivers/zfcp/${DEVICE}/${WWPN}/${FCPLUN} ] \
|
||||
&& echo $FCPLUN > /sys/bus/ccw/drivers/zfcp/${DEVICE}/${WWPN}/unit_add
|
||||
;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
exit 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue