#!/bin/sh if [ -f /etc/grub/default ]; then . /etc/grub/default fi if [ -z "$GRUB_CMDLINE_LINUX_DEFAULT" ]; then set -- $(cat /proc/cmdline) bootopts= for opt; do case "$opt" in initrd=*|BOOT_IMAGE=*|root=*|rootflags=*) ;; *) bootopts="$bootopts $opt";; esac done mkdir -p /etc/default echo "GRUB_CMDLINE_LINUX_DEFAULT=\"$bootopts\"" >> /etc/default/grub fi