/bin/live-update-initramfs-uuid is in live-tools 1:20151214+nmu1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | #!/bin/sh
# live-tools(7) - System Support Scripts
# Copyright (C) 2006-2015 Daniel Baumann <mail@daniel-baumann.ch>
#
# This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
# This is free software, and you are welcome to redistribute it
# under certain conditions; see COPYING for details.
set -e
_OLD_INITRD="${1}"
_NEW_INITRD="${2}"
_NEW_UUID="${3}"
if [ -z "${_OLD_INITRD}" ]
then
echo "Usage: ${0} OLD_INITRD [NEW_INITRD] [NEW_UUID|NEW_UUID.conf]"
exit 1
fi
_TMPDIR="$(mktemp -d -t live-update-initramfs-uuid.XXXXXXXX)"
trap "rm -rf ${_TMPDIR}" EXIT HUP INT QUIT TERM
case "${_INITRD}" in
*.gz)
_COMPRESSION="gzip"
;;
*.bz2)
_COMPRESSION="bzip2"
;;
*.lzma)
_COMPRESSION="lzma"
;;
*.lz)
_COMPRESSION="lzip"
;;
*.xz)
_COMPRESSION="xz"
;;
esac
if [ ! -x "$(which ${_COMPRESSION} 2> /dev/null)" ]
then
echo "E: ${_COMPRESSION} - no such program"
exit 1
fi
if [ -e "${_NEW_UUID}" ]
then
# uuid from user specified file
_NEW_UUID="$(cat ${_NEW_UUID})"
fi
if [ -z "${_NEW_UUID}" ]
then
# uuid neither from file (or file is empty),
# nor specified as argument
_NEW_UUID="$(uuidgen -r)"
fi
cd "${_TMPDIR}"
${_COMPRESSION} -c -d "${_OLD_INITRD}" | cpio -id
echo "${_NEW_UUID}" > conf/uuid.conf
find . | cpio --quiet -R 0:0 -o -H newc | ${_COMPRESSION} -c > "/tmp/$(basename ${_OLD_INITRD})"
cd "${OLDPWD}"
if [ -n "${_NEW_UUID}" ]
then
mv "/tmp/$(basename ${_OLD_INITRD})" "${_NEW_INITRD}"
else
mv "/tmp/$(basename ${_OLD_INITRD})" ./
fi
|