RE: [poky] Running chroot-like command in Yocto #yocto

"Chen, Qi" <[email protected]>
Newsgroups org.yoctoproject.lists.poky
Message-ID <CO6PR11MB560246500A31280B432B45F5EDED2@CO6PR11MB5602.namprd11.prod.outlook.com>
I haven't tried, but you can test with the following approach:

  1.  Setup nopasswd sudo
  2.  In you custom command, disable pseudo (export PSEUDO_UNLOAD=1)
  3.  Run 'sudo chroot ...'
  4.  You may also need to enable the 'network' flag for do_rootfs/do_image_xxx task (whichever task your command is run in) to avoid namespace messing things up. E.g., do_rootfs['network'] = 1

Anyway, if you can find a way to adjust syslinux class to add extra functionality to it, that would be best.

Regards,
Qi

From: [email protected] <[email protected]> On Behalf Of Nicolas Wirth via lists.yoctoproject.org
Sent: Wednesday, May 15, 2024 10:42 PM
To: [email protected]
Subject: Re: [poky] Running chroot-like command in Yocto #yocto

That's not entirely true. The syslinux class does indeed a lot of this, I was able to experiment with this using the live hddimage. However, this mechanism ends up creating 2 different partitions, one containing the bootloader, and one containing the rootfs. I would like to have them in the same partition. I was able to find how to do it by scripting, but it's outside of the build environment. My script looks like this:

loop_dev=$(losetup --find --partscan --show "my-image-genericx86-64.wic")

if [[ -z "$loop_dev" ]]; then

    echo "Failed to set up loop device!"

    exit 1

fi



if [[ "$arch" == "amd64" ]]; then

    echo "Setting up Extlinux"

    mount_dir=$(mktemp --directory)

    mount ${loop_dev}p1 ${mount_dir}

    extlinux --install ${mount_dir}/boot/syslinux

    umount ${loop_dev}p1

fi
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.