Skip to content

Commit

Permalink
Add missing squashfs-tools dependencies
Browse files Browse the repository at this point in the history
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
chazzam authored and tatsushid committed Sep 19, 2018
1 parent 9163572 commit a9b64c3
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 6 deletions.
1 change: 1 addition & 0 deletions 9.0/x86/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ RUN mkdir -p /tmp/tce/optional \
&& $(cd etc/sysconfig; ln -s ../../tmp/tce tcedir) \
&& echo -n tc > etc/sysconfig/tcuser \
&& . /etc/init.d/tc-functions \
&& ldconfig \
&& setupHome

USER tc
Expand Down
Binary file modified 9.0/x86/squashfs-tools.tar.gz
Binary file not shown.
34 changes: 31 additions & 3 deletions 9.0/x86/src/build_squashfs_tools.sh
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
1 change: 1 addition & 0 deletions 9.0/x86_64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ RUN mkdir -p /tmp/tce/optional \
&& $(cd etc/sysconfig; ln -s ../../tmp/tce tcedir) \
&& echo -n tc > etc/sysconfig/tcuser \
&& . /etc/init.d/tc-functions \
&& ldconfig \
&& setupHome

USER tc
Expand Down
Binary file modified 9.0/x86_64/squashfs-tools.tar.gz
Binary file not shown.
34 changes: 31 additions & 3 deletions 9.0/x86_64/src/build_squashfs_tools.sh
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

0 comments on commit a9b64c3

Please sign in to comment.