Comment 56 for bug 1797581

Revision history for this message
Dmitrii Shcherbakov (dmitriis) wrote :

The kernel code path mentioned in #55 is only executed if there is no "early userspace init" - in other words, if there is no /init on initrd:

https://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/bionic/tree/init/main.c?id=Ubuntu-4.15.0-47.50#n1087

 /*
  * check if there is an early userspace init. If yes, let it do all
  * the work
  */

 if (!ramdisk_execute_command)
  ramdisk_execute_command = "/init"; // <--- if there's no command specified, default to /init

 if (sys_access((const char __user *) ramdisk_execute_command, 0) != 0) { // <-- check if /init is present by doing the access syscall
  ramdisk_execute_command = NULL;
  prepare_namespace(); // <-- call prepare_namespace as mentioned in #55 which results in an error
 }

However, I can see that the initrd used in my case contains the init script (so sys_access should be successful):

initrd=http://10.10.101.2:5248/images/ubuntu/amd64/generic/bionic/daily/boot-initrd

 lsinitramfs /var/lib/maas/boot-resources/current/ubuntu/amd64/generic/bionic/daily/boot-initrd | grep -P ^init$
init

If I increase the memory allocation from 2048 to 2049 MiB the machine starts to boot just fine.

Unsuccessful boot log (2048 MiB): https://paste.ubuntu.com/p/CY834ZGnvS/
Successful boot log (2049 MiB): https://paste.ubuntu.com/p/3fYfFXW8qR/

Attached boot-initrd.