Exclude systemd.machineid from /etc/kernel/cmdline

This commit is contained in:
dalto 2023-01-28 12:18:19 -06:00
parent 0581b07aaa
commit d6bba71c54
1 changed files with 2 additions and 0 deletions

View File

@ -34,9 +34,11 @@ if [[ ! -e /etc/kernel/cmdline ]]; then
BOOT_OPTIONS=""
read -r -d '' -a line < /proc/cmdline
# Add the items from /proc/cmdline excluding the items we don't need
for i in "${line[@]}"; do
[[ "${i#initrd=*}" != "$i" ]] && continue
[[ "${i#BOOT_IMAGE=*}" != "$i" ]] && continue
[[ "${i#systemd.machine_id=*}" != "$i" ]] && continue
BOOT_OPTIONS+="$i "
done
echo ${BOOT_OPTIONS} > /etc/kernel/cmdline