Skip to content

Commit 50060ac

Browse files
committed
chore(rootfs): update rootfs to Ubuntu 24.04
Update guest rootfs to Ubuntu 24.04 Signed-off-by: Pablo Barbáchano <[email protected]>
1 parent d7df543 commit 50060ac

20 files changed

+89
-91
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ We test all combinations of:
132132

133133
| Instance | Host OS & Kernel | Guest Rootfs | Guest Kernel |
134134
| :-------- | :---------------- | :----------- | :----------- |
135-
| c5n.metal | al2 linux_5.10 | ubuntu 22.04 | linux_5.10 |
135+
| c5n.metal | al2 linux_5.10 | ubuntu 24.04 | linux_5.10 |
136136
| m5n.metal | al2023 linux_6.1 | | linux_6.1 |
137137
| m6i.metal | | | |
138138
| m6a.metal | | | |

docs/getting-started.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ You can check if your system meets the requirements by running
99
`firecracker/tools/devtool checkenv`.
1010

1111
An opinionated way to run Firecracker is to launch an
12-
[EC2](https://aws.amazon.com/ec2/) `c5.metal` instance with Ubuntu 22.04.
12+
[EC2](https://aws.amazon.com/ec2/) `c5.metal` instance with Ubuntu 24.04.
1313

1414
Firecracker requires [the KVM Linux kernel module](https://www.linux-kvm.org/)
1515
to perform its virtualization and emulation tasks.
@@ -95,7 +95,7 @@ For simplicity, this guide will not use the [`jailer`](../src/jailer/).
9595

9696
To successfully start a microVM, you will need an uncompressed Linux kernel
9797
binary, and an ext4 file system image (to use as rootfs). This guide uses a 5.10
98-
kernel image with a Ubuntu 22.04 rootfs from our CI:
98+
kernel image with a Ubuntu 24.04 rootfs from our CI:
9999

100100
```bash
101101
ARCH="$(uname -m)"
@@ -106,13 +106,13 @@ latest=$(wget "http://spec.ccfc.min.s3.amazonaws.com/?prefix=firecracker-ci/v1.1
106106
wget "https://s3.amazonaws.com/spec.ccfc.min/${latest}"
107107

108108
# Download a rootfs
109-
wget "https://s3.amazonaws.com/spec.ccfc.min/firecracker-ci/v1.10/${ARCH}/ubuntu-22.04.ext4"
109+
wget "https://s3.amazonaws.com/spec.ccfc.min/firecracker-ci/v1.10/${ARCH}/ubuntu-24.04.ext4"
110110

111111
# Download the ssh key for the rootfs
112-
wget "https://s3.amazonaws.com/spec.ccfc.min/firecracker-ci/v1.10/${ARCH}/ubuntu-22.04.id_rsa"
112+
wget "https://s3.amazonaws.com/spec.ccfc.min/firecracker-ci/v1.10/${ARCH}/ubuntu-24.04.id_rsa"
113113

114114
# Set user read permission on the ssh key
115-
chmod 400 ./ubuntu-22.04.id_rsa
115+
chmod 400 ./ubuntu-24.04.id_rsa
116116
```
117117

118118
### Getting a Firecracker Binary
@@ -238,7 +238,7 @@ sudo curl -X PUT --unix-socket "${API_SOCKET}" \
238238
}" \
239239
"http://localhost/boot-source"
240240

241-
ROOTFS="./ubuntu-22.04.ext4"
241+
ROOTFS="./ubuntu-24.04.ext4"
242242

243243
# Set rootfs
244244
sudo curl -X PUT --unix-socket "${API_SOCKET}" \
@@ -280,13 +280,13 @@ sudo curl -X PUT --unix-socket "${API_SOCKET}" \
280280
sleep 2s
281281

282282
# Setup internet access in the guest
283-
ssh -i ./ubuntu-22.04.id_rsa [email protected] "ip route add default via 172.16.0.1 dev eth0"
283+
ssh -i ./ubuntu-24.04.id_rsa [email protected] "ip route add default via 172.16.0.1 dev eth0"
284284

285285
# Setup DNS resolution in the guest
286-
ssh -i ./ubuntu-22.04.id_rsa [email protected] "echo 'nameserver 8.8.8.8' > /etc/resolv.conf"
286+
ssh -i ./ubuntu-24.04.id_rsa [email protected] "echo 'nameserver 8.8.8.8' > /etc/resolv.conf"
287287

288288
# SSH into the microVM
289-
ssh -i ./ubuntu-22.04.id_rsa [email protected]
289+
ssh -i ./ubuntu-24.04.id_rsa [email protected]
290290

291291
# Use `root` for both the login and password.
292292
# Run `reboot` to exit.

resources/rebuild.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function build_rootfs {
4848

4949
cp -rvf overlay/* $rootfs
5050

51-
# curl -O https://cloud-images.ubuntu.com/minimal/releases/jammy/release/ubuntu-22.04-minimal-cloudimg-amd64-root.tar.xz
51+
# curl -O https://cloud-images.ubuntu.com/minimal/releases/noble/release/ubuntu-24.04-minimal-cloudimg-amd64-root.tar.xz
5252
#
5353
# TBD use systemd-nspawn instead of Docker
5454
# sudo tar xaf ubuntu-22.04-minimal-cloudimg-amd64-root.tar.xz -C $rootfs
@@ -199,7 +199,7 @@ function prepare_and_build_rootfs {
199199
compile_and_install $BIN/devmemread.c $BIN/devmemread
200200
fi
201201

202-
build_rootfs ubuntu-22.04 jammy
202+
build_rootfs ubuntu-24.04 noble
203203
build_initramfs
204204
}
205205

tests/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,9 +303,9 @@ that are pre-initialized with specific guest kernels and rootfs:
303303
304304
- `uvm_plain_any` is parametrized by the guest kernels
305305
[supported](../docs/kernel-policy.md) by Firecracker and a read-only Ubuntu
306-
22.04 squashfs as rootfs,
306+
24.04 squashfs as rootfs,
307307
- `uvm_plain` yields a Firecracker process pre-initialized with a 5.10 kernel
308-
and the same Ubuntu 22.04 squashfs.
308+
and the same Ubuntu 24.04 squashfs.
309309
310310
Generally, tests should use the former if you are testing some interaction
311311
between the guest and Firecracker, while the latter should be used if

tests/conftest.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -383,26 +383,26 @@ def rootfs_fxt(request, record_property):
383383

384384
# Fixtures for all Ubuntu rootfs, and specific versions
385385
rootfs = pytest.fixture(rootfs_fxt, params=rootfs_params("*.squashfs"))
386-
rootfs_ubuntu_22 = pytest.fixture(
387-
rootfs_fxt, params=rootfs_params("ubuntu-22*.squashfs")
386+
rootfs_ubuntu_24 = pytest.fixture(
387+
rootfs_fxt, params=rootfs_params("ubuntu-24*.squashfs")
388388
)
389389
rootfs_rw = pytest.fixture(rootfs_fxt, params=rootfs_params("*.ext4"))
390390

391391

392392
@pytest.fixture
393-
def uvm_plain(microvm_factory, guest_kernel_linux_5_10, rootfs_ubuntu_22):
393+
def uvm_plain(microvm_factory, guest_kernel_linux_5_10, rootfs_ubuntu_24):
394394
"""Create a vanilla VM, non-parametrized
395395
kernel: 5.10
396-
rootfs: Ubuntu 22.04
396+
rootfs: Ubuntu 24.04
397397
"""
398-
return microvm_factory.build(guest_kernel_linux_5_10, rootfs_ubuntu_22)
398+
return microvm_factory.build(guest_kernel_linux_5_10, rootfs_ubuntu_24)
399399

400400

401401
@pytest.fixture
402402
def uvm_plain_rw(microvm_factory, guest_kernel_linux_5_10, rootfs_rw):
403403
"""Create a vanilla VM, non-parametrized
404404
kernel: 5.10
405-
rootfs: Ubuntu 22.04
405+
rootfs: Ubuntu 24.04
406406
"""
407407
return microvm_factory.build(guest_kernel_linux_5_10, rootfs_rw)
408408

@@ -424,12 +424,12 @@ def artifact_dir():
424424

425425

426426
@pytest.fixture
427-
def uvm_plain_any(microvm_factory, guest_kernel, rootfs_ubuntu_22):
427+
def uvm_plain_any(microvm_factory, guest_kernel, rootfs_ubuntu_24):
428428
"""All guest kernels
429429
kernel: all
430-
rootfs: Ubuntu 22.04
430+
rootfs: Ubuntu 24.04
431431
"""
432-
return microvm_factory.build(guest_kernel, rootfs_ubuntu_22)
432+
return microvm_factory.build(guest_kernel, rootfs_ubuntu_24)
433433

434434

435435
guest_kernel_6_1_debug = pytest.fixture(

tests/framework/utils_drive.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,15 @@ class VhostUserBlkBackendType(Enum):
2323
CROSVM = "Crosvm"
2424

2525

26-
def partuuid_and_disk_path(rootfs_ubuntu_22, disk_path):
26+
def partuuid_and_disk_path(rootfs, disk_path):
2727
"""
2828
We create a new file with specified path, get its partuuid and use it as a rootfs.
2929
"""
30-
initial_size = rootfs_ubuntu_22.stat().st_size + 50 * MB
30+
initial_size = rootfs.stat().st_size + 50 * MB
3131
disk_path.touch()
3232
os.truncate(disk_path, initial_size)
3333
check_output(f"echo type=83 | sfdisk --no-tell-kernel {str(disk_path)}", shell=True)
34-
check_output(
35-
f"dd bs=1M seek=1 if={str(rootfs_ubuntu_22)} of={disk_path}", shell=True
36-
)
34+
check_output(f"dd bs=1M seek=1 if={str(rootfs)} of={disk_path}", shell=True)
3735
ptuuid = check_output(
3836
f"blkid -s PTUUID -o value {disk_path}", shell=True, encoding="ascii"
3937
).strip()

tests/integration_tests/functional/test_api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,7 @@ def _drive_patch(test_microvm):
895895
"is_root_device": True,
896896
"cache_type": "Unsafe",
897897
"is_read_only": True,
898-
"path_on_host": "/ubuntu-22.04.squashfs",
898+
"path_on_host": "/" + test_microvm.rootfs_file.name,
899899
"rate_limiter": None,
900900
"io_engine": "Sync",
901901
"socket": None,
@@ -1226,7 +1226,7 @@ def test_get_full_config(uvm_plain):
12261226
"is_root_device": True,
12271227
"cache_type": "Unsafe",
12281228
"is_read_only": True,
1229-
"path_on_host": "/ubuntu-22.04.squashfs",
1229+
"path_on_host": "/" + test_microvm.rootfs_file.name,
12301230
"rate_limiter": None,
12311231
"io_engine": "Sync",
12321232
"socket": None,

tests/integration_tests/functional/test_cpu_features_aarch64.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,12 @@ def test_host_vs_guest_cpu_features_aarch64(uvm_nano):
148148
PLATFORM != "aarch64",
149149
reason="This is aarch64 specific test.",
150150
)
151-
def test_default_cpu_features(microvm_factory, guest_kernel, rootfs_ubuntu_22):
151+
def test_default_cpu_features(microvm_factory, guest_kernel, rootfs_ubuntu_24):
152152
"""
153153
Check the CPU features for a microvm with the specified config.
154154
"""
155155

156-
vm = microvm_factory.build(guest_kernel, rootfs_ubuntu_22, monitor_memory=False)
156+
vm = microvm_factory.build(guest_kernel, rootfs_ubuntu_24, monitor_memory=False)
157157
vm.spawn()
158158
vm.basic_config()
159159
vm.add_net_iface()
@@ -167,13 +167,13 @@ def test_default_cpu_features(microvm_factory, guest_kernel, rootfs_ubuntu_22):
167167
reason="This is aarch64 specific test.",
168168
)
169169
def test_cpu_features_with_static_template(
170-
microvm_factory, guest_kernel, rootfs_ubuntu_22, cpu_template
170+
microvm_factory, guest_kernel, rootfs_ubuntu_24, cpu_template
171171
):
172172
"""
173173
Check the CPU features for a microvm with the specified config.
174174
"""
175175

176-
vm = microvm_factory.build(guest_kernel, rootfs_ubuntu_22, monitor_memory=False)
176+
vm = microvm_factory.build(guest_kernel, rootfs_ubuntu_24, monitor_memory=False)
177177
vm.spawn()
178178
vm.basic_config(cpu_template=cpu_template)
179179
vm.add_net_iface()
@@ -195,13 +195,13 @@ def test_cpu_features_with_static_template(
195195
reason="This is aarch64 specific test.",
196196
)
197197
def test_cpu_features_with_custom_template(
198-
microvm_factory, guest_kernel, rootfs_ubuntu_22, custom_cpu_template
198+
microvm_factory, guest_kernel, rootfs_ubuntu_24, custom_cpu_template
199199
):
200200
"""
201201
Check the CPU features for a microvm with the specified config.
202202
"""
203203

204-
vm = microvm_factory.build(guest_kernel, rootfs_ubuntu_22, monitor_memory=False)
204+
vm = microvm_factory.build(guest_kernel, rootfs_ubuntu_24, monitor_memory=False)
205205
vm.spawn()
206206
vm.basic_config()
207207
vm.api.cpu_config.put(**custom_cpu_template["template"])

tests/integration_tests/functional/test_cpu_features_x86_64.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ def msr_cpu_template_fxt(request):
560560
@pytest.mark.timeout(900)
561561
@pytest.mark.nonci
562562
def test_cpu_rdmsr(
563-
microvm_factory, msr_cpu_template, guest_kernel, rootfs_ubuntu_22, results_dir
563+
microvm_factory, msr_cpu_template, guest_kernel, rootfs_ubuntu_24, results_dir
564564
):
565565
"""
566566
Test MSRs that are available to the guest.
@@ -595,7 +595,7 @@ def test_cpu_rdmsr(
595595
"""
596596

597597
vcpus, guest_mem_mib = 1, 1024
598-
vm = microvm_factory.build(guest_kernel, rootfs_ubuntu_22, monitor_memory=False)
598+
vm = microvm_factory.build(guest_kernel, rootfs_ubuntu_24, monitor_memory=False)
599599
vm.spawn()
600600
vm.add_net_iface()
601601
vm.basic_config(
@@ -665,7 +665,7 @@ def dump_msr_state_to_file(dump_fname, ssh_conn, shared_names):
665665
@pytest.mark.timeout(900)
666666
@pytest.mark.nonci
667667
def test_cpu_wrmsr_snapshot(
668-
microvm_factory, guest_kernel, rootfs_ubuntu_22, msr_cpu_template
668+
microvm_factory, guest_kernel, rootfs_ubuntu_24, msr_cpu_template
669669
):
670670
"""
671671
This is the first part of the test verifying
@@ -686,7 +686,7 @@ def test_cpu_wrmsr_snapshot(
686686
shared_names = SNAPSHOT_RESTORE_SHARED_NAMES
687687

688688
vcpus, guest_mem_mib = 1, 1024
689-
vm = microvm_factory.build(guest_kernel, rootfs_ubuntu_22, monitor_memory=False)
689+
vm = microvm_factory.build(guest_kernel, rootfs_ubuntu_24, monitor_memory=False)
690690
vm.spawn()
691691
vm.add_net_iface()
692692
vm.basic_config(
@@ -822,7 +822,7 @@ def dump_cpuid_to_file(dump_fname, ssh_conn):
822822
@pytest.mark.timeout(900)
823823
@pytest.mark.nonci
824824
def test_cpu_cpuid_snapshot(
825-
microvm_factory, guest_kernel, rootfs_ubuntu_22, msr_cpu_template
825+
microvm_factory, guest_kernel, rootfs_ubuntu_24, msr_cpu_template
826826
):
827827
"""
828828
This is the first part of the test verifying
@@ -839,7 +839,7 @@ def test_cpu_cpuid_snapshot(
839839

840840
vm = microvm_factory.build(
841841
kernel=guest_kernel,
842-
rootfs=rootfs_ubuntu_22,
842+
rootfs=rootfs_ubuntu_24,
843843
)
844844
vm.spawn()
845845
vm.add_net_iface()
@@ -1215,9 +1215,9 @@ def check_enabled_features(test_microvm, cpu_template):
12151215
"enhanced REP MOVSB/STOSB": "true",
12161216
"SMAP: supervisor mode access prevention": "true",
12171217
# xsave_0xd_0
1218-
"XCR0 supported: x87 state": "true",
1219-
"XCR0 supported: SSE state": "true",
1220-
"XCR0 supported: AVX state": "true",
1218+
"x87 state": "true",
1219+
"SSE state": "true",
1220+
"AVX state": "true",
12211221
# xsave_0xd_1
12221222
"XSAVEOPT instruction": "true",
12231223
# extended_080000001_edx

0 commit comments

Comments
 (0)