|
|
|
@ -486,3 +486,48 @@ calculate_pkg_postinst() {
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# FUNCTION: calculate_update_ver (/boot vmlinuz
|
|
|
|
|
# DESCRIPTION:
|
|
|
|
|
# Create backups of older versions before installing
|
|
|
|
|
calculate_update_ver() {
|
|
|
|
|
local dir=$1
|
|
|
|
|
local fn=$2
|
|
|
|
|
local ver=$3
|
|
|
|
|
local src=$4
|
|
|
|
|
if [ -f "$dir/$fn-$ver" ] ; then
|
|
|
|
|
mv "$dir/$fn-$ver" "$dir/$fn-$ver.old"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
cat "$src" > "$dir/$fn-$ver"
|
|
|
|
|
|
|
|
|
|
# This section is for backwards compatibility only
|
|
|
|
|
if test -f "$dir/$fn" ; then
|
|
|
|
|
# The presence of "$dir/$1" is unusual in modern intallations, and
|
|
|
|
|
# the results are mostly unused. So only recreate them if they
|
|
|
|
|
# already existed.
|
|
|
|
|
if test -L "$dir/$fn" ; then
|
|
|
|
|
# If we were using links, continue to use links, updating if
|
|
|
|
|
# we need to.
|
|
|
|
|
if [ "$(readlink -f ${dir}/${fn})" = "${dir}/${fn}-${ver}" ]; then
|
|
|
|
|
# Yup, we need to change
|
|
|
|
|
ln -sf "$fn-$ver.old" "$dir/$fn.old"
|
|
|
|
|
else
|
|
|
|
|
mv "$dir/$fn" "$dir/$fn.old"
|
|
|
|
|
fi
|
|
|
|
|
ln -sf "$fn-$ver" "$dir/$fn"
|
|
|
|
|
else # No links
|
|
|
|
|
mv "$dir/$fn" "$dir/$fn.old"
|
|
|
|
|
cat "$src" > "$dir/$fn"
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# FUNCTION: calculate_fix_lib_modules_contents
|
|
|
|
|
# DESCRIPTION:
|
|
|
|
|
# Unlink /lib/modules files from CONTENTS
|
|
|
|
|
calculate_fix_lib_modules_contents() {
|
|
|
|
|
local vardb=/var/db/pkg
|
|
|
|
|
local content="${vardb}/${CATEGORY}/${PF}/CONTENTS"
|
|
|
|
|
sed -i '/ \/lib\/modules/d' $content
|
|
|
|
|
}
|
|
|
|
|