8.7. file stage 2 5.47
Rebuild file in the final target environment so file-type detection and libmagic use the finalized userspace.
Input assumption: file-5.47.tar.gz is already present in /sources from the chapter 4 source staging step.
Source URL: https://mirrors.mit.edu/macports/distfiles/file/file-5.47.tar.gz
Licenses:
- BSD-2-Clause
Dependencies:
- musl (libc)
- xz (for compressed magic data files)
- zlib-ng (for compressed magic data files)
- make
file is a file type identification utility and library. we need it to provide final stage file and libmagic behavior in the completed chapter 8 userspace.
Extract and Enter the Source Tree
cd /sources
tar -xf file-5.47.tar.gz
cd file-5.47
Configure file
lbi_configure
Build file
make $LWI_MAKE_FLAGS
Install file
make install
After this step is complete, you can remove the extracted source directory and source tarball from
/sources if you do not plan to rebuild file again.
Command Explanations
cd /sources,tar -xf, andcd file-...: Enter the staged file source tree.lbi_configure: Configures file for the book's layout.make $LWI_MAKE_FLAGS: Builds with shared make parallelism.make install: Installs into the active target filesystem.