suse-postun.sh
来自「lustre 1.6.5 source code」· Shell 代码 · 共 61 行
SH
61 行
if [ -L /boot/vmlinux ]; then image=vmlinuxelif [ -L /boot/vmlinuz ]; then image=vmlinuzelif [ -L /boot/image ]; then image=imageelse # nothing to do (UML kernels for example). exit 0ficase %ver_str in (*xen*|*um*) SHORTNM=%ver_str SHORTNM=-${SHORTNM##*-} ;; (*) unset SHORTNM ;;esacif [ "$(readlink /boot/$image$SHORTNM)" = $image-%ver_str ]; then # This may be the last kernel RPM on the system, or it may # be an update. In both of those cases the symlinks will # eventually be correct. Only if this kernel # is removed and other kernel rpms remain installed, # find the most recent of the remaining kernels, and make # the symlinks point to it. This makes sure that the boot # manager will always have a kernel to boot in its default # configuration. shopt -s nullglob for img in $(cd /boot ; ls -dt $image-*$SHORTNM); do initrd=initrd-${img#*-} if [ -f /boot/$img -a -f /boot/$initrd ]; then relink $img /boot/${img%%%%-*}$SHORTNM relink $initrd /boot/${initrd%%%%-*}$SHORTNM # Notify the boot loader that a new kernel image is active. if [ -x /sbin/new-kernel-pkg ]; then /sbin/new-kernel-pkg $(/sbin/get_kernel_version /boot/$img) fi break fi done shopt -u nullglobfi# Check whether there is a .previous link to the image we're about# to remove or to the image we point the new symlink to (so .previous# would be identical to the current symlink)case "$(readlink /boot/$image$SHORTNM.previous)" in$image-%ver_str|$(readlink /boot/$image$SHORTNM)) rm -f /boot/$image$SHORTNM.previous ;;esaccase "$(readlink /boot/initrd$SHORTNM.previous)" ininitrd-%ver_str|$(readlink /boot/initrd$SHORTNM)) rm -f /boot/initrd$SHORTNM.previous ;;esac# created in %postrm -f /boot/initrd-%ver_str
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?