mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-19 17:26:28 +00:00
We no longer directly convert to initrd, we use Go libraries for this
Removed unused tooling. Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
parent
673b25f26f
commit
7ca40d7801
@ -1,6 +0,0 @@
|
||||
FROM alpine:3.5
|
||||
|
||||
COPY . /
|
||||
|
||||
ENTRYPOINT ["/bin/sh", "-c"]
|
||||
CMD ["/tar2initrd.sh"]
|
@ -1,29 +0,0 @@
|
||||
.PHONY: tag push
|
||||
|
||||
BASE=alpine:3.5
|
||||
IMAGE=tar2initrd
|
||||
|
||||
default: push
|
||||
|
||||
hash: Dockerfile tar2initrd.sh
|
||||
DOCKER_CONTENT_TRUST=1 docker pull $(BASE)
|
||||
tar cf - $^ | docker build --no-cache -t $(IMAGE):build -
|
||||
docker run --rm --entrypoint=/bin/sh $(IMAGE):build -c 'cat Dockerfile tar2initrd.sh /lib/apk/db/installed | sha1sum' | sed 's/ .*//' > hash
|
||||
|
||||
push: hash
|
||||
docker pull mobylinux/$(IMAGE):$(shell cat hash) || \
|
||||
(docker tag $(IMAGE):build mobylinux/$(IMAGE):$(shell cat hash) && \
|
||||
docker push mobylinux/$(IMAGE):$(shell cat hash))
|
||||
docker rmi $(IMAGE):build
|
||||
rm -f hash
|
||||
|
||||
tag: hash
|
||||
docker pull mobylinux/$(IMAGE):$(shell cat hash) || \
|
||||
docker tag $(IMAGE):build mobylinux/$(IMAGE):$(shell cat hash)
|
||||
docker rmi $(IMAGE):build
|
||||
rm -f hash
|
||||
|
||||
clean:
|
||||
rm -f hash
|
||||
|
||||
.DELETE_ON_ERROR:
|
@ -1,34 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
mkdir -p /tmp/input
|
||||
|
||||
cd /tmp/input
|
||||
|
||||
tar xf -
|
||||
|
||||
find . | cpio -H newc -o | gzip -9 > ../initrd.img
|
||||
|
||||
cd /tmp
|
||||
|
||||
SIZE=$(stat -c "%s" initrd.img)
|
||||
SIZE4=$(( $SIZE / 4 \* 4 ))
|
||||
DIFF=$(( $SIZE - $SIZE4 ))
|
||||
[ $DIFF -ne 0 ] && DIFF=$(( 4 - $DIFF ))
|
||||
|
||||
dd if=/dev/zero bs=1 count=$DIFF of=zeropad 2>/dev/null
|
||||
|
||||
cat zeropad >> initrd.img
|
||||
|
||||
SIZE=$(stat -c "%s" initrd.img)
|
||||
SIZE4=$(( $SIZE / 4 \* 4 ))
|
||||
DIFF=$(( $SIZE - $SIZE4 ))
|
||||
|
||||
if [ $DIFF -ne 0 ]
|
||||
then
|
||||
echo "Bad alignment" >2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cat initrd.img
|
@ -1,12 +0,0 @@
|
||||
FROM alpine:3.5
|
||||
|
||||
RUN \
|
||||
apk update && apk upgrade -a && \
|
||||
apk add --no-cache \
|
||||
libarchive-tools \
|
||||
&& true
|
||||
|
||||
COPY . /
|
||||
|
||||
ENTRYPOINT ["/bin/sh", "-c"]
|
||||
CMD ["/tartar2initrd.sh"]
|
@ -1,29 +0,0 @@
|
||||
.PHONY: tag push
|
||||
|
||||
BASE=alpine:3.5
|
||||
IMAGE=tartar2initrd
|
||||
|
||||
default: push
|
||||
|
||||
hash: Dockerfile tartar2initrd.sh
|
||||
DOCKER_CONTENT_TRUST=1 docker pull $(BASE)
|
||||
tar cf - $^ | docker build --no-cache -t $(IMAGE):build -
|
||||
docker run --rm --entrypoint=/bin/sh $(IMAGE):build -c "cat $^ /lib/apk/db/installed | sha1sum" | sed 's/ .*//' > $@
|
||||
|
||||
push: hash
|
||||
docker pull mobylinux/$(IMAGE):$(shell cat hash) || \
|
||||
(docker tag $(IMAGE):build mobylinux/$(IMAGE):$(shell cat hash) && \
|
||||
docker push mobylinux/$(IMAGE):$(shell cat hash))
|
||||
docker rmi $(IMAGE):build
|
||||
rm -f hash
|
||||
|
||||
tag: hash
|
||||
docker pull mobylinux/$(IMAGE):$(shell cat hash) || \
|
||||
docker tag $(IMAGE):build mobylinux/$(IMAGE):$(shell cat hash)
|
||||
docker rmi $(IMAGE):build
|
||||
rm -f hash
|
||||
|
||||
clean:
|
||||
rm -f hash
|
||||
|
||||
.DELETE_ON_ERROR:
|
@ -1,40 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
mkdir -p /tmp/input0 /tmp/input
|
||||
|
||||
cd /tmp/input0
|
||||
|
||||
# outer tarball
|
||||
bsdtar xf -
|
||||
|
||||
cd /tmp/input
|
||||
|
||||
# inner tarballs
|
||||
find /tmp/input0 \( -name '*.tar' -or -name '*.tgz' -or -name '*.tar.gz' \) -exec bsdtar xf '{}' \;
|
||||
|
||||
find . | cpio -H newc -o | gzip -9 > ../initrd.img
|
||||
|
||||
cd /tmp
|
||||
|
||||
SIZE=$(stat -c "%s" initrd.img)
|
||||
SIZE4=$(( $SIZE / 4 \* 4 ))
|
||||
DIFF=$(( $SIZE - $SIZE4 ))
|
||||
[ $DIFF -ne 0 ] && DIFF=$(( 4 - $DIFF ))
|
||||
|
||||
dd if=/dev/zero bs=1 count=$DIFF of=zeropad 2>/dev/null
|
||||
|
||||
cat zeropad >> initrd.img
|
||||
|
||||
SIZE=$(stat -c "%s" initrd.img)
|
||||
SIZE4=$(( $SIZE / 4 \* 4 ))
|
||||
DIFF=$(( $SIZE - $SIZE4 ))
|
||||
|
||||
if [ $DIFF -ne 0 ]
|
||||
then
|
||||
echo "Bad alignment" >2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cat initrd.img
|
Loading…
Reference in New Issue
Block a user