Chroot to porteus

Non release banter
Post Reply
tome
Contributor
Contributor
Posts: 577
Joined: 26 Jun 2013, 14:03
Distribution: x64 Openbox
Location: Poland
Contact:

Chroot to porteus

Post#1 by tome » 15 Jan 2016, 11:11

Has anyone ready script to mount porteus base modules and changes directory at /mnt/chroot-porteus and chroot to it? Does anyone use something like this?

aus9

Re: Chroot to porteus

Post#2 by aus9 » 15 Jan 2016, 12:58

Hi

first you would use the xzm2dir command to unpack your module then consider this link
https://forum.porteus.org/viewtopic.php ... oot#p39289

ie starting from cd

Code: Select all

cd <result of xzm2dir>
mount -t proc proc proc/
mount -t sysfs sys sys/
mount -o bind /dev dev/
mount -t devpts pts dev/pts/
chroot . /bin/bash

User avatar
brokenman
Site Admin
Site Admin
Posts: 5659
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v3.2rcX all desktops
Location: Brazil
Contact:

Re: Chroot to porteus

Post#3 by brokenman » 15 Jan 2016, 20:14

I do this regulary.

Code: Select all

mkdir /mnt/chroot
xzm2dir $1 /mnt/chroot
mount -t proc proc /mnt/chroot/proc
mount --rbind /dev /mnt/chroot/dev
mount --rbind /sys /mnt/chroot/sys
chroot /mnt/chroot /bin/bash
Call the script as: script /path/to/001-core.xzm

EDIT:
To unmount

Code: Select all

exit
umount /mnt/chroot/dev/pts
umount /mnt/chroot/dev
umount /mnt/chroot/proc
umount -l /mnt/chroot/sys
How do i become super user?
Wear your underpants on the outside and put on a cape.

tome
Contributor
Contributor
Posts: 577
Joined: 26 Jun 2013, 14:03
Distribution: x64 Openbox
Location: Poland
Contact:

Re: Chroot to porteus

Post#4 by tome » 15 Jan 2016, 21:40

I want replace "xzm2dir" with "mount -t aufs".

User avatar
brokenman
Site Admin
Site Admin
Posts: 5659
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v3.2rcX all desktops
Location: Brazil
Contact:

Re: Chroot to porteus

Post#5 by brokenman » 15 Jan 2016, 23:59

You can do that, but remember your mountpoint will be read only.
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
francois
Contributor
Contributor
Posts: 5136
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus artix
Location: C'est l'hiver: la neige soudainement est là à Montréal.

Re: Chroot to porteus

Post#6 by francois » 16 Jan 2016, 01:13

Good to read that. I thought porteus was unchrootable from another installation. :)
Carpe diem.

Bogomips
Full of knowledge
Full of knowledge
Posts: 2563
Joined: 25 Jun 2014, 15:21
Distribution: 3.2.2 Cinnamon & KDE5
Location: London

Re: Chroot to porteus

Post#7 by Bogomips » 14 Feb 2016, 01:31

Digression slightly off topic :wink:

Followed all the links, brings back memories. With last gasp of hdd on old m/c, managed to dd installed kanotix system to usb stick. Bios could not boot from usb. Grub no good here, finally found kexec-loader, which booted off floppy and then be used to boot usb. Next complication was Kanotix initrd lacked usb kernel modules. :( Added plop rescue system to usb, booted plop then an exec chroot to Kanotix partition (in this instance pivot_root did not work), which got the entire system back, running off usb, but with plop kernel.

Finally with fully functioning system, could have sorted out the kernel modules. However there was no point anymore as the plop kernel was one of the latest, and had all necessary kernel modules. No immediate urgency to get new m/c. Could bide my time, and it was many moons later before the right opportunity showed up, 14 months to be precise.

Brand new computer without o/s offered at knock-down price. Presumably thinking was to draw people in with the price, and then when they found they could do nothing with the bare machine, they would then be sitting ducks for high pressure sale of win$oze etc. :twisted: But with Linux it was a different story. :D
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB

Post Reply