85-initrd.install 567 B

1234567891011121314151617181920212223242526272829
  1. #!/bin/sh
  2. set -eu
  3. # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
  4. # ex: ts=8 sw=4 sts=4 et filetype=sh
  5. COMMAND="$1"
  6. KERNEL_VERSION="$2"
  7. BOOT_DIR_ABS="$3"
  8. INITRD_SRC="/boot/initrd.img-$KERNEL_VERSION"
  9. INITRD_DEST="$BOOT_DIR_ABS/initrd"
  10. if [ "$COMMAND" = remove ]; then
  11. rm -f "$INITRD_DEST"
  12. exit 0
  13. fi
  14. if [ "$COMMAND" != add ]; then
  15. echo "Invalid command $COMMAND" >&2
  16. exit 1
  17. fi
  18. if [ -e "$INITRD_SRC" ];then
  19. cp "$INITRD_SRC" "$INITRD_DEST"
  20. else
  21. echo "$INITRD_SRC does not exist, not installing an initrd"
  22. fi
  23. exit 0