Advertisement
Guest User

postrmd-slash-initramfs-tools

a guest
Oct 16th, 2014
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.88 KB | None | 0 0
  1. version="$1"
  2. bootopt=""
  3.  
  4. # passing the kernel version is required
  5. if [ -z "${version}" ]; then
  6.         echo >&2 "W: initramfs-tools: ${DPKG_MAINTSCRIPT_PACKAGE:-kernel package} did not pass a version number"
  7.         exit 0
  8. fi
  9.  
  10. # exit if custom kernel does not need an initramfs
  11. if [ -n "${KERNEL_PACKAGE_VERSION}" ] && [ "$INITRD" = 'No' ]; then
  12.         exit 0
  13. fi
  14.  
  15. # absolute file name of kernel image may be passed as a second argument;
  16. # create the initrd in the same directory
  17. if [ -n "$2" ]; then
  18.         bootdir=$(dirname "$2")
  19.         bootopt="-b ${bootdir}"
  20. fi
  21.  
  22. # avoid running multiple times
  23. if [ -n "$DEB_MAINT_PARAMS" ]; then
  24.         eval set -- "$DEB_MAINT_PARAMS"
  25.         if [ -z "$1" ] || [ "$1" != "remove" ]; then
  26.                 exit 0
  27.         fi
  28. fi
  29.  
  30. # delete initramfs
  31. INITRAMFS_TOOLS_KERNEL_HOOK=1 update-initramfs -d -t -k "${version}" ${bootopt} >&2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement