Help Center> Object Storage Service> Tools Guide> obsfs> Environment Preparation> Method 2: Generating obsfs by Compilation

Method 2: Generating obsfs by Compilation

obsfs is an open-source tool on GitHub. If your Linux distribution is not Ubuntu 16 or CentOS 7, or if you want to generate obsfs by compiling the source code, you can obtain the source code from GitHub. To compile the source code to generate obsfs, you need to configure the compilation environment and execute the compiling script.

Downloading the obsfs Source Code

Link to download the obsfs source code: https://github.com/huaweicloud/huaweicloud-obs-obsfs

On the Linux OS, run the following command to download the obsfs source code to the local host:

git clone https://github.com/huaweicloud/huaweicloud-obs-obsfs.git

Configuring the Compilation Environment

The compilation environment is used to directly compile source code on the local host to generate obsfs. Different Linux distributions have different configuration commands. Configuration commands are provided as follows for the obsfs compilation environment on Linux distributions such as Fedora, CentOS, RHEL, Debian, Ubuntu, SUSE, and openSUSE.

  • CentOS 7, Fedora 28, and RHEL 7
    yum install -y gcc libstdc++-devel gcc-c++ fuse fuse-devel curl-devel libxml2-devel mailcap git automake make 
    yum install -y openssl-devel
  • Ubuntu 14, Ubuntu 16, Ubuntu 18, and Debian 8
    apt-get install -y build-essential git libfuse-dev libcurl4-openssl-dev libxml2-dev mime-support automake libtool
    apt-get install -y pkg-config libssl-dev
  • SUSE 12, openSUSE Leap 42.1
    zypper in -y automake curl-devel fuse fuse-devel gcc-c++ libxml2-devel make openssl-devel 
  • obsfs supports libfuse 2.9.7, 2.9.8, or 2.9.9. If your libfuse is of another version, install it by referring to libfuse Installation Guide.
  • You can view the libfuse version by running the version query command on the CLI of the operating system. Alternatively, you can also run the following command to query the libfuse.so:
    find / -name libfuse.so*

Generating obsfs

After the compilation environment is configured successfully, run the cd command to go to the following path and run the bash build.sh command to generate obsfs.

cd Directory where the downloaded obsfs source code resides/huaweicloud-obs-obsfs

The generated obsfs is saved in the following path: Directory where the downloaded obsfs source code resides/huaweicloud-obs-obsfs/src

Verification

Go to the directory where obsfs resides and run the following command to verify whether obsfs can run successfully:

./obsfs --version

If the obsfs version information is displayed in the command output, obsfs is running successfully. You can start initializing and using obsfs. libfuse Installation Guide