Page 1 of 1

[SOLVED] chroot on v 3.5 A=/usr/local/sbin/newroot

Posted: 26 Nov 2015, 10:55
by aus9
Hi

Just discovered I can't use relative sym links as they are find my real system (RAM drive) for an unpacked base XZM that I am attempting to mod.

https://wiki.archlinux.org/index.php/Change_root

offers 2 main methods AFAIK, which is better please and 2 more below

Using chroot or Using systemd-nspawn

At this stage I don't need any internet or run any gui app.....its command line interface only

Also mentions in this post
https://wiki.archlinux.org/index.php/Ch ... nvironment

Proot or Fakechroot


thanks for reading.

Re: chroot which is better?

Posted: 26 Nov 2015, 10:59
by aus9
there appears to be a nice alternative here

Code: Select all

mkdir /mnt/arch
mount /dev/<device-or-partition-name> /mnt/arch
cd /mnt/arch
mount -t proc proc proc/
mount -t sysfs sys sys/
mount -o bind /dev dev/
mount -t devpts pts dev/pts/
chroot . /bin/bash
https://shafeeqk.wordpress.com/2012/07/ ... ux-chroot/

so that makes it about 5 ways and counting

Re: chroot which is better?

Posted: 26 Nov 2015, 23:49
by ncmprhnsbl
ive only used the basic chroot on the wiki to recover my arch install(from archbang livecd and porteus once i think) a few times..
systemd-nspawn sounds slightly easier... fewer setup steps... :unknown:

Re: chroot which is better?

Posted: 27 Nov 2015, 00:09
by brokenman
And this is how I built Nemesis. All from a chroot (on any OS). systemd-nspawn looks very useful. Cheers.

Re: [SOLVED] chroot which is better? A=systemd-nspawn

Posted: 27 Nov 2015, 00:57
by aus9
Yes you beat me to it. Just created my first successful sym link

for others to see a good result....in code box I use # to show output results

Code: Select all

cd $UNPACK
systemd-nspawn

# Spawning container squashfs-root on /tmp/squashfs-root.
# Press ^] three times within 1s to kill container.
# xargs: `/dev/null': No such file or directory
# Failed to connect to bus: No such file or directory

<do commands>

exit

# logout
# Container squashfs-root exited successfully

Re: [SOLVED] chroot which is better? A=systemd-nspawn

Posted: 27 Nov 2015, 02:13
by brokenman
On Nemesis simply unpack the 001-core module to a folder.
Copy your /etc/resolv.conf file into the folder
cd into the folder and type: systemd-nspawn

Now you are inside your chroot (container) in the root folder.
To exit type: logout

Works just like chroot but without having to remember all the commands.

Re: [SOLVED] chroot which is better? A=systemd-nspawn

Posted: 26 Jan 2016, 23:31
by aus9
I am not sure systemd-nspawn is available now we have moved to openrc

Code: Select all

sudo pacman -S systemd-nspawn
error: target not found: systemd-nspawn

Re: [SOLVED] chroot which is better? A=systemd-nspawn

Posted: 26 Jan 2016, 23:46
by brokenman
Correct. Systemd is not available on Nemesis v3.4+.
I have a script I use called newroot instead. I may have left it in /usr/local.

Re: [SOLVED] chroot which is better? A=systemd-nspawn

Posted: 26 Jan 2016, 23:57
by aus9
great its in the 001-core
/usr/local/sbin/newroot