-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add missing squashfs-tools dependencies
Add support for downloading squashfs-tools.tcz.dep Download all the listed dependencies, and check for any other dependencies Run ldconfig to load the added libraries
- Loading branch information
Showing
6 changed files
with
64 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,39 @@ | ||
#!/bin/sh | ||
URL_TCZ=http://tinycorelinux.net/9.x/x86/tcz | ||
|
||
apk add --no-cache curl squashfs-tools >/dev/null | ||
|
||
if [ ! -f squashfs-tools.tcz ]; then | ||
curl -SLO http://tinycorelinux.net/9.x/x86/tcz/squashfs-tools.tcz >/dev/null | ||
download_tcz() { | ||
# Ignore empty/whitespace only | ||
[ -z "$(echo $1)" ] && return | ||
[ -f "$1" ] && return | ||
curl -SLO $URL_TCZ/$1 >/dev/null | ||
# Attempt to download .dep, but it might not exist | ||
curl --fail -LO $URL_TCZ/$1.dep >/dev/null 2>&1 | ||
# Make sure the .dep has an empty last line | ||
[ -f "$1.dep" ] && echo >> "$1.dep" | ||
} | ||
|
||
# Download squashfs-tools.tcz | ||
download_tcz squashfs-tools.tcz | ||
|
||
# Download any found dependencies, repeat 4 times for "recursion" | ||
if [ -f squashfs-tools.tcz.dep ]; then | ||
COUNTDOWN=5 | ||
while [ "$COUNTDOWN" -gt 0 ]; do | ||
COUNTDOWN=$(($COUNTDOWN - 1)) | ||
for t in $(cat *.dep|sort|uniq); do | ||
download_tcz $t | ||
done | ||
done | ||
fi | ||
|
||
[ -d /mnt ] || mkdir /mnt | ||
unsquashfs -f -d /mnt squashfs-tools.tcz >/dev/null | ||
|
||
# Extract all of the downloaded tcz files | ||
for t in $(find -name '*.tcz'); do | ||
unsquashfs -f -d /mnt $t >/dev/null | ||
done | ||
|
||
# Make a tarball of all of it and print to stdout | ||
tar cf - -C /mnt . | gzip -c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,39 @@ | ||
#!/bin/sh | ||
URL_TCZ=http://tinycorelinux.net/9.x/x86_64/tcz | ||
|
||
apk add --no-cache curl squashfs-tools >/dev/null | ||
|
||
if [ ! -f squashfs-tools.tcz ]; then | ||
curl -SLO http://tinycorelinux.net/9.x/x86_64/tcz/squashfs-tools.tcz >/dev/null | ||
download_tcz() { | ||
# Ignore empty/whitespace only | ||
[ -z "$(echo $1)" ] && return | ||
[ -f "$1" ] && return | ||
curl -SLO $URL_TCZ/$1 >/dev/null | ||
# Attempt to download .dep, but it might not exist | ||
curl --fail -LO $URL_TCZ/$1.dep >/dev/null 2>&1 | ||
# Make sure the .dep has an empty last line | ||
[ -f "$1.dep" ] && echo >> "$1.dep" | ||
} | ||
|
||
# Download squashfs-tools.tcz | ||
download_tcz squashfs-tools.tcz | ||
|
||
# Download any found dependencies, repeat 4 times for "recursion" | ||
if [ -f squashfs-tools.tcz.dep ]; then | ||
COUNTDOWN=5 | ||
while [ "$COUNTDOWN" -gt 0 ]; do | ||
COUNTDOWN=$(($COUNTDOWN - 1)) | ||
for t in $(cat *.dep|sort|uniq); do | ||
download_tcz $t | ||
done | ||
done | ||
fi | ||
|
||
[ -d /mnt ] || mkdir /mnt | ||
unsquashfs -f -d /mnt squashfs-tools.tcz >/dev/null | ||
|
||
# Extract all of the downloaded tcz files | ||
for t in $(find -name '*.tcz'); do | ||
unsquashfs -f -d /mnt $t >/dev/null | ||
done | ||
|
||
# Make a tarball of all of it and print to stdout | ||
tar cf - -C /mnt . | gzip -c |