The officially official Devuan Forum!

You are not logged in.

#1 2020-07-05 17:21:35

vazhnov
Member
From: Wrocław, Poland
Registered: 2020-05-31
Posts: 26  

AWS EC2 AMI by FAI: grub-probe: error: failed to get canonical path

I'm trying to create clean minimal Devuan image for AWS.

As I know, Debian uses Fully automatic installation (FAI) to create AWS AMIs: https://wiki.debian.org/Cloud/SystemsComparison, https://wiki.debian.org/Cloud/AmazonEC2Image.

So first I tried to repeat process of Debian image creation by FAI. Next step will be: change FAI configuration to build Devuan image.

System: I use KVM virtual machine (Proxmox 6/Debian 10 buster) with Devuan guest:

lenin@devuan3-01 ~ % cat /etc/os-release
PRETTY_NAME="Devuan GNU/Linux 3 (beowulf)"
NAME="Devuan GNU/Linux"
VERSION_ID="3"
VERSION="3 (beowulf)"
VERSION_CODENAME=beowulf
ID=debian
ID_LIKE=debian
HOME_URL="https://www.devuan.org/"
SUPPORT_URL="https://devuan.org/os/community"
BUG_REPORT_URL="https://bugs.devuan.org/"

Commands I used:

sudo apt-get -V install fai-server fai-setup-storage qemu-utils
sudo apt-get -V --no-install-recommends install ca-certificates debsums dosfstools fai-server fai-setup-storage make python3 python3-libcloud python3-marshmallow python3-pytest python3-yaml qemu-utils udev
git clone "git@salsa.debian.org:cloud-team/debian-cloud-images.git"
cd debian-cloud-images
make DESTDIR=/tmp/ image_buster_ec2_amd64

(also I changed apt_cdn=http://192.168.1.1:3142/deb.debian.org and security_cdn=http://192.168.1.1:3142/security.debian.org URLs to use apt-cacher-ng).

Result:

…
Setting up grub-cloud-amd64 (0.0.4) ...
grub-probe: error: failed to get canonical path of `/dev/loop0p1'.
Installing for i386-pc platform.
grub-install: error: failed to get canonical path of `/dev/loop0p1'.
dpkg: error processing package grub-cloud-amd64 (--configure):
 installed grub-cloud-amd64 package post-installation script subprocess returned error exit status 1
…

Errors were encountered while processing:
 grub-cloud-amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)
ERROR: 25600 25600
ERROR: chroot /tmp/fai-diskimage.M61Y2t apt-get -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confnew --fix-missing install --no-install-recommends openssh-server cloud-initramfs-growroot sudo libpam-systemd unattended-upgrades chrony apt-utils ifupdown init iptables iputils-ping isc-dhcp-client less logrotate nano netbase rsyslog vim-tiny whiptail python-boto bsdmainutils awscli python3-boto cloud-init cloud-guest-utils linux-image-cloud-amd64 apparmor grub-cloud-amd64 return code 100
install_packages: executing chroot /tmp/fai-diskimage.M61Y2t apt-get clean
install_packages: executing chroot /tmp/fai-diskimage.M61Y2t dpkg --configure --pending
Setting up grub-cloud-amd64 (0.0.4) ...
grub-probe: error: failed to get canonical path of `/dev/loop0p1'.
Installing for i386-pc platform.
grub-install: error: failed to get canonical path of `/dev/loop0p1'.
dpkg: error processing package grub-cloud-amd64 (--configure):
 installed grub-cloud-amd64 package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 grub-cloud-amd64
ERROR: 256 256
ERROR: chroot /tmp/fai-diskimage.M61Y2t dpkg --configure --pending return code 1
install_packages: executing chroot /tmp/fai-diskimage.M61Y2t dpkg -C
The following packages are only half configured, probably due to problems
configuring them the first time.  The configuration should be retried using
dpkg --configure <package> or the configure menu option in dselect:
 grub-cloud-amd64     GRand Unified Bootloader (cloud setup)

install_packages: executing chroot /tmp/fai-diskimage.M61Y2t apt-get clean
2 errors during executing of install_packages
Error in task instsoft. Code: 471
Traceback: task_error task_instsoft task task_install task task_action task main
FATAL ERROR. Installation stopped.
Size of disk image and filename: 800M	/tmp/image_buster_ec2_amd64.raw
Image created by: /usr/sbin/fai-diskimage --verbose --hostname debian --class DEBIAN,CLOUD,TYPE_DEV,BUSTER,EXTRAS,EC2,IPV6_DHCP,AMD64,GRUB_CLOUD_AMD64,LOCALDEBS,LINUX_IMAGE_CLOUD,LAST --size 8G --cspace /home/lenin/debian-cloud-images/src/debian_cloud_images/build/fai_config /tmp/image_buster_ec2_amd64.raw
Traceback (most recent call last):
  File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/lenin/debian-cloud-images/src/debian_cloud_images/cli/__main__.py", line 38, in <module>
    main()
  File "/home/lenin/debian-cloud-images/src/debian_cloud_images/cli/__main__.py", line 34, in main
    args.cls(argparser=parser, **vars(args))()
  File "/home/lenin/debian-cloud-images/src/debian_cloud_images/cli/build.py", line 417, in __call__
    self.fai(not self.noop)
  File "/home/lenin/debian-cloud-images/src/debian_cloud_images/build/fai.py", line 47, in __call__
    raise subprocess.CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '('sudo', 'env', 'PYTHONPATH=/home/lenin/debian-cloud-images/src/debian_cloud_images/build/../..', 'CLOUD_BUILD_DATA=/home/lenin/debian-cloud-images/src/debian_cloud_images/data', 'CLOUD_BUILD_INFO={"type": "dev", "release": "buster", "release_id": "10", "release_baseid": "10", "vendor": "ec2", "arch": "amd64", "build_id": "manual", "version": "202007051951"}', 'CLOUD_BUILD_NAME=image_buster_ec2_amd64', 'CLOUD_BUILD_OUTPUT_DIR=/tmp', 'CLOUD_RELEASE_ID=ec2', 'CLOUD_RELEASE_VERSION=202007051951', 'fai-diskimage', '--verbose', '--hostname', 'debian', '--class', 'DEBIAN,CLOUD,TYPE_DEV,BUSTER,EXTRAS,EC2,IPV6_DHCP,AMD64,GRUB_CLOUD_AMD64,LOCALDEBS,LINUX_IMAGE_CLOUD,LAST', '--size', '8G', '--cspace', '/home/lenin/debian-cloud-images/src/debian_cloud_images/build/fai_config', '/tmp/image_buster_ec2_amd64.raw')' returned non-zero exit status 1.
make: *** [Makefile:14: image_buster_ec2_amd64] Error 1

Before the error, disks are:

lenin@devuan3-01 ~ % sudo lsblk
NAME       MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
loop0        7:0    0    8G  0 loop 
├─loop0p1  259:0    0  7.9G  0 part /tmp/fai-diskimage.M61Y2t
├─loop0p14 259:1    0    3M  0 part 
└─loop0p15 259:2    0  124M  0 part /tmp/fai-diskimage.M61Y2t/boot/efi
sr0         11:0    1  620M  0 rom  
vda        254:0    0   32G  0 disk 
├─vda1     254:1    0   30G  0 part /
├─vda2     254:2    0    1K  0 part 
└─vda5     254:5    0    2G  0 part [SWAP]
lenin@devuan3-01 ~ % sudo blkid|grep loop| sort
/dev/loop0p14: PARTUUID="f298765a-20f9-2543-8fe7-2749d86cdd61"
/dev/loop0p15: SEC_TYPE="msdos" UUID="4FCA-6200" TYPE="vfat" PARTUUID="5afa65b1-da1b-3648-b04c-c16bc2da197e"
/dev/loop0p1: UUID="f69236e0-7497-40a3-9e78-79d095a33e20" TYPE="ext4" PARTUUID="87e7358e-67ec-ba46-8dc5-91ecdd661c0e"
/dev/loop0: PTUUID="7553b010-f107-3449-9c99-5db320211b37" PTTYPE="gpt"
lenin@devuan3-01 ~ % ls -lAF /tmp/fai-diskimage.M61Y2t
total 88
drwxr-xr-x   2 root  root   4096 Jul  5 19:54 bin/
drwxr-xr-x   3 root  root   4096 Jul  5 19:54 boot/
drwxr-xr-x   4 root  root   4096 Jul  5 19:52 dev/
drwxr-xr-x  71 root  root   4096 Jul  5 19:55 etc/
drwxr-xr-x   2 root  root   4096 May  2 19:39 home/
drwxr-xr-x  12 root  root   4096 Jul  5 19:54 lib/
drwxr-xr-x   2 root  root   4096 Jul  5 19:52 lib64/
drwxr-xr-x   2 lenin lenin  4096 Jun 20 15:40 localdebs/
drwx------   2 root  root  16384 Jul  5 19:51 lost+found/
drwxr-xr-x   2 root  root   4096 Jul  5 19:52 media/
drwxr-xr-x   2 root  root   4096 Jul  5 19:52 mnt/
drwxr-xr-x   2 root  root   4096 Jul  5 19:52 opt/
dr-xr-xr-x 106 root  root      0 Jul  1 00:29 proc/
drwx------   2 root  root   4096 Jul  5 19:52 root/
drwxr-xr-x   5 root  root   4096 Jul  5 19:53 run/
drwxr-xr-x   2 root  root   4096 Jul  5 19:54 sbin/
drwxr-xr-x   2 root  root   4096 Jul  5 19:52 srv/
dr-xr-xr-x  13 root  root      0 Jul  1 00:29 sys/
drwxrwxrwt   2 root  root   4096 Jul  5 19:54 tmp/
drwxr-xr-x  10 root  root   4096 Jul  5 19:52 usr/
drwxr-xr-x  11 root  root   4096 Jul  5 19:52 var/

I tried to repeat the same steps on the same Debian KVM virtual machine, it finished without error.

Any idea how to prevent this error, "grub-probe: error: failed to get canonical path of `/dev/loop0p1'"?

Offline

#2 2020-07-05 18:15:07

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 3,125  
Website

Re: AWS EC2 AMI by FAI: grub-probe: error: failed to get canonical path

Are /proc, /dev & /sys mounted in the Devuan VM?

for i in proc sys dev;do findmnt /$i;done

Compare the output with the Debian VM.


Brianna Ghey — Rest In Power

Offline

#3 2020-07-05 18:23:55

vazhnov
Member
From: Wrocław, Poland
Registered: 2020-05-31
Posts: 26  

Re: AWS EC2 AMI by FAI: grub-probe: error: failed to get canonical path

Devuan 3:

root@devuan3-01:~# for i in proc sys dev;do findmnt /$i;done
TARGET SOURCE FSTYPE OPTIONS
/proc  proc   proc   rw,nosuid,nodev,noexec,relatime
TARGET SOURCE FSTYPE OPTIONS
/sys   sysfs  sysfs  rw,nosuid,nodev,noexec,relatime
TARGET SOURCE FSTYPE   OPTIONS
/dev   udev   devtmpfs rw,nosuid,relatime,size=1005164k,nr_inodes=251291,mode=755

Debian 10:

root@debian10-01:~# for i in proc sys dev;do findmnt /$i;done
TARGET SOURCE FSTYPE OPTIONS
/proc  proc   proc   rw,nosuid,nodev,noexec,relatime
TARGET SOURCE FSTYPE OPTIONS
/sys   sysfs  sysfs  rw,nosuid,nodev,noexec,relatime
TARGET SOURCE FSTYPE   OPTIONS
/dev   udev   devtmpfs rw,nosuid,relatime,size=1006728k,nr_inodes=251682,mode=755

No difference except size and nr_inodes.

Offline

#4 2020-11-08 00:09:55

vazhnov
Member
From: Wrocław, Poland
Registered: 2020-05-31
Posts: 26  

Re: AWS EC2 AMI by FAI: grub-probe: error: failed to get canonical path

Checked the same steps with Devuan 4 Chimaera and fresh content of "debian-cloud-images" repository — image created successfully:

 % ls -l /tmp/image*                 
-rw-r--r-- 1 root  root       37004 Nov  8 03:01 /tmp/image_buster_ec2_amd64.build-fai.json
-rw-r--r-- 1 lenin lenin      37806 Nov  8 03:02 /tmp/image_buster_ec2_amd64.build.json
-rw-r--r-- 1 root  root       15460 Nov  8 03:01 /tmp/image_buster_ec2_amd64.build.junit.xml
-rw-r--r-- 1 root  root       42430 Nov  8 03:01 /tmp/image_buster_ec2_amd64.info
-rw-r--r-- 1 root  root  8589934592 Nov  8 03:01 /tmp/image_buster_ec2_amd64.raw
-rw-r--r-- 1 lenin lenin  775700480 Nov  8 03:01 /tmp/image_buster_ec2_amd64.tar
 % file /tmp/image_buster_ec2_amd64.raw
/tmp/image_buster_ec2_amd64.raw: DOS/MBR boot sector, extended partition table (last)

Offline

Board footer