public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Waldo Lemmer <pugonfireyt@gmail.com>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] chroot: on update I got "mount: /proc: mount failed: Unknown error 5005.,Unable to mark /proc slave: 32"
Date: Thu, 18 Jul 2024 06:11:55 +0200	[thread overview]
Message-ID: <CAAEVSTE6u-96G2ZafA5_69Sdp2yaKpRHT8pyhSG48HmsHZSj7A@mail.gmail.com> (raw)
In-Reply-To: <edaca869-df88-4ebd-b163-b7f7d9735404@ya.ru>

[-- Attachment #1: Type: text/plain, Size: 850 bytes --]

On Wed, Jul 17, 2024, 19:09 Vitaly Zdanevich <zdanevich.vitaly@ya.ru> wrote:

> My script in the chroot folder:
>
> ```
> mount --rbind /dev dev
> mount --make-rslave dev
> mount -t proc /proc proc
> mount --rbind /sys sys
> mount --make-rslave sys
> mount --rbind /tmp tmp
> mount --bind /run run
>
> mount -o bind /var/db/repos/ var/db/repos/
>
> chroot . /bin/bash
>
> ```
>

The last line chroots into the current working directory, not the directory
where the script is located. Thus, it doesn't matter where your script is
located.

I would suggest adding the following line to the start of your script:

```
cd "$1"
```

Then you can pass the path to your mounted filesystem as a parameter:

```sh
# /mnt/gentoo/chroot.sh /mnt/gentoo/
```

You could also use `dirname "$0"` in your script to get the directory where
your script is located.

>

[-- Attachment #2: Type: text/html, Size: 1831 bytes --]

      parent reply	other threads:[~2024-07-18  4:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-17 17:08 [gentoo-user] chroot: on update I got "mount: /proc: mount failed: Unknown error 5005.,Unable to mark /proc slave: 32" Vitaly Zdanevich
2024-07-17 19:50 ` Michael
2024-07-18  4:11 ` Waldo Lemmer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAAEVSTE6u-96G2ZafA5_69Sdp2yaKpRHT8pyhSG48HmsHZSj7A@mail.gmail.com \
    --to=pugonfireyt@gmail.com \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox