help-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reconfigure grub in preseed stage during linux installation


From: sashab
Subject: Re: Reconfigure grub in preseed stage during linux installation
Date: Mon, 23 Apr 2018 20:35:41 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

Hi Artur,

First of all:
You should use fs-UUIDs instead of /dev/sdX1, if possible.
This way of finding the right partition is default in Debian.

AFAIU those commands are executed sequentially, right?
In that case your file is created, modified, and then gets overwritten
by update-grub:
# cat /usr/sbin/update-grub
    #!/bin/sh
    set -e
    exec grub-mkconfig -o /boot/grub/grub.cfg "$@"

So you have just to remove the last line you posted.

Regards,
    sashab

On 23/04/18 14:30, Artur Korobeynyk wrote:
> Hi community,
> When I install debian using the preseeded file, I have a live USB stick
> mounted as sda1 and ssd drive as sdb1. So I install MBR to sdb1 during
> installation. But when USB stick is removed afterwards SSD drive becomes
> sda1. And /boot/grub/grub.cfg does not work any more. I added a late
> command to the preseed file in order to fix that according to the
> documentation. It is simple and works if I run it manually on the machine
> but fails in preseed stage (the file does not get updated).
> 
> My preseed steps are:
> d-i preseed/late_command string \
> in-target sed -i 's#^\(GRUB_CMDLINE_LINUX_DEFAULT="quiet\)"$#\1
> root=/dev/sda1"#' /etc/default/grub ; \
> in-target grub-mkconfig -o /boot/grub/grub.cfg ; \
> sed -i 's/root\=\/dev\/sdb1/root\=\/dev\/sda1/g'
> /target/boot/grub/grub.cfg; \
> in-target bash -c 'update-grub';
> 
> So can anyone give me a hand in solving it? I asked that on all the related
> linux branches of stackexchange but those are quiet for a long time already.
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]