[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Getting started with mmdebstrap / chroot Operation not permitted.



Hello list members,

having seen this recently on the mailing list, I am interested to try out `mmdebstrap` (as a replacement for `debootstrap`). The ultimate goal of my use of these utilities is to arrive at an image suitable for booting an armhf SBC (Banana Pi M2+ EDU). Existing (overly complicated and not debian-only) work on this is on https://github.com/m7a/lp-banana-pi-m2p-edu (just for completeness, might be irrelevant to the issue at hand).

So far, I installed `mmdebstrap` and tried the most simple of invocations:

~~~
$ mmdebstrap stable test.tar
I: automatically chosen mode: fakechroot
I: chroot architecture amd64 is equal to the host's architecture
I: using /tmp/mmdebstrap.r10cMA6wAV as tempdir
I: running apt-get update...
done
I: downloading packages with apt...
done
I: extracting archives...
done
/usr/sbin/chroot: cannot change root directory to '/tmp/mmdebstrap.r10cMA6wAV': Operation not permitted
I: the /bin/mv binary inside the chroot doesn't work under fakechroot
I: with certain versions of coreutils and glibc, this is due to missing support for renameat2 in fakechroot
I: see https://github.com/dex4er/fakechroot/issues/60
I: expect package post installation scripts not to work
I: installing packages...
done
/usr/sbin/chroot: cannot change root directory to '/tmp/mmdebstrap.r10cMA6wAV': Operation not permitted
E: /usr/sbin/chroot /tmp/mmdebstrap.r10cMA6wAV env --unset=TMPDIR dpkg --install --force-depends --status-fd=<$fd> /var/cache/apt/archives//libpcre3_2%3a8.39-12_amd64.deb /var/cache/apt/archives//findutils_4.6.0+git+20190209-2_amd64.deb /var/cache/apt/archives//libc6_2.28-10_amd64.deb /var/cache/apt/archives//ncurses-bin_6.1+20181013-2+deb10u2_amd64.deb /var/cache/apt/archives//libncursesw6_6.1+20181013-2+deb10u2_amd64.deb /var/cache/apt/archives//libuuid1_2.33.1-0.1_amd64.deb /var/cache/apt/archives//libbz2-1.0_1.0.6-9.2~deb10u1_amd64.deb /var/cache/apt/archives//debconf_1.5.71_all.deb /var/cache/apt/archives//base-passwd_3.5.46_amd64.deb /var/cache/apt/archives//gcc-8-base_8.3.0-6_amd64.deb /var/cache/apt/archives//libpam0g_1.3.1-5_amd64.deb /var/cache/apt/archives//dpkg_1.19.7_amd64.deb /var/cache/apt/archives//fdisk_2.33.1-0.1_amd64.deb /var/cache/apt/archives//tar_1.30+dfsg-6_amd64.deb /var/cache/apt/archives//mawk_1.3.3-17+b3_amd64.deb /var/cache/apt/archives//gzip_1.9-3_amd64.deb /var/cache/apt/archives//libdb5.3_5.3.28+dfsg1-0.5_amd64.deb /var/cache/apt/archives//coreutils_8.30-3_amd64.deb /var/cache/apt/archives//liblz4-1_1.8.3-1_amd64.deb /var/cache/apt/archives//init-system-helpers_1.56+nmu1_all.deb /var/cache/apt/archives//libselinux1_2.8-1+b1_amd64.deb /var/cache/apt/archives//libmount1_2.33.1-0.1_amd64.deb /var/cache/apt/archives//libaudit1_1%3a2.8.4-3_amd64.deb /var/cache/apt/archives//bsdutils_1%3a2.33.1-0.1_amd64.deb /var/cache/apt/archives//libpam-modules-bin_1.3.1-5_amd64.deb /var/cache/apt/archives//libgcrypt20_1.8.4-5_amd64.deb /var/cache/apt/archives//zlib1g_1%3a1.2.11.dfsg-1_amd64.deb /var/cache/apt/archives//hostname_3.21_amd64.deb /var/cache/apt/archives//libblkid1_2.33.1-0.1_amd64.deb /var/cache/apt/archives//liblzma5_5.2.4-1_amd64.deb /var/cache/apt/archives//libcap-ng0_0.7.9-2_amd64.deb /var/cache/apt/archives//libsystemd0_241-7~deb10u3_amd64.deb /var/cache/apt/archives//libpam-runtime_1.3.1-5_all.deb /var/cache/apt/archives//libtinfo6_6.1+20181013-2+deb10u2_amd64.deb /var/cache/apt/archives//libc-bin_2.28-10_amd64.deb /var/cache/apt/archives//libaudit-common_1%3a2.8.4-3_all.deb /var/cache/apt/archives//diffutils_1%3a3.7-3_amd64.deb /var/cache/apt/archives//ncurses-base_6.1+20181013-2+deb10u2_all.deb /var/cache/apt/archives//libgcc1_1%3a8.3.0-6_amd64.deb /var/cache/apt/archives//libattr1_1%3a2.4.48-4_amd64.deb /var/cache/apt/archives//libfdisk1_2.33.1-0.1_amd64.deb /var/cache/apt/archives//perl-base_5.28.1-6_amd64.deb /var/cache/apt/archives//libdebconfclient0_0.249_amd64.deb /var/cache/apt/archives//libudev1_241-7~deb10u3_amd64.deb /var/cache/apt/archives//libgpg-error0_1.35-1_amd64.deb /var/cache/apt/archives//sed_4.7-1_amd64.deb /var/cache/apt/archives//libsmartcols1_2.33.1-0.1_amd64.deb /var/cache/apt/archives//base-files_10.3+deb10u3_amd64.deb /var/cache/apt/archives//dash_0.5.10.2-5_amd64.deb /var/cache/apt/archives//sysvinit-utils_2.93-8_amd64.deb /var/cache/apt/archives//util-linux_2.33.1-0.1_amd64.deb /var/cache/apt/archives//login_1%3a4.5-1.1_amd64.deb /var/cache/apt/archives//bash_5.0-4_amd64.deb /var/cache/apt/archives//grep_3.3-1_amd64.deb /var/cache/apt/archives//libacl1_2.2.53-4_amd64.deb /var/cache/apt/archives//debianutils_4.8.6.1_amd64.deb /var/cache/apt/archives//libpam-modules_1.3.1-5_amd64.deb failed
I: removing tempdir /tmp/mmdebstrap.r10cMA6wAV...
~~~

When I run the same command as root, it proceeds without error. However, I wanted to try out this nice possibility of creating chroots without root and so far, it does not seem to work. How can I get to work mmdebstrap without
being root?

OS: Debian 10 (buster/stable) amd64.
/tmp resides on the root filesystem (ext4).

~~~
$ stat /tmp
 File: /tmp
 Size: 135168    	Blocks: 272        IO Block: 4096   directory
Device: 801h/2049d	Inode: 2097153     Links: 21
Access: (1777/drwxrwxrwt)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2014-11-30 13:37:40.000000000 +0100
Modify: 2020-02-13 20:16:56.857792631 +0100
Change: 2020-02-13 20:16:56.857792631 +0100
Birth: -
~~~

Thanks in advance
Linux-Fan

Attachment: pgp3pzzuAHHLr.pgp
Description: PGP signature


Reply to: