Skip to content

Commit d34f031

Browse files
committed
Adding Ubuntu Focal.
1 parent a501deb commit d34f031

File tree

8 files changed

+87
-0
lines changed

8 files changed

+87
-0
lines changed

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,15 @@ build:
1212
@cd arch && ./build $(TAG)
1313
@echo "building ubuntu bionic"
1414
@cd ubuntu/bionic && ./build $(TAG)
15+
@echo "building ubuntu focal"
16+
@cd ubuntu/focal && ./build $(TAG)
1517
deploy:
1618
@echo "logging into docker"
1719
@docker login -u $(LOGIN_USERNAME) -p $(LOGIN_PASSWORD)
1820
@echo "deplying arch"
1921
@cd arch && ./deploy $(TAG)
2022
@echo "deplying ubuntu bionic"
2123
@cd ubuntu/bionic && ./deploy $(TAG)
24+
@echo "deplying ubuntu focal"
25+
@cd ubuntu/focal && ./deploy $(TAG)
2226
ci: build deploy

ubuntu/focal/Dockerfile

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

ubuntu/focal/build

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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 focal 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:focal .
16+
docker tag godarch/ubuntu:focal godarch/ubuntu:focal-$TAG

ubuntu/focal/deploy

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

ubuntu/focal/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/focal/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/focal/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/focal/helpers/darch-teardown

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+
echo "tearing down..."
5+
6+
apt-get clean

0 commit comments

Comments
 (0)