Author Topic: chroot per published instructions. DID not work.  (Read 38666 times)

userxbw

  • Newbie
  • *
  • Posts: 5
  • Karma: +1/-0
chroot per published instructions. DID not work.
« on: Sun Feb 04 21:14:34 2018 »
step 1
Code: [Select]
Introduction

This article explains every step to compile packages in a chroot.
Adjust /etc/cards.conf

To be able to install the compiled packages from your chroot, you need to adjust your /etc/cards.conf file. You will add on the top of this file:

dir /mnt/hd/usr/ports/perso

You are now ready to proceed with your chroot.
added at top of cards.conf file
Code: [Select]
userx [ ~ ]$ cat /etc/cards.conf   [11:01 x86_64 4.14.13-NuTyX-lts userx@nutyx]
version current

dir /mnt/hd/usr/ports/perso
step 2.
Code: [Select]
Installation of your chroot

Depending on the branch you want to use, you can specify it when naming the[u][i] (script name should go here, to make it absolutely clear which script is being talked about)[/i][/u]script: [u][i]( What script? it is not made clear to what script this goes in)[/i][/u]
The stable branch

VERSION="stable" install-nutyx

The current branch

VERSION="current" install-nutyx

The development branch

VERSION="development" install-nutyx

Enter the chroot

install-nutyx -ec
so next all I have to do is issue that command install-nutyx -ec and I will be put into a chroot environment per instructions.
My results are this:
Code: [Select]
userx [ ~ ]$ sudo install-nutyx -ec[11:01 x86_64 4.14.13-NuTyX-lts userx@nutyx]
cp: cannot create regular file '/mnt/hd/etc/resolv.conf': No such file or directory
mount: /mnt/hd/dev: mount point does not exist.
mount: /mnt/hd/dev/pts: mount point does not exist.
mount: /mnt/hd/proc: mount point does not exist.
mount: /mnt/hd/sys: mount point does not exist.
mount: /mnt/hd/run: mount point does not exist.

******************************
Chroot path: /mnt/hd
******************************
chroot'ing to /mnt/hd
chroot: cannot change root directory to '/mnt/hd': No such file or directory
umount: /mnt/hd/run: no mount point specified.
umount: /mnt/hd/dev/pts: no mount point specified.
umount: /mnt/hd/dev: no mount point specified.
umount: /mnt/hd/proc: no mount point specified.
umount: /mnt/hd/sys: no mount point specified.
It failed, NO CHAROOT achieved.  Missing directories to mount to.
« Last Edit: Sun Feb 04 21:16:16 2018 by userxbw »

tnut

  • Administrator
  • Sr. Member
  • *****
  • Posts: 345
  • Karma: +3/-0
  • Gender: Male
    • NuTyX distribution
Re: chroot per published instructions. DID not work.
« Reply #1 on: Mon Feb 05 11:58:10 2018 »
I will try to improve this page.

Nevertheless, before you can enter into your chroot, you need to INSTALL IT by just doing:

Code: [Select]
VERSION="current" install-nutyx
It will install a NuTyX in the default location which is /mnt/hd. This location can be changed by passing the variable LFS, so for example if you type:

Code: [Select]
LFS=/mychroot VERSION="current" install-nutyxYour NuTyX will be install in /mychroot folder

userxbw

  • Newbie
  • *
  • Posts: 5
  • Karma: +1/-0
Re: chroot per published instructions. DID not work.
« Reply #2 on: Mon Feb 05 13:28:41 2018 »
I will try to improve this page.

Nevertheless, before you can enter into your chroot, you need to INSTALL IT by just doing:

Code: [Select]
VERSION="current" install-nutyx
It will install a NuTyX in the default location which is /mnt/hd. This location can be changed by passing the variable LFS, so for example if you type:

Code: [Select]
LFS=/mychroot VERSION="current" install-nutyxYour NuTyX will be install in /mychroot folder

That's what I am talking about, explicit step by step instructions. Thanks, if I find any other discrepancies I will inform you, yes?
Thanks again. Now I  am going to reboot into Nutyx and give this a try...

tnut

  • Administrator
  • Sr. Member
  • *****
  • Posts: 345
  • Karma: +3/-0
  • Gender: Male
    • NuTyX distribution
Re: chroot per published instructions. DID not work.
« Reply #3 on: Mon Feb 05 13:38:53 2018 »
Quote
Thanks, if I find any other discrepancies I will inform you, yes?
Absolutly, I counting on your feedbacks, will improve if necessary.

userxbw

  • Newbie
  • *
  • Posts: 5
  • Karma: +1/-0
Re: chroot per published instructions. DID not work.
« Reply #4 on: Mon Feb 05 13:47:03 2018 »
Needs to be said that user needs to either be in root shell, or use sudo to gain root privileges. 
Code: [Select]
LFS=/mychroot VERSION="current" sudo install-nutyx
but its now downloading. thanks again.

WAIT it did not work as you stated. Look here:
I created a directory on root side, set LFS then issued that command and it still installed it in /mnt/hd no matter what. hum... why is that?
Code: [Select]
userx [ /usr/ports/perso ]$ sudo mkdir -p /builds ; LFS=/builds VERSION="current" sudo  install-nutyx
LFS        : /mnt/hd
DEVICE     : /mnt/hd
URL        : http://downloads.nutyx.org
VERSION    : 10.0
KERNEL     : linux-firmware sysklogd sysvinit reiserfsprogs e3 grub lz4 mdadm jfsutils xfsprogs btrfs-progs dhcpcd kernel-lts
DEPOT      : /var/lib/pkg/depot
MOUNT      :
FOLDER     : /mnt/hd
DEPOT_BASE : http://downloads.nutyx.org/x86_64/10.0/base
DEVEL

Adding a semicolon to seperate the setting of LFS and installing the needed files did not work either.
Code: [Select]
userx [ /usr/ports/perso ]$ ls /builds
userx [ /usr/ports/perso ]$ sudo mkdir -p /builds ; LFS=/builds [color=red]; [/color]VERSION="current" sudo  install-nutyx
LFS        : /mnt/hd
DEVICE     : /mnt/hd
URL        : http://downloads.nutyx.org
VERSION    : 10.0
KERNEL     : linux-firmware sysklogd sysvinit reiserfsprogs e3 grub lz4 mdadm jfsutils xfsprogs btrfs-progs dhcpcd kernel-lts
DEPOT      : /var/lib/pkg/depot
MOUNT      :
FOLDER     : /mnt/hd
DEPOT_BASE : http://downloads.nutyx.org/x86_64/10.0/base
DEVEL      :
CHROOT_LIST: nutyx acl attr bash bzip2 coreutils curl expat gcc readline ncurses lzo glibc gmp xz zlib libarchive mpc mpfr openssl cards
Retrieve info about the 73 packages: 100 %
[color=red]pkgadd 2.4.0: package nutyx already installed (use -u to upgrade)                                    [ FAIL ]
 FAILURE:

 You should not read this error.

 It means something went wrong with the installation of nutyx  Thanks to inform us via the website http://www.nutyx.org. Thanks again for your collaboration.[/color]

that message was given to me because it is not looking for /builds as the root dir but /mnt/hd still.

Code: [Select]
sudo mkdir -p /builds ; export LFS=/builds ; VERSION="current" sudo  install-nutyx
export does not work either in this case.
« Last Edit: Mon Feb 05 13:59:49 2018 by userxbw »

tnut

  • Administrator
  • Sr. Member
  • *****
  • Posts: 345
  • Karma: +3/-0
  • Gender: Male
    • NuTyX distribution
Re: chroot per published instructions. DID not work.
« Reply #5 on: Mon Feb 05 14:16:27 2018 »
You need to pass the sudo command first:
Code: [Select]
sudo LFS=/mychroot VERSION="current" install-nutyxwill work

userxbw

  • Newbie
  • *
  • Posts: 5
  • Karma: +1/-0
Re: chroot per published instructions. DID not work.
« Reply #6 on: Mon Feb 05 15:26:42 2018 »
ok , looks like I put the sudo in the wrong place..  proper instructions produce proper results.   ;)  how do you say that in french, or Swedish?  whichever is your native tongue ;D (hopes you have a sense of humor about oneself) :D

Now how does one work out sourceforge download addresses? as it is not liking anything I've tried to format so far. this latest one

Code: [Select]
cat > /usr/ports/perso/menumaker/Pkgfile << EOF
# Depends on: python
description="menumaker for blackbox,deskmenu,fluxbox,IceWM,openbox,pekWM,WindowMaker,XFCE4"
packager="Michael Heras"
#url="https://sourceforge.net/projects/menumaker/files/latest/download"
url="https://sourceforge.net"
name=menumaker
version=0.99.10
release=1
#source=(${url}/projects/menumaker/files/$name-$version/download)
#source=(${url}downloads/$name/$name-$version.tar.gz)
source="https://sourceforge.net/projects/menumaker/files/latest/download"
build() {
   cd $name-$version
   ./configure --prefix=/usr/local
   make
 }
 package(){
  make DESTDIR=$PKG install
 }
EOF
got me this,
Code: [Select]
=======> Downloading 'https://sourceforge.net/projects/menumaker/files/latest/download'.
--2018-02-05 15:20:37--  https://sourceforge.net/projects/menumaker/files/latest/download
Resolving sourceforge.net... 216.34.181.60
Connecting to sourceforge.net|216.34.181.60|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://downloads.sourceforge.net/project/menumaker/menumaker-0.99.10.tar.[14:00 x86_64 4.14.13-NuTyX-lts root@nutyx]lowing]
--2018-02-05 15:20:38--  https://downloads.sourceforge.net/project/menumaker/menumak[14:00 x86_64 4.14.13-NuTyX-lts root@nutyx]or=gigenet
Resolving downloads.sourceforge.net... 216.34.181.59                                [14:00 x86_64 4.14.13-NuTyX-lts root@nutyx]
Connecting to downloads.sourceforge.net|216.34.181.59|:443... connected.
HTTP request sent, awaiting response... 302 Found                                   [14:00 x86_64 4.14.13-NuTyX-lts root@nutyx]
Location: https://gigenet.dl.sourceforge.net/project/menumaker/menumaker-0.99.10.tar[14:00 x86_64 4.14.13-NuTyX-lts root@nutyx]
--2018-02-05 15:20:38--  https://gigenet.dl.sourceforge.net/project/menumaker/menumaker-0.99.10.tar.gz
Resolving gigenet.dl.sourceforge.net... 69.65.16.142
Connecting to gigenet.dl.sourceforge.net|69.65.16.142|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 202580 (198K) [application/x-gzip]
Saving to: '/tmp/download.partial'

     0K .......... .......... .......... .......... .......... 25%  445K 0s
    50K .......... .......... .......... .......... .......... 50% 1.06M 0s
   100K .......... .......... .......... .......... .......... 75% 5.50M 0s
   150K .......... .......... .......... .......... .......   100% 9.68M=0.2s

2018-02-05 15:20:39 (1.12 MB/s) - '/tmp/download.partial' saved [202580/202580]

=======> Building '/usr/ports/perso/menumaker/menumaker1517844037x86_64.cards.tar.xz'.
cp /tmp/download /tmp/work/src
+ build
+ cd -
/usr/ports/perso/menumaker
+ ./configure --prefix=/usr/local
Pkgfile: line 14: ./configure: No such file or directory
=======> ERROR: Building '/usr/ports/perso/menumaker/menumaker1517844037x86_64.cards.tar.xz' failed.
cards 2.4.0 create: could not parse Pkgfile: While running 'build()'
root [ /usr/ports/perso/menumaker ]# ls
Pkgfile
root [ /usr/ports/perso/menumaker ]# ls /tmp/work
pkg  src
root [ /usr/ports/perso/menumaker ]# ls /tmp/work/src
download
root [ /usr/ports/perso/menumaker ]# ls /tmp/work/pkg
root [ /usr/ports/perso/menumaker ]#
« Last Edit: Mon Feb 05 15:29:22 2018 by userxbw »

tnut

  • Administrator
  • Sr. Member
  • *****
  • Posts: 345
  • Karma: +3/-0
  • Gender: Male
    • NuTyX distribution
Re: chroot per published instructions. DID not work.
« Reply #7 on: Mon Feb 05 15:36:18 2018 »
sourceforge sourcecode files are a nightmare:
My experience with this issue is: Try first by hand:
I guess this should make it:
Code: [Select]
wget https://sourceforge.net/projects/menumaker/files/menumaker-0.99.10.tar.gzthen to check if it looks ok:
Code: [Select]
bsdtar --list --file menumaker-0.99.10.tar.gzIn my case it looks fine

tnut

  • Administrator
  • Sr. Member
  • *****
  • Posts: 345
  • Karma: +3/-0
  • Gender: Male
    • NuTyX distribution
Re: chroot per published instructions. DID not work.
« Reply #8 on: Mon Feb 05 15:39:47 2018 »
By the way, don't use /usr/local as prefix, all the triggers conditions for the cards post-install commands are configure to look into /usr as prefix

userxbw

  • Newbie
  • *
  • Posts: 5
  • Karma: +1/-0
Re: chroot per published instructions. DID not work.
« Reply #9 on: Mon Feb 05 15:54:17 2018 »
sourceforge sourcecode files are a nightmare:
My experience with this issue is: Try first by hand:
I guess this should make it:
Code: [Select]
wget https://sourceforge.net/projects/menumaker/files/menumaker-0.99.10.tar.gzthen to check if it looks ok:
Code: [Select]
bsdtar --list --file menumaker-0.99.10.tar.gzIn my case it looks fine
thanks I just tried this after I posted,
Code: [Select]
source="https://sourceforge.net/projects/menumaker/files/menumaker-0.99.10.tar.gz"
just removing that last part 'downloads' then it downloaded it untared it but still errored.
Code: [Select]

2018-02-05 15:39:16 (1.21 MB/s) - '/tmp/menumaker-0.99.10.tar.gz.partial' saved [202580/202580]

=======> Building '/usr/ports/perso/menumaker/menumaker1517845154x86_64.cards.tar.xz'.
bsdtar -p -o -C /tmp/work/src -xf /tmp/menumaker-0.99.10.tar.gz
+ build
+ cd -
/usr/ports/perso/menumaker
+ ./configure --prefix=/usr/local
Pkgfile: line 15: ./configure: No such file or directory
=======> ERROR: Building '/usr/ports/perso/menumaker/menumaker1517845154x86_64.cards.tar.xz' failed.
cards 2.4.0 create: could not parse Pkgfile: While running 'build()'
root [ /usr/ports/perso/menumaker ]# ls /tmp/work/pkg
root [ /usr/ports/perso/menumaker ]# ls /tmp/work/src
menumaker-0.99.10
root [ /usr/ports/perso/menumaker ]# ls /tmp/work/src/menumaker-0.99.10
AUTHORS  ChangeLog  Config.py.in  Keywords.py  Makefile.in  NEWS      Prophet  aclocal.m4  configure     doc         m4       mmaker
COPYING  Config.py  INSTALL       Makefile.am  MenuMaker    Paths.py  README   compile     configure.ac  install-sh  missing
root [ /usr/ports/perso/menumaker ]#


what is telling it to go to 'src' directory? the pkgmk.conf tells it to go here,
Code: [Select]
PKGMK_SOURCE_DIR="/tmp"
PKGMK_WORK_DIR="/tmp/work"
the Pkgfile tells it to go in to the base directory of the tar name-version
Code: [Select]
build() {
   cd $name-$version
   ./configure --prefix=/usr
   make
 }

so where is it getting the idea to go into a directory called src ? configure is located within the base directory name-version not src. How do I adjust that one? and I'll adjust the --prefix=/usr is that even needed if it is declared within the configure, or makefile?

with adjustment to prefix I still get error
Code: [Select]
=======> Building '/usr/ports/perso/menumaker/menumaker1517845907x86_64.cards.tar.xz'.
bsdtar -p -o -C /tmp/work/src -xf /tmp/menumaker-0.99.10.tar.gz
+ build
+ cd -
/usr/ports/perso/menumaker
+ ./configure --prefix=/usr
Pkgfile: line 15: ./configure: No such file or directory
=======> ERROR: Building '/usr/ports/perso/menumaker/menumaker1517845907x86_64.cards.tar.xz' failed.
cards 2.4.0 create: could not parse Pkgfile: While running 'build()'
root [ /usr/ports/perso/menumaker ]# ls /tmp
download  menumaker-0.99.10.tar.gz  setup  work
root [ /usr/ports/perso/menumaker ]# ls /tmp/work
pkg  src
root [ /usr/ports/perso/menumaker ]# ls /tmp/work/src
menumaker-0.99.10
root [ /usr/ports/perso/menumaker ]# ls /tmp/work/src/menumaker-0.99.10
AUTHORS  ChangeLog  Config.py.in  Keywords.py  Makefile.in  NEWS      Prophet  aclocal.m4  configure     doc         m4       mmaker
COPYING  Config.py  INSTALL       Makefile.am  MenuMaker    Paths.py  README   compile     configure.ac  install-sh  missing
root [ /usr/ports/perso/menumaker ]#

« Last Edit: Mon Feb 05 15:58:39 2018 by userxbw »

tnut

  • Administrator
  • Sr. Member
  • *****
  • Posts: 345
  • Karma: +3/-0
  • Gender: Male
    • NuTyX distribution
Re: chroot per published instructions. DID not work.
« Reply #10 on: Mon Feb 05 16:08:45 2018 »
Don't worry about all thoses locations, they are all set properly. Have a look at:

Code: [Select]
man pkgmk.conf
It will tell's you what's configurable

Good luck