lmi
[Top][All Lists]
Advanced

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

Re: [lmi] Build lmi in a debian chroot in a centos chroot on debian


From: Greg Chicares
Subject: Re: [lmi] Build lmi in a debian chroot in a centos chroot on debian
Date: Fri, 1 May 2020 13:56:20 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0

On 2019-10-03 22:54, Greg Chicares wrote:
> /home/greg[0]$tail -1 
> /srv/chroot/centos7/srv/chroot/lmi_bullseyeeraseme/home/greg/log 
> + echo Finished building lmi.
> 
> Now I only need to clean up the script and commit it.
...and then maintain it. I'll soon backport to centos some changes
that I'd made to the redhat script.

Meanwhile, it was convenient to have this nested debian-in-centos
nested chroot, where I could emulate the redhat server on my local
hardware, notably getting an up-to-the-minute debian-testing (i.e.,
"bullseye") environment. The steps were just complicated enough
that it seems wise to record them here in case I ever do that again:

First of all, 'install_centos.sh' apparently copied cached files as
root:root, so for now I fixed that manually:

/home/greg[0]$sudo chown greg:greg 
/srv/chroot/centos7lmi/srv/chroot/lmi_bullseye_1/cache_for_lmi

Then, because I still haven't switched schroot to use "directory"
rather than "plain" chroots, I needed to remount stuff:

/home/greg[1]$sudo mount --rbind /var/cache/centos_lmi 
/srv/chroot/centos7lmi/var/cache/yum
/home/greg[0]$sudo schroot --chroot=chroot:centos7lmi
/home/greg[0]#mountpoint /dev/pts || mount -t devpts -o 
rw,nosuid,noexec,relatime,mode=600 devpts /dev/pts
/dev/pts is not a mountpoint
/home/greg[0]#mountpoint /proc    || mount -t proc -o 
rw,nosuid,nodev,noexec,relatime proc /proc
/proc is not a mountpoint

Then I had to become su in order to enter the centos chroot as root
(sudo doesn't work here, and I think that's because I didn't set up
a root password in the centos chroot):

/home/greg[0]#schroot --chroot=lmi --user=root --directory=/tmp

Having mounted debian-host in centos above,
now mount centos in debian-inside-centos
(until I figure out "directory" chroots):

/tmp[0]#mountpoint /dev/pts || mount -t devpts -o 
rw,nosuid,noexec,relatime,mode=600 devpts /dev/pts
/dev/pts is not a mountpoint
/tmp[0]#mountpoint /proc    || mount -t proc -o rw,nosuid,nodev,noexec,relatime 
proc /proc
/proc is not a mountpoint

And now I can update the nested debian chroot in the obvious way:

/tmp[0]#apt-get update
/tmp[0]#apt-get dist-upgrade
/tmp[0]#apt-get autoremove
/tmp[0]#mountpoint /dev/pts
/dev/pts is a mountpoint

...and then exit the "root" chroots, and reenter them as my normal
user in order to do the normal things like building lmi:

/tmp[0]#exit
/home/greg[0]#exit
/home/greg[0]$schroot --chroot=chroot:centos7lmi
/home/greg[0]$schroot --chroot=chroot:lmi_bullseye_1


reply via email to

[Prev in Thread] Current Thread [Next in Thread]