Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5B03AC25B75 for ; Wed, 15 May 2024 14:42:03 +0000 (UTC) Subject: Re: Running chroot-like command in Yocto #yocto To: poky@lists.yoctoproject.org From: "Nicolas Wirth" X-Originating-Location: Baechli, Nidwalden, CH (146.4.107.86) X-Originating-Platform: Windows Chrome 124 User-Agent: GROUPS.IO Web Poster MIME-Version: 1.0 Date: Wed, 15 May 2024 07:42:00 -0700 References: In-Reply-To: Message-ID: <19808.1715784120309934958@lists.yoctoproject.org> Content-Type: multipart/alternative; boundary="WGaRQ0ekiPV9D3QA07GW" List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 15 May 2024 14:42:03 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/poky/message/13354 --WGaRQ0ekiPV9D3QA07GW Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable That's not entirely true. The syslinux class does indeed a lot of this, I w= as able to experiment with this using the live hddimage. However, this mech= anism ends up creating 2 different partitions, one containing the bootloade= r, and one containing the rootfs. I would like to have them in the same par= tition. I was able to find how to do it by scripting, but it's outside of t= he build environment. My script looks like this: loop_dev =3D$( losetup --find --partscan --show " my-image-genericx86-64.wi= c " ) if [[ -z " $loop_dev " ]]; then echo " Failed to set up loop device! " exit 1 fi if [[ " $arch " =3D=3D " amd64 " ]]; then echo " Setting up Extlinux " mount_dir =3D$( mktemp --directory ) mount ${ loop_dev } p1 ${ mount_dir } extlinux --install ${ mount_dir } /boot/syslinux umount ${ loop_dev } p1 fi --WGaRQ0ekiPV9D3QA07GW Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable That's not entirely true. The syslinux class does indeed a lot of this, I w= as able to experiment with this using the live hddimage. However, this mech= anism ends up creating 2 different partitions, one containing the bootloade= r, and one containing the rootfs. I would like to have them in the same par= tition. I was able to find how to do it by scripting, but it's outside of t= he build environment. My script looks like this:
loop_dev=3D$(los= etup --find --partscan = --show"= my-image-genericx86-64.wic")
if [[ -z "$loop_dev" ]= ]; then
    echo"Failed to set up loop device!= "
    exit1
fi

if [[ "$arch" =3D=3D "<= /span>amd64" ]]; then
    echo"Setting up Extlinux"
    mount_dir=3D$(= mktemp --directory)
    mount ${loop_dev}p1 ${mount_d= ir}
    extlinux --install ${mount_dir= }/boot/syslinux
    umount ${loop_dev}p1
fi
--WGaRQ0ekiPV9D3QA07GW--