From ea3af255cf674d47a9ce2aba8a79e43d4a1f3f52 Mon Sep 17 00:00:00 2001 From: Filippo Squillace Date: Fri, 26 Feb 2016 23:21:52 +0000 Subject: [PATCH] Issue #138: pkgfile documentation --- README.md | 148 ++++++++++++++++++++++++++++------------------------ bin/jchroot | 4 +- bin/junest | 2 +- lib/core.sh | 4 +- lib/util.sh | 2 +- 5 files changed, 88 insertions(+), 72 deletions(-) diff --git a/README.md b/README.md index 0725d65..8f7a22e 100644 --- a/README.md +++ b/README.md @@ -204,75 +204,13 @@ Troubleshooting > In order to install packages using yaourt you may need to install the package group **base-devel** > that contains all the essential packages for compiling source code (such as gcc, make, patch, etc): - pacman -S base-devel - -##Kernel too old## - -> **Q**: Why do I get the error: "FATAL: kernel too old"? - -> **A**: This is because the executable from the precompiled package cannot -> properly run if the kernel is old. -> You may need to specify the PRoot *-k* option if the guest rootfs -> requires a newer kernel version: - - junest -p "-k 3.10" - -> In order to check if an executable inside JuNest environment can be compatible -> with the kernel of the host OS just use the *file* command, for instance: - - file ~/.junest/usr/bin/bash - ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked - (uses shared libs), for GNU/Linux 2.6.32, - BuildID[sha1]=ec37e49e7188ff4030052783e61b859113e18ca6, stripped - -> From the output you can see what is the minimum recommended Linux kernel version. - -##SUID permissions## -> **Q**: Why I do not have permissions for ping? - - ping www.google.com - ping: icmp open socket: Operation not permitted - -> **A**: The ping command uses *suid* permissions that allow to execute the command using -> root privileges. The fakeroot mode is not able to execute a command set with suid, -> and you may need to use root privileges. There are other few commands that -> have *suid* permission, you can list the commands from your JuNest environment -> with the following command: - - find /usr/bin -perm +4000 - -##No characters are visible on a graphic application## - -> **Q**: Why I do not see any characters in the application I have installed? - -> **A**: This is probably because there are no -> [fonts](https://wiki.archlinux.org/index.php/Font_Configuration) installed in -> the system. - -> To quick fix this, you can just install a fonts package: - - pacman -S gnu-free-fonts - -##Differences between filesystem and package ownership## - -> **Q**: Why do I get warning when I install a package using root privileges? - - pacman -S systat - ... - warning: directory ownership differs on /usr/ - filesystem: 1000:100 package: 0:0 - ... - -> **A**: In these cases the package installation went smoothly anyway. -> This should happen every time you install package with root privileges -> since JuNest will try to preserve the JuNest environment by assigning ownership -> of the files to the real user. + #> pacman -S base-devel ##No servers configured for repository## > **Q**: Why I cannot install packages? - pacman -S lsof + #> pacman -S lsof Packages (1): lsof-4.88-2 Total Download Size: 0.09 MiB @@ -286,8 +224,84 @@ Troubleshooting > **A**: You need simply to update the mirrorlist file according to your location: # Uncomment the repository line according to your location - nano /etc/pacman.d/mirrorlist - pacman -Syy + #> nano /etc/pacman.d/mirrorlist + #> pacman -Syy + +## Locate the package for a given file ## + +> **Q**: How do I find which package a certain file belongs to? + +> **A**: JuNest is a really small distro, therefore you frequently need to find +> the package name for a certain file. `pkgfile` is an extremely useful package +> that allows you to detect the package of a given file. +> For instance, if you want to find the package name for the command `getopt`: + + #> pacman -S pkgfile + #> pkgfile --update + $> pkgfile getop + core/util-linux + +##Kernel too old## + +> **Q**: Why do I get the error: "FATAL: kernel too old"? + +> **A**: This is because the executable from the precompiled package cannot +> properly run if the kernel is old. +> You may need to specify the PRoot *-k* option if the guest rootfs +> requires a newer kernel version: + + $> junest -p "-k 3.10" + +> In order to check if an executable inside JuNest environment can be compatible +> with the kernel of the host OS just use the *file* command, for instance: + + $> file ~/.junest/usr/bin/bash + ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked + (uses shared libs), for GNU/Linux 2.6.32, + BuildID[sha1]=ec37e49e7188ff4030052783e61b859113e18ca6, stripped + +> From the output you can see what is the minimum recommended Linux kernel version. + +##SUID permissions## +> **Q**: Why I do not have permissions for ping? + + $> ping www.google.com + ping: icmp open socket: Operation not permitted + +> **A**: The ping command uses *suid* permissions that allow to execute the command using +> root privileges. The fakeroot mode is not able to execute a command set with suid, +> and you may need to use root privileges. There are other few commands that +> have *suid* permission, you can list the commands from your JuNest environment +> with the following command: + + $> find /usr/bin -perm +4000 + +##No characters are visible on a graphic application## + +> **Q**: Why I do not see any characters in the application I have installed? + +> **A**: This is probably because there are no +> [fonts](https://wiki.archlinux.org/index.php/Font_Configuration) installed in +> the system. + +> To quick fix this, you can just install a fonts package: + + #> pacman -S gnu-free-fonts + +##Differences between filesystem and package ownership## + +> **Q**: Why do I get warning when I install a package using root privileges? + + #> pacman -S systat + ... + warning: directory ownership differs on /usr/ + filesystem: 1000:100 package: 0:0 + ... + +> **A**: In these cases the package installation went smoothly anyway. +> This should happen every time you install package with root privileges +> since JuNest will try to preserve the JuNest environment by assigning ownership +> of the files to the real user. More documentation ================== @@ -296,7 +310,7 @@ There are additional tutorials in the License ======= -Copyright (c) 2012-2015 +Copyright (c) 2012-2016 This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published diff --git a/bin/jchroot b/bin/jchroot index 2ed810f..98f8680 100755 --- a/bin/jchroot +++ b/bin/jchroot @@ -1,6 +1,8 @@ #!/bin/bash # -# Copyright (c) 2012-2015 +# This file is part of JuNest (https://github.com/fsquillace/junest) +# +# Copyright (c) 2015 # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Library General Public License as published diff --git a/bin/junest b/bin/junest index c978dc5..9ac3736 100755 --- a/bin/junest +++ b/bin/junest @@ -2,7 +2,7 @@ # # This file is part of JuNest (https://github.com/fsquillace/junest). # -# Copyright (c) 2012-2015 +# Copyright (c) 2015 # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Library General Public License as published diff --git a/lib/core.sh b/lib/core.sh index bf13710..4cd08f0 100644 --- a/lib/core.sh +++ b/lib/core.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -# Copyright (c) 2012-2015 +# Copyright (c) 2015 # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Library General Public License as published @@ -34,7 +34,7 @@ CODE_NAME='Nitida' DESCRIPTION='The Arch Linux based distro that runs upon any Linux distros without root access' AUTHOR='Filippo Squillace ' HOMEPAGE="https://github.com/fsquillace/${CMD}" -COPYRIGHT='2012-2015' +COPYRIGHT='2012-2016' if [ "$JUNEST_ENV" == "1" ] diff --git a/lib/util.sh b/lib/util.sh index 7f45102..6865c16 100644 --- a/lib/util.sh +++ b/lib/util.sh @@ -2,7 +2,7 @@ # # This file is part of JuNest (https://github.com/fsquillace/junest) # -# Copyright (c) 2012-2015 +# Copyright (c) 2015 # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Library General Public License as published