--- postinst-orig 2005-05-19 16:06:48.000000000 +0300 +++ postinst 2005-05-19 18:26:39.000000000 +0300 @@ -381,6 +381,22 @@ rm -f /target/boot/grub/menu.lst update_grub +# Set the password if it has been preseeded +password=`db_get grub-installer/password` +if [ -n $password ] ; then + # check if the password is crypted + db_get grub-installer/password-crypt + if [ "$RET" == true ]; then + password_opts=--md5 + fi + echo password $password_opts $password > /tmp/menu.lst.password/ + # Add a line to menu.lst to use the given password + # The line is appended after the commented example + sed "/^# password/r /tmp/menu.lst.password/" \ + < /target/boot/grub/menu.lst > /target/boot/grub/menu.lst.new + mv /target/boot/grub/menu.lst.new /target/boot/grub/menu.lst +fi + user_params=$(echo $(user-params)) || true if [ -n "$user_params" ]; then # Modify menu.lst to include user parameters.