Skip to content

Commit 013b0d9

Browse files
committed
Configure Ubuntu grub defaults like a cloud-image
Images built with image-builder currently use the default grub configuration which does not enable the serial console, and hides the boot log with a splash screen on the graphical console. This patch places grub defaults which match those in the pre-built ubuntu cloud images, enabling the serial console and disabling the splash screen. The boot log is now functional "openstack console log show <server-id>" and the graphical console is simplified without the splash screen.
1 parent 896c21a commit 013b0d9

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Cloud Image specific Grub settings for Cloud Images
2+
# This file was created/modified by the k8s image-builder process
3+
4+
# Set the recordfail timeout
5+
GRUB_RECORDFAIL_TIMEOUT=0
6+
7+
# Do not wait on grub prompt
8+
GRUB_TIMEOUT=0
9+
10+
# Set the default commandline
11+
GRUB_CMDLINE_LINUX_DEFAULT="console=tty1 console=ttyS0"
12+
13+
# Set the grub console type
14+
GRUB_TERMINAL=console
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright 2024 The Kubernetes Authors.
2+
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
---
15+
- name: Update debian grub
16+
ansible.builtin.shell: |
17+
update-grub
18+
changed_when: true

images/capi/ansible/roles/sysprep/tasks/debian.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,16 @@
9999
state: absent
100100
path: /etc/udev/rules.d/70-persistent-net.rules
101101

102+
- name: Configure grub for non graphical consoles
103+
ansible.builtin.copy:
104+
src: etc/default/grub.d/50-cloudimg-settings.cfg
105+
dest: /etc/default/grub.d/50-cloudimg-settings.cfg
106+
group: root
107+
owner: root
108+
mode: "0644"
109+
notify:
110+
- Update debian grub
111+
102112
- name: Remvoing subiquity disable disable cloud-init networking config
103113
ansible.builtin.file:
104114
path: /etc/cloud/cloud.cfg.d/subiquity-disable-cloudinit-networking.cfg

0 commit comments

Comments
 (0)