VaKeR CYBER ARMY
Logo of a company Server : Apache/2.4.41 (Ubuntu)
System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64
User : www-data ( 33)
PHP Version : 7.4.33
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Directory :  /proc/self/root/usr/sbin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/usr/sbin/libguestfs-make-fixed-appliance
#!/bin/bash -
# appliance/libguestfs-make-fixed-appliance.  Generated from libguestfs-make-fixed-appliance.in by configure.
# libguestfs-make-fixed-appliance tool
# Copyright (C) 2012 Red Hat Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

unset CDPATH

program="libguestfs-make-fixed-appliance"
version="1.40.2"

TEMP=`getopt \
        -o V \
        --long help,version,xz \
        -n $program -- "$@"`
if [ $? != 0 ]; then
    echo "$program: problem parsing the command line arguments"
    exit 1
fi
eval set -- "$TEMP"

usage ()
{
    echo "Usage:"
    echo "  $program [--options] OUTPUTDIR"
    echo "  $program [--options] --xz"
    echo
    echo "Read $program(1) man page for more information."
    exit $1
}

while true; do
    case "$1" in
        -V|--version)
            echo "$program $version"
            exit 0;;
        --xz)
            xz_mode=1
            shift;;
        --help)
            usage 0;;
        --)
            shift
            break;;
        *)
            echo "internal error ($1)"
            exit 1;;
    esac
done

# Either xz_mode or we expect one extra parameter (output directory).
if [ -n "$xz_mode" ]; then
    if [ $# -gt 0 ]; then
        echo "error: $program: extra parameters on the command line"
        echo
        usage 1
    fi
else
    if [ $# -ne 1 ]; then
        echo "error: $program: missing output directory"
        echo
        usage 1
    fi
    outputdir="$1"
fi

# end of command line parsing
#----------------------------------------------------------------------

set -e

# The two ways to build the appliance are roughly the same, except for
# --xz we build into a temporary directory and tar it up at the end.

if [ -n "$xz_mode" ]; then
    tmpdir="$(mktemp -d)"
    outputdir="$tmpdir/appliance"

    cleanup ()
    {
        rm -rf $tmpdir ||:
    }
    trap cleanup EXIT ERR
fi

# Create the output directory.
mkdir -p "$outputdir"

# Build the supermin appliance, if not already.
guestfish -a /dev/null run

# Find the location of the appliance.
cachedir="$(guestfish get-cachedir)"
euid="$(id -u)"
appliancedir="$cachedir/.guestfs-$euid/appliance.d"

cp "$appliancedir/kernel" "$outputdir/kernel"
cp "$appliancedir/initrd" "$outputdir/initrd"
cp --sparse=always "$appliancedir/root" "$outputdir/root"

cat <<EOF >"$outputdir/README.fixed"
This is the "fixed appliance", a pre-built binary appliance for
libguestfs.  This was built using $program.

Unpack the appliance directory:

  tar -Jxvf appliance-<VERSION>.tar.xz

Then copy all four files:

 * kernel
 * initrd
 * root
 * README.fixed

into a directory somewhere, eg. /usr/local/lib/guestfs/appliance/

Then build libguestfs from source, disabling the normal appliance
and daemon:

  ./configure --disable-appliance --disable-daemon
  make
  sudo make install

Set LIBGUESTFS_PATH to the path where you unpacked these files, eg:

  export LIBGUESTFS_PATH=/usr/local/lib/guestfs/appliance/

and run the libguestfs programs and virt tools in the normal way.


LICENSE
-------

This appliance contains software under a variety of open source
licenses.  The software is from Fedora (https://fedoraproject.org/),
and to rebuild it you need to download Fedora 17+ and
libguestfs >= 1.17.10, and build libguestfs from source in the usual
way.

EOF

# If --xz, compress the result.  Note -S option to preserve sparseness.
if [ -n "$xz_mode" ]; then
    tar -C "$tmpdir" -S -cf - appliance | xz --best > "appliance-$version.tar.xz"
    rm -rf "$tmpdir" ||:
    trap - EXIT ERR
fi

VaKeR 2022