Add function to download source files.

This commit is contained in:
Andrius Štikonas 2021-01-11 22:34:37 +00:00
parent c4528a0dac
commit 1f0d7d2f78
2 changed files with 20 additions and 18 deletions

View File

@ -87,22 +87,24 @@ popd
cp "$(basename $url .tar.gz).kaem" tmp/after cp "$(basename $url .tar.gz).kaem" tmp/after
tar -C tmp/after -xf "../sources/$(basename $url)" tar -C tmp/after -xf "../sources/$(basename $url)"
# gzip 1.2.4 get_file() {
url=https://ftp.gnu.org/gnu/gzip/gzip-1.2.4.tar url=$1
pushd ../sources pushd ../sources
wget --continue "$url" wget --continue "$url"
popd popd
cp "$(basename $url .tar).kaem" tmp/after ext="${url##*.}"
cp "../sources/$(basename $url)" tmp/after if [ "$ext" = "tar" ]; then
bname=$(basename "$url" .tar)
# diffutils 2.7 else
url=https://ftp.gnu.org/gnu/diffutils/diffutils-2.7.tar.gz bname=$(basename "$url" ".tar.${ext}")
pushd ../sources fi
wget --continue "$url" cp "${bname}.kaem" tmp/after
popd cp "../sources/$(basename "$url")" tmp/after
cp "$(basename $url .tar.gz).kaem" tmp/after }
cp "../sources/$(basename $url)" tmp/after
# Download remaining sources
get_file https://ftp.gnu.org/gnu/gzip/gzip-1.2.4.tar
get_file https://ftp.gnu.org/gnu/diffutils/diffutils-2.7.tar.gz
# General cleanup # General cleanup
find tmp -name .git -exec rm -rf \; find tmp -name .git -exec rm -rf \;
@ -113,7 +115,7 @@ find . | cpio -H newc -o | gzip > initramfs.igz
# Run # Run
${QEMU_CMD:-qemu-system-x86_64} -enable-kvm \ ${QEMU_CMD:-qemu-system-x86_64} -enable-kvm \
-m ${RAM:-8G} \ -m "${RAM:-8G}" \
-nographic \ -nographic \
-no-reboot \ -no-reboot \
-kernel ../../kernel -initrd initramfs.igz -append console=ttyS0 -kernel ../../kernel -initrd initramfs.igz -append console=ttyS0

View File

@ -30,5 +30,5 @@ tcc -c -I. fnmatch.c
tcc -c -I. regex.c tcc -c -I. regex.c
# Link # Link
tcc -o ${bindir}/cmp cmp.o cmpbuf.o error.o getopt.o getopt1.o xmalloc.o version.o tcc -static -o ${bindir}/cmp cmp.o cmpbuf.o error.o getopt.o getopt1.o xmalloc.o version.o
tcc -o ${bindir}/diff diff.o analyze.o cmpbuf.o dir.o io.o util.o context.o ed.o ifdef.o normal.o side.o fnmatch.o getopt.o getopt1.o regex.o version.o tcc -static -o ${bindir}/diff diff.o analyze.o cmpbuf.o dir.o io.o util.o context.o ed.o ifdef.o normal.o side.o fnmatch.o getopt.o getopt1.o regex.o version.o