File tree Expand file tree Collapse file tree 2 files changed +19
-19
lines changed
Expand file tree Collapse file tree 2 files changed +19
-19
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,25 @@ is_sme_or_sev_active()
3838 journalctl -q --dmesg --grep " ^Memory Encryption Features active: AMD (SME|SEV)$" > /dev/null 2>&1
3939}
4040
41+ # read the value of an environ variable from given environ file path
42+ #
43+ # The environment variable entries in /proc/[pid]/environ are separated
44+ # by null bytes instead of by spaces.
45+ #
46+ # $1: environment variable
47+ # $2: environ file path
48+ read_proc_environ_var ()
49+ {
50+ local _var=$1 _environ_path=$2
51+ sed -n -E " s/.*(^|\x00)${_var} =([^\x00]*).*/\2/p" < " $_environ_path "
52+ }
53+
54+ _OSBUILD_ENVIRON_PATH=' /proc/1/environ'
55+ _is_osbuild ()
56+ {
57+ [[ $( read_proc_environ_var container " $_OSBUILD_ENVIRON_PATH " ) == bwrap-osbuild ]]
58+ }
59+
4160has_command ()
4261{
4362 [[ -x $( command -v " $1 " ) ]]
Original file line number Diff line number Diff line change @@ -1970,25 +1970,6 @@ reset_crashkernel_after_update()
19701970 done
19711971}
19721972
1973- # read the value of an environ variable from given environ file path
1974- #
1975- # The environment variable entries in /proc/[pid]/environ are separated
1976- # by null bytes instead of by spaces.
1977- #
1978- # $1: environment variable
1979- # $2: environ file path
1980- read_proc_environ_var ()
1981- {
1982- local _var=$1 _environ_path=$2
1983- sed -n -E " s/.*(^|\x00)${_var} =([^\x00]*).*/\2/p" < " $_environ_path "
1984- }
1985-
1986- _OSBUILD_ENVIRON_PATH=' /proc/1/environ'
1987- _is_osbuild ()
1988- {
1989- [[ $( read_proc_environ_var container " $_OSBUILD_ENVIRON_PATH " ) == bwrap-osbuild ]]
1990- }
1991-
19921973reset_crashkernel_for_installed_kernel ()
19931974{
19941975 local _installed_kernel _grub_entry_index _kernel _old_ck _old_fadump
You can’t perform that action at this time.
0 commit comments