Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ycai
simbricks
Commits
4998b831
Commit
4998b831
authored
Sep 09, 2020
by
Antoine Kaufmann
Browse files
images: further split images into just ubuntu & base image
parent
22effe94
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
125 additions
and
54 deletions
+125
-54
.gitignore
.gitignore
+1
-3
images/Makefile
images/Makefile
+13
-5
images/base.json
images/base.json
+108
-0
images/mtcp.json
images/mtcp.json
+1
-1
images/nopaxos.json
images/nopaxos.json
+1
-1
images/ubuntu1804.json
images/ubuntu1804.json
+1
-44
No files found.
.gitignore
View file @
4998b831
...
@@ -15,9 +15,7 @@ images/mqnic/modules.order
...
@@ -15,9 +15,7 @@ images/mqnic/modules.order
images/mqnic/mqnic.mod*
images/mqnic/mqnic.mod*
images/vmlinux
images/vmlinux
images/bzImage
images/bzImage
images/output-ubuntu1804-base
images/output-*
images/output-nopaxos
images/output-mtcp
images/packer
images/packer
images/packer_cache
images/packer_cache
images/kheaders.tar.bz2
images/kheaders.tar.bz2
...
...
images/Makefile
View file @
4998b831
PACKER_VERSION
:=
1.6.0
PACKER_VERSION
:=
1.6.0
KERNEL_VERSION
:=
5.4.46
KERNEL_VERSION
:=
5.4.46
BASE_IMAGE
:=
output-ubuntu1804-base/ubuntu1804-base
UBUNTU_IMAGE
:=
output-ubuntu1804/ubuntu1804
BASE_IMAGE
:=
output-base/base
NOPAXOS_IMAGE
:=
output-nopaxos/nopaxos
NOPAXOS_IMAGE
:=
output-nopaxos/nopaxos
MTCP_IMAGE
:=
output-mtcp/mtcp
MTCP_IMAGE
:=
output-mtcp/mtcp
IMAGES
:=
$(BASE_IMAGE)
$(NOPAXOS_IMAGE)
$(MTCP_IMAGE)
IMAGES
:=
$(BASE_IMAGE)
$(NOPAXOS_IMAGE)
$(MTCP_IMAGE)
...
@@ -10,9 +11,10 @@ RAW_IMAGES := $(addsuffix .raw,$(IMAGES))
...
@@ -10,9 +11,10 @@ RAW_IMAGES := $(addsuffix .raw,$(IMAGES))
all
:
$(IMAGES) $(RAW_IMAGES) vmlinux bzImage mqnic/mqnic.ko
all
:
$(IMAGES) $(RAW_IMAGES) vmlinux bzImage mqnic/mqnic.ko
clean
:
clean
:
rm
-rf
packer packer_cache
output-ubuntu1804
vmlinux bzImage
\
rm
-rf
packer packer_cache vmlinux bzImage
\
mqnic/mqnic.ko mqnic/
*
.o mqnic/.
*
.cmd mqnic/mqnic.mod.c
\
mqnic/mqnic.ko mqnic/
*
.o mqnic/.
*
.cmd mqnic/mqnic.mod.c
\
mqnic/Module.symvers mqnic/modules.order
\
mqnic/Module.symvers mqnic/modules.order
\
output-ubuntu1804 output-base output-mtcp output-nopaxos
\
kernel/linux-
$(KERNEL_VERSION)
/ kheaders.tar.bz2
kernel/linux-
$(KERNEL_VERSION)
/ kheaders.tar.bz2
################################################
################################################
...
@@ -21,9 +23,14 @@ clean:
...
@@ -21,9 +23,14 @@ clean:
%.raw
:
%
%.raw
:
%
qemu-img convert
-f
qcow2
-O
raw
$<
$@
qemu-img convert
-f
qcow2
-O
raw
$<
$@
$(BASE_IMAGE)
:
$(wildcard scripts/*) packer ubuntu1804-base.json bzImage kheaders.tar.bz2
$(UBUNTU_IMAGE)
:
$(wildcard scripts/*) packer ubuntu1804.json
rm
-rf
output-ubuntu1804-base
rm
-rf
output-ubuntu1804
./packer build ubuntu1804-base.json
./packer build ubuntu1804.json
touch
$@
$(BASE_IMAGE)
:
$(wildcard scripts/*) packer base.json $(UBUNTU_IMAGE) bzImage kheaders.tar.bz2
rm
-rf
output-base
./packer build base.json
touch
$@
touch
$@
$(NOPAXOS_IMAGE)
:
$(wildcard scripts/*) packer nopaxos.json $(BASE_IMAGE) scripts/install-nopaxos.sh
$(NOPAXOS_IMAGE)
:
$(wildcard scripts/*) packer nopaxos.json $(BASE_IMAGE) scripts/install-nopaxos.sh
...
@@ -89,6 +96,7 @@ kernel/linux-$(KERNEL_VERSION)/.config: kernel/config-$(KERNEL_VERSION)
...
@@ -89,6 +96,7 @@ kernel/linux-$(KERNEL_VERSION)/.config: kernel/config-$(KERNEL_VERSION)
wget https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-
$(KERNEL_VERSION)
.tar.xz
wget https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-
$(KERNEL_VERSION)
.tar.xz
tar
xf linux-
$(KERNEL_VERSION)
.tar.xz
tar
xf linux-
$(KERNEL_VERSION)
.tar.xz
rm
-f
linux-
$(KERNEL_VERSION)
.tar.xz
rm
-f
linux-
$(KERNEL_VERSION)
.tar.xz
rm
-rf
kernel/linux-
$(KERNEL_VERSION)
mv
linux-
$(KERNEL_VERSION)
kernel/
mv
linux-
$(KERNEL_VERSION)
kernel/
cd
kernel/linux-
$(KERNEL_VERSION)
&&
patch
-p1
< ../linux-
$(KERNEL_VERSION)
-timers-gem5
.patch
cd
kernel/linux-
$(KERNEL_VERSION)
&&
patch
-p1
< ../linux-
$(KERNEL_VERSION)
-timers-gem5
.patch
cp
kernel/config-
$(KERNEL_VERSION)
kernel/linux-
$(KERNEL_VERSION)
/.config
cp
kernel/config-
$(KERNEL_VERSION)
kernel/linux-
$(KERNEL_VERSION)
/.config
...
...
images/base.json
0 → 100644
View file @
4998b831
{
"_comment"
:
"Build with `packer build ubuntu.json`"
,
"builders"
:
[
{
"iso_urls"
:
[
"output-ubuntu1804/ubuntu1804"
],
"iso_checksum"
:
"none"
,
"disk_image"
:
"true"
,
"use_backing_file"
:
"true"
,
"headless"
:
"{{ user `headless` }}"
,
"disable_vnc"
:
"false"
,
"output_directory"
:
"output-{{ user `vm_name` }}"
,
"qemuargs"
:
[
[
"-m"
,
"{{ user `memory` }}"
],
[
"-display"
,
"none"
],
[
"-machine"
,
"accel=kvm"
],
[
"-cpu"
,
"host"
],
[
"-smp"
,
"cpus={{ user `cpus`}}"
],
[
"-serial"
,
"mon:stdio"
]
],
"shutdown_command"
:
"echo '{{ user `ssh_password` }}'|sudo -S shutdown -P now"
,
"ssh_password"
:
"{{ user `ssh_password` }}"
,
"ssh_timeout"
:
"10000s"
,
"ssh_username"
:
"{{ user `ssh_username` }}"
,
"type"
:
"qemu"
,
"vm_name"
:
"{{ user `vm_name` }}"
}
],
"provisioners"
:
[
{
"type"
:
"file"
,
"source"
:
"scripts/guestinit.sh"
,
"destination"
:
"/home/ubuntu/guestinit.sh"
,
"direction"
:
"upload"
},
{
"type"
:
"file"
,
"source"
:
"bzImage"
,
"destination"
:
"/tmp/bzImage"
,
"direction"
:
"upload"
},
{
"type"
:
"file"
,
"source"
:
"kernel/config-5.4.46"
,
"destination"
:
"/tmp/config-5.4.46"
,
"direction"
:
"upload"
},
{
"type"
:
"file"
,
"source"
:
"kheaders.tar.bz2"
,
"destination"
:
"/tmp/kheaders.tar.bz2"
,
"direction"
:
"upload"
},
{
"type"
:
"shell"
,
"inline"
:
[
"sudo mv /tmp/bzImage /boot/vmlinuz-5.4.46"
,
"sudo mv /tmp/config-5.4.46 /boot/config-5.4.46"
,
"sudo update-grub"
,
"cd / && sudo tar xf /tmp/kheaders.tar.bz2"
]
},
{
"type"
:
"file"
,
"source"
:
"m5"
,
"destination"
:
"/tmp/m5"
,
"direction"
:
"upload"
},
{
"type"
:
"shell"
,
"inline"
:
[
"sudo mv /tmp/m5 /sbin/m5"
]
}
],
"variables"
:
{
"cleanup_pause"
:
""
,
"cpus"
:
"4"
,
"custom_script"
:
"."
,
"desktop"
:
"false"
,
"disk_size"
:
"10000"
,
"headless"
:
""
,
"hostname"
:
"vagrant"
,
"memory"
:
"4096"
,
"preseed"
:
"preseed.cfg"
,
"ssh_fullname"
:
"vagrant"
,
"ssh_password"
:
"ubuntu"
,
"ssh_username"
:
"ubuntu"
,
"vagrantfile_template"
:
""
,
"version"
:
"0.1.0"
,
"vm_name"
:
"base"
}
}
images/mtcp.json
View file @
4998b831
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
"_comment"
:
"Build with `packer build ubuntu.json`"
,
"_comment"
:
"Build with `packer build ubuntu.json`"
,
"builders"
:
[
"builders"
:
[
{
{
"iso_urls"
:
[
"output-
ubuntu1804-base/ubuntu1804-
base"
],
"iso_urls"
:
[
"output-
base/
base"
],
"iso_checksum"
:
"none"
,
"iso_checksum"
:
"none"
,
"disk_image"
:
"true"
,
"disk_image"
:
"true"
,
"use_backing_file"
:
"true"
,
"use_backing_file"
:
"true"
,
...
...
images/nopaxos.json
View file @
4998b831
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
"_comment"
:
"Build with `packer build ubuntu.json`"
,
"_comment"
:
"Build with `packer build ubuntu.json`"
,
"builders"
:
[
"builders"
:
[
{
{
"iso_urls"
:
[
"output-
ubuntu1804-base/ubuntu1804-
base"
],
"iso_urls"
:
[
"output-
base/
base"
],
"iso_checksum"
:
"none"
,
"iso_checksum"
:
"none"
,
"disk_image"
:
"true"
,
"disk_image"
:
"true"
,
"use_backing_file"
:
"true"
,
"use_backing_file"
:
"true"
,
...
...
images/ubuntu1804
-base
.json
→
images/ubuntu1804.json
View file @
4998b831
...
@@ -82,49 +82,6 @@
...
@@ -82,49 +82,6 @@
"scripts/cleanup.sh"
"scripts/cleanup.sh"
],
],
"type"
:
"shell"
"type"
:
"shell"
},
{
"type"
:
"file"
,
"source"
:
"scripts/guestinit.sh"
,
"destination"
:
"/home/ubuntu/guestinit.sh"
,
"direction"
:
"upload"
},
{
"type"
:
"file"
,
"source"
:
"bzImage"
,
"destination"
:
"/tmp/bzImage"
,
"direction"
:
"upload"
},
{
"type"
:
"file"
,
"source"
:
"kernel/config-5.4.46"
,
"destination"
:
"/tmp/config-5.4.46"
,
"direction"
:
"upload"
},
{
"type"
:
"file"
,
"source"
:
"kheaders.tar.bz2"
,
"destination"
:
"/tmp/kheaders.tar.bz2"
,
"direction"
:
"upload"
},
{
"type"
:
"shell"
,
"inline"
:
[
"sudo mv /tmp/bzImage /boot/vmlinuz-5.4.46"
,
"sudo mv /tmp/config-5.4.46 /boot/config-5.4.46"
,
"sudo update-grub"
,
"cd / && sudo tar xf /tmp/kheaders.tar.bz2"
]
},
{
"type"
:
"file"
,
"source"
:
"m5"
,
"destination"
:
"/tmp/m5"
,
"direction"
:
"upload"
},
{
"type"
:
"shell"
,
"inline"
:
[
"sudo mv /tmp/m5 /sbin/m5"
]
}
}
],
],
"variables"
:
{
"variables"
:
{
...
@@ -156,7 +113,7 @@
...
@@ -156,7 +113,7 @@
"update"
:
"false"
,
"update"
:
"false"
,
"vagrantfile_template"
:
""
,
"vagrantfile_template"
:
""
,
"version"
:
"0.1.0"
,
"version"
:
"0.1.0"
,
"vm_name"
:
"ubuntu1804
-base
"
"vm_name"
:
"ubuntu1804"
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment