Skip to content

Commit 8d13ffa

Browse files
authored
Merge pull request #1163 from c-po/serial-fixes
image: T8375: honor already existing boot_settings
2 parents 018e4dd + 8c97d46 commit 8d13ffa

5 files changed

Lines changed: 17 additions & 13 deletions

File tree

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ all:
1515
.PHONY: checkiso
1616
.ONESHELL:
1717
checkiso:
18-
if [ ! -f $(ISO_PATH) ]; then
18+
if [[ ! -f $(ISO_PATH) ]]; then
1919
echo "Could not find $(ISO_PATH)"
2020
exit 1
2121
fi
@@ -73,7 +73,7 @@ testtpm: checkiso
7373
.PHONY: test-ci-qcow2
7474
.ONESHELL:
7575
test-ci-qcow2:
76-
if [ ! -f build/*.qcow2 ]; then
76+
if [[ ! -n $$(ls -t build/*.qcow2 | head -n 1) ]]; then
7777
echo "Could not find any QCOW2 disk image"
7878
exit 1
7979
fi

data/architectures/amd64.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,5 @@ packages = [
1212
"amd64-microcode"
1313
]
1414

15-
console_type = "ttyS"
16-
console_num = "0"
17-
console_speed = "115200"
15+
[boot_settings]
16+
console_type = "ttyS"

data/architectures/arm64.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@ packages = [
66
bootloaders = "grub-efi"
77
squashfs_compression_type = "xz -b 256k -always-use-fragments -no-recovery"
88

9-
console_type = "ttyAMA"
10-
console_num = "0"
11-
console_speed = "115200"
9+
[boot_settings]
10+
console_type = "ttyAMA"

scripts/check-qemu-install

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,11 @@ def basic_cli_tests(c):
542542
lines = [l.strip() for l in c.before.splitlines() if l.strip()]
543543
console_type = lines[-1].decode('utf-8').strip() # e.g. ttyS
544544

545+
# We do only care for ttyS or ttyAMA console types, exit early
546+
# for VGA consoles
547+
if console_type == 'tty':
548+
return
549+
545550
c.sendline('cat /usr/share/vyos/flavor.json | jq -r ".console_num"')
546551
c.expect(op_mode_prompt)
547552
lines = [l.strip() for l in c.before.splitlines() if l.strip()]

scripts/image-build/build-vyos-image

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -440,9 +440,10 @@ def build():
440440
build_config['version'] = version
441441

442442
flavor_data = {
443-
'console_type': build_config["console_type"],
444-
'console_num': build_config["console_num"],
445-
'console_speed': build_config["console_speed"]
443+
'flavor': build_config["build_flavor"],
444+
'console_type': build_config["boot_settings"]["console_type"],
445+
'console_num': build_config["boot_settings"]["console_num"],
446+
'console_speed': build_config["boot_settings"]["console_speed"]
446447
}
447448

448449
version_data = {
@@ -639,8 +640,8 @@ DOCUMENTATION_URL="{build_config['documentation_url']}"
639640
--archive-areas "{{debian_archive_areas}}" \
640641
--backports true \
641642
--binary-image iso-hybrid \
642-
--bootappend-live "boot=live components hostname=vyos username=live nopersistence noautologin nonetworking union=overlay console="{{console_type}}{{console_num}},{{console_speed}}" console=tty0 net.ifnames=0 biosdevname=0" \
643-
--bootappend-live-failsafe "live components memtest noapic noapm nodma nomce nolapic nomodeset nosmp nosplash vga=normal console="{{console_type}}{{console_num}},{{console_speed}}" console=tty0 net.ifnames=0 biosdevname=0" \
643+
--bootappend-live "boot=live components hostname=vyos username=live nopersistence noautologin nonetworking union=overlay console="{{boot_settings.console_type}}{{boot_settings.console_num}},{{boot_settings.console_speed}}" console=tty0 net.ifnames=0 biosdevname=0" \
644+
--bootappend-live-failsafe "live components memtest noapic noapm nodma nomce nolapic nomodeset nosmp nosplash vga=normal console="{{boot_settings.console_type}}{{boot_settings.console_num}},{{boot_settings.console_speed}}" console=tty0 net.ifnames=0 biosdevname=0" \
644645
--bootloaders "{{bootloaders}}" \
645646
--checksums "sha256" \
646647
--chroot-squashfs-compression-type "{{squashfs_compression_type}}" \

0 commit comments

Comments
 (0)