mirror of
https://github.com/erenfro/gen2stage4.git
synced 2024-11-13 02:38:57 -05:00
Added automatic extraction script
This commit is contained in:
parent
d30ac26a8c
commit
fcd6f88870
2 changed files with 34 additions and 2 deletions
10
README.md
10
README.md
|
@ -61,7 +61,13 @@ mkstage4.sh [-q -c -b -l -k -p] [-s || -t <target-mountpoint>] [-e <additional e
|
|||
|
||||
## System Tarball Extraction
|
||||
|
||||
### Single-threaded
|
||||
### Automatic (Multi-threaded)
|
||||
|
||||
We provide a script for convenient extraction, `exstage4`, which is shipped with this package.
|
||||
Currently it simply automates the Multi-threaded extraction selection listed below and otherwise has no functionality except checking that the file name looks sane.
|
||||
If in doubt, use one of the explicit extraction methods described below.
|
||||
|
||||
### Explicit Single-threaded
|
||||
|
||||
Tarballs created with mkstage4 can be extracted with:
|
||||
|
||||
|
@ -78,7 +84,7 @@ tar xvjpf archive_name.tar.bz2.kmod
|
|||
tar xvjpf archive_name.tar.bz2.ksrc
|
||||
```
|
||||
|
||||
### Multi-threaded
|
||||
### Explicit Multi-threaded
|
||||
|
||||
If you have a parallel de/compressor installed, you can extract the archive with one of the respective commands:
|
||||
|
||||
|
|
26
exstage4.sh
Executable file
26
exstage4.sh
Executable file
|
@ -0,0 +1,26 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
STAGE_FILE=${1}
|
||||
|
||||
echo "${STAGE_FILE}"
|
||||
|
||||
EXT="${STAGE_FILE##*.}"
|
||||
|
||||
TARFILE="${STAGE_FILE%%.$EXT}"
|
||||
TAREXT="${TARFILE##*.}"
|
||||
|
||||
if [[ $TAREXT != "tar" ]]; then
|
||||
echo "The stage file you are trying to unpack (\`$STAGE_FILE\`) does not appear to be an archived TAR file"
|
||||
else
|
||||
echo "Extracting \`${STAGE_FILE}\` inplace."
|
||||
fi
|
||||
|
||||
if [ $EXT == "xz" ]; then
|
||||
tar -I 'xz -T0' -xvf "${STAGE_FILE}" --xattrs-include='*.*' --numeric-owner
|
||||
elif [ $EXT == "bz2" ]; then
|
||||
tar -I pbzip2 -xvf "${STAGE_FILE}" --xattrs-include='*.*' --numeric-owner
|
||||
elif [ $EXT == "gz" ]; then
|
||||
tar -I unpigz -xvf "${STAGE_FILE}" --xattrs-include='*.*' --numeric-owner
|
||||
else
|
||||
echo "Not sure how to unpack \`${STAGE_FILE}\`"
|
||||
fi
|
Loading…
Reference in a new issue