Gentoo Linux: use doas instead of sudo
← Older revision | Revision as of 16:39, 15 August 2023 | ||
(3 intermediate revisions by the same user not shown) | |||
Line 36: | Line 36: | ||
After setting up a chroot using any of the methods described below, the loader can be set up in Alpine like so (these instructions are for a Debian chroot in /var/chroots/debian, on x86_64, but can be adapted to other systems by using the appropriate paths): | After setting up a chroot using any of the methods described below, the loader can be set up in Alpine like so (these instructions are for a Debian chroot in /var/chroots/debian, on x86_64, but can be adapted to other systems by using the appropriate paths): | ||
{{cmd|mkdir -p /lib64 | |||
ln -s /var/chroots/debian/lib/x86_64-linux-gnu/ld-2.33.so /lib64 | |||
printf '/var/chroots/debian/lib/x86_64-linux/gnu\n/var/chroots/debian/usr/lib/x86_64-linux-gnu\n' > /etc/ld.so.conf | |||
/var/chroots/debian/sbin/ldconfig}} | |||
=== Gentoo Linux === | === Gentoo Linux === | ||
Line 47: | Line 47: | ||
First, | First, | ||
{{cmd|doas apk add {{pkg|xz}}}} | |||
Enter the chroot: | Enter the chroot: | ||
{{cmd|mkdir ~/chroot | |||
cd ~/chroot | |||
tar -xvf stage3-*.tar.xz | |||
tar -xvf portage-latest.tar.xz | |||
mv portage usr | |||
doas mount --bind /dev dev | |||
doas mount --bind /sys sys | |||
doas mount -t proc proc proc | |||
cp /etc/resolv.conf etc | |||
doas chroot . /bin/bash}} | |||
And voilà, you have your working Gentoo chroot!<br> | And voilà, you have your working Gentoo chroot!<br> | ||
Line 72: | Line 72: | ||
CHROOT_PATH="/home/$USER/chroot" | CHROOT_PATH="/home/$USER/chroot" | ||
cd $CHROOT_PATH | cd $CHROOT_PATH | ||
mount | grep $CHROOT_PATH/dev || | mount | grep $CHROOT_PATH/dev || doas mount --bind /dev dev | ||
mount | grep $CHROOT_PATH/sys || | mount | grep $CHROOT_PATH/sys || doas mount --bind /sys sys | ||
mount | grep $CHROOT_PATH/proc || | mount | grep $CHROOT_PATH/proc || doas mount -t proc proc proc | ||
cp /etc/resolv.conf etc | cp /etc/resolv.conf etc | ||
doas chroot --userspec=$USER:users . /bin/bash | |||
echo "You must manually unmount $CHROOT_PATH/dev, $CHROOT_PATH/sys, $CHROOT_PATH/proc." | echo "You must manually unmount $CHROOT_PATH/dev, $CHROOT_PATH/sys, $CHROOT_PATH/proc." | ||
</nowiki> | </nowiki> | ||
Line 87: | Line 87: | ||
Either use '''pacstrap''' (included with the arch-install-scripts package) or an Arch bootstrap image: | Either use '''pacstrap''' (included with the arch-install-scripts package) or an Arch bootstrap image: | ||
{{cmd| | {{cmd|doas apk add {{pkg|arch-install-scripts}} | ||
mkdir ~/chroot && cd ~/chroot | mkdir ~/chroot && cd ~/chroot | ||
doas tar xzf archlinux-bootstrap-x86_64.tar.gz && rm archlinux-bootstrap-x86_64.tar.gz | |||
doas sed -i '/evowise/s/^#//' root.x86_64/etc/pacman.d/mirrorlist | |||
doas sed -i '/CheckSpace/s/^/#/' root.x86_64/etc/pacman.conf | |||
doas arch-chroot root.x86_64 | |||
[chroot]# pacman-key --init | [chroot]# pacman-key --init | ||
[chroot]# pacman-key --populate archlinux}} | [chroot]# pacman-key --populate archlinux}} |
Distro