Skip to content

Commit 08d1604

Browse files
committed
Added ubuntu cosmic.
1 parent 43a4a75 commit 08d1604

File tree

8 files changed

+83
-1
lines changed

8 files changed

+83
-1
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,6 @@ void/root.tar.xz
66
debian/root.testing.x86_64
77
debian/root.testing.x86_64.tar.gz
88
debian/root.stretch.x86_64
9-
debian/root.stretch.x86_64.tar.gz
9+
debian/root.stretch.x86_64.tar.gz
10+
ubuntu/cosmic/root.x86_64
11+
ubuntu/cosmic/root.x86_64.tar.gz

ubuntu/cosmic/Dockerfile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
FROM scratch
2+
3+
ADD root.x86_64.tar.gz /
4+
5+
RUN apt-get update
6+
7+
# Some common packages
8+
RUN apt-get -y install lvm2
9+
10+
ADD helpers/darch-extract /darch-extract
11+
ADD helpers/darch-prepare /darch-prepare
12+
ADD helpers/darch-runrecipe /darch-runrecipe
13+
ADD helpers/darch-teardown /darch-teardown
14+
15+
# Add the Darch repo for initramfs tools.
16+
RUN apt-get -y install curl gnupg software-properties-common
17+
RUN curl -L https://raw.githubusercontent.com/godarch/debian-repo/master/key.pub | apt-key add -
18+
RUN add-apt-repository 'deb https://raw.githubusercontent.com/godarch/debian-repo/master/darch testing main'
19+
RUN apt-get update
20+
RUN apt-get -y install darch-initramfs-tools
21+
RUN update-initramfs -u
22+
23+
# Clean up
24+
RUN apt-get clean

ubuntu/cosmic/build

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
if [ ! -e root.x86_64 ]; then
5+
mkdir root.x86_64
6+
debootstrap --include=linux-image-generic cosmic root.x86_64 http://archive.ubuntu.com/ubuntu/
7+
fi
8+
9+
if [ ! -e root.x86_64.tar.gz ]; then
10+
cd root.x86_64
11+
tar -czpf ../root.x86_64.tar.gz *
12+
cd ..
13+
fi
14+
15+
docker build --squash -t godarch/ubuntu:cosmic .
16+
docker tag godarch/ubuntu:cosmic godarch/ubuntu:cosmic-$TAG
17+
docker tag godarch/ubuntu:cosmic godarch/ubuntu:latest

ubuntu/cosmic/deploy

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
TAG="$1"
5+
6+
docker push godarch/ubuntu:cosmic
7+
docker push godarch/ubuntu:cosmic-$TAG
8+
docker push godarch/ubuntu:latest

ubuntu/cosmic/helpers/darch-extract

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
# TODO: Only install if needed, and if we install it, remove it when we are done.
5+
apt-get install -y squashfs-tools
6+
7+
# Make the directory that will be extracted
8+
mkdir /extract
9+
10+
# Build/copy all files to extract directory
11+
mksquashfs / /extract/rootfs.squash -e /extract -e /sys -e /proc
12+
KERNEL=`find /boot -name "vmlinuz*generic"`
13+
INITRAMFS=`find /boot -name "initrd*generic"`
14+
cp $KERNEL /extract/vmlinuz
15+
cp $INITRAMFS /extract/init.img
16+
17+
# Stamp a json file which tells people what files are for what.
18+
json='{"kernel": "vmlinuz", "kernelparams": "boot=darch root=dummy", "initramfs": "init.img", "rootfs": "rootfs.squash", "nodoublemount": false}'
19+
echo $json > /extract/image.json

ubuntu/cosmic/helpers/darch-prepare

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
echo "preparing..."

ubuntu/cosmic/helpers/darch-runrecipe

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
RECIPE_NAME="$1"
5+
6+
/usr/bin/env bash -c "cd /recipes/$RECIPE_NAME/ && ./script"

ubuntu/cosmic/helpers/darch-teardown

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env bash
2+
set -e

0 commit comments

Comments
 (0)