fix: install/remove kernel in one layer
This commit is contained in:
parent
3cd901b1be
commit
4eed03ec2a
@ -85,16 +85,17 @@ func Runs(km config.KernelMask) (commands []string) {
|
||||
// Install and remove a single kernel and headers.
|
||||
// This ensures that all dependencies are cached.
|
||||
|
||||
cmdf("export TMP_HEADERS=$(yum search kernel-devel --showduplicates " +
|
||||
"| grep '^kernel-devel' | cut -d ' ' -f 1 | head -n 1)")
|
||||
cmd := "export HEADERS=$(yum search kernel-devel --showduplicates " +
|
||||
"| grep '^kernel-devel' | cut -d ' ' -f 1 | head -n 1)"
|
||||
|
||||
cmdf("export TMP_KERNEL=$(echo $TMP_HEADERS | sed 's/-devel//')")
|
||||
cmdf("export TMP_MODULES=$(echo $TMP_HEADERS | sed 's/-devel/-modules/')")
|
||||
cmdf("export TMP_CORE=$(echo $TMP_HEADERS | sed 's/-devel/-core/')")
|
||||
cmd += " KERNEL=$(echo $HEADERS | sed 's/-devel//')"
|
||||
cmd += " MODULES=$(echo $HEADERS | sed 's/-devel/-modules/')"
|
||||
cmd += " CORE=$(echo $HEADERS | sed 's/-devel/-core/')"
|
||||
|
||||
cmdf("yum -y install $TMP_KERNEL $TMP_HEADERS")
|
||||
cmdf("yum -y remove %s $TMP_KERNEL $TMP_HEADERS $TMP_MODULES $TMP_CORE",
|
||||
flags)
|
||||
cmd += " && yum -y install $KERNEL $HEADERS"
|
||||
cmd += " && yum -y remove %s $KERNEL $HEADERS $MODULES $CORE"
|
||||
|
||||
cmdf(cmd, flags)
|
||||
|
||||
return
|
||||
}
|
||||
|
@ -34,15 +34,17 @@ func Runs(km config.KernelMask) (commands []string) {
|
||||
// Install and remove a single kernel and headers.
|
||||
// This ensures that all dependencies are cached.
|
||||
|
||||
cmdf("export TMP_HEADERS=$(apt-cache search " +
|
||||
cmd := "export HEADERS=$(apt-cache search " +
|
||||
"--names-only '^linux-headers-[0-9\\.\\-]*-generic' " +
|
||||
"| awk '{ print $1 }' | head -n 1)")
|
||||
"| awk '{ print $1 }' | head -n 1)"
|
||||
|
||||
cmdf("export TMP_KERNEL=$(echo $TMP_HEADERS | sed 's/headers/image/')")
|
||||
cmdf("export TMP_MODULES=$(echo $TMP_HEADERS | sed 's/headers/modules/')")
|
||||
cmd += " KERNEL=$(echo $HEADERS | sed 's/headers/image/')"
|
||||
cmd += " MODULES=$(echo $HEADERS | sed 's/headers/modules/')"
|
||||
|
||||
cmdf("apt-get install -y $TMP_HEADERS $TMP_KERNEL $TMP_MODULES")
|
||||
cmdf("apt-get remove -y $TMP_HEADERS $TMP_KERNEL $TMP_MODULES")
|
||||
cmd += " && apt-get install -y $HEADERS $KERNEL $MODULES"
|
||||
cmd += " && apt-get remove -y $HEADERS $KERNEL $MODULES"
|
||||
|
||||
cmdf(cmd)
|
||||
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user