diff --git a/9.0/x86/Dockerfile b/9.0/x86/Dockerfile index cf041de..a64f63a 100644 --- a/9.0/x86/Dockerfile +++ b/9.0/x86/Dockerfile @@ -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 diff --git a/9.0/x86/squashfs-tools.tar.gz b/9.0/x86/squashfs-tools.tar.gz index fbd5acf..1153033 100644 Binary files a/9.0/x86/squashfs-tools.tar.gz and b/9.0/x86/squashfs-tools.tar.gz differ diff --git a/9.0/x86/src/build_squashfs_tools.sh b/9.0/x86/src/build_squashfs_tools.sh index d4e25f9..0db37dc 100755 --- a/9.0/x86/src/build_squashfs_tools.sh +++ b/9.0/x86/src/build_squashfs_tools.sh @@ -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 diff --git a/9.0/x86_64/Dockerfile b/9.0/x86_64/Dockerfile index 75ca619..2752d15 100644 --- a/9.0/x86_64/Dockerfile +++ b/9.0/x86_64/Dockerfile @@ -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 diff --git a/9.0/x86_64/squashfs-tools.tar.gz b/9.0/x86_64/squashfs-tools.tar.gz index 5531f34..53fb7b5 100644 Binary files a/9.0/x86_64/squashfs-tools.tar.gz and b/9.0/x86_64/squashfs-tools.tar.gz differ diff --git a/9.0/x86_64/src/build_squashfs_tools.sh b/9.0/x86_64/src/build_squashfs_tools.sh index e748664..408e427 100755 --- a/9.0/x86_64/src/build_squashfs_tools.sh +++ b/9.0/x86_64/src/build_squashfs_tools.sh @@ -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