Skip to content

update-grub fails when in chroot #445

@SilviaIreneM

Description

@SilviaIreneM

Hi,

I've noticed that if you, while in chroot, give a update-grub because, e.g., you've modified /etc/default/grub, the command itself fails with
/usr/sbin/grub-probe: error: failed to get canonical path of /dev/sdXx'`
while if I do everything by hand: extracting cd, unsquashing filesystem, mounting everything it must be mounted for chrooting and then chrooting, update-grub works.

Is there something wrong in Cubic code? When I do it by hand I do this, before and after chrooting:

sudo mount -o bind /run/ edit/run;sudo mount --bind /dev/ edit/dev
export DISPLAY=:0 
xhost +
sudo chroot edit

export PS1="(chroot) $PS1"
mount -t proc none /proc; mount -t sysfs none /sys; mount -t devpts none /dev/pts
export HOME=/root;export LC_ALL=C
dbus-uuidgen > /var/lib/dbus/machine-id
dpkg-divert --local --rename --add /sbin/initctl
ln -s /bin/true /sbin/initctl

[various customizations here]
...
exit

I use Cubic because actually I've found some problems in creating iso and honestly I haven't so much time for trying to solve them (and Cubic does the dirt job for me ;-) )

Thanks,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions