/usr/bin
NameSizeModeActions
2to3950755editdlrm
ab834160755editdlrm
aclocal363760755editdlrm
aclocal-1.16363760755editdlrm
acyclic156640755editdlrm
addr2line284080755editdlrm
alias330755editdlrm
animate154560755editdlrm
appstream-compose322240755editdlrm
appstream-util1193680755editdlrm
apropos496880755editdlrm
apropos.man-db496880755editdlrm
ar573280755editdlrm
arch322240755editdlrm
arpaname154720755editdlrm
arping279040755editdlrm
as7273600755editdlrm
aserver404160755editdlrm
aspell1547440755editdlrm
at568244755editdlrm
atq568244755editdlrm
atrm568244755editdlrm
attr154960755editdlrm
audit2allow150640755editdlrm
audit2why150640755editdlrm
aulast196640755editdlrm
aulastlog154880755editdlrm
ausyscall154800755editdlrm
authselect447280755editdlrm
autoconf147710755editdlrm
autoheader85340755editdlrm
autom4te321810755editdlrm
automake2579810755editdlrm
automake-1.162579810755editdlrm
autopoint269970755editdlrm
autoreconf210660755editdlrm
autoscan171240755editdlrm
autoupdate338720755editdlrm
auvirt361520755editdlrm
avinfo239280755editdlrm
awk7149280755editdlrm
b2sum528320755editdlrm
base32363440755editdlrm
base64363440755editdlrm
basename322400755editdlrm
basenc489760755editdlrm
bash13890240755editdlrm
bashbug70790755editdlrm
bashbug-6470790755editdlrm
batch1400755editdlrm
bcomps239280755editdlrm
bg300755editdlrm
bison5066320755editdlrm
bluemoon448080755editdlrm
bluetoothctl6494560755editdlrm
bond2team232930755editdlrm
bootconfig310160755editdlrm
bootctl1029520755editdlrm
brotli7713760755editdlrm
bsqldb361360755editdlrm
bsqlodbc319360755editdlrm
btattach322720755editdlrm
btmgmt1989040755editdlrm
btmon12436240755editdlrm
bunzip2403920755editdlrm
busctl1025600755editdlrm
bwrap739520755editdlrm
bzcat403920755editdlrm
bzcmp21440755editdlrm
bzdiff21440755editdlrm
bzegrep20580755editdlrm
bzfgrep20580755editdlrm
bzgrep20580755editdlrm
bzip2403920755editdlrm
bzip2recover155920755editdlrm
bzless12630755editdlrm
bzmore12630755editdlrm
c++10972240755editdlrm
c++filt278400755editdlrm
c892280755editdlrm
c992190755editdlrm
ca-legacy16480755editdlrm
cal530640755editdlrm
canberra-boot195280755editdlrm
canberra-gtk-play196400755editdlrm
captoinfo898960755editdlrm
cat363040755editdlrm
catchsegv32890755editdlrm
catman367200755editdlrm
cc10931280755editdlrm
ccomps281280755editdlrm
cd300755editdlrm
centrino-decode144640755editdlrm
certutil1767360755editdlrm
chacl196080755editdlrm
chage737044755editdlrm
chattr155520755editdlrm
chcat139570755editdlrm
chcon614960755editdlrm
checkmodule4617040755editdlrm
checkpolicy5401840755editdlrm
chfn320324711editdlrm
chgrp573200755editdlrm
chmem362480755editdlrm
chmod573040755editdlrm
choom238560755editdlrm
chown614320755editdlrm
chronyc1072560755editdlrm
chrt279600755editdlrm
chsh237840711editdlrm
chvt155440755editdlrm
cifsiostat239200755editdlrm
circo156000755editdlrm
cksum321360755editdlrm
cl-linksafe-apply-group5580755editdlrm
cl-linksafe-reconfigure49470755editdlrm
clear155120755editdlrm
clockdiff237520755editdlrm
cluster488400755editdlrm
cmp410960755editdlrm
cmsutil484960755editdlrm
col237920755editdlrm
colcrt155520755editdlrm
colrm155280755editdlrm
column361840755editdlrm
comm364000755editdlrm
command350755editdlrm
compare154560755editdlrm
compile_et13460755editdlrm
composite154560755editdlrm
config_data71380755editdlrm
conjure154640755editdlrm
convert154640755editdlrm
coredumpctl612800755editdlrm
corelist152790755editdlrm
cp1444000755editdlrm
cpan85710755editdlrm
cpan-mirrors42880755editdlrm
cpansign20320755editdlrm
cpapi134781120755editdlrm
cpapi234781120755editdlrm
cpapi334781120755editdlrm
cpio1490160755editdlrm
cpp10972240755editdlrm
cpupower819360755editdlrm
crb26540744editdlrm
crc3210430755editdlrm
crlutil942000755editdlrm
cronnext407040755editdlrm
crontab571124755editdlrm
csplit1112800755editdlrm
curl2544480755editdlrm
cut446480755editdlrm
cvtsudoers3606800755editdlrm
cxpm280720755editdlrm
cyrusbdb2current16518240755editdlrm
datacopy319920755editdlrm
date1063360755editdlrm
dbus-broker2363680755editdlrm
dbus-broker-launch1319040755editdlrm
dbus-monitor279200755editdlrm
dbus-send278720755editdlrm
dbus-update-activation-environment155360755editdlrm
dbus-uuidgen155040755editdlrm
dbxtool238960755editdlrm
dconf662640755editdlrm
dd695760755editdlrm
deallocvt155520755editdlrm
debuginfo-install36900755editdlrm
debuginfod-find197360755editdlrm
defncopy320160755editdlrm
delv464720755editdlrm
df824640755editdlrm
diff1993680755editdlrm
diff3535600755editdlrm
diffimg156240755editdlrm
dig1398720755editdlrm
dijkstra199040755editdlrm
dir1407520755editdlrm
dircolors405680755editdlrm
dirmngr4505280755editdlrm
dirmngr-client574720755editdlrm
dirname279520755editdlrm
display154560755editdlrm
distro9530755editdlrm
dltest154640755editdlrm
dmesg734960755editdlrm
dnf20940755editdlrm
dnf-320940755editdlrm
dnf420940755editdlrm
dnsdomainname244080755editdlrm
dnstap-read237440755editdlrm
domainname244080755editdlrm
dot156000755editdlrm
dot2gxl408880755editdlrm
dotty20890755editdlrm
doveadm8404640755editdlrm
doveconf3842480755editdlrm
dovecot-sysreport64310755editdlrm
dpkg3282160755editdlrm
dpkg-deb1574000755editdlrm
dpkg-divert1328880755editdlrm
dpkg-maintscript-helper211280755editdlrm
dpkg-query1496720755editdlrm
dpkg-realpath364880755editdlrm
dpkg-split1072720755editdlrm
dpkg-statoverride574000755editdlrm
dpkg-trigger492320755editdlrm
dracut1009170755editdlrm
dtrace177960755editdlrm
du1528480755editdlrm
dumpkeys1678000755editdlrm
dwp8720320755editdlrm
dwz2334640755editdlrm
ea-php81113216640755editdlrm
ea-php81-pear3830755editdlrm
ea-php81-pecl2990755editdlrm
ea-php82114099360755editdlrm
ea-php82-pear3830755editdlrm
ea-php82-pecl2990755editdlrm
ea-wappspector1040755editdlrm
echo279360755editdlrm
ed537680755editdlrm
edgepaint25803040755editdlrm
egrep320755editdlrm
eject446560755editdlrm
elfedit366960755editdlrm
enc2xs416630755editdlrm
encguess29890755editdlrm
env450880755editdlrm
envml42050755editdlrm
envsubst362400755editdlrm
eps2eps6430755editdlrm
eqn1940640755editdlrm
event_rpcgen.py549360755editdlrm
evmctl712640755editdlrm
ex14522480755editdlrm
exempi288560755editdlrm
exiv22046160755editdlrm
expand404880755editdlrm
expr1110320755editdlrm
factor735920755editdlrm
fallocate237600755editdlrm
false279360755editdlrm
fc300755editdlrm
fc-cache1390755editdlrm
fc-cache-64237280755editdlrm
fc-cat196160755editdlrm
fc-conflist154960755editdlrm
fc-list154960755editdlrm
fc-match154960755editdlrm
fc-pattern155040755editdlrm
fc-query154960755editdlrm
fc-scan155040755editdlrm
fc-validate155040755editdlrm
fdp156000755editdlrm
fg300755editdlrm
fgconsole155360755editdlrm
fgrep320755editdlrm
filan487760755editdlrm
file282880755editdlrm
fincore238560755editdlrm
find2917920755editdlrm
find-repos-of-install36900755editdlrm
findmnt663040755editdlrm
fips-finish-install17640755editdlrm
fips-mode-setup82130755editdlrm
firewall-cmd1436080755editdlrm
firewall-offline-cmd1239520755editdlrm
fisql361360755editdlrm
flatpak18585600755editdlrm
flatpak-bisect78440755editdlrm
flatpak-coredumpctl34330755editdlrm
flex4225440755editdlrm
flex++4225440755editdlrm
flock239280755editdlrm
fmt405280755editdlrm
fold404560755editdlrm
free239200755editdlrm
freebcp237440755editdlrm
freetype-config44230755editdlrm
fribidi292720755editdlrm
ftp1030720755editdlrm
funzip320000755editdlrm
fuse2fs744240755editdlrm
fusermount363684755editdlrm
fusermount3364004755editdlrm
fwupdmgr1607840755editdlrm
fwupdtool1814560755editdlrm
g++10972240755editdlrm
g131129360755editdlrm
gapplication237680755editdlrm
gawk7149280755editdlrm
gc198560755editdlrm
gcc10931280755editdlrm
gcc-ar283360755editdlrm
gcc-nm283120755editdlrm
gcc-ranlib283360755editdlrm
gcov4885760755editdlrm
gcov-dump2987680755editdlrm
gcov-tool3281600755editdlrm
gdbmtool1528400755editdlrm
gdbm_dump288960755editdlrm
gdbm_load373520755editdlrm
gdbus527360755editdlrm
gdbus-codegen20380755editdlrm
gdk-pixbuf-query-loaders-64155280755editdlrm
gdk-pixbuf-thumbnailer196080755editdlrm
gencat281040755editdlrm
genl-ctrl-list158480755editdlrm
gen_grub_cfgstub6600700editdlrm
geqn1940640755editdlrm
GET162000755editdlrm
getconf360800755editdlrm
getent367200755editdlrm
getfacl320320755editdlrm
getfattr279200755editdlrm
getkeycodes155280755editdlrm
getopt238240755editdlrm
getopts350755editdlrm
gettext362000755editdlrm
gettext.sh51910755editdlrm
gettextize422360755editdlrm
ghostscript154880755editdlrm
gio940240755editdlrm
gio-querymodules-64154960755editdlrm
git233775200755editdlrm
git-receive-pack233775200755editdlrm
git-shell65629840755editdlrm
git-upload-archive233775200755editdlrm
git-upload-pack233775200755editdlrm
glib-compile-resources443840755editdlrm
glib-compile-schemas527040755editdlrm
glib-genmarshal411050755editdlrm
glib-gettextize53900755editdlrm
glib-mkenums307970755editdlrm
gmake2557920755editdlrm
gml2gv489280755editdlrm
gneqn9160755editdlrm
gnroff32850755editdlrm
gobject-query155280755editdlrm
gpasswd780164755editdlrm
gpg11236240755editdlrm
gpg-agent3504880755editdlrm
gpg-card1742160755editdlrm
gpg-connect-agent867840755editdlrm
gpg-error369680755editdlrm
gpg-error-config20240755editdlrm
gpg-wks-client1326560755editdlrm
gpg-wks-server1160480755editdlrm
gpg211236240755editdlrm
gpgconf1034080755editdlrm
gpgme-json866560755editdlrm
gpgparsemail361760755editdlrm
gpgrt-config134500755editdlrm
gpgsplit281600755editdlrm
gpgtar664240755editdlrm
gpgv3025200755editdlrm
gpgv23025200755editdlrm
gpic2065600755editdlrm
gpio-event-mon185600755editdlrm
gpio-hammer144560755editdlrm
gpio-watch144560755editdlrm
gprof1039200755editdlrm
gr2fonttest286720755editdlrm
graphml2gv241120755editdlrm
grep1582000755editdlrm
gresource238400755editdlrm
groff990880755editdlrm
grops1712720755editdlrm
grotty1251280755editdlrm
groups363360755editdlrm
grub2-editenv4984160755editdlrm
grub2-file11633040755editdlrm
grub2-fstest17505920755editdlrm
grub2-glue-efi3085760755editdlrm
grub2-kbdcomp16720755editdlrm
grub2-menulst2cfg2913440755editdlrm
grub2-mkfont3420400755editdlrm
grub2-mkimage4768160755editdlrm
grub2-mklayout3189200755editdlrm
grub2-mknetdir5453760755editdlrm
grub2-mkpasswd-pbkdf23215440755editdlrm
grub2-mkrelpath3083920755editdlrm
grub2-mkrescue14081680755editdlrm
grub2-mkstandalone6522480755editdlrm
grub2-mount10738000755editdlrm
grub2-render-label11682400755editdlrm
grub2-script-check3419600755editdlrm
grub2-syslinux2cfg10949920755editdlrm
gs154880755editdlrm
gsbj3540755editdlrm
gsdj3560755editdlrm
gsdj5003560755editdlrm
gsettings321360755editdlrm
gsf-office-thumbnailer205520755editdlrm
gslj3570755editdlrm
gslp3540755editdlrm
gsnd2810755editdlrm
gsoelim329520755editdlrm
gst-inspect-1.0734720755editdlrm
gst-launch-1.0404240755editdlrm
gst-stats-1.0364960755editdlrm
gst-typefind-1.0198000755editdlrm
gtar5348240755editdlrm
gtbl1340000755editdlrm
gtester320400755editdlrm
gtester-report190900755editdlrm
gtk-launch197440755editdlrm
gtk-query-immodules-2.0-64196320755editdlrm
gtk-query-immodules-3.0-64238320755editdlrm
gtk-update-icon-cache407840755editdlrm
gtroff7496400755editdlrm
gunzip23500755editdlrm
gv2gml239680755editdlrm
gv2gxl408880755editdlrm
gvcolor507760755editdlrm
gvgen239760755editdlrm
gvmap28810960755editdlrm
gvmap.sh21940755editdlrm
gvpack4076960755editdlrm
gvpr155680755editdlrm
gxl2dot408880755editdlrm
gxl2gv408880755editdlrm
gzexe64840755editdlrm
gzip910880755editdlrm
h2ph293820755editdlrm
h2xs609310755editdlrm
hardlink362800755editdlrm
hash320755editdlrm
hb-ot-shape-closure447040755editdlrm
hb-shape490560755editdlrm
hb-subset406080755editdlrm
hb-view655440755editdlrm
HEAD162000755editdlrm
head405520755editdlrm
hex2hcd195360755editdlrm
hexdump526400755editdlrm
host1111760755editdlrm
hostid322240755editdlrm
hostname244080755editdlrm
hostnamectl322480755editdlrm
htdbm394560755editdlrm
htdigest263280755editdlrm
html2text9800755editdlrm
htpasswd395840755editdlrm
httxt2dbm253200755editdlrm
hunspell1051360755editdlrm
i386281360755editdlrm
ibd2sdi3339760755editdlrm
iconv656240755editdlrm
icu-config2050755editdlrm
icu-config-64221890755editdlrm
icuinfo158640755editdlrm
id404720755editdlrm
identify154640755editdlrm
idiag-socket-details158880755editdlrm
idn373360755editdlrm
ifnames41280755editdlrm
iio_event_monitor308560755editdlrm
iio_generic_buffer349600755editdlrm
ima-add-sigs37630755editdlrm
ima-setup38000755editdlrm
import154560755editdlrm
imunify-agent-proxy137820080755editdlrm
imunify-antivirus10240755editdlrm
imunify-fgw-dump81829920755editdlrm
imunify-service10200755editdlrm
imunify360-agent10240755editdlrm
imunify360-command-wrapper122100755editdlrm
info3202400755editdlrm
infocmp652080755editdlrm
infotocap898960755editdlrm
innochecksum2346960755editdlrm
install1526560755editdlrm
instmodsh41940755editdlrm
intel-speed-select1194640755editdlrm
ionice155760755editdlrm
iostat570320755editdlrm
ipcmk238480755editdlrm
ipcrm196880755editdlrm
ipcs402800755editdlrm
iptc300080755editdlrm
irqtop361200755editdlrm
isosize155120755editdlrm
ispell9920755editdlrm
isql402880755editdlrm
iusql320560755editdlrm
jcat-tool452720755editdlrm
jobs320755editdlrm
join529280755editdlrm
journalctl902240755editdlrm
jq319280755editdlrm
json_pp48960755editdlrm
json_reformat199840755editdlrm
json_verify156720755editdlrm
json_xs70130755editdlrm
kbdinfo196560755editdlrm
kbdrate196640755editdlrm
kbd_mode158800755editdlrm
kdumpctl612760755editdlrm
kernel-install140300755editdlrm
keyctl655600755editdlrm
kill320320755editdlrm
killall337360755editdlrm
kmod1695440755editdlrm
krb5-config67460755editdlrm
kvm_stat644270755editdlrm
l2ping155440755editdlrm
last361360755editdlrm
lastb361360755editdlrm
lastlog293200755editdlrm
lchfn236800755editdlrm
lchsh236800755editdlrm
ld17916000755editdlrm
ld.bfd17916000755editdlrm
ld.gold21285920755editdlrm
ld.so9387920755editdlrm
ldd54460755editdlrm
lefty3076560755editdlrm
less2024400755editdlrm
lessecho155360755editdlrm
lesskey252000755editdlrm
lesspipe.sh35800755editdlrm
lex4225440755editdlrm
lexgrog903040755editdlrm
libnetcfg157750755editdlrm
libpng-config24400755editdlrm
libpng16-config24400755editdlrm
libtool3678020755editdlrm
libtoolize1292000755editdlrm
libwmf-fontmap133440755editdlrm
link322320755editdlrm
linux-boot-prober59970755editdlrm
linux32281360755editdlrm
linux64281360755editdlrm
ln572880755editdlrm
lneato15510755editdlrm
loadkeys2051760755editdlrm
loadunimap321840755editdlrm
locale604960755editdlrm
localectl322000755editdlrm
localedef3215840755editdlrm
logger368400755editdlrm
login445040755editdlrm
loginctl695920755editdlrm
logname322240755editdlrm
logresolve256640755editdlrm
look196320755editdlrm
ls1407440755editdlrm
lsattr155440755editdlrm
lsblk1273520755editdlrm
lscpu1108320755editdlrm
lsgpio146400755editdlrm
lsiio226720755editdlrm
lsinitrd121370755editdlrm
lsipc527360755editdlrm
lsirq237920755editdlrm
lslocks323520755editdlrm
lslogins527360755editdlrm
lsmem363760755editdlrm
lsns402720755editdlrm
lsof1792640755editdlrm
lsphp9370755editdlrm
lsscsi915840755editdlrm
lto-dump278825680755editdlrm
lua237840755editdlrm
luac1614720755editdlrm
lwp-download102920755editdlrm
lwp-dump27110755editdlrm
lwp-mirror24130755editdlrm
lwp-request162000755editdlrm
lynis524540755editdlrm
lz4_decompress1303120755editdlrm
m42461680755editdlrm
Mail10375680755editdlrm
mail10375680755editdlrm
mailx10375680755editdlrm
mailx.s-nail10375680755editdlrm
make2557920755editdlrm
make-dummy-cert6140755editdlrm
man1176720755editdlrm
man-recode286800755editdlrm
man.man-db1176720755editdlrm
mandb1362000755editdlrm
manpath325840755editdlrm
mapscrn321440755editdlrm
mcookie279600755editdlrm
md5sum403920755editdlrm
mdb_copy160800755editdlrm
mdb_dump162160755editdlrm
mdb_load244080755editdlrm
mdb_stat161840755editdlrm
mdig525360755editdlrm
mesg155040755editdlrm
mkdir697520755editdlrm
mkfifo405920755editdlrm
mkfontdir690755editdlrm
mkfontscale458480755editdlrm
mknod447280755editdlrm
mktemp405680755editdlrm
mm2gv403920755editdlrm
mmdblookup283840755editdlrm
modulecmd6697020755editdlrm
modulemd-validator290720755editdlrm
modutil941120755editdlrm
mogrify154640755editdlrm
mokutil626880755editdlrm
montage154640755editdlrm
more444640755editdlrm
mount484804755editdlrm
mountpoint196400755editdlrm
mpris-proxy1035840755editdlrm
mpstat528320755editdlrm
msgattrib278240755editdlrm
msgcat277920755editdlrm
msgcmp279200755editdlrm
msgcomm278080755editdlrm
msgconv237040755editdlrm
msgen237040755editdlrm
msgexec237040755editdlrm
msgfilter361600755editdlrm
msgfmt861120755editdlrm
msgfmt.py75900755editdlrm
msgfmt3.9.py75900755editdlrm
msgfmt3.py75900755editdlrm
msggrep1192000755editdlrm
msginit690560755editdlrm
msgmerge772960755editdlrm
msgunfmt361760755editdlrm
msguniq237040755editdlrm
mv1443280755editdlrm
myisamchk67999760755editdlrm
myisamlog66312000755editdlrm
myisampack66667840755editdlrm
myisam_ftdump66066240755editdlrm
mysql74960640755editdlrm
mysqladmin72301680755editdlrm
mysqlbinlog75416320755editdlrm
mysqlcheck72389680755editdlrm
mysqldump73035120755editdlrm
mysqldumpslow77190755editdlrm
mysqld_pre_systemd44210755editdlrm
mysqlimport72181520755editdlrm
mysqlpump77066640755editdlrm
mysqlshow72167280755editdlrm
mysqlslap72278800755editdlrm
mysql_config8430755editdlrm
mysql_config-6450520755editdlrm
mysql_config_editor2196080755editdlrm
mysql_migrate_keyring72921040755editdlrm
mysql_secure_installation72018000755editdlrm
mysql_ssl_rsa_setup2644960755editdlrm
mysql_tzinfo_to_sql1420480755editdlrm
mysql_upgrade73006240755editdlrm
my_print_defaults2303840755editdlrm
nail10375680755editdlrm
named-rrchecker236960755editdlrm
namei237840755editdlrm
nano3545040755editdlrm
nc531040755editdlrm
ncurses6-config83210755editdlrm
ncursesw6-config83240755editdlrm
ndptool280800755editdlrm
neato156000755editdlrm
needs-restarting36900755editdlrm
neqn9160755editdlrm
netcat531040755editdlrm
netstat1606160755editdlrm
newgidmap429600755editdlrm
newgrp417444755editdlrm
newuidmap388400755editdlrm
nf-ct-add162720755editdlrm
nf-ct-events156960755editdlrm
nf-ct-list163120755editdlrm
nf-exp-add207920755editdlrm
nf-exp-delete164720755editdlrm
nf-exp-list163120755editdlrm
nf-log156800755editdlrm
nf-monitor156960755editdlrm
nf-queue156880755editdlrm
ngettext361920755editdlrm
nice363360755editdlrm
nisdomainname244080755editdlrm
nl1029200755editdlrm
nl-addr-add161440755editdlrm
nl-addr-delete162000755editdlrm
nl-addr-list203120755editdlrm
nl-class-add161280755editdlrm
nl-class-delete160400755editdlrm
nl-class-list160080755editdlrm
nl-classid-lookup158720755editdlrm
nl-cls-add202880755editdlrm
nl-cls-delete161120755editdlrm
nl-cls-list160640755editdlrm
nl-fib-lookup158960755editdlrm
nl-link-enslave156560755editdlrm
nl-link-ifindex2name156560755editdlrm
nl-link-list160480755editdlrm
nl-link-name2ifindex156560755editdlrm
nl-link-release156560755editdlrm
nl-link-set161200755editdlrm
nl-link-stats159040755editdlrm
nl-list-caches156720755editdlrm
nl-list-sockets156560755editdlrm
nl-monitor158560755editdlrm
nl-neigh-add160400755editdlrm
nl-neigh-delete160720755editdlrm
nl-neigh-list159840755editdlrm
nl-neightbl-list158160755editdlrm
nl-nh-list158480755editdlrm
nl-pktloc-lookup159040755editdlrm
nl-qdisc-add160720755editdlrm
nl-qdisc-delete160400755editdlrm
nl-qdisc-list201600755editdlrm
nl-route-add203120755editdlrm
nl-route-delete203920755editdlrm
nl-route-get156800755editdlrm
nl-route-list162400755editdlrm
nl-rule-list158480755editdlrm
nl-tctree-list159760755editdlrm
nl-util-addr156560755editdlrm
nm457920755editdlrm
nm-online239440755editdlrm
nmcli10796720755editdlrm
nmtui8626560755editdlrm
nmtui-connect8626560755editdlrm
nmtui-edit8626560755editdlrm
nmtui-hostname8626560755editdlrm
nohup362480755editdlrm
nop156960755editdlrm
notify-send202240755editdlrm
nproc363520755editdlrm
nroff32850755editdlrm
nsenter281280755editdlrm
nslookup1152240755editdlrm
nss-policy-check155200755editdlrm
nsupdate735280755editdlrm
numfmt569680755editdlrm
objcopy1898160755editdlrm
objdump4230000755editdlrm
od654080755editdlrm
odbcinst237280755editdlrm
odbc_config154720755editdlrm
openssl11225520755editdlrm
openvt241200755editdlrm
orc-bugreport238720755editdlrm
os-prober59190755editdlrm
osage156000755editdlrm
osinfo-db-export280080755editdlrm
osinfo-db-import279600755editdlrm
osinfo-db-path156720755editdlrm
osinfo-db-validate239600755editdlrm
osinfo-detect280560755editdlrm
osinfo-install-script325360755editdlrm
osinfo-query329600755editdlrm
osql97070755editdlrm
p11-kit2459040755editdlrm
pacat526560755editdlrm
package-cleanup36900755editdlrm
pacmd195840755editdlrm
pactl815840755editdlrm
page_owner_sort267520755editdlrm
pamon526560755editdlrm
pango-list195680755editdlrm
pango-segmentation195840755editdlrm
pango-view616160755editdlrm
paperconf161840755editdlrm
paplay526560755editdlrm
parec526560755editdlrm
parecord526560755editdlrm
passwd326564755editdlrm
paste362400755editdlrm
pasuspender238320755editdlrm
patch1996960755editdlrm
patchwork156000755editdlrm
pathchk363200755editdlrm
pathfix.py67860755editdlrm
pathfix3.9.py67860755editdlrm
pax11publish154880755editdlrm
pcre-config21420755editdlrm
pcre2-config19540755editdlrm
pdf2dsc7010755editdlrm
pdf2ps9130755editdlrm
pdnsutil50501760755editdlrm
pdns_control4915440755editdlrm
peekfd161840755editdlrm
perl154960755editdlrm
perl5.32.1154960755editdlrm
perlbug448630755editdlrm
perldoc1180755editdlrm
perlivp108130755editdlrm
perlml148400755editdlrm
perlthanks448630755editdlrm
perror10309280755editdlrm
pf2afm5020755editdlrm
pfbtopfa5200755editdlrm
pftp1030720755editdlrm
pgrep321760755editdlrm
php9370755editdlrm
pic2065600755editdlrm
piconv82710755editdlrm
pidof238880755editdlrm
pidstat528320755editdlrm
pidwait321760755editdlrm
pigz1360240755editdlrm
ping914720755editdlrm
pinky362560755editdlrm
pip6480755editdlrm
pip-36480755editdlrm
pip-3.96480755editdlrm
pip36480755editdlrm
pip3.96480755editdlrm
pipewire155200755editdlrm
pipewire-aes67155200755editdlrm
pipewire-avb155200755editdlrm
pipewire-pulse155200755editdlrm
pipewire-vulkan155200755editdlrm
pk12util741920755editdlrm
pkaction196240755editdlrm
pkcheck237280755editdlrm
pkexec319284755editdlrm
pkg-config3350755editdlrm
pkgconf464480755editdlrm
pkill321760755editdlrm
pkla-admin-identities245360755editdlrm
pkla-check-authorization369680755editdlrm
pkttyagent237120755editdlrm
pl2pm45330755editdlrm
pldd239280755editdlrm
plesk_configure3460755editdlrm
pmap362400755editdlrm
png-fix-itxt154720755editdlrm
pngfix609920755editdlrm
pod2html41340755editdlrm
pod2man150340755editdlrm
pod2text108030755editdlrm
pod2usage41070755editdlrm
podchecker36580755editdlrm
POST162000755editdlrm
post-grohtml2045520755editdlrm
powernow-k8-decode144640755editdlrm
pphs4080755editdlrm
pr738320755editdlrm
pre-grohtml951520755editdlrm
precat56600755editdlrm
preconv576160755editdlrm
preunzip56600755editdlrm
prezip56600755editdlrm
prezip-bin160640755editdlrm
printafm3990755editdlrm
printenv320400755editdlrm
printf528160755editdlrm
prlimit284160755editdlrm
procan362800755editdlrm
protoc238800755editdlrm
protoc-c1619920755editdlrm
protoc-gen-c1619920755editdlrm
prove135620755editdlrm
prtstat244160755editdlrm
prune157760755editdlrm
ps1445360755editdlrm
ps2ascii6350755editdlrm
ps2epsi12680755editdlrm
ps2pdf2760755editdlrm
ps2pdf122190755editdlrm
ps2pdf132190755editdlrm
ps2pdf142190755editdlrm
ps2pdfwr10820755editdlrm
ps2ps6510755editdlrm
ps2ps26730755editdlrm
psfaddtable320080755editdlrm
psfgettable320080755editdlrm
psfstriptable320080755editdlrm
psfxtable320080755editdlrm
pslog160800755editdlrm
pstree377840755editdlrm
pstree.x11377840755editdlrm
ptar34700755editdlrm
ptardiff25490755editdlrm
ptargrep42990755editdlrm
ptx1319120755editdlrm
pure-pw395120755editdlrm
pure-pwconvert148640755editdlrm
pure-statsdecode148640755editdlrm
pw-jack13520755editdlrm
pwd363680755editdlrm
pwdx156480755editdlrm
pwmake160800755editdlrm
pwscore160800755editdlrm
pydoc780755editdlrm
pydoc3780755editdlrm
pydoc3.9780755editdlrm
pygettext.py215370755editdlrm
pygettext3.9.py215370755editdlrm
pygettext3.py215370755editdlrm
python-config610755editdlrm
python-html2text9800755editdlrm
python3154480755editdlrm
python3-config610755editdlrm
python3-html2text9800755editdlrm
python3.9154480755editdlrm
python3.9-config610755editdlrm
python3.9-x86_64-config36240755editdlrm
quota836324755editdlrm
quotasync664320755editdlrm
ranlib573360755editdlrm
read320755editdlrm
readelf6832960755editdlrm
readlink404480755editdlrm
realpath405360755editdlrm
recode-sr-latin154960755editdlrm
red920755editdlrm
rename237840755editdlrm
renew-dummy-cert7290755editdlrm
renice155280755editdlrm
repo-graph36900755editdlrm
repoclosure36900755editdlrm
repodiff36900755editdlrm
repomanage36900755editdlrm
repoquery36900755editdlrm
reposync36900755editdlrm
repotrack36900755editdlrm
rescan-scsi-bus.sh390020755editdlrm
reset279920755editdlrm
resizecons280320755editdlrm
rev155200755editdlrm
rm614320755editdlrm
rmdir444640755editdlrm
rnano3545040755editdlrm
rpcbind613280755editdlrm
rpcinfo364320755editdlrm
rpm242000755editdlrm
rpm2archive238800755editdlrm
rpm2cpio154800755editdlrm
rpmdb202160755editdlrm
rpmkeys159680755editdlrm
rpmquery242000755editdlrm
rpmverify242000755editdlrm
rsync5885680755editdlrm
rsync-ssl51320755editdlrm
run-parts19870755editdlrm
run-with-aspell890755editdlrm
runcon363120755editdlrm
rvi14522480755editdlrm
rview14522480755editdlrm
s-nail10375680755editdlrm
sadf4698560755editdlrm
sar1389280755editdlrm
sccmap239280755editdlrm
scl404960755editdlrm
scl_enabled2620755editdlrm
scl_source19290755editdlrm
scp1361040755editdlrm
script528160755editdlrm
scriptlive445200755editdlrm
scriptreplay361440755editdlrm
scsi-rescan390020755editdlrm
scsi_logging_level85880755editdlrm
scsi_mandat36060755editdlrm
scsi_readcap13310755editdlrm
scsi_ready11250755editdlrm
scsi_satl38340755editdlrm
scsi_start12890755editdlrm
scsi_stop14780755editdlrm
scsi_temperature9400755editdlrm
sdiff452640755editdlrm
secon289280755editdlrm
sed1155440755editdlrm
sedismod2959520755editdlrm
sedispol2252080755editdlrm
semodule_expand154800755editdlrm
semodule_link154960755editdlrm
semodule_package196240755editdlrm
semodule_unpackage154880755editdlrm
seq487360755editdlrm
sestatus236800755editdlrm
setarch281360755editdlrm
setfacl444160755editdlrm
setfattr278640755editdlrm
setfont528800755editdlrm
setkeycodes155680755editdlrm
setleds197360755editdlrm
setmetamode156720755editdlrm
setpriv402880755editdlrm
setsid155120755editdlrm
setterm361760755editdlrm
setup-nsssysinit15430755editdlrm
setup-nsssysinit.sh15430755editdlrm
setvtrgb156320755editdlrm
sfdp156000755editdlrm
sftp1608640755editdlrm
sg417444755editdlrm
sginfo753600755editdlrm
sgm_dd402880755editdlrm
sgp_dd445920755editdlrm
sg_bg_ctl157120755editdlrm
sg_compare_and_write284320755editdlrm
sg_copy_results246480755editdlrm
sg_dd567120755editdlrm
sg_decode_sense160400755editdlrm
sg_emc_trespass154960755editdlrm
sg_format412000755editdlrm
sg_get_config370400755editdlrm
sg_get_elem_status283040755editdlrm
sg_get_lba_status243760755editdlrm
sg_ident158000755editdlrm
sg_inq1236000755editdlrm
sg_logs1565680755editdlrm
sg_luns242320755editdlrm
sg_map196480755editdlrm
sg_map26283200755editdlrm
sg_modes481200755editdlrm
sg_opcodes368160755editdlrm
sg_persist378160755editdlrm
sg_prevent156960755editdlrm
sg_raw284240755editdlrm
sg_rbuf241760755editdlrm
sg_rdac154800755editdlrm
sg_read278480755editdlrm
sg_readcap242240755editdlrm
sg_read_attr384240755editdlrm
sg_read_block_limits157440755editdlrm
sg_read_buffer290320755editdlrm
sg_read_long159120755editdlrm
sg_reassign158640755editdlrm
sg_referrals158800755editdlrm
sg_rep_pip157840755editdlrm
sg_rep_zones285040755editdlrm
sg_requests241680755editdlrm
sg_reset158960755editdlrm
sg_reset_wp158160755editdlrm
sg_rmsn157040755editdlrm
sg_rtpg158080755editdlrm
sg_safte241120755editdlrm
sg_sanitize285280755editdlrm
sg_sat_identify200560755editdlrm
sg_sat_phy_event203360755editdlrm
sg_sat_read_gplog200400755editdlrm
sg_sat_set_features200000755editdlrm
sg_scan196480755editdlrm
sg_seek202080755editdlrm
sg_senddiag287680755editdlrm
sg_ses1239600755editdlrm
sg_ses_microcode289280755editdlrm
sg_start201920755editdlrm
sg_stpg241200755editdlrm
sg_stream_ctl200160755editdlrm
sg_sync158800755editdlrm
sg_test_rwbuf199840755editdlrm
sg_timestamp242000755editdlrm
sg_turs282800755editdlrm
sg_unmap241920755editdlrm
sg_verify202240755editdlrm
sg_vpd1223600755editdlrm
sg_write_buffer287680755editdlrm
sg_write_long159680755editdlrm
sg_write_same284880755editdlrm
sg_write_verify283200755editdlrm
sg_write_x620320755editdlrm
sg_wr_mode241200755editdlrm
sg_xcopy444080755editdlrm
sg_zone201120755editdlrm
sh13890240755editdlrm
sha1hmac361120755editdlrm
sha1sum403840755editdlrm
sha224hmac361120755editdlrm
sha224sum403920755editdlrm
sha256hmac361120755editdlrm
sha256sum403920755editdlrm
sha384hmac361120755editdlrm
sha384sum403920755editdlrm
sha512hmac361120755editdlrm
sha512sum403920755editdlrm
shasum98920755editdlrm
showconsolefont197520755editdlrm
showkey196880755editdlrm
shred529200755editdlrm
shuf489440755editdlrm
sieve-dump387920755editdlrm
sieve-filter443840755editdlrm
sieve-test443120755editdlrm
sievec390480755editdlrm
signver405520755editdlrm
size323680755editdlrm
skill321520755editdlrm
slabinfo439840755editdlrm
slabtop239840755editdlrm
sleep322240755editdlrm
slencheck154880755editdlrm
sm3hmac361120755editdlrm
snice321520755editdlrm
socat3962080755editdlrm
soelim329520755editdlrm
soelim.groff329520755editdlrm
sort1156000755editdlrm
sotruss42820755editdlrm
spell1250755editdlrm
splain194110755editdlrm
split533600755editdlrm
sprof362960755editdlrm
sqlite316102240755editdlrm
ssh9178960755editdlrm
ssh-add3130560755editdlrm
ssh-agent3253280755editdlrm
ssh-copy-id141740755editdlrm
ssh-keygen4868240755editdlrm
ssh-keyscan3463520755editdlrm
ssltap732560755editdlrm
sss_ssh_authorizedkeys238480755editdlrm
sss_ssh_knownhostsproxy279520755editdlrm
stat817680755editdlrm
stdbuf446000755editdlrm
strace21766640755editdlrm
strace-log-merge18790755editdlrm
stream154560755editdlrm
streamzip78450755editdlrm
strings325040755editdlrm
strip1898080755editdlrm
stty774480755editdlrm
su569364750editdlrm
sudo2976884111editdlrm
sudoedit2976884111editdlrm
sudoreplay998880111editdlrm
sum362320755editdlrm
sw-engine253140960755editdlrm
sxpm323360755editdlrm
sync361920755editdlrm
systemctl3055760755editdlrm
systemd-analyze2064160755editdlrm
systemd-ask-password199280755editdlrm
systemd-cat197280755editdlrm
systemd-cgls240320755editdlrm
systemd-cgtop403600755editdlrm
systemd-creds448560755editdlrm
systemd-cryptenroll738080755editdlrm
systemd-delta279680755editdlrm
systemd-detect-virt197200755editdlrm
systemd-dissect489280755editdlrm
systemd-escape238160755editdlrm
systemd-firstboot574320755editdlrm
systemd-hwdb156480755editdlrm
systemd-id128280320755editdlrm
systemd-inhibit238720755editdlrm
systemd-machine-id-setup200160755editdlrm
systemd-mount614720755editdlrm
systemd-notify238720755editdlrm
systemd-path197200755editdlrm
systemd-repart1733280755editdlrm
systemd-run655600755editdlrm
systemd-socket-activate280080755editdlrm
systemd-stdio-bridge238240755editdlrm
systemd-sysext489040755editdlrm
systemd-sysusers740880755editdlrm
systemd-tmpfiles1275280755editdlrm
systemd-tty-ask-password-agent403120755editdlrm
systemd-umount614720755editdlrm
tabs196240755editdlrm
tac1028000755editdlrm
tail695280755editdlrm
tapestat280240755editdlrm
tar5348240755editdlrm
taskset237840755editdlrm
tbl1340000755editdlrm
tclsh160640755editdlrm
tclsh8.6160640755editdlrm
tcptraceroute15890755editdlrm
tdspool2640480755editdlrm
team2bond161380755editdlrm
teamd1705920755editdlrm
teamdctl380080755editdlrm
teamnl238160755editdlrm
tee363440755editdlrm
test446560755editdlrm
tic898960755editdlrm
timedatectl488080755editdlrm
timeout368480755editdlrm
tload198000755editdlrm
tmon435040755editdlrm
tmpwatch368960755editdlrm
toe237840755editdlrm
top1354480755editdlrm
touch940480755editdlrm
tput279040755editdlrm
tr447280755editdlrm
tracepath196800755editdlrm
traceroute791440755editdlrm
traceroute6791440755editdlrm
tracker36257440755editdlrm
tred157200755editdlrm
troff7496400755editdlrm
true279360755editdlrm
truncate363280755editdlrm
trust2753360755editdlrm
tset279920755editdlrm
tsort487440755editdlrm
tsql2598400755editdlrm
tty322160755editdlrm
turbostat1726080755editdlrm
twopi156000755editdlrm
type320755editdlrm
tzselect153520755editdlrm
uapi34781120755editdlrm
udevadm6019600755editdlrm
ul238160755editdlrm
ulimit340755editdlrm
ulockmgr_server198400755editdlrm
umask330755editdlrm
umount361124755editdlrm
unalias350755editdlrm
uname322320755editdlrm
uname26281360755editdlrm
unexpand404800755editdlrm
unflatten157360755editdlrm
unicode_start26330755editdlrm
unicode_stop3670755editdlrm
uniq446720755editdlrm
unlink322240755editdlrm
unpigz1360240755editdlrm
unshare323120755editdlrm
unxz869760755editdlrm
unzip2006880755editdlrm
unzipsfx898080755editdlrm
update-ca-trust44660755editdlrm
update-crypto-policies870755editdlrm
update-gtk-immodules3160755editdlrm
update-mime-database613040755editdlrm
upower244480755editdlrm
uptime156560755editdlrm
users322560755editdlrm
usleep156560755editdlrm
utmpdump237680755editdlrm
uuidgen196160755editdlrm
uuidparse237680755editdlrm
vdir1407440755editdlrm
VGAuthService1357120755editdlrm
vi14522480755editdlrm
view1460755editdlrm
vimdot10860755editdlrm
vlock240160755editdlrm
vm-support128790755editdlrm
vmhgfs-fuse493600755editdlrm
vmstat403600755editdlrm
vmtoolsd821920755editdlrm
vmware-alias-import870160755editdlrm
vmware-checkvm155680755editdlrm
vmware-hgfsclient156400755editdlrm
vmware-namespace-cmd237760755editdlrm
vmware-rpctool198400755editdlrm
vmware-toolbox-cmd612880755editdlrm
vmware-vgauth-cmd196320755editdlrm
vmware-xferlogs342400755editdlrm
w239280755editdlrm
wait320755editdlrm
wall237840755editdlrm
watch285360755editdlrm
watchgnupg237600755editdlrm
wc445760755editdlrm
wdctl320800755editdlrm
wget5337200755editdlrm
whatis496880755editdlrm
whatis.man-db496880755editdlrm
whereis326080755editdlrm
which285600755editdlrm
whiptail326960755editdlrm
who528240755editdlrm
whoami322240755editdlrm
wireplumber241920755editdlrm
wmf2eps201920755editdlrm
wmf2fig202880755editdlrm
wmf2gd161920755editdlrm
wmf2svg202960755editdlrm
wmf2x160800755editdlrm
word-list-compress160800755editdlrm
wpctl737600755editdlrm
wpexec200720755editdlrm
write238002755editdlrm
x86_64281360755editdlrm
x86_64-redhat-linux-c++10972240755editdlrm
x86_64-redhat-linux-g++10972240755editdlrm
x86_64-redhat-linux-gcc10931280755editdlrm
x86_64-redhat-linux-gcc-1110931280755editdlrm
x86_64-redhat-linux-gnu-pkg-config8290755editdlrm
x86_energy_perf_policy396560755editdlrm
xargs656320755editdlrm
xb-tool322240755editdlrm
xdg-dbus-proxy578960755editdlrm
xgettext3038240755editdlrm
xml2-config18770755editdlrm
xmlcatalog237120755editdlrm
xmllint824880755editdlrm
xmlsec1730880755editdlrm
xmlwf405760755editdlrm
xslt-config26390755editdlrm
xsltproc319840755editdlrm
xsubpp50800755editdlrm
xz869760755editdlrm
xzcat869760755editdlrm
xzcmp66370755editdlrm
xzdec162320755editdlrm
xzdiff66370755editdlrm
xzegrep59080755editdlrm
xzfgrep59080755editdlrm
xzgrep59080755editdlrm
xzless18030755editdlrm
xzmore21660755editdlrm
yat2m410000755editdlrm
yes320640755editdlrm
ypdomainname244080755editdlrm
yum20940755editdlrm
yum-builddep36900755editdlrm
yum-config-manager36900755editdlrm
yum-debug-dump36900755editdlrm
yum-debug-restore36900755editdlrm
yum-groups-manager36900755editdlrm
yumdownloader36900755editdlrm
zcat19880755editdlrm
zcmp16820755editdlrm
zdiff64510755editdlrm
zdump280000755editdlrm
zegrep330755editdlrm
zfgrep330755editdlrm
zforce20850755editdlrm
zgrep81160755editdlrm
zip2264000755editdlrm
zipcloak775120755editdlrm
zipdetails599690755editdlrm
zipgrep29570755editdlrm
zipinfo2006880755editdlrm
zipnote692320755editdlrm
zipsplit651040755editdlrm
zless22100755editdlrm
zlib_decompress1178800755editdlrm
zmore18460755editdlrm
znew45810755editdlrm
zone2json14109280755editdlrm
zone2sql14355360755editdlrm
zsoelim329520755editdlrm
[528720755editdlrm
Edit: /usr/bin/kdumpctl (61276B)
#!/usr/bin/bash KEXEC=/sbin/kexec KDUMP_KERNELVER="" KDUMP_KERNEL="" KDUMP_COMMANDLINE="" KEXEC_ARGS="" MKDUMPRD="/sbin/mkdumprd -f" MKFADUMPRD="/sbin/mkfadumprd" DRACUT_MODULES_FILE="/usr/lib/dracut/modules.txt" SAVE_PATH=/var/crash SSH_KEY_LOCATION="/root/.ssh/kdump_id_rsa" DUMP_TARGET="" DEFAULT_INITRD="" DEFAULT_INITRD_BAK="" INITRD_CHECKSUM_LOCATION="" KDUMP_INITRD="" TARGET_INITRD="" #kdump shall be the default dump mode DEFAULT_DUMP_MODE="kdump" VMCORE_CREATION_STATUS="/var/lib/kdump/vmcore-creation.status" image_time=0 standard_kexec_args="-p" # Some default values in case /etc/sysconfig/kdump doesn't include KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug" if [[ -f /etc/sysconfig/kdump ]]; then . /etc/sysconfig/kdump fi [[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut . $dracutbasedir/dracut-functions.sh . /lib/kdump/kdump-lib.sh . /lib/kdump/kdump-logger.sh #initiate the kdump logger if ! dlog_init; then echo "failed to initiate the kdump logger." exit 1 fi KDUMP_TMPDIR=$(mktemp --tmpdir -d kdump.XXXX) TMPMNT="$KDUMP_TMPDIR/target" trap ' ret=$?; is_mounted $TMPMNT && umount -f $TMPMNT; rm -rf "$KDUMP_TMPDIR" [[ -d $LUKS_CONFIGFS ]] && find $LUKS_CONFIGFS/ -mindepth 1 -type d -delete exit $ret; ' EXIT single_instance_lock() { local rc timeout=5 lockfile if [[ -d /run/lock ]]; then lockfile=/run/lock/kdump else # when updating package using virt-customize, /run/lock doesn't exist lockfile=/tmp/kdump.lock fi if ! exec 9> $lockfile; then derror "Create file lock failed" exit 1 fi flock -n 9 rc=$? while [[ $rc -ne 0 ]]; do dinfo "Another app is currently holding the kdump lock; waiting for it to exit..." flock -w $timeout 9 rc=$? done } determine_dump_mode() { # Check if firmware-assisted dump is enabled # if yes, set the dump mode as fadump if is_fadump_capable; then dinfo "Dump mode is fadump" DEFAULT_DUMP_MODE="fadump" fi ddebug "DEFAULT_DUMP_MODE=$DEFAULT_DUMP_MODE" } save_core() { coredir="/var/crash/$(date +"%Y-%m-%d-%H:%M")" mkdir -p "$coredir" ddebug "cp --sparse=always /proc/vmcore $coredir/vmcore-incomplete" if cp --sparse=always /proc/vmcore "$coredir/vmcore-incomplete"; then mv "$coredir/vmcore-incomplete" "$coredir/vmcore" dinfo "saved a vmcore to $coredir" else derror "failed to save a vmcore to $coredir" fi # pass the dmesg to Abrt tool if exists, in order # to collect the kernel oops message. # https://fedorahosted.org/abrt/ if [[ -x /usr/bin/dumpoops ]]; then ddebug "makedumpfile --dump-dmesg $coredir/vmcore $coredir/dmesg" makedumpfile --dump-dmesg "$coredir/vmcore" "$coredir/dmesg" > /dev/null 2>&1 ddebug "dumpoops -d $coredir/dmesg" if dumpoops -d "$coredir/dmesg" > /dev/null 2>&1; then dinfo "kernel oops has been collected by abrt tool" fi fi } rebuild_fadump_initrd() { if ! $MKFADUMPRD "$DEFAULT_INITRD_BAK" "$TARGET_INITRD" --kver "$KDUMP_KERNELVER"; then derror "mkfadumprd: failed to make fadump initrd" return 1 fi return 0 } check_earlykdump_is_enabled() { grep -q -w "rd.earlykdump" /proc/cmdline } rebuild_kdump_initrd() { ddebug "rebuild kdump initrd: $MKDUMPRD $TARGET_INITRD $KDUMP_KERNELVER" if ! $MKDUMPRD "$TARGET_INITRD" "$KDUMP_KERNELVER"; then derror "mkdumprd: failed to make kdump initrd" return 1 fi if check_earlykdump_is_enabled; then dwarn "Tips: If early kdump is enabled, also require rebuilding the system initramfs to make the changes take effect for early kdump." fi return 0 } check_and_generate_vconsole_conf() { if [[ ! -e /etc/vconsole.conf ]]; then dwarn "/etc/vconsole.conf does not exist, trying to set keymap to us to reduce the initramfs size." if [[ -x "$(command -v localectl)" ]] ; then if localectl list-keymaps | grep -q "^us$"; then localectl set-keymap us 2>/dev/null fi fi fi } rebuild_initrd() { local _ret if [[ ! -w $(dirname "$TARGET_INITRD") ]]; then derror "$(dirname "$TARGET_INITRD") does not have write permission. Cannot rebuild $TARGET_INITRD" return 1 fi check_and_generate_vconsole_conf if [[ $DEFAULT_DUMP_MODE == "fadump" ]]; then rebuild_fadump_initrd else rebuild_kdump_initrd fi _ret=$? set_vmcore_creation_status 'clear' return $_ret } #$1: the files to be checked with IFS=' ' check_exist() { for file in $1; do if [[ ! -e $file ]]; then derror "Error: $file not found." return 1 fi done } #$1: the files to be checked with IFS=' ' check_executable() { for file in $1; do if [[ ! -x $file ]]; then derror "Error: $file is not executable." return 1 fi done } backup_default_initrd() { ddebug "backup default initrd: $DEFAULT_INITRD" if [[ ! -f $DEFAULT_INITRD ]]; then return fi if [[ ! -e $DEFAULT_INITRD_BAK ]]; then dinfo "Backing up $DEFAULT_INITRD before rebuild." # save checksum to verify before restoring sha1sum "$DEFAULT_INITRD" > "$INITRD_CHECKSUM_LOCATION" if ! cp "$DEFAULT_INITRD" "$DEFAULT_INITRD_BAK"; then dwarn "WARNING: failed to backup $DEFAULT_INITRD." rm -f -- "$INITRD_CHECKSUM_LOCATION" rm -f -- "$DEFAULT_INITRD_BAK" fi fi } restore_default_initrd() { ddebug "restore default initrd: $DEFAULT_INITRD" if [[ ! -f $DEFAULT_INITRD ]]; then return fi # If a backup initrd exists, we must be switching back from # fadump to kdump. Restore the original default initrd. if [[ -f $DEFAULT_INITRD_BAK ]] && [[ -f $INITRD_CHECKSUM_LOCATION ]]; then # verify checksum before restoring backup_checksum=$(sha1sum "$DEFAULT_INITRD_BAK" | awk '{ print $1 }') default_checksum=$(awk '{ print $1 }' "$INITRD_CHECKSUM_LOCATION") if [[ $default_checksum != "$backup_checksum" ]]; then dwarn "WARNING: checksum mismatch! Can't restore original initrd.." else rm -f $INITRD_CHECKSUM_LOCATION if mv "$DEFAULT_INITRD_BAK" "$DEFAULT_INITRD"; then derror "Restoring original initrd as fadump mode is disabled." sync fi fi fi } check_config() { local -A _opt_rec while read -r config_opt config_val; do case "$config_opt" in dracut_args) if [[ $config_val == *--mount* ]]; then if [[ $(echo "$config_val" | grep -o "\-\-mount" | wc -l) -ne 1 ]]; then derror 'Multiple mount targets specified in one "dracut_args".' return 1 fi config_opt=_target fi ;; raw) if [[ -d "/proc/device-tree/ibm,opal/dump" ]]; then dwarn "WARNING: Won't capture opalcore when 'raw' dump target is used." fi config_opt=_target ;; ext[234] | minix | btrfs | xfs | nfs | ssh | virtiofs) config_opt=_target ;; sshkey | path | core_collector | kdump_post | kdump_pre | extra_bins | extra_modules | failure_action | default | final_action | force_rebuild | force_no_rebuild | fence_kdump_args | fence_kdump_nodes | auto_reset_crashkernel) ;; net | options | link_delay | disk_timeout | debug_mem_level | blacklist) derror "Deprecated kdump config option: $config_opt. Refer to kdump.conf manpage for alternatives." return 1 ;; '') continue ;; *) derror "Invalid kdump config option $config_opt" return 1 ;; esac if [[ -z $config_val ]]; then derror "Invalid kdump config value for option '$config_opt'" return 1 fi if [[ -n ${_opt_rec[$config_opt]} ]]; then if [[ $config_opt == _target ]]; then derror "More than one dump targets specified" else derror "Duplicated kdump config value of option $config_opt" fi return 1 fi _opt_rec[$config_opt]="$config_val" done <<< "$(kdump_read_conf)" check_failure_action_config || return 1 check_final_action_config || return 1 check_fence_kdump_config || return 1 return 0 } # get_pcs_cluster_modified_files # return list of modified file for fence_kdump modified in Pacemaker cluster get_pcs_cluster_modified_files() { local time_stamp local modified_files is_generic_fence_kdump && return 1 is_pcs_fence_kdump || return 1 time_stamp=$(pcs cluster cib | xmllint --xpath 'string(/cib/@cib-last-written)' - | xargs -0 date +%s --date) if [[ -n $time_stamp ]] && [[ $time_stamp -gt $image_time ]]; then modified_files="cluster-cib" fi if [[ -f $FENCE_KDUMP_CONFIG_FILE ]]; then time_stamp=$(stat -c "%Y" "$FENCE_KDUMP_CONFIG_FILE") if [[ $time_stamp -gt $image_time ]]; then modified_files="$modified_files $FENCE_KDUMP_CONFIG_FILE" fi fi echo "$modified_files" } setup_initrd() { if ! prepare_kdump_bootinfo; then derror "failed to prepare for kdump bootinfo." return 1 fi DEFAULT_INITRD_BAK="$KDUMP_BOOTDIR/.$(basename "$DEFAULT_INITRD").default" INITRD_CHECKSUM_LOCATION="$DEFAULT_INITRD_BAK.checksum" if [[ $DEFAULT_DUMP_MODE == "fadump" ]]; then TARGET_INITRD="$DEFAULT_INITRD" # backup initrd for reference before replacing it # with fadump aware initrd backup_default_initrd else TARGET_INITRD="$KDUMP_INITRD" # check if a backup of default initrd exists. If yes, # it signifies a switch from fadump mode. So, restore # the backed up default initrd. restore_default_initrd fi } check_files_modified() { local modified_files="" #also rebuild when Pacemaker cluster conf is changed and fence kdump is enabled. modified_files=$(get_pcs_cluster_modified_files) EXTRA_BINS=$(kdump_get_conf_val kdump_post) CHECK_FILES=$(kdump_get_conf_val kdump_pre) HOOKS="/etc/kdump/post.d/ /etc/kdump/pre.d/" if [[ -d /etc/kdump/post.d ]]; then for file in /etc/kdump/post.d/*; do if [[ -x $file ]]; then POST_FILES="$POST_FILES $file" fi done fi if [[ -d /etc/kdump/pre.d ]]; then for file in /etc/kdump/pre.d/*; do if [[ -x $file ]]; then PRE_FILES="$PRE_FILES $file" fi done fi HOOKS="$HOOKS $POST_FILES $PRE_FILES" CORE_COLLECTOR=$(kdump_get_conf_val core_collector | awk '{print $1}') CORE_COLLECTOR=$(type -P "$CORE_COLLECTOR") # POST_FILES and PRE_FILES are already checked against executable, need not to check again. EXTRA_BINS="$EXTRA_BINS $CHECK_FILES" CHECK_FILES=$(kdump_get_conf_val extra_bins) EXTRA_BINS="$EXTRA_BINS $CHECK_FILES" files="$KDUMP_CONFIG_FILE $KDUMP_KERNEL $EXTRA_BINS $CORE_COLLECTOR" [[ -e /etc/fstab ]] && files="$files /etc/fstab" # Check for any updated extra module EXTRA_MODULES="$(kdump_get_conf_val extra_modules)" if [[ -n $EXTRA_MODULES ]]; then if [[ -e /lib/modules/$KDUMP_KERNELVER/modules.dep ]]; then files="$files /lib/modules/$KDUMP_KERNELVER/modules.dep" fi for _module in $EXTRA_MODULES; do if _module_file="$(modinfo --set-version "$KDUMP_KERNELVER" --filename "$_module" 2> /dev/null)"; then files="$files $_module_file" for _dep_modules in $(modinfo -F depends "$_module" | tr ',' ' '); do files="$files $(modinfo --set-version "$KDUMP_KERNELVER" --filename "$_dep_modules" 2> /dev/null)" done else # If it's not a module nor builtin, give an error if ! (modprobe --set-version "$KDUMP_KERNELVER" --dry-run "$_module" &> /dev/null); then dwarn "Module $_module not found" fi fi done fi # HOOKS is mandatory and need to check the modification time files="$files $HOOKS" is_lvm2_thinp_dump_target && files="$files $LVM_CONF" check_exist "$files" && check_executable "$EXTRA_BINS" || return 2 for file in $files; do if [[ -e $file ]]; then time_stamp=$(stat -c "%Y" "$file") if [[ $time_stamp -gt $image_time ]]; then modified_files="$modified_files $file" fi if [[ -L $file ]]; then file=$(readlink -m "$file") time_stamp=$(stat -c "%Y" "$file") if [[ $time_stamp -gt $image_time ]]; then modified_files="$modified_files $file" fi fi else dwarn "$file doesn't exist" fi done if [[ -n $modified_files ]]; then dinfo "Detected change(s) in the following file(s): $modified_files" return 1 fi return 0 } check_drivers_modified() { local _target _new_drivers _old_drivers _module_name _module_filename # If it's dump target is on block device, detect the block driver _target=$(get_block_dump_target) if [[ -n $_target ]]; then _record_block_drivers() { local _drivers _drivers=$(udevadm info -a "/dev/block/$1" | sed -n 's/\s*DRIVERS=="\(\S\+\)"/\1/p') for _driver in $_drivers; do if ! [[ " $_new_drivers " == *" $_driver "* ]]; then _new_drivers="$_new_drivers $_driver" fi done ddebug "MAJ:MIN=$1 drivers='$_drivers'" } check_block_and_slaves_all _record_block_drivers "$(get_maj_min "$_target")" fi # Include watchdog drivers if watchdog module is not omitted is_dracut_mod_omitted watchdog || _new_drivers+=" $(get_watchdog_drvs)" [[ -z $_new_drivers ]] && return 0 if is_fadump_capable; then _old_drivers="$(lsinitrd "$TARGET_INITRD" -f /usr/lib/dracut/fadump-kernel-modules.txt | tr '\n' ' ')" else _old_drivers="$(lsinitrd "$TARGET_INITRD" -f /usr/lib/dracut/hostonly-kernel-modules.txt | tr '\n' ' ')" fi ddebug "Modules required for kdump: '$_new_drivers'" ddebug "Modules included in old initramfs: '$_old_drivers'" for _driver in $_new_drivers; do # Skip deprecated/invalid driver name or built-in module _module_name=$(modinfo --set-version "$KDUMP_KERNELVER" -F name "$_driver" 2> /dev/null) _module_filename=$(modinfo --set-version "$KDUMP_KERNELVER" -n "$_driver" 2> /dev/null) if [[ -z $_module_name ]] || [[ -z $_module_filename ]] || [[ $_module_filename == *"(builtin)"* ]]; then continue fi if ! [[ " $_old_drivers " == *" $_module_name "* ]]; then dinfo "Detected change in block device driver, new loaded module: $_module_name" return 1 fi done } check_fs_modified() { local _old_dev _old_mntpoint _old_fstype local _new_dev _new_mntpoint _new_fstype local _target _dracut_args # No need to check in case of mount target specified via "dracut_args". if is_mount_in_dracut_args; then return 0 fi # No need to check in case of raw target. # Currently we do not check also if ssh/nfs/virtiofs/thinp target is specified if is_ssh_dump_target || is_nfs_dump_target || is_raw_dump_target || is_virtiofs_dump_target || is_lvm2_thinp_dump_target; then return 0 fi _target=$(get_block_dump_target) _new_fstype=$(get_fs_type_from_target "$_target") if [[ -z $_target ]] || [[ -z $_new_fstype ]]; then derror "Dump target is invalid" return 2 fi ddebug "_target=$_target _new_fstype=$_new_fstype" _new_dev=$(kdump_get_persistent_dev "$_target") if [[ -z $_new_dev ]]; then perror "Get persistent device name failed" return 2 fi _new_mntpoint="$(get_kdump_mntpoint_from_target "$_target")" _dracut_args=$(lsinitrd "$TARGET_INITRD" -f usr/lib/dracut/build-parameter.txt) if [[ -z $_dracut_args ]]; then dwarn "Warning: No dracut arguments found in initrd" return 0 fi # if --mount argument present then match old and new target, mount # point and file system. If any of them mismatches then rebuild if echo "$_dracut_args" | grep -q "\-\-mount"; then # shellcheck disable=SC2046 set -- $(echo "$_dracut_args" | awk -F "--mount '" '{print $2}' | cut -d' ' -f1,2,3) _old_dev=$1 _old_mntpoint=$2 _old_fstype=$3 [[ $_new_dev == "$_old_dev" && $_new_mntpoint == "$_old_mntpoint" && $_new_fstype == "$_old_fstype" ]] && return 0 # otherwise rebuild if target device is not a root device else [[ $_target == "$(get_root_fs_device)" ]] && return 0 fi dinfo "Detected change in File System" return 1 } # returns 0 if system is not modified # returns 1 if system is modified # returns 2 if system modification is invalid check_system_modified() { local ret local CONF_ERROR=2 local CONF_MODIFY=1 local CONF_NO_MODIFY=0 local conf_status=$CONF_NO_MODIFY [[ -f $TARGET_INITRD ]] || return 1 for _func in check_files_modified check_fs_modified check_drivers_modified; do $_func ret=$? # return immediately if an error occurred. [[ $ret -eq "$CONF_ERROR" ]] && return "$ret" [[ $ret -eq "$CONF_MODIFY" ]] && { conf_status="$CONF_MODIFY"; } done return $conf_status } check_rebuild() { local capture_capable_initrd="1" local force_rebuild force_no_rebuild local ret system_modified="0" setup_initrd || return 1 force_no_rebuild=$(kdump_get_conf_val force_no_rebuild) force_no_rebuild=${force_no_rebuild:-0} if [[ $force_no_rebuild != "0" ]] && [[ $force_no_rebuild != "1" ]]; then derror "Error: force_no_rebuild value is invalid" return 1 fi force_rebuild=$(kdump_get_conf_val force_rebuild) force_rebuild=${force_rebuild:-0} if [[ $force_rebuild != "0" ]] && [[ $force_rebuild != "1" ]]; then derror "Error: force_rebuild value is invalid" return 1 fi if [[ $force_no_rebuild == "1" && $force_rebuild == "1" ]]; then derror "Error: force_rebuild and force_no_rebuild are enabled simultaneously in kdump.conf" return 1 fi # Will not rebuild kdump initrd if [[ $force_no_rebuild == "1" ]]; then return 0 fi #check to see if dependent files has been modified #since last build of the image file if [[ -f $TARGET_INITRD ]]; then image_time=$(stat -c "%Y" "$TARGET_INITRD" 2> /dev/null) #in case of fadump mode, check whether the default/target #initrd is already built with dump capture capability if [[ $DEFAULT_DUMP_MODE == "fadump" ]]; then capture_capable_initrd=$(lsinitrd -f $DRACUT_MODULES_FILE "$TARGET_INITRD" | grep -c -e ^kdumpbase$ -e ^zz-fadumpinit$) fi fi check_system_modified ret=$? if [[ $ret -eq 2 ]]; then return 1 elif [[ $ret -eq 1 ]]; then system_modified="1" fi if [[ $image_time -eq 0 ]]; then dinfo "No kdump initial ramdisk found." elif [[ $capture_capable_initrd == "0" ]]; then dinfo "Rebuild $TARGET_INITRD with dump capture support" elif [[ $force_rebuild != "0" ]]; then dinfo "Force rebuild $TARGET_INITRD" elif [[ $system_modified != "0" ]]; then : else return 0 fi dinfo "Rebuilding $TARGET_INITRD" rebuild_initrd } # On ppc64le LPARs, the keys trusted by firmware do not end up in # .builtin_trusted_keys. So instead, add the key to the .ima keyring function load_kdump_kernel_key() { # this is only called inside is_secure_boot_enforced, # no need to retest # this is only required if DT /ibm,secure-boot is a file. # if it is a dir, we are on OpenPower and don't need this. if ! [[ -f /proc/device-tree/ibm,secure-boot ]]; then return fi # %.ima keyring is writable to the user, no need to use # "sudo -i keyctl" keyctl padd asymmetric "" %:.ima < "/usr/share/doc/kernel-keys/$KDUMP_KERNELVER/kernel-signing-ppc.cer" } # Load the kdump kernel specified in /etc/sysconfig/kdump # If none is specified, try to load a kdump kernel with the same version # as the currently running kernel. load_kdump() { local uki KEXEC_ARGS=$(prepare_kexec_args "${KEXEC_ARGS}") KDUMP_COMMANDLINE=$(prepare_cmdline "${KDUMP_COMMANDLINE}" "${KDUMP_COMMANDLINE_REMOVE}" "${KDUMP_COMMANDLINE_APPEND}") if is_uki "$KDUMP_KERNEL"; then uki=$KDUMP_KERNEL KDUMP_KERNEL=$KDUMP_TMPDIR/vmlinuz objcopy -O binary --only-section .linux "$uki" "$KDUMP_KERNEL" sync -f "$KDUMP_KERNEL" # Make sure the temp file has the correct SELinux label. # Otherwise starting the kdump.service will fail. chcon -t boot_t "$KDUMP_KERNEL" fi if ! prepare_luks; then derror "kexec: failed to prepare for a LUKS target" return 1 fi [[ ${KEYCTL_CMD[0]} == sudo ]] && KEXEC="sudo -i $KEXEC" ddebug "$KEXEC $KEXEC_ARGS $standard_kexec_args --command-line=$KDUMP_COMMANDLINE --initrd=$TARGET_INITRD $KDUMP_KERNEL" # shellcheck disable=SC2086 $KEXEC $KEXEC_ARGS $standard_kexec_args \ --command-line="$KDUMP_COMMANDLINE" \ --initrd="$TARGET_INITRD" "$KDUMP_KERNEL" if [[ $? == 0 ]]; then dinfo "kexec: loaded kdump kernel" return 0 else derror "kexec: failed to load kdump kernel" return 1 fi } check_ssh_config() { local SSH_TARGET while read -r config_opt config_val; do case "$config_opt" in sshkey) # remove inline comments after the end of a directive. if [[ -f $config_val ]]; then # canonicalize the path SSH_KEY_LOCATION=$(/usr/bin/readlink -m "$config_val") else dwarn "WARNING: '$config_val' doesn't exist, using default value '$SSH_KEY_LOCATION'" fi ;; path) SAVE_PATH=$config_val ;; ssh) DUMP_TARGET=$config_val ;; *) ;; esac done <<< "$(kdump_read_conf)" #make sure they've configured kdump.conf for ssh dumps SSH_TARGET=$(echo -n "$DUMP_TARGET" | sed -n '/.*@/p') if [[ -z $SSH_TARGET ]]; then return 1 fi return 0 } # ipv6 host address may takes a long time to be ready. # Instead of checking against ipv6 address, we just check the network reachable # by the return val of 'ssh' check_and_wait_network_ready() { local start_time local warn_once=1 local cur local diff local retval local errmsg start_time=$(date +%s) while true; do errmsg=$(ssh -i "$SSH_KEY_LOCATION" -o BatchMode=yes "$DUMP_TARGET" mkdir -p "$SAVE_PATH" 2>&1) retval=$? # ssh exits with the exit status of the remote command or with 255 if an error occurred if [[ $retval -eq 0 ]]; then return 0 elif [[ $retval -ne 255 ]]; then derror "Could not create $DUMP_TARGET:$SAVE_PATH, you should check the privilege on server side" return 1 fi # if server removes the authorized_keys or, no /root/.ssh/kdump_id_rsa ddebug "$errmsg" if echo "$errmsg" | grep -q "Permission denied\|No such file or directory\|Host key verification failed"; then derror "Could not create $DUMP_TARGET:$SAVE_PATH, you probably need to run \"kdumpctl propagate\"" return 1 fi if [[ $warn_once -eq 1 ]]; then dwarn "Network dump target is not usable, waiting for it to be ready..." warn_once=0 fi cur=$(date +%s) diff=$((cur - start_time)) # 60s time out if [[ $diff -gt 180 ]]; then break fi sleep 1 done dinfo "Could not create $DUMP_TARGET:$SAVE_PATH, ipaddr is not ready yet. You should check network connection" return 1 } check_ssh_target() { check_and_wait_network_ready } propagate_ssh_key() { if ! check_ssh_config; then derror "No ssh config specified in $KDUMP_CONFIG_FILE. Can't propagate" exit 1 fi local KEYFILE=$SSH_KEY_LOCATION local errmsg="Failed to propagate ssh key" #Check to see if we already created key, if not, create it. if [[ -f $KEYFILE ]]; then dinfo "Using existing keys..." else dinfo "Generating new ssh keys... " /usr/bin/ssh-keygen -t rsa -f "$KEYFILE" -N "" 2>&1 > /dev/null dinfo "done." fi #now find the target ssh user and server to contact. SSH_USER=$(echo "$DUMP_TARGET" | cut -d@ -f1) SSH_SERVER=$(echo "$DUMP_TARGET" | sed -e's/\(.*@\)\(.*$\)/\2/') #now send the found key to the found server ssh-copy-id -i "$KEYFILE" "$SSH_USER@$SSH_SERVER" RET=$? if [[ $RET == 0 ]]; then dinfo "$KEYFILE has been added to ~$SSH_USER/.ssh/authorized_keys on $SSH_SERVER" return 0 else derror "$errmsg, $KEYFILE failed in transfer to $SSH_SERVER" exit 1 fi } show_reserved_mem() { local mem local mem_mb mem=$(get_reserved_mem_size) mem_mb=$((mem / 1024 / 1024)) dinfo "Reserved ${mem_mb}MB memory for crash kernel" } save_raw() { local kdump_dir local raw_target raw_target=$(kdump_get_conf_val raw) [[ -z $raw_target ]] && return 0 [[ -b $raw_target ]] || { derror "raw partition $raw_target not found" return 1 } check_fs=$(lsblk --nodeps -npo FSTYPE "$raw_target") if [[ $(echo "$check_fs" | wc -w) -ne 0 ]]; then dwarn "Warning: Detected '$check_fs' signature on $raw_target, data loss is expected." return 0 fi kdump_dir=$(kdump_get_conf_val path) if [[ -z ${kdump_dir} ]]; then coredir="/var/crash/$(date +"%Y-%m-%d-%H:%M")" else coredir="${kdump_dir}/$(date +"%Y-%m-%d-%H:%M")" fi mkdir -p "$coredir" [[ -d $coredir ]] || { derror "failed to create $coredir" return 1 } if makedumpfile -R "$coredir/vmcore" < "$raw_target" > /dev/null 2>&1; then # dump found dinfo "Dump saved to $coredir/vmcore" # wipe makedumpfile header dd if=/dev/zero of="$raw_target" bs=1b count=1 2> /dev/null else rm -rf "$coredir" fi return 0 } local_fs_dump_target() { local _target if _target=$(grep -E "^ext[234]|^xfs|^btrfs|^minix" /etc/kdump.conf); then echo "$_target" | awk '{print $2}' fi } path_to_be_relabeled() { local _path _target _mnt="/" _rmnt if is_user_configured_dump_target; then if is_mount_in_dracut_args; then return fi _target=$(local_fs_dump_target) if [[ -n $_target ]]; then _mnt=$(get_mntpoint_from_target "$_target") if ! is_mounted "$_mnt"; then return fi else return fi fi _path=$(get_save_path) # if $_path is masked by other mount, we will not relabel it. _rmnt=$(df "$_mnt/$_path" 2> /dev/null | tail -1 | awk '{ print $NF }') if [[ $_rmnt == "$_mnt" ]]; then echo "$_mnt/$_path" fi } selinux_relabel() { local _path _i _attr _path=$(path_to_be_relabeled) if [[ -z $_path ]] || ! [[ -d $_path ]]; then return fi while IFS= read -r -d '' _i; do _attr=$(getfattr -m "security.selinux" "$_i" 2> /dev/null) if [[ -z $_attr ]]; then restorecon "$_i" fi done < <(find "$_path" -print0) } check_fence_kdump_config() { local hostname local ipaddrs local nodes hostname=$(hostname) ipaddrs=$(hostname -I) nodes=$(kdump_get_conf_val "fence_kdump_nodes") for node in $nodes; do if [[ $node == "$hostname" ]]; then derror "Option fence_kdump_nodes cannot contain $hostname" return 1 fi # node can be ipaddr if echo "$ipaddrs " | grep -q "$node "; then derror "Option fence_kdump_nodes cannot contain $node" return 1 fi done return 0 } check_dump_feasibility() { if [[ $DEFAULT_DUMP_MODE == "fadump" ]]; then return 0 fi check_kdump_feasibility } fadump_bootargs_append() { if [[ -f "$FADUMP_APPEND_ARGS_SYS_NODE" ]]; then output=$( { echo "${FADUMP_COMMANDLINE_APPEND}" > "$FADUMP_APPEND_ARGS_SYS_NODE" ; } 2>&1) if [ $? -eq 0 ]; then output=$(cat "$FADUMP_APPEND_ARGS_SYS_NODE") dinfo "fadump: additional parameters for capture kernel: '$output'" else dwarn "WARNING: failed to setup additional parameters for fadump capture kernel: '$output'" fi else dwarn "WARNING: this kernel does not support passing additional parameters to fadump capture kernel." fi } start_fadump() { fadump_bootargs_append echo 1 > "$FADUMP_REGISTER_SYS_NODE" if ! is_kernel_loaded "fadump"; then derror "fadump: failed to register" return 1 fi dinfo "fadump: registered successfully" return 0 } start_dump() { # On secure boot enabled Power systems, load kernel signing key on .ima for signature # verification using kexec file based syscall. if [[ "$(uname -m)" == ppc64le ]] && is_secure_boot_enforced; then load_kdump_kernel_key fi if [[ $DEFAULT_DUMP_MODE == "fadump" ]]; then start_fadump else load_kdump fi } check_failure_action_config() { local default_option local failure_action local option="failure_action" default_option=$(kdump_get_conf_val default) failure_action=$(kdump_get_conf_val failure_action) if [[ -z $failure_action ]] && [[ -z $default_option ]]; then return 0 elif [[ -n $failure_action ]] && [[ -n $default_option ]]; then derror "Cannot specify 'failure_action' and 'default' option together" return 1 fi if [[ -n $default_option ]]; then option="default" failure_action="$default_option" fi case "$failure_action" in reboot | halt | poweroff | shell | dump_to_rootfs) return 0 ;; *) dinfo $"Usage kdump.conf: $option {reboot|halt|poweroff|shell|dump_to_rootfs}" return 1 ;; esac } check_final_action_config() { local final_action final_action=$(kdump_get_conf_val final_action) if [[ -z $final_action ]]; then return 0 else case "$final_action" in reboot | halt | poweroff) return 0 ;; *) dinfo $"Usage kdump.conf: final_action {reboot|halt|poweroff}" return 1 ;; esac fi } remove_luks_vol_keys() { local _key_line _key_id _key_desc _status=1 # Get all keys from @u keyring and process each line # sudo process by default only has the permission to list the keys # stored in user keyring i.e. "sudo keyctl list" can work not # "sudo keyctl unlink/show" while read -r _key_line; do # Skip header lines and empty lines [[ $_key_line =~ ^[0-9]+: ]] || continue # Extract key ID (first field before colon) _key_id=${_key_line%%:*} # Extract key description (everything after "logon: " or "user: ") if [[ $_key_line =~ logon:\ (.+)$ ]]; then _key_desc=${BASH_REMATCH[1]} else continue fi # Check if key description starts with LUKS_KEY_PRFIX if [[ $_key_desc == "$LUKS_KEY_PRFIX"* ]]; then "${KEYCTL_CMD[@]}" unlink "$_key_id" _status=0 fi done < <(keyctl list @u 2> /dev/null || true) return $_status } _get_luks_key_by_unlock() { local _devuuid=$1 _key_des=$2 local _max_retries local _attempt=1 local _luks_unlock_cmd="" # Check if stdin is a terminal. if [ -t 0 ]; then _max_retries=5 ddebug "Attempting to unlock LUKS device. You have $_max_retries attempts." else # Not a terminal (e.g., running as system service), so only try once # for cases where volume key is sealed to TPM which doesn't need user # interaction. _max_retries=1 ddebug "Attempting to unlock LUKS device (non-interactive mode)..." fi while [ "$_attempt" -le "$_max_retries" ]; do if cryptsetup open "UUID=$_devuuid" DUMMY "--link-vk-to-keyring=@u::%logon:$_key_des" --test-passphrase; then ddebug "Success: LUKS device unlocked." # For an interactive terminal, it's possible an user manually entered a passphrase [ -t 0 ] && dwarn "If you typed passphrase to unlock it manually, please run 'kdumpctl setup-crypttab' (see man kdumpctl)." return 0 fi _attempt=$((_attempt + 1)) done derror "Error: Could not unlock the LUKS device." return 1 } # Some users may use "sudo kdumpctl". sudo process by default inherits the # session keyring (@s) of the original user which means it can't read LUKS keys # stored in root's user (@u) which is only linked to root's session keyring. # So use "sudo -i keyctl" and "sudo kexec" automatically in order to be able to # search and read the LUKS key(s). KEYCTL_CMD=(keyctl) prepare_luks() { local _key_id _key_des _luks_unlock_cmd declare -a _luks_devs # Use "sudo -i" to use the root's session keyring to access LUKS keys if ! keyctl show @s | grep -qs "_uid.0$"; then KEYCTL_CMD=(sudo -i keyctl) fi mapfile -t _luks_devs < <(get_all_kdump_crypt_dev) if [[ ${#_luks_devs[@]} -lt 1 ]]; then if remove_luks_vol_keys; then dwarn "Encrypted device not in dump path, please drop the link-volume-key option in $CRYPTTAB_FILE" fi return 0 fi # Currently only x86_64 is supported if [[ "$(uname -m)" != "x86_64" ]]; then dwarn "Warning: Encrypted device is in dump path, which is not recommended, see kexec-kdump-howto.txt for more details." return 0 fi if [[ ! -d $LUKS_CONFIGFS ]]; then dwarn "$LUKS_CONFIGFS not available, please use a newer kernel or see kexec-kdump-howto.txt to make sure dumping to encrypted target will work." remove_luks_vol_keys return 0 fi # For the case of CPU/memory hotplugging, we can reuse loaded keys [[ $(cat $LUKS_CONFIGFS/reuse) == 1 ]] && return 0 for _devuuid in "${_luks_devs[@]}"; do _key_dir=$LUKS_CONFIGFS/$_devuuid _key_des=$LUKS_KEY_PRFIX$_devuuid if _key_id=$("${KEYCTL_CMD[@]}" request logon "$_key_des" 2> /dev/null); then ddebug "Succesfully get @u::%logon:$_key_des" elif _get_luks_key_by_unlock "$_devuuid" "$_key_des"; then if ! _key_id=$("${KEYCTL_CMD[@]}" request logon "$_key_des"); then derror "Probably you are using 'sudo kdumpctl' or 'sudo su', please retry with 'sudo -i kdumpctl'" return 1 fi ddebug "Succesfully get @u::%logon:$_key_des after cryptsetup" else derror "Failed to get logon key $_key_des. Run 'kdumpctl restart' manually to start kdump." return 1 fi # Let the key expire after 300 seconds "${KEYCTL_CMD[@]}" timeout "$_key_id" 300 mkdir "$_key_dir" printf "%s" "$_key_des" > "$_key_dir"/description done } start() { if ! check_dump_feasibility; then derror "Starting kdump: [FAILED]" return 1 fi if ! check_config; then derror "Starting kdump: [FAILED]" return 1 fi if sestatus 2> /dev/null | grep -q "SELinux status.*enabled"; then selinux_relabel fi if ! save_raw; then derror "Starting kdump: [FAILED]" return 1 fi if [[ $DEFAULT_DUMP_MODE == "kdump" ]] && is_kernel_loaded "kdump"; then dwarn "Kdump already running: [WARNING]" return 0 fi if check_ssh_config; then if ! check_ssh_target; then derror "Starting kdump: [FAILED]" return 1 fi fi if ! check_rebuild; then derror "Starting kdump: [FAILED]" return 1 fi if ! start_dump; then derror "Starting kdump: [FAILED]" return 1 fi dinfo "Starting kdump: [OK]" } # @description Updates a crypttab file to add the 'link-volume-key' option for kdump devices. # # It gets the list of kdump-related UUIDs by calling the 'get_all_kdump_crypt_dev' function. # The function is idempotent and performs pre-flight checks before making any modifications. # # @exitcode 0 If the update was successful or no changes were needed. # @exitcode 1 If there is an error (e.g. UUID mismatch). # # @stdout No output on success. # @stderr Progress and error messages are printed to stderr. CRYPTTAB_FILE=/etc/crypttab setup_crypttab() { local _devuuid uuids_string temp_file declare -a _luks_devs if [[ "$(uname -m)" != "x86_64" ]]; then dwarn "Currently only x86_64 supported" return 0 fi if [[ ! -f $CRYPTTAB_FILE ]]; then dinfo "$CRYPTTAB_FILE doesn't exist, skip setup" return 0 fi mapfile -t _luks_devs < <(get_all_kdump_crypt_dev) if [[ ${#_luks_devs[@]} -eq 0 ]]; then dinfo "No LUKS-encrypted device found to process. Exiting." return 0 fi for _devuuid in "${_luks_devs[@]}"; do if ! awk -v devuuid="$_devuuid" '!/^[[:space:]]*#/ && $2 == "UUID="devuuid { found=1; exit } END { exit !found }' "$CRYPTTAB_FILE"; then derror "Device UUID=${_devuuid} doesn't exist." return 1 fi done uuids_string="${_luks_devs[*]}" temp_file=$(mktemp) local status_updates status_updates=$({ awk -v prefix="$LUKS_KEY_PRFIX" -v targets="$uuids_string" ' BEGIN { split(targets, temp_arr, " ") for (i in temp_arr) { target_uuids[temp_arr[i]] = 1 } } /^#|^$/ { print; next } { split($2, uuid_parts, "=") current_uuid = uuid_parts[2] if (current_uuid in target_uuids) { target_option = "link-volume-key=@u::%logon:" prefix current_uuid if (!index($0, target_option)) { # If we need to modify, check if we are replacing or adding if (index($0, "link-volume-key=")) { print "STATUS:REPLACED:" current_uuid > "/dev/stderr" } else { print "STATUS:ADDED:" current_uuid > "/dev/stderr" } # Remove any existing, incorrect link-volume-key option sub(/,?link-volume-key=[^, ]+/, "", $4) sub(/^,/, "", $4) # Add the correct option if (NF < 3 || $3 == "") { $3 = "none" } if ($4 == "" || $4 == "none") { $4 = target_option } else { $4 = $4 "," target_option } } } print }' "$CRYPTTAB_FILE" > "$temp_file" } 2>&1) if cmp -s "$CRYPTTAB_FILE" "$temp_file"; then dinfo "No changes were needed. $CRYPTTAB_FILE is already up to date." rm "$temp_file" return 0 else mv "$temp_file" "$CRYPTTAB_FILE" restorecon "$CRYPTTAB_FILE" dinfo "Success! $CRYPTTAB_FILE has been updated." # Parse status updates and report on each changed UUID while IFS=: read -r _ status uuid; do if [[ $status == "ADDED" ]]; then dinfo " - Added link-volume-key for UUID: $uuid" elif [[ $status == "REPLACED" ]]; then dinfo " - Replaced link-volume-key for UUID: $uuid" fi done < <(echo "$status_updates" | grep "STATUS:") dinfo "If the dump target is rootfs and you call this command manually, you will need to run 'dracut -f --regenerate-all' to regenerate initramfs." return 0 fi } reload() { if ! is_kernel_loaded "$DEFAULT_DUMP_MODE"; then dwarn "Kdump was not running: [WARNING]" fi if [[ $DEFAULT_DUMP_MODE == "fadump" ]]; then reload_fadump return else if ! stop_kdump; then derror "Stopping kdump: [FAILED]" return 1 fi fi dinfo "Stopping kdump: [OK]" if ! setup_initrd; then derror "Starting kdump: [FAILED]" return 1 fi if ! start_dump; then derror "Starting kdump: [FAILED]" return 1 fi dinfo "Starting kdump: [OK]" } stop_fadump() { echo 0 > "$FADUMP_REGISTER_SYS_NODE" if is_kernel_loaded "fadump"; then derror "fadump: failed to unregister" return 1 fi dinfo "fadump: unregistered successfully" return 0 } stop_kdump() { if is_secure_boot_enforced; then $KEXEC -s -p -u else $KEXEC -p -u fi # shellcheck disable=SC2181 if [[ $? != 0 ]]; then derror "kexec: failed to unload kdump kernel" return 1 fi dinfo "kexec: unloaded kdump kernel" return 0 } reload_fadump() { fadump_bootargs_append if echo 1 > "$FADUMP_REGISTER_SYS_NODE"; then dinfo "fadump: re-registered successfully" return 0 else # FADump could fail on older kernel where re-register # support is not enabled. Try stop/start from userspace # to handle such scenario. if stop_fadump; then start_fadump return fi fi return 1 } stop() { if [[ $DEFAULT_DUMP_MODE == "fadump" ]]; then stop_fadump else stop_kdump fi # shellcheck disable=SC2181 if [[ $? != 0 ]]; then derror "Stopping kdump: [FAILED]" return 1 fi dinfo "Stopping kdump: [OK]" return 0 } rebuild() { check_config || return 1 if check_ssh_config; then if ! check_ssh_target; then return 1 fi fi setup_initrd || return 1 dinfo "Rebuilding $TARGET_INITRD" rebuild_initrd } check_vmlinux() { # Use readelf to check if it's a valid ELF readelf -h "$1" &> /dev/null || return 1 } get_vmlinux_size() { local size=0 _msize while read -r _msize; do size=$((size + _msize)) done <<< "$(readelf -l -W "$1" | awk '/^ LOAD/{print $6}' 2> /dev/stderr)" echo $size } try_decompress() { # The obscure use of the "tr" filter is to work around older versions of # "grep" that report the byte offset of the line instead of the pattern. # Try to find the header ($1) and decompress from here for pos in $(tr "$1\n$2" "\n$2=" < "$4" | grep -abo "^$2"); do if ! type -P "$3" > /dev/null; then ddebug "Signiature detected but '$3' is missing, skip this decompressor" break fi pos=${pos%%:*} tail "-c+$pos" "$img" | $3 > "$5" 2> /dev/null if check_vmlinux "$5"; then ddebug "Kernel is extracted with '$3'" return 0 fi done return 1 } # Borrowed from linux/scripts/extract-vmlinux get_kernel_size() { # Prepare temp files: local tmp img=$1 tmp="$KDUMP_TMPDIR/vmlinux" # Try to check if it's a vmlinux already check_vmlinux "$img" && get_vmlinux_size "$img" && return 0 # That didn't work, so retry after decompression. try_decompress '\037\213\010' xy gunzip "$img" "$tmp" || try_decompress '\3757zXZ\000' abcde unxz "$img" "$tmp" || try_decompress 'BZh' xy bunzip2 "$img" "$tmp" || try_decompress '\135\0\0\0' xxx unlzma "$img" "$tmp" || try_decompress '\211\114\132' xy 'lzop -d' "$img" "$tmp" || try_decompress '\002!L\030' xxx 'lz4 -d' "$img" "$tmp" || try_decompress '(\265/\375' xxx unzstd "$img" "$tmp" # Finally check for uncompressed images or objects: [[ $? -eq 0 ]] && get_vmlinux_size "$tmp" && return 0 # Fallback to use iomem local _size=0 _seg while read -r _seg; do _size=$((_size + 0x${_seg#*-} - 0x${_seg%-*})) done <<< "$(grep -E "Kernel (code|rodata|data|bss)" /proc/iomem | cut -d ":" -f 1)" echo $_size } do_estimate() { local kdump_mods local -A large_mods local baseline local kernel_size mod_size initrd_size baseline_size runtime_size reserved_size estimated_size recommended_size _cryptsetup_overhead local size_mb=$((1024 * 1024)) setup_initrd if [[ ! -f $TARGET_INITRD ]]; then derror "kdumpctl estimate: kdump initramfs is not built yet." exit 1 fi kdump_mods="$(lsinitrd "$TARGET_INITRD" -f /usr/lib/dracut/hostonly-kernel-modules.txt | tr '\n' ' ')" baseline=$(kdump_get_arch_recommend_size) if [[ ${baseline: -1} == "M" ]]; then baseline=${baseline%M} elif [[ ${baseline: -1} == "G" ]]; then baseline=$((${baseline%G} * 1024)) elif [[ ${baseline: -1} == "T" ]]; then baseline=$((${baseline%Y} * 1048576)) fi # The default pre-reserved crashkernel value baseline_size=$((baseline * size_mb)) # Current reserved crashkernel size reserved_size=$(get_reserved_mem_size) # A pre-estimated value for userspace usage and kernel # runtime allocation, 64M should good for most cases runtime_size=$((64 * size_mb)) # Kernel image size kernel_size=$(get_kernel_size "$KDUMP_KERNEL") # Kdump initramfs size initrd_size=$(du -b "$TARGET_INITRD" | awk '{print $1}') # Kernel modules static size after loaded mod_size=0 while read -r _name _size _; do if [[ " $kdump_mods " != *" $_name "* ]]; then continue fi mod_size=$((mod_size + _size)) # Mark module with static size larger than 2M as large module if [[ $((_size / size_mb)) -ge 1 ]]; then large_mods[$_name]=$_size fi done <<< "$(< /proc/modules)" # Extra memory usage required for LUKS2 decryption crypt_size=0 for _dev in $(get_all_kdump_crypt_dev); do _crypt_info=$(cryptsetup luksDump "/dev/block/$_dev") [[ $(echo "$_crypt_info" | sed -n "s/^Version:\s*\(.*\)/\1/p") == "2" ]] || continue for _mem in $(echo "$_crypt_info" | sed -n "s/\sMemory:\s*\(.*\)/\1/p" | sort -n -r); do crypt_size=$((crypt_size + _mem * 1024)) break done done if [[ $crypt_size -ne 0 ]]; then if [[ $(uname -m) == aarch64 ]]; then _cryptsetup_overhead=50 else _cryptsetup_overhead=20 fi crypt_size=$((crypt_size + _cryptsetup_overhead * size_mb)) echo -e "Encrypted kdump target requires extra memory, assuming using the keyslot with maximum memory requirement\n" fi estimated_size=$((kernel_size + mod_size + initrd_size + runtime_size + crypt_size)) if [[ $baseline_size -gt $estimated_size ]]; then recommended_size=$baseline_size else recommended_size=$estimated_size fi echo "Reserved crashkernel: $((reserved_size / size_mb))M" echo "Recommended crashkernel: $((recommended_size / size_mb))M" echo echo "Kernel image size: $((kernel_size / size_mb))M" echo "Kernel modules size: $((mod_size / size_mb))M" echo "Initramfs size: $((initrd_size / size_mb))M" echo "Runtime reservation: $((runtime_size / size_mb))M" [[ $crypt_size -ne 0 ]] && echo "LUKS required size: $((crypt_size / size_mb))M" echo -n "Large modules:" if [[ ${#large_mods[@]} -eq 0 ]]; then echo " " else echo "" for _mod in "${!large_mods[@]}"; do echo " $_mod: ${large_mods[$_mod]}" done fi if [[ $reserved_size -lt $recommended_size ]]; then echo "WARNING: Current crashkernel size is lower than recommended size $((recommended_size / size_mb))M." fi } get_default_crashkernel() { local _dump_mode=$1 kdump_get_arch_recommend_crashkernel "$_dump_mode" } # Read kernel cmdline parameter for a specific kernel # $1: kernel path, DEFAULT or kernel path, ALL not accepted # $2: kernel cmldine parameter get_grub_kernel_boot_parameter() { local _kernel_path=$1 _para=$2 [[ $_kernel_path == ALL ]] && derror "kernel_path=ALL invalid for get_grub_kernel_boot_parameter" && return 1 grubby --info="$_kernel_path" | sed -En -e "/^args=.*$/{s/^.*(\s|\")${_para}=(\S*).*\"$/\2/p;q}" } # get dump mode by fadump value # return # - fadump, if fadump=on or fadump=nocma # - kdump, if fadump=off or empty fadump, return kdump # - error if otherwise get_dump_mode_by_fadump_val() { local _fadump_val=$1 if [[ -z $_fadump_val ]] || [[ $_fadump_val == off ]]; then echo -n kdump elif [[ $_fadump_val == on ]] || [[ $_fadump_val == nocma ]]; then echo -n fadump else derror "invalid fadump=$_fadump_val" return 1 fi } # get dump mode of a specific kernel # based on its fadump kernel cmdline parameter get_dump_mode_by_kernel() { local _kernel_path=$1 _fadump_val _dump_mode _fadump_val=$(get_grub_kernel_boot_parameter "$_kernel_path" fadump) if _dump_mode=$(get_dump_mode_by_fadump_val "$_fadump_val"); then echo -n "$_dump_mode" else derror "failed to get dump mode for kernel $_kernel_path" exit fi } _filter_grubby_kernel_str() { local _grubby_kernel_str=$1 echo -n "$_grubby_kernel_str" | sed -n -e 's/^kernel="\(.*\)"/\1/p' } _find_kernel_path_by_release() { local _release="$1" _grubby_kernel_str _kernel_path # Insert '/' before '+' to cope with grep's EREs _release=${_release//+/\\+} _grubby_kernel_str=$(grubby --info ALL | grep -E "^kernel=.*$_release(\/\w+)?\"$") _kernel_path=$(_filter_grubby_kernel_str "$_grubby_kernel_str") if [[ -z $_kernel_path ]]; then ddebug "kernel $_release doesn't exist" return 1 fi echo -n "$_kernel_path" } _get_current_running_kernel_path() { local _release _path _release=$(uname -r) if _path=$(_find_kernel_path_by_release "$_release"); then echo -n "$_path" else return 1 fi } _update_kernel_cmdline() { local _kernel_path=$1 _crashkernel=$2 _dump_mode=$3 _fadump_val=$4 if is_ostree; then if rpm-ostree kargs | grep -q "crashkernel="; then rpm-ostree kargs --replace="crashkernel=$_crashkernel" else rpm-ostree kargs --append="crashkernel=$_crashkernel" fi else grubby --args "crashkernel=$_crashkernel" --update-kernel "$_kernel_path" if [[ $_dump_mode == kdump ]]; then grubby --remove-args="fadump" --update-kernel "$_kernel_path" else grubby --args="fadump=$_fadump_val" --update-kernel "$_kernel_path" fi fi [[ -f /etc/zipl.conf ]] && zipl > /dev/null } _valid_grubby_kernel_path() { [[ -n "$1" ]] && grubby --info="$1" > /dev/null 2>&1 } # return all the kernel paths given a grubby kernel-path # # $1: kernel path accepted by grubby, e.g. DEFAULT, ALL, # /boot/vmlinuz-`uname -r` # return: kernel paths separated by space _get_all_kernels_from_grubby() { local _kernels _line _kernel_path _grubby_kernel_path=$1 for _line in $(grubby --info "$_grubby_kernel_path" | grep "^kernel="); do _kernel_path=$(_filter_grubby_kernel_str "$_line") _kernels="$_kernels $_kernel_path" done echo -n "$_kernels" } GRUB_ETC_DEFAULT="/etc/default/grub" # Update a kernel parameter in default grub conf # # If a value is specified, it will be inserted in the end. Otherwise it # would remove given kernel parameter. # # Note this function doesn't address the following cases, # 1. The kernel ignores everything on the command line after a '--'. So # simply adding the new entry to the end will fail if the cmdline # contains a --. # 2. If the value for a parameter contains spaces it can be quoted using # double quotes, for example param="value with spaces". This will # break the [^[:space:]\"] regex for the value. # 3. Dashes and underscores in the parameter name are equivalent. So # some_parameter and some-parameter are identical. # 4. Some parameters, e.g. efivar_ssdt, can be given multiple times. # 5. Some kernel parameters, e.g. quiet, doesn't have value # # $1: the name of the kernel command line parameter # $2: new value. If empty, given parameter would be removed _update_kernel_arg_in_grub_etc_default() { local _para=$1 _val=$2 _para_val if [[ $(uname -m) == s390x ]]; then return fi if [[ -n $_val ]]; then _para_val="$_para=$_val" fi # Update the command line /etc/default/grub, i.e. # on the line that starts with 'GRUB_CMDLINE_LINUX=', # 1) remove $para=$val if the it's the first arg # 2) remove all occurences of $para=$val # 3) insert $_para_val to end # 4) remove duplicate spaces left over by 1) or 2) or 3) # 5) remove space at the beginning of the string left over by 1) or 2) or 3) # 6) remove space at the end of the string left over by 1) or 2) or 3) sed -i -E "/^GRUB_CMDLINE_LINUX=/ { s/\"${_para}=[^[:space:]\"]*/\"/g; s/[[:space:]]+${_para}=[^[:space:]\"]*/ /g; s/\"$/ ${_para_val}\"/ s/[[:space:]]+/ /g; s/(\")[[:space:]]+/\1/g; s/[[:space:]]+(\")/\1/g; }" "$GRUB_ETC_DEFAULT" } # Read the kernel arg in default grub conf. # Note reading a kernel parameter that doesn't have a value isn't supported. # # $1: the name of the kernel command line parameter _read_kernel_arg_in_grub_etc_default() { sed -n -E "s/^GRUB_CMDLINE_LINUX=.*[[:space:]\"]${1}=([^[:space:]\"]*).*$/\1/p" "$GRUB_ETC_DEFAULT" } reset_crashkernel() { local _opt _val _dump_mode _fadump_val _reboot _grubby_kernel_path _kernel _kernels local _old_crashkernel _new_crashkernel _new_dump_mode _crashkernel_changed local _new_fadump_val _old_fadump_val _what_is_updated for _opt in "$@"; do case "$_opt" in --fadump=*) _val=${_opt#*=} if _dump_mode=$(get_dump_mode_by_fadump_val $_val); then _fadump_val=$_val else derror "failed to determine dump mode" exit fi ;; --kernel=*) _val=${_opt#*=} if ! _valid_grubby_kernel_path $_val; then derror "Invalid $_opt, please specify a valid kernel path, ALL or DEFAULT" exit fi _grubby_kernel_path=$_val ;; --reboot) # --reboot option was deprecated with # kdump-utils v1.0.45. Keep the code for now to # not break any user setup. dwarn "Option --reboot is deprecated and will be removed in RHEL11." _reboot=yes ;; *) derror "$_opt not recognized" exit 1 ;; esac done # 1. OSTree systems use "rpm-ostree kargs" instead of grubby to manage kernel command # line. --kernel=ALL doesn't make sense for OStree. # 2. We don't have any OSTree POWER systems so the dump mode is always kdump. # 3. "rpm-ostree kargs" would prompt the user to reboot the system after # modifying the kernel command line so there is no need for kexec-tools # to repeat it. if is_ostree; then _old_crashkernel=$(rpm-ostree kargs | sed -n -E 's/.*(^|\s)crashkernel=(\S*).*/\2/p') _new_dump_mode=kdump _new_crashkernel=$(kdump_get_arch_recommend_crashkernel "$_new_dump_mode") if [[ $_old_crashkernel != "$_new_crashkernel" ]]; then _update_kernel_cmdline "" "$_new_crashkernel" "$_new_dump_mode" "" if [[ $_reboot == yes ]]; then systemctl reboot fi fi return fi # For non-ppc64le systems, the dump mode is always kdump since only ppc64le # has FADump. if [[ -z $_dump_mode && $(uname -m) != ppc64le ]]; then _dump_mode=kdump _fadump_val=off fi # If the dump mode is determined, we can also know the default crashkernel value if [[ -n $_dump_mode ]]; then _crashkernel=$(kdump_get_arch_recommend_crashkernel "$_dump_mode") fi # If --kernel-path=ALL, update GRUB_CMDLINE_LINUX in /etc/default/grub. # # An exception case is when the ppc64le user doesn't specify the fadump value. # In this case, the dump mode would be determined by parsing the kernel # command line of the kernel(s) to be updated thus don't update GRUB_CMDLINE_LINUX. # # The following code has been simplified because of what has been done early, # - set the dump mode as kdump for non-ppc64le cases # - retrieved the default crashkernel value for given dump mode if [[ $_grubby_kernel_path == ALL && -n $_dump_mode ]]; then _update_kernel_arg_in_grub_etc_default crashkernel "$_crashkernel" # remove the fadump if fadump is disabled if [[ $_fadump_val == off ]]; then _fadump_val="" fi _update_kernel_arg_in_grub_etc_default fadump "$_fadump_val" fi # If kernel-path not specified, either # - use KDUMP_KERNELVER if it's defined # - use current running kernel if [[ -z $_grubby_kernel_path ]]; then if [[ -z $KDUMP_KERNELVER ]] || ! _kernel_path=$(_find_kernel_path_by_release "$KDUMP_KERNELVER"); then if ! _kernel_path=$(_get_current_running_kernel_path); then derror "no running kernel found" exit 1 fi fi _kernels=$_kernel_path else _kernels=$(_get_all_kernels_from_grubby "$_grubby_kernel_path") fi for _kernel in $_kernels; do if [[ -z $_dump_mode ]]; then _new_dump_mode=$(get_dump_mode_by_kernel "$_kernel") _new_crashkernel=$(kdump_get_arch_recommend_crashkernel "$_new_dump_mode") _new_fadump_val=$(get_grub_kernel_boot_parameter "$_kernel" fadump) else _new_dump_mode=$_dump_mode _new_crashkernel=$_crashkernel _new_fadump_val=$_fadump_val fi _old_crashkernel=$(get_grub_kernel_boot_parameter "$_kernel" crashkernel) _old_fadump_val=$(get_grub_kernel_boot_parameter "$_kernel" fadump) [[ "$_new_fadump_val" == off ]] && _new_fadump_val="" if [[ $_old_crashkernel != "$_new_crashkernel" || $_old_fadump_val != "$_new_fadump_val" ]]; then _update_kernel_cmdline "$_kernel" "$_new_crashkernel" "$_new_dump_mode" "$_new_fadump_val" if [[ $_reboot != yes ]]; then if [[ $_old_crashkernel != "$_new_crashkernel" ]]; then _what_is_updated="Updated crashkernel=$_new_crashkernel" else # This case happens only when switching between fadump=on and fadump=nocma _what_is_updated="Updated fadump=$_new_fadump_val" fi dwarn "$_what_is_updated for kernel=$_kernel. Please reboot the system for the change to take effect." fi _crashkernel_changed=yes fi done if [[ $_reboot == yes && $_crashkernel_changed == yes ]]; then reboot fi } _is_bootloader_installed() { if [[ $(uname -m) == s390x ]]; then test -f /etc/zipl.conf else test -f /boot/grub2/grub.cfg fi } _update_crashkernel() { local _kernel _kver _dump_mode _old_default_crashkernel _new_default_crashkernel _fadump_val _msg _kernel=$1 _dump_mode=$(get_dump_mode_by_kernel "$_kernel") _old_default_crashkernel=$(get_grub_kernel_boot_parameter "$_kernel" crashkernel) _kver=$(parse_kver_from_path "$_kernel") # The second argument is for the case of aarch64, where installing a 64k variant on a 4k kernel, or vice versa _new_default_crashkernel=$(kdump_get_arch_recommend_crashkernel "$_dump_mode" "$_kver") if [[ $_old_default_crashkernel != "$_new_default_crashkernel" ]]; then _fadump_val=$(get_grub_kernel_boot_parameter "$_kernel" fadump) if _update_kernel_cmdline "$_kernel" "$_new_default_crashkernel" "$_dump_mode" "$_fadump_val"; then _msg="For kernel=$_kernel, crashkernel=$_new_default_crashkernel now. Please reboot the system for the change to take effet." _msg+=" Note if you don't want kexec-tools to manage the crashkernel kernel parameter, please set auto_reset_crashkernel=no in /etc/kdump.conf." dinfo "$_msg" fi fi } # shellcheck disable=SC2154 # false positive when dereferencing an array reset_crashkernel_after_update() { local _kernel if ! _is_bootloader_installed; then return fi for _kernel in $(_get_all_kernels_from_grubby ALL); do _update_crashkernel "$_kernel" done } # read the value of an environ variable from given environ file path # # The environment variable entries in /proc/[pid]/environ are separated # by null bytes instead of by spaces. # # $1: environment variable # $2: environ file path read_proc_environ_var() { local _var=$1 _environ_path=$2 sed -n -E "s/.*(^|\x00)${_var}=([^\x00]*).*/\2/p" < "$_environ_path" } _OSBUILD_ENVIRON_PATH='/proc/1/environ' _is_osbuild() { [[ $(read_proc_environ_var container "$_OSBUILD_ENVIRON_PATH") == bwrap-osbuild ]] } reset_crashkernel_for_installed_kernel() { local _installed_kernel # During package install, only try to reset crashkernel for osbuild # thus to avoid calling grubby when installing os via anaconda if ! _is_bootloader_installed && ! _is_osbuild; then return fi if ! _installed_kernel=$(_find_kernel_path_by_release "$1"); then exit 1 fi if _is_osbuild; then if ! grep -qs crashkernel= /etc/kernel/cmdline; then reset_crashkernel "--kernel=$_installed_kernel" fi return fi _update_crashkernel "$_installed_kernel" } if [[ ! -f $KDUMP_CONFIG_FILE ]]; then derror "Error: No kdump config file found!" exit 1 fi set_kdump_test_id() { local _id=$1 KDUMP_COMMANDLINE_APPEND+=" $_id " if ! reload >& /dev/null; then derror "Set kdump test id fail." exit 1 fi } # $1: success/fail/pending/manual/clear # $2: test id set_vmcore_creation_status() { local _status=$1 local _kdump_test_id _dir=$(dirname "$VMCORE_CREATION_STATUS") [[ -d "$_dir" ]] || mkdir -p "$_dir" [[ -w "$_dir" ]] || chmod +w "$_dir" case "$_status" in pending) _kdump_test_id="kdump_test_id=$(date +%s-%N)" set_kdump_test_id "$_kdump_test_id" echo "$_status $_kdump_test_id" > "$VMCORE_CREATION_STATUS" ;; success | fail | manual) sed -E -i "s/^\w+/$_status/" "$VMCORE_CREATION_STATUS" ;; clear) rm -f "$VMCORE_CREATION_STATUS" ;; *) return esac sync -f "$_dir" } fetch_status() { local _test_id="$1" _mnt local _status _target is_raw_dump_target && return 2 _status="$(get_save_path)/kdump-test-$_test_id/vmcore-creation.status" if is_nfs_dump_target || is_fs_dump_target; then if is_fs_dump_target; then _target=$(fs_dump_target) else _target=$(kdump_get_conf_val nfs) fi _mnt=$(get_mntpoint_from_target "$_target") if [[ -z "$_mnt" ]] || ! is_mounted "$_mnt"; then mkdir -p "$TMPMNT" mount "$_target" "$TMPMNT" -o defaults || \ { dwarn "Failed to mount $_target" && return 2; } _mnt="$TMPMNT" fi _status="$_mnt/$_status" elif is_ssh_dump_target; then local _scp_address if is_ipv6_address "${OPT[_target]}"; then _scp_address="${OPT[_target]%@*}@[${OPT[_target]#*@}]" else _scp_address="${OPT[_target]}" fi scp -q -i "${OPT[sshkey]}" -o BatchMode=yes \ "$_scp_address:$_status" \ "$KDUMP_TMPDIR" case "$?" in 0) # success ;; 1) # file not found return 1 ;; 255) # no connection to host return 2 esac _status="$KDUMP_TMPDIR/vmcore-creation.status" fi [[ -f "$_status" ]] || return 1 grep -q "success" "$_status" && return 0 || return 1 } check_vmcore_creation_status() { local _status _test_id _timestamp _status_date [[ ${VMCORE_CREATION_NOTIFICATION,,} == "yes" ]] || return [[ "$DEFAULT_DUMP_MODE" == "kdump" ]] || return if [[ ! -s "$VMCORE_CREATION_STATUS" ]]; then dwarn "Notice: No vmcore creation test performed!" return fi read -r _status _test_id < "$VMCORE_CREATION_STATUS" _test_id=${_test_id#*=} _timestamp=${_test_id%-*} _status_date=$(date -d "@$_timestamp") if [[ "$_status" == "pending" ]]; then fetch_status "$_test_id" case "$?" in 0) _status="success" ;; 1) _status="fail" ;; *) _status="manual" ;; esac set_vmcore_creation_status "$_status" fi case "$_status" in success) dinfo "Notice: Last successful vmcore creation on $_status_date" ;; fail) dwarn "Notice: Last NOT successful vmcore creation on $_status_date" ;; manual) dwarn "Notice: Require manual check for kdump test of $_status_date" ;; *) derror "Unknown test status: $_status" ;; esac } kdump_test() { if ! is_kernel_loaded "$DEFAULT_DUMP_MODE"; then derror "Kdump needs be operational before test." exit 1 fi if [[ ! "$DEFAULT_DUMP_MODE" == "kdump" ]]; then derror "Only kdump is supported for test." exit 1 fi if [[ ! "$1" == "--force" ]]; then read -r -p "DANGER!!! Will perform a kdump test by crashing the system, proceed? (y/N): " input case $input in [Yy] ) dinfo "Start kdump test..." ;; * ) dinfo "Operation cancelled." exit 0 ;; esac fi set_vmcore_creation_status 'pending' echo c > /proc/sysrq-trigger } main() { # Determine if the dump mode is kdump or fadump determine_dump_mode case "$1" in start) if [[ -s /proc/vmcore ]]; then save_core reboot else start fi ;; stop) stop ;; status) EXIT_CODE=0 is_kernel_loaded "$DEFAULT_DUMP_MODE" case "$?" in 0) dinfo "Kdump is operational" EXIT_CODE=0 ;; 1) dinfo "Kdump is not operational" EXIT_CODE=3 ;; esac check_vmcore_creation_status exit $EXIT_CODE ;; reload) reload ;; restart) stop start ;; rebuild) rebuild ;; condrestart) ;; propagate) propagate_ssh_key ;; showmem) show_reserved_mem ;; estimate) do_estimate ;; get-default-crashkernel) get_default_crashkernel "$2" ;; reset-crashkernel) shift reset_crashkernel "$@" ;; test) shift kdump_test "$@" ;; _reset-crashkernel-after-update) if [[ $(kdump_get_conf_val auto_reset_crashkernel) != no ]]; then reset_crashkernel_after_update fi ;; _reset-crashkernel-for-installed_kernel) if [[ $(kdump_get_conf_val auto_reset_crashkernel) != no ]]; then reset_crashkernel_for_installed_kernel "$2" fi ;; setup-crypttab) setup_crypttab ;; *) dinfo $"Usage: $0 {estimate|start|stop|status|restart|reload|rebuild|reset-crashkernel|propagate|showmem|test|setup-crypttab}" exit 1 ;; esac } # Other kdumpctl instances will block in queue, until this one exits single_instance_lock # To avoid fd 9 leaking, we invoke a subshell, close fd 9 and call main. # So that fd isn't leaking when main is invoking a subshell. ( exec 9<&- main "$@" )