Skip to content

Support ONIE installer discovery over DHCPv6 - #1136

Open
byteocean wants to merge 4 commits into
opencomputeproject:masterfrom
byteocean:feature/dhcp6-boot-pr
Open

byteocean wants to merge 4 commits into
opencomputeproject:masterfrom
byteocean:feature/dhcp6-boot-pr

Conversation

@byteocean

Copy link
Copy Markdown

Summary
Adds DHCPv6 installer discovery to ONIE so a switch can obtain its ONIE installer URL from a DHCPv6 server via Boot File URL (RFC 5970, option 59), in addition to the existing DHCPv4 path. This enables automated ONIE provisioning
on IPv6-only or dual-stack networks.

Changes

patches/busybox/udhcp6-additional-options.patch
Extends the udhcpc6 DHCPv6 client to request and parse RFC 5970 network-boot options:

  • Option 59 (Boot File URL), 60 (Boot File Param), 61 (Client Arch Type), 62 (NII)
  • Option 23 (DNS Servers), 24 (Domain List), 39 (Client FQDN)
  • Exports the Boot File URL as the bootfile environment variable for -s handler scripts
  • Adds -V/--vendorclass CLI option

ONIE rootfs scripts

  • rootconf/default/bin/discover: adds sd_dhcp6() which calls udhcpc6 -O 59 and feeds the result into the installer discovery loop
  • rootconf/default/lib/onie/udhcp6_sd: maps $bootfile → onie_disco_bootfile
  • rootconf/default/lib/onie/udhcp6_net: configures IPv6 address and DNS from the DHCPv6 reply
  • rootconf/default/etc/init.d/networking.sh: adds DHCPv6 management interface bring-up

Verification

KVM emulation (kvm_x86_64)

A self-contained verification harness is included in contrib/dhcp6-emulation/. It provides a reproducible, hardware-free procedure to build the patched kvm_x86_64 image and confirm the DHCPv6 boot path end-to-end. See
contrib/dhcp6-emulation/README.md for the full run book.

Validated with a libvirt VM attached to a dnsmasq DHCPv6 server via a Linux network namespace + bridge + tap, and following observable results serve as the signals of success.

  • udhcpc6 requests option 59
  • dnsmasq replies with bootfile-url http://[2001:db8::1]:8080/onie-installer
  • ONIE fetches the installer over IPv6 and the demo OS installs successfully

Hardware (accton_as7726_32x — Edgecore AS7726-32X)

The DHCPv6 installer discovery flow was also validated on a physical Edgecore AS7726-32X switch running the accton_as7726_32x ONIE build. The patched ONIE kernel and initrd were deployed to the switch and the full DHCPv6 boot path — DHCPv6 address assignment, option-59 URL discovery, and installer fetch — was confirmed working on real hardware, a SONiC image can be successfully installed onto the switch.

Notes

  • The DHCPv6 discovery path (sd_dhcp6) is additive — the existing DHCPv4 path is unchanged and DHCPv4 discovery still runs after DHCPv6 in the service discovery order.
  • The busybox patch applies to busybox 1.25.1 at commit 6bbd082c.

This implementation was developed with the assistance of AI. The code, patches, and verification harness were tested, and validated by the author.

@byteocean byteocean changed the title Support ONIE installer discovery over DHCPv6 (RFC 5970 option 59) Support ONIE installer discovery over DHCPv6 Aug 10, 2026
@byteocean
byteocean force-pushed the feature/dhcp6-boot-pr branch from c332dda to 6088d27 Compare August 10, 2026 11:19
@byteocean

Copy link
Copy Markdown
Author

Hi @mshych , I am wondering if it is possible to get a review on this PR? thanks.

@mshych

mshych commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the work on this — DHCPv6 installer discovery is a feature ONIE needs, and the RFC 5970 option decoding itself looks correct. I test-applied the busybox patch to 1.25.1 and it applies cleanly and compiles. However, the PR needs careful verification and rework before it can be merged.

Functional regression

config_ethmgmt() uses a short-circuit chain: static || dhcp6 || dhcp4 || fallback. That was safe only because config_ethmgmt_dhcp6() always returned 1. Now that it can succeed, any dual-stack network with a DHCPv6 server will leave the switch with an IPv6 address and no IPv4 address and no IPv4 link-local fallback. sd_dhcp4() still collects DHCPv4 options, but every resulting IPv4 fetch will fail. This silently breaks working IPv4 provisioning the moment DHCPv6 appears on the same VLAN. The two families need to be configured independently.

Debug and dead code

The busybox patch ships bb_error_msg("DBG: nxt=%d vfc=%d ...") immediately after the existing "unrelated/bogus packet, ignoring" branch, so it will spam stderr for every stray IPv6 packet, plus two log1() traces in option_to_env(). exec_installer gains a log_debug_msg "TFTP bootfiles: ...".
The patch exports option 39 as fqdn=, but udhcp6_net checks $hostname, which udhcpc6 never sets — hostname is never configured despite -O 39 being requested.
The $bootfile fallback in udhcp6_sd can never fire; its own comment says the printenv pipeline already covers it.
udhcp6_net ships in-progress deliberation as comments ("We should merge or append. For now, let's append...") and defines LOGSRV_CONF without using it.
-V vendor class is malformed

udhcpc6_args() reuses the DHCPv4 string -V onie_vendor:${onie_platform}. DHCPv4 option 60 is free-form, but d6_alloc_vendor_option() parses a numeric enterprise number before the colon, so strtoul() fails and option 16 goes out with enterprise number 0. $onie_iana_enterprise (42623) already exists in functions and is what the DHCPv4 option-125 path uses.

Unrelated changes

Per CONTRIBUTING.md, each patch should contain one logical change. Currently mixed in, and unmentioned in the commit messages:

/dev/null 2>&1 removed from the DHCPv4 udhcpc call, so udhcpc chatter now hits the boot console.
ifconfig $intf up replaced with ip link set down; sleep 3; up; sleep 5, plus another sleep 5 for DAD and sleep 3 in sd_dhcp6 — roughly 13 extra seconds per management interface on every discovery iteration for every platform, IPv6 or not, and it bounces the link on each retry. neigh_discovery() already polls ip addr show | grep tentative for exactly this; please reuse that instead of fixed sleeps.
exec_installer moves the onie_disco_bootfile attempt out of http_download() to the top level and drops the quiet flag, reordering discovery for existing DHCPv4 option-67 users.
The busybox patch silently carries four independent upstream fixes (renew message type, status-code parsing, ia_na free-before-validate, option_to_env packet bounds) and changes packet transmission (Ethernet dest 33:33:00:01:00:02 and a link-local source address). Only the d6_find_option() fix is mentioned. The transmission change is also why the DAD sleep was needed.
Commit messages don't match the diff

"bin/exec_installer: handle IPv6 installer URLs" — there is no IPv6 URL handling in the diff. "lib/onie/functions: supporting helpers for IPv6 network config" — those are DHCPv6 option encoders.

contrib/dhcp6-emulation/ (1,031 of 1,860 added lines)

This duplicates emulation/onie-vm.sh and contrib/build-env/Dockerfile, and it's built on Debian 9 via archive.debian.org. More concerning, kernel-config.patch disables CONFIG_MODULE_SIG*, CONFIG_SIGNED_PE_FILE_VERIFICATION and the trusted keyring, and machine.make.patch flips SECURE_BOOT_ENABLE/EXT and SECURE_GRUB to no. Checking in a script that disables Secure Boot on kvm_x86_64 invites accidents.

That patch also adds CONFIG_IPV6_AUTOCONF=y, which is not a Linux Kconfig symbol — autoconf is the net.ipv6.conf.*.autoconf sysctl, and the symbol appears in none of the 14 configs under build-config/conf/kernel/. So either the override is unnecessary, or there's a real gap that should be fixed in ONIE proper. Which is it?

Smaller items

No patch header on udhcp6-additional-options.patch; every other patch in patches/busybox/ has a description, copyright, and SPDX line. udhcp6_net and udhcp6_sd also lack SPDX headers, unlike the udhcp4_* files they're based on.
32 machines ship their own copy of functions and images.make copies it over /lib/onie, so udhcpc6_args/str2lenhex16 won't exist there.
DHCPv6 option 17 uses sub-option codes 1/2/3 for machine/arch/machine_rev, while DHCPv4 option 125 uses 3/4/5 for the same data. Please keep them aligned.
resolv.conf is appended, never truncated, unlike udhcp4_net — renews and multiple interfaces accumulate duplicates.
No default route is configured and the address is always /128 (parse_addr_prefix's / branch is dead, since udhcpc6 exports ipv6= without a prefix), so this only works with an on-link installer server.
ifconfig | grep 'inet6 ' | sed -e 's/:/ /g' shreds the IPv6 colons — the "Using DHCPv6 addr" message prints garbage and matches both link-local and global lines.
add_d6_client_options() writes the ORO, vendor class, and all -x options into the on-stack struct d6_packet with no bounds check.
dname_dec() is used without the #if ENABLE_FEATURE_UDHCP_RFC3397 guard that upstream uses in dhcpc.c. ONIE enables it, so it links today, but it breaks other configs.
Compiler warning at d6_dhcpc.c:1649: ISO C90 forbids mixed declarations and code.
sd_dhcp6 adds 2>&1 where sd_dhcp4 does not; if udhcpc6 ever exits 0 without ONIE_PARMS:, the whole stderr transcript becomes onie_disco.
TODO is blanked rather than git rm'd, and the sd_mdns/sd_fallback TODOs remain.
Trailing whitespace on 7 added lines in networking.sh, functions, and udhcp6_net.
Boot File URLs over 255 bytes abort option parsing entirely (option[0]/option[2] high-byte check). Pre-existing, but worth documenting since this is a URL option.
Suggested split

busybox DHCPv6 bug fixes
busybox RFC 5970 option support, with a proper patch header and no debug logging
ONIE runtime DHCPv6 discovery
Then drop contrib/ (or reduce it to a README reusing emulation/onie-vm.sh and contrib/build-env), fix the DHCPv4 short-circuit, remove the unrelated networking.sh/exec_installer edits, replace the fixed sleeps with the existing tentative-address poll, and either wire up or delete the hostname and $bootfile dead paths.

Given the amount of debug output, dead code, and unrelated edits, I'd ask that the series be reviewed carefully end-to-end before the next submission — several of these would have been caught by a read-through of the final diff.

@byteocean

Copy link
Copy Markdown
Author

@mshych thanks for taking time reviewing this PR, and your valuable comments. To address the points in your comments, in which way would you prefer to see the changes? should I keep the existing three commits and add extra commits addressing above points, or overwrite three commits with another set of commits containing existing changes and amendments?

@byteocean
byteocean marked this pull request as draft September 23, 2026 15:02
@byteocean
byteocean force-pushed the feature/dhcp6-boot-pr branch 2 times, most recently from 9c2fcf4 to af493d6 Compare September 23, 2026 15:11
Add patches/busybox/udhcp6-bugfixes.patch with seven independent
correctness fixes to the busybox 1.25.1 DHCPv6 client:

1. d6_find_option: advance both the option pointer and the remaining
   length by (option len + 4); previously the length budget was never
   reduced correctly, allowing walking past the option area.
2. Bound option parsing by the actual received packet length instead
   of sizeof(packet->d6_options): thread packet_len through
   d6_run_script() into fill_envp(); NULL-terminate the env array.
3. send_d6_renew: send D6_MSG_RENEW, not DHCPREQUEST.
4. NAK handling: test the 16-bit status code (data[0] | data[1])
   instead of the unrelated byte data[4].
5. IA_NA: copy and validate the new option before freeing the old one;
   previously a missing IA_NA left a freed pointer in client state.
6. Packet transmission per RFC 2464: use the IPv6 multicast Ethernet
   destination 33:33:00:01:00:02 and a link-local source address.
   Note: with a link-local source the interface must have completed
   DAD; callers should wait for the address to leave tentative state.
7. option_to_env: add the missing break after the D6_OPT_IAPREFIX
   case; latent until further cases follow it in the switch.

Signed-off-by: Tao Li <tao.li06@sap.com>
Add patches/busybox/udhcp6-rfc5970-boot-options.patch:

* RFC 5970 network boot options: BOOT_FILE_URL (59, exported as
  bootfile=), BOOT_FILE_PARAM (60, bootfile_param=), CLIENT_ARCH_TYPE
  (61, client_arch_type=) and NII (62, nii=). BOOT_FILE_PARAM also
  tolerates the dnsmasq length-prefix quirk.
* Common options: DNS_SERVERS (23, dns=), DOMAIN_LIST (24, search=),
  CLIENT_FQDN (39, hostname=). The latter two require and are guarded
  by ENABLE_FEATURE_UDHCP_RFC3397 (dname_dec).
* VENDOR_CLASS/VENDOR_OPTS decoding (vendor_class_id/_data,
  vendor_specific_id/_data, vendoropts=).
* -V/--vendorclass CLI option: DHCPv6 option 16 with a numeric
  enterprise number; format '<enterprise>:<string>'.
* -O requested options are now actually sent: add_d6_client_options
  builds the ORO from the opt_mask and appends -x options, with bounds
  checks against the on-stack packet buffer.
* A caller-supplied client-id (-x 1:...) overrides the generated
  DUID, allowing a DUID-EN to be sent.

Known limitation (pre-existing): option_to_env() stops parsing at any
option whose code or length exceeds 255; a BOOT_FILE_URL longer than
255 bytes terminates parsing of the remaining options.

Signed-off-by: Tao Li <tao.li06@sap.com>
Add DHCPv6 installer discovery alongside the existing DHCPv4 path, so
a switch can obtain its ONIE installer URL from a DHCPv6 server via
the RFC 5970 Boot File URL option (59).

* bin/discover: implement sd_dhcp6(); udhcpc6 requests option 59 and
  the result feeds the installer discovery loop.  The DHCPv6 Boot File
  URL surfaces as onie_disco_bootfile and is consumed by the existing
  bootfile handling in exec_installer (no changes needed there).
* etc/init.d/networking.sh: implement config_ethmgmt_dhcp6().  DHCPv6
  now runs in addition to, never instead of, the IPv4 configuration:
  on dual-stack networks both address families are configured.  Before
  soliciting, wait for the link-local address to leave tentative state
  (DAD) by polling, mirroring neigh_discovery(); busybox udhcpc6 now
  sends with a link-local source address and the IPv6 multicast MAC.
* lib/onie/udhcp6_net: reactor script; installs the leased address
  (busybox exports no prefix, so it is a /128 host address and the
  installer server must be on-link), sets hostname from option 39, and
  maintains a marked IPv6 block in resolv.conf so renewals replace
  rather than duplicate entries and IPv4 entries stay intact.
* lib/onie/udhcp6_sd: service discovery script; maps the exported
  option variables (bootfile -> onie_disco_bootfile) via the generic
  printenv pipeline, same as udhcp4_sd.
* lib/onie/functions: DHCPv6 option encoders for udhcpc6_args():
  DUID-EN client-id, user class, vendor class (option 16 with ONIE's
  IANA enterprise number 42623, matching the DHCPv4 option 125 usage),
  vendor specific information (option 17, sub-option codes 3/4/5
  aligned with DHCPv4 option 125), plus a wait_dad() helper.  Both
  DHCPv6 call sites degrade gracefully on the machines that ship their
  own older copy of /lib/onie/functions.
* Remove the top-level TODO file (its 'DHCP v6' entry is resolved by
  this commit).

Signed-off-by: Tao Li <tao.li06@sap.com>
@byteocean
byteocean force-pushed the feature/dhcp6-boot-pr branch 2 times, most recently from 3c0abc6 to 1b330b9 Compare September 24, 2026 13:44
@byteocean

Copy link
Copy Markdown
Author

@mshych thanks again for reviewing this PR. the commits are now rewritten along your suggested split. Force-pushed as 4 commits with commit messages rewritten to match each diff:

busybox: udhcpc6 correctness fixes — the DHCPv6 client fixes are now their own patch with a header listing each.
The patch bundles the 4 fixes you called out (renew message type, status-code parse via data[0]|data[1], IA_NA
copy→validate→free, option to env packet-length bounds via packet_len threading into fill_envp) plus the d6_find_option step/bounds fix you also flagged and two smaller items surfaced while auditing (RFC 2464 multicast MAC 33:33:00:01:00:02 + link-local source; missing break after D6_OPT_IAPREFIX). ISO C90 mixed-declaration fixed here in the IA_NA hunk.

busybox: RFC 5970 network-boot options — only the option/CLI feature: options 59–62 + 23/24/39,
VENDOR_CLASS/VENDOR_OPTS decoding, -V/--vendorclass with numeric enterprise, and real ORO + -x in add_d6_client_options (previously stubbed). Per your comments: all debug logging removed (bb_error_msg("DBG: ..."), both log1() in option_to_env); dname_dec uses wrapped in #if ENABLE_FEATURE_UDHCP_RFC3397; bounds checks added on every write into the on-stack d6_packet; option 39 (Client FQDN, RFC 4704) decoded via dname_dec and exported as hostname= (wires up the previously dead reader in udhcp6_net); the pre-existing >255-byte URL limitation is called out in the patch header as a known constraint.

runtime: DHCPv6 installer discovery — per your bullets:

  • IPv4 regression (major): DHCPv6 is now additive. The v4 chain static || dhcp4 || fallback is
    untouched. config_ethmgmt_dhcp6 runs after it and cannot suppress it. On dual-stack both families configure
    independently.
  • Link bounce and fixed sleeps gone from networking.sh: removed the ifconfig down; sleep 3; up; sleep 5 sequence and both DAD sleep 5s. DHCPv6 config now brings the interface up and calls a new wait_dad helper — a bounded 30×0.1s poll of the tentative flag, same pattern as neigh_discovery in bin/discover. The wait is needed now precisely because the busybox fixes make udhcpc6 source solicits from the link-local address. Also restored > /dev/null 2>&1 on the DHCPv4 udhcpc call so it no longer chatters to the boot console.
  • sd_dhcp6: no more 2>&1 (matches sd_dhcp4; no risk of stderr becoming onie_disco), no sleep 3.
  • functions: -V ${onie_iana_enterprise}:onie_vendor:${onie_platform} — real enterprise number so busybox
    d6_alloc_vendor_option parses correctly. Option 17 sub-codes 3/4/5, mirroring DHCPv4 option 125's encoding at
    functions:429-438.
  • udhcp6_net/udhcp6_sd: SPDX headers matching udhcp4_net/udhcp4_sd. Dead $bootfile fallback, deliberation comments, and unused LOGSRV_CONF all removed. resolv.conf now handled as a marked # BEGIN entries from udhcpc6 / # END entries from udhcpc6 block, purged before append — no duplicates on renew, and IPv4 entries owned by udhcp4_net are left alone.
  • exec_installer: reverted to zero diff. Option 59 flows through the existing onie_disco_bootfile handling inside
    http_download() with quiet; no reordering for existing DHCPv4 option-67 users.
  • Garbled inet6 display fixed: now ip -6 addr show dev $intf scope global | awk ... — scope-filtered, no colon-shredding.
  • 32 machine-local functions copies: both DHCPv6 call sites guard with command -v udhcpc6_args >/dev/null 2>&1 so platforms shipping an older local copy degrade gracefully (skip with a log message) rather than error at runtime.
  • /128 on-link-only limitation documented in code comments and the commit message.

contrib/dhcp6-emulation — only scripts to create a working, local and reproducible virtual environment for this work and future enhancement if anyone wants to further build something on top of it. I feel it would be too much to embed these scripts into a single README.md file.
Gone: the second Dockerfile, build-onie-kvm.sh wrapper, onie-vm.xml.in, and both security-disabling build-config-overrides/*.patch. Build now uses the stock contrib/build-env container; the VM boots -kernel/-initrd straight onto a tap + dnsmasq(option 59) + HTTP segment. run-onie-vm.sh also offers an optional --with-disk flag bootstrapping a fresh qcow2 with GRUB-BOOT (ef02) and ONIE-BOOT (ext4) partitions via qemu-nbd/sgdisk plus minimal grub scaffolding, so the demo installer's install-to-disk step can run as well as the DHCPv6 fetch. If run-onie-vm.sh is executed without this flag, a diskless VM will be started. A detailed README.md provides instructions and evidence for verifying this work using these helper scripts.

Validation:

  • end-to-end verification with VM: dnsmasq log shows option 59 served, HTTP log shows the installer GET, ONIE console shows the /128 address assigned and Attempting http://[2001:db8::1]:8080/onie-installer → Executing installer → Verifying image checksum ... OK.
  • Also re-verified the new version of this work on real hardware (AS7726_32X): dhcp6 fetch → install succeeds, and installed as before.
Version   : feature/dhcp6-boot-pr-09231522-dirty
Build Date: 2026-09-23T15:22+00:00
Info: Mounting kernel filesystems... done.
Info: Mounting ONIE-BOOT on /mnt/onie-boot ...
[    4.149165] ext4 filesystem being mounted at /mnt/onie-boot supports timestamps until 2038 (0x7fffffff)
Info: BIOS mode:   legacy
Info: Using eth0 MAC address: 90:3c:b3:33:75:fb
Info: Using eth1 MAC address: 90:3c:b3:33:75:fc
Info: Using eth2 MAC address: 90:3c:b3:33:75:fd
Info: eth0:  Checking link... up.
Info: Trying DHCPv4 on interface: eth0
ONIE: Using DHCPv4 addr: eth0: 192.168.123.143 / 255.255.255.0
Info: Trying DHCPv6 on interface: eth0
ONIE: Using DHCPv6 addr: eth0: 2a10:abcd:1234:ffff:ffff:903c:b333:75fb
2a10:abcd:1234:ffff:923c:b3ff:fe33:75fb
Info: eth1:  Checking link... down.
ONIE: eth1: link down.  Skipping configuration.
Info: eth2:  Checking link... down.
ONIE: eth2: link down.  Skipping configuration.
ONIE: Failed to configure eth1 interface
ONIE: Failed to configure eth2 interface
Starting: klogd... done.
Starting: dropbear ssh daemon... done.
Starting: telnetd... done.
discover: installer mode detected.  Running installer.
Starting: discover... done.
Please press Enter to activate this console. Info: eth0:  Checking link... up.
Info: Trying DHCPv4 on interface: eth0
ONIE: Using DHCPv4 addr: eth0: 192.168.123.143 / 255.255.255.0
Info: Trying DHCPv6 on interface: eth0
ONIE: Using DHCPv6 addr: eth0: 2a10:abcd:1234:ffff:ffff:903c:b333:75fb
2a10:abcd:1234:ffff:923c:b3ff:fe33:75fb
Info: eth1:  Checking link... down.
ONIE: eth1: link down.  Skipping configuration.
Info: eth2:  Checking link... down.
ONIE: eth2: link down.  Skipping configuration.
ONIE: Failed to configure eth1 interface
ONIE: Failed to configure eth2 interface
ONIE: Starting ONIE Service Discovery
Info: Attempting file://dev/sda4/onie-installer-x86_64-accton_as7726_32x-r0 ...
Info: Attempting file://dev/sda4/onie-installer-x86_64-accton_as7726_32x-r0.bin ...
Info: Attempting file://dev/sda4/onie-installer-x86_64-accton_as7726_32x ...
Info: Attempting file://dev/sda4/onie-installer-x86_64-accton_as7726_32x.bin ...
Info: Attempting file://dev/sda4/onie-installer-accton_as7726_32x ...
Info: Attempting file://dev/sda4/onie-installer-accton_as7726_32x.bin ...
Info: Attempting file://dev/sda4/onie-installer-x86_64-bcm ...
Info: Attempting file://dev/sda4/onie-installer-x86_64-bcm.bin ...
Info: Attempting file://dev/sda4/onie-installer-x86_64 ...
Info: Attempting file://dev/sda4/onie-installer-x86_64.bin ...
Info: Attempting file://dev/sda4/onie-installer ...
Info: Attempting file://dev/sda4/onie-installer.bin ...
Info: Attempting http://192.168.123.50/onie-installer-x86_64-accton_as7726_32x-r0 ...
Info: Attempting http://192.168.123.50/onie-installer-x86_64-accton_as7726_32x-r0.bin ...
Info: Attempting http://192.168.123.50/onie-installer-x86_64-accton_as7726_32x ...
Info: Attempting http://192.168.123.50/onie-installer-x86_64-accton_as7726_32x.bin ...
Info: Attempting http://192.168.123.50/onie-installer-accton_as7726_32x ...
Info: Attempting http://192.168.123.50/onie-installer-accton_as7726_32x.bin ...
Info: Attempting http://192.168.123.50/onie-installer-x86_64-bcm ...
Info: Attempting http://192.168.123.50/onie-installer-x86_64-bcm.bin ...
Info: Attempting http://192.168.123.50/onie-installer-x86_64 ...
Info: Attempting http://192.168.123.50/onie-installer-x86_64.bin ...
Info: Attempting http://192.168.123.50/onie-installer ...
Info: Attempting http://192.168.123.50/onie-installer.bin ...
Info: Attempting http://192.168.123.191/onie-installer-x86_64-accton_as7726_32x-r0 ...
Info: Attempting http://192.168.123.191/onie-installer-x86_64-accton_as7726_32x-r0.bin ...
Info: Attempting http://192.168.123.191/onie-installer-x86_64-accton_as7726_32x ...
Info: Attempting http://192.168.123.191/onie-installer-x86_64-accton_as7726_32x.bin ...
Info: Attempting http://192.168.123.191/onie-installer-accton_as7726_32x ...
Info: Attempting http://192.168.123.191/onie-installer-accton_as7726_32x.bin ...
Info: Attempting http://192.168.123.191/onie-installer-x86_64-bcm ...
Info: Attempting http://192.168.123.191/onie-installer-x86_64-bcm.bin ...
Info: Attempting http://192.168.123.191/onie-installer-x86_64 ...
Info: Attempting http://192.168.123.191/onie-installer-x86_64.bin ...
Info: Attempting http://192.168.123.191/onie-installer ...
Info: Attempting http://192.168.123.191/onie-installer.bin ...
Info: Attempting http://[fe80::3a68:ddff:fe61:9789%eth0]/onie-installer-x86_64-accton_as7726_32x-r0 ...
Info: Attempting http://[fe80::3a68:ddff:fe61:9789%eth0]/onie-installer-x86_64-accton_as7726_32x-r0.bin ...
Info: Attempting http://[fe80::3a68:ddff:fe61:9789%eth0]/onie-installer-x86_64-accton_as7726_32x ...
Info: Attempting http://[fe80::3a68:ddff:fe61:9789%eth0]/onie-installer-x86_64-accton_as7726_32x.bin ...
Info: Attempting http://[fe80::3a68:ddff:fe61:9789%eth0]/onie-installer-accton_as7726_32x ...
Info: Attempting http://[fe80::3a68:ddff:fe61:9789%eth0]/onie-installer-accton_as7726_32x.bin ...
Info: Attempting http://[fe80::3a68:ddff:fe61:9789%eth0]/onie-installer-x86_64-bcm ...
Info: Attempting http://[fe80::3a68:ddff:fe61:9789%eth0]/onie-installer-x86_64-bcm.bin ...
Info: Attempting http://[fe80::3a68:ddff:fe61:9789%eth0]/onie-installer-x86_64 ...
Info: Attempting http://[fe80::3a68:ddff:fe61:9789%eth0]/onie-installer-x86_64.bin ...
Info: Attempting http://[fe80::3a68:ddff:fe61:9789%eth0]/onie-installer ...
Info: Attempting http://[fe80::3a68:ddff:fe61:9789%eth0]/onie-installer.bin ...
Info: Attempting http://[fe80::3a68:ddff:fe61:9745%eth0]/onie-installer-x86_64-accton_as7726_32x-r0 ...
Info: Attempting http://[fe80::3a68:ddff:fe61:9745%eth0]/onie-installer-x86_64-accton_as7726_32x-r0.bin ...
Info: Attempting http://[fe80::3a68:ddff:fe61:9745%eth0]/onie-installer-x86_64-accton_as7726_32x ...
Info: Attempting http://[fe80::3a68:ddff:fe61:9745%eth0]/onie-installer-x86_64-accton_as7726_32x.bin ...
Info: Attempting http://[fe80::3a68:ddff:fe61:9745%eth0]/onie-installer-accton_as7726_32x ...
Info: Attempting http://[fe80::3a68:ddff:fe61:9745%eth0]/onie-installer-accton_as7726_32x.bin ...
Info: Attempting http://[fe80::3a68:ddff:fe61:9745%eth0]/onie-installer-x86_64-bcm ...
Info: Attempting http://[fe80::3a68:ddff:fe61:9745%eth0]/onie-installer-x86_64-bcm.bin ...
Info: Attempting http://[fe80::3a68:ddff:fe61:9745%eth0]/onie-installer-x86_64 ...
Info: Attempting http://[fe80::3a68:ddff:fe61:9745%eth0]/onie-installer-x86_64.bin ...
Info: Attempting http://[fe80::3a68:ddff:fe61:9745%eth0]/onie-installer ...
Info: Attempting http://[fe80::3a68:ddff:fe61:9745%eth0]/onie-installer.bin ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:25bc%eth0]/onie-installer-x86_64-accton_as7726_32x-r0 ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:25bc%eth0]/onie-installer-x86_64-accton_as7726_32x-r0.bin ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:25bc%eth0]/onie-installer-x86_64-accton_as7726_32x ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:25bc%eth0]/onie-installer-x86_64-accton_as7726_32x.bin ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:25bc%eth0]/onie-installer-accton_as7726_32x ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:25bc%eth0]/onie-installer-accton_as7726_32x.bin ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:25bc%eth0]/onie-installer-x86_64-bcm ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:25bc%eth0]/onie-installer-x86_64-bcm.bin ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:25bc%eth0]/onie-installer-x86_64 ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:25bc%eth0]/onie-installer-x86_64.bin ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:25bc%eth0]/onie-installer ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:25bc%eth0]/onie-installer.bin ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:3629%eth0]/onie-installer-x86_64-accton_as7726_32x-r0 ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:3629%eth0]/onie-installer-x86_64-accton_as7726_32x-r0.bin ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:3629%eth0]/onie-installer-x86_64-accton_as7726_32x ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:3629%eth0]/onie-installer-x86_64-accton_as7726_32x.bin ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:3629%eth0]/onie-installer-accton_as7726_32x ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:3629%eth0]/onie-installer-accton_as7726_32x.bin ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:3629%eth0]/onie-installer-x86_64-bcm ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:3629%eth0]/onie-installer-x86_64-bcm.bin ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:3629%eth0]/onie-installer-x86_64 ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:3629%eth0]/onie-installer-x86_64.bin ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:3629%eth0]/onie-installer ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:3629%eth0]/onie-installer.bin ...
Info: Attempting http://[fe80::3a68:ddff:fe26:8f05%eth0]/onie-installer-x86_64-accton_as7726_32x-r0 ...
Info: Attempting http://[fe80::3a68:ddff:fe26:8f05%eth0]/onie-installer-x86_64-accton_as7726_32x-r0.bin ...
Info: Attempting http://[fe80::3a68:ddff:fe26:8f05%eth0]/onie-installer-x86_64-accton_as7726_32x ...
Info: Attempting http://[fe80::3a68:ddff:fe26:8f05%eth0]/onie-installer-x86_64-accton_as7726_32x.bin ...
Info: Attempting http://[fe80::3a68:ddff:fe26:8f05%eth0]/onie-installer-accton_as7726_32x ...
Info: Attempting http://[fe80::3a68:ddff:fe26:8f05%eth0]/onie-installer-accton_as7726_32x.bin ...
Info: Attempting http://[fe80::3a68:ddff:fe26:8f05%eth0]/onie-installer-x86_64-bcm ...
Info: Attempting http://[fe80::3a68:ddff:fe26:8f05%eth0]/onie-installer-x86_64-bcm.bin ...
Info: Attempting http://[fe80::3a68:ddff:fe26:8f05%eth0]/onie-installer-x86_64 ...
Info: Attempting http://[fe80::3a68:ddff:fe26:8f05%eth0]/onie-installer-x86_64.bin ...
Info: Attempting http://[fe80::3a68:ddff:fe26:8f05%eth0]/onie-installer ...
Info: Attempting http://[fe80::3a68:ddff:fe26:8f05%eth0]/onie-installer.bin ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:3210%eth0]/onie-installer-x86_64-accton_as7726_32x-r0 ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:3210%eth0]/onie-installer-x86_64-accton_as7726_32x-r0.bin ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:3210%eth0]/onie-installer-x86_64-accton_as7726_32x ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:3210%eth0]/onie-installer-x86_64-accton_as7726_32x.bin ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:3210%eth0]/onie-installer-accton_as7726_32x ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:3210%eth0]/onie-installer-accton_as7726_32x.bin ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:3210%eth0]/onie-installer-x86_64-bcm ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:3210%eth0]/onie-installer-x86_64-bcm.bin ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:3210%eth0]/onie-installer-x86_64 ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:3210%eth0]/onie-installer-x86_64.bin ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:3210%eth0]/onie-installer ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:3210%eth0]/onie-installer.bin ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:2f17%eth0]/onie-installer-x86_64-accton_as7726_32x-r0 ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:2f17%eth0]/onie-installer-x86_64-accton_as7726_32x-r0.bin ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:2f17%eth0]/onie-installer-x86_64-accton_as7726_32x ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:2f17%eth0]/onie-installer-x86_64-accton_as7726_32x.bin ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:2f17%eth0]/onie-installer-accton_as7726_32x ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:2f17%eth0]/onie-installer-accton_as7726_32x.bin ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:2f17%eth0]/onie-installer-x86_64-bcm ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:2f17%eth0]/onie-installer-x86_64-bcm.bin ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:2f17%eth0]/onie-installer-x86_64 ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:2f17%eth0]/onie-installer-x86_64.bin ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:2f17%eth0]/onie-installer ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:2f17%eth0]/onie-installer.bin ...
To check the install status inspect /var/log/onie.log.
Try this:  tail -f /var/log/onie.log
** Installer Mode Enabled **
ONIE:/ # Info: Attempting http://[fe80::4ed9:8fff:fe95:21e3%eth0]/onie-installer-x86_64-accton_as7726_32x-r0 ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:21e3%eth0]/onie-installer-x86_64-accton_as7726_32x-r0.bin ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:21e3%eth0]/onie-installer-x86_64-accton_as7726_32x ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:21e3%eth0]/onie-installer-x86_64-accton_as7726_32x.bin ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:21e3%eth0]/onie-installer-accton_as7726_32x ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:21e3%eth0]/onie-installer-accton_as7726_32x.bin ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:21e3%eth0]/onie-installer-x86_64-bcm ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:21e3%eth0]/onie-installer-x86_64-bcm.bin ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:21e3%eth0]/onie-installer-x86_64 ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:21e3%eth0]/onie-installer-x86_64.bin ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:21e3%eth0]/onie-installer ...
Info: Attempting http://[fe80::4ed9:8fff:fe95:21e3%eth0]/onie-installer.bin ...
Info: Attempting http://[2a10:abcd:1234:ffff:5054:ff:fee4:7ae9]:8086/onie ...
ONIE: Executing installer: http://[2a10:abcd:1234:ffff:5054:ff:fee4:7ae9]:8086/onie
Verifying image checksum ... OK.
Preparing image archive ... OK.
Installing SONiC in ONIE
ONIE Installer: platform: x86_64-broadcom-r0
onie_platform: x86_64-accton_as7726_32x-r0
deleting partition 4 ...
Filesystem           1K-blocks      Used Available Use% Mounted on
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot.
The operation has completed successfully.
Partition #1 is in use.
Partition #2 is in use.
Partition #3 is in use.
Partition #4 is available
Creating new SONiC-OS partition /dev/sda4 ...
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot.
The operation has completed successfully.
mke2fs 1.46.3 (27-Jul-2021)
Discarding device blocks: done
Creating filesystem with 8388608 4k blocks and 2097152 inodes
Filesystem UUID: a4f6f6ad-13da-4476-be4a-b0d8c368e0c6
Superblock backups stored on blocks:
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
    4096000, 7962624
Allocating group tables: done
Writing inode tables: done
Creating journal (65536 blocks): done
Writing superblocks and filesystem accounting information: done
Installing SONiC to /tmp/tmp.yUqM37/image-Edgecore-SONiC_20241018_041000_ec202211_ecsonic_431

@byteocean
byteocean marked this pull request as ready for review September 24, 2026 15:07
@byteocean
byteocean force-pushed the feature/dhcp6-boot-pr branch from 1b330b9 to a912503 Compare September 24, 2026 15:10
Reproducible, hardware-free validation of the DHCPv6 (RFC 5970)
installer-discovery path on kvm_x86_64:

* setup-dhcp6-test.sh: Linux netns + bridge + tap with dnsmasq
  serving option 59 (Boot File URL) and an HTTP server hosting the
  installer.  QEMU user-mode networking cannot serve DHCPv6 option 59,
  hence the real L2 segment.  Default payload dir is /tmp/payload;
  the setup fails fast if payload/onie-installer is missing.  Two
  host-kernel workarounds are applied at bring-up:
  - bridge multicast snooping is disabled on br-onie (no querier on
    this private segment; otherwise IPv6 solicited-node multicast is
    silently dropped and global-scope ND fails).
  - IPv6 DAD is disabled on the netns-side veth (accept_dad=0,
    dad_transmits=0, plus 'nodad' on the address itself) so python's
    bind() does not race the ~1s tentative window and fail with
    EADDRNOTAVAIL.
* run-onie-vm.sh: direct -kernel/-initrd QEMU boot on the tap, with
  boot_reason=install (the same cmdline install.ipxe uses).  No ISO,
  UEFI or signing is involved in this path.  Optional --with-disk
  [PATH] flag creates a fresh qcow2 (default
  /tmp/onie-disk-<MACHINE>.qcow2, size DISK_SIZE, default 4G),
  partitions it with GRUB-BOOT (ef02, 2 MiB) and ONIE-BOOT (ext4,
  128 MiB) via qemu-nbd + sgdisk, populates ONIE-BOOT with the
  minimal grub scaffolding the demo installer needs (50_onie_grub
  from installer/grub-arch, plus placeholder grub-variables /
  grub-machine.cfg / grub-extra.cfg / grub-common.cfg), then attaches
  the disk so the demo installer can complete install-to-disk in
  addition to the DHCPv6 fetch.  ANY EXISTING FILE AT PATH IS
  DELETED.  Bootstrap requires the script to run as root
  (qemu-nbd, modprobe, mount).  Without the flag the harness boots
  diskless (fetch + checksum only, sufficient to validate the DHCPv6
  discovery path itself).
* verify-dhcp6-boot.sh: PASS/FAIL evidence gate over the dnsmasq log
  (option 59 sent), the HTTP log (installer fetched) and optionally
  the captured ONIE console.
* test-udhcp6-sd.sh: hermetic micro-test proving udhcp6_sd maps
  option 59 to onie_disco_bootfile; no network or VM needed.

The build uses the stock container environment (contrib/build-env).

Signed-off-by: Tao Li <tao.li06@sap.com>
@byteocean
byteocean force-pushed the feature/dhcp6-boot-pr branch from a912503 to f924523 Compare September 24, 2026 15:12

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants