From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7325333789757931520 Date: Thu, 18 Jan 2024 00:16:05 -0800 (PST) From: Srinuvasan Arjunan To: isar-users Message-Id: In-Reply-To: <30d89d27-4004-4f9c-8d3a-e8c466aaaa3f@siemens.com> References: <398dbb64-03db-4922-b829-4cef9656804cn@googlegroups.com> <30d89d27-4004-4f9c-8d3a-e8c466aaaa3f@siemens.com> Subject: Re: mount loop devices not works in schroot MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_27986_692444644.1705565765520" X-TUID: 1Ead+ZlT3iCl ------=_Part_27986_692444644.1705565765520 Content-Type: multipart/alternative; boundary="----=_Part_27987_95561499.1705565765520" ------=_Part_27987_95561499.1705565765520 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Thursday, January 18, 2024 at 1:26:32=E2=80=AFPM UTC+5:30 Jan Kiszka wro= te: On 18.01.24 08:16, Srinuvasan Arjunan wrote:=20 > Hi All,=20 >=20 > Presently we migrated the chroot to sbuildchroot and one of= =20 > my image creation part i try to mount some temporary file system as a=20 > loop device and do create volumes and other stuffs.=20 >=20 > Here i could see am not able to mount the file system as a loop device=20 > specifically in chroot.=20 >=20 > reproduce steps:=20 > =20 > 1. chroot into the created session =20 > 2. dd if=3D/dev/zero of=3Dext4.img bs=3D4k count=3D2048=20 > 3.mkfs.ext4 ext4.img=20 > 4. mnt=3D$(mktemp -d)=20 > 5. mount -o loop 'ext4.img' "${mnt}"=20 >=20 > when i mount this ext4.img as a loop devices it throws the below error:= =20 > Error: "mount: /tmp/tmp.7oJoEpL0vt: mount failed: Operation not=20 permitted." =20 >=20 > But the above steps are working fine in my host machine.=20 >=20 > I hope we need to install the loop module in chroot or any other=20 > suggestion that would be helpful to mount loop devices in schroot=20 sessions.=20 >=20 > Note: losetup also not works in schroot.=20 >=20 I don't think you can run such stuff in the schroot, and you will surely=20 not be able to once we fully de-privilege the build. That's why I=20 suggested to you already to get rid of this loop-mount requirement.=20 Jan=20 --=20 Siemens AG, Technology=20 Linux Expert Center Thanks jan for your quick reply, but still i didn't get this line "and you= =20 will surely not be able to once we fully de-privilege the build" Can you please provide more information on the above line but i could see this was working fine in existing BUILDCHROOT. Many thanks, Srinu=20 ------=_Part_27987_95561499.1705565765520 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable

On Thursday, January 18, 2024 at 1:26:32= =E2=80=AFPM UTC+5:30 Jan Kiszka wrote:
On 18.01.24 08:16, Srinuvasan Arjunan wrote:
> Hi All,
>=20
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Presently we mig= rated the chroot to sbuildchroot and one of
> my image creation part i try to mount some temporary file system= as a
> loop device and do create volumes and other stuffs.
>=20
> Here i could see am not able to mount the file system as a loop = device
> specifically in chroot.
>=20
> reproduce steps:
> =C2=A0
> 1. chroot into the created session=C2=A0
> 2.=C2=A0dd if=3D/dev/zero of=3Dext4.img bs=3D4k count=3D2048
> 3.mkfs.ext4 ext4.img
> 4.=C2=A0mnt=3D$(mktemp -d)
> 5.=C2=A0=C2=A0mount -o loop 'ext4.img' "${mnt}"
>=20
> when i mount this ext4.img as a loop devices it throws the below= error:
> Error: "mount: /tmp/tmp.7oJoEpL0vt: mount failed: Operation not = permitted."=C2=A0
>=20
> But the above steps are working fine in my host machine.
>=20
> I hope we need to install the loop module in chroot or any other
> suggestion that would be helpful to mount loop devices in schroo= t sessions.
>=20
> Note:=C2=A0 losetup also not works in schroot.
>=20

I don't think you can run such stuff in the schroot, and you will sur= ely
not be able to once we fully de-privilege the build. That's why I
suggested to you already to get rid of this loop-mount requirement.

Jan

--=20
Siemens AG, Technology
Linux Expert Center


Thanks jan for your quick reply, but still i didn't get this line "and yo= u will surely
not be able to once we fully de-privilege the build= "

Can you please provide more information on the= above line

but i could see this was working fin= e in existing BUILDCHROOT.

Many thanks,
Srinu=C2=A0 ------=_Part_27987_95561499.1705565765520-- ------=_Part_27986_692444644.1705565765520--