Skip to content

Conversation

@Jkintalix
Copy link
Contributor

@Jkintalix Jkintalix commented Sep 5, 2025

  • Refactored SystemBlockDevices to build the device list incrementally instead of pre-allocating with fixed size.
  • Integrated isReadOnlyISO checks to exclude ISO installer devices.

Merge Checklist

All boxes should be checked before merging the PR

  • The changes in the PR have been built and tested
  • [] cgmanifest file has been updated if required
  • Ready to merge

Description

For reference to ITEP-70891: This change refactors SystemBlockDevices to exclude boot and ISO devices from the returned list of installation targets. Previously, all block devices were included, which risked accidentally selecting the root disk or mounted ISO images during installation. The update introduces new helper functions: isReadOnlyISO to filter devices mounted as read-only. With these improvements, the EMT ISO installer now only considers safe, valid disks for installation, reducing the risk of overwriting the boot disk or ISO media

The EMT ISO installer was incorrectly listing the system’s boot device and mounted ISO devices as valid installation targets. This created a risk of overwriting the active root disk or the installation media itself, leading to failed or unstable installations. The filtering logic for excluding boot/ISO devices already exists in the graphical installer, and this update brings the same robustness to the EMT ISO installer.

Any Newly Introduced Dependencies

No

How Has This Been Tested?

Tested ISO locally.

image

Terminal disk selection page:

image

@Jkintalix Jkintalix requested a review from a team as a code owner September 5, 2025 07:05
@Jkintalix Jkintalix marked this pull request as draft September 5, 2025 07:05
@Jkintalix Jkintalix force-pushed the feature/filter-system-block-devices branch from cb901b3 to ee2dcc2 Compare September 5, 2025 07:10
@Jkintalix Jkintalix changed the title Refactor: Enhance diskutils.go for EMT ISO installer boot exclusion Refactor: Improve Boot Exclusion in diskutils.go for EMT ISO Installer Sep 5, 2025
@Jkintalix Jkintalix self-assigned this Sep 5, 2025
@Jkintalix Jkintalix marked this pull request as ready for review September 8, 2025 08:46
@Jkintalix Jkintalix force-pushed the feature/filter-system-block-devices branch 3 times, most recently from a428ca7 to 0208beb Compare September 18, 2025 08:35
Copy link
Contributor

@yepmunchun yepmunchun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we just need to exclude the device that currently acting as the installer, isn't that the isBootDevice check is sufficient? Why do we still need isISODevice and isReadOnlyISO check?

@Jkintalix
Copy link
Contributor Author

Jkintalix commented Sep 23, 2025

If we just need to exclude the device that currently acting as the installer, isn't that the isBootDevice check is sufficient? Why do we still need isISODevice and isReadOnlyISO check?

Thanks for the review! isBootDevice catches the active installer device via /proc/cmdline and /proc/mounts, but isISODevice and isReadOnlyISO are needed to exclude non-boot ISO9660 devices (e.g., a secondary USB) that could be installer media. isISODevice flags ISO filesystems with blkid, and isReadOnlyISO confirms read-only status to avoid writable disks. This ensures safety in multi-device setups

@yepmunchun
Copy link
Contributor

I think the original issue is to prevent the currently active installer from being selected as the installation target.
If there are other devices containing ISO installer/ISO installed image, those devices should remain available for selection as an installation target.

- Refactored SystemBlockDevices to build the device list incrementally
  instead of pre-allocating with fixed size.
- Added isBootDevice to detect and exclude active boot devices using
  /proc/cmdline and /proc/mounts.

This improves safety for EMT ISO installer by preventing accidental
selection of boot or ISO devices as installation targets.

Signed-off-by: kinatli jayanth <[email protected]>
@Jkintalix Jkintalix force-pushed the feature/filter-system-block-devices branch from 0208beb to 834b8de Compare September 25, 2025 15:14
- Refactored SystemBlockDevices to build the device list incrementally
  instead of pre-allocating with fixed size.
- Added isBootDevice to detect and exclude active boot devices using
  /proc/cmdline and /proc/mounts.

This improves safety for EMT ISO installer by preventing accidental
selection of boot or ISO devices as installation targets.

Signed-off-by: kinatli jayanth <[email protected]>
@Jkintalix Jkintalix force-pushed the feature/filter-system-block-devices branch from 834b8de to 89eb2a8 Compare September 25, 2025 15:15
@Jkintalix
Copy link
Contributor Author

I think the original issue is to prevent the currently active installer from being selected as the installation target. If there are other devices containing ISO installer/ISO installed image, those devices should remain available for selection as an installation target.

Addressed

- Refactored SystemBlockDevices to build the device list incrementally
  instead of pre-allocating with fixed size.
- Added isBootDevice to detect and exclude active boot devices using
  /proc/cmdline and /proc/mounts.

This improves safety for EMT ISO installer by preventing accidental
selection of boot or ISO devices as installation targets.

Signed-off-by: kinatli jayanth <[email protected]>
@Jkintalix Jkintalix force-pushed the feature/filter-system-block-devices branch from 89eb2a8 to 6c26d0e Compare October 1, 2025 08:05
@Jkintalix Jkintalix force-pushed the feature/filter-system-block-devices branch 2 times, most recently from 2879667 to 00bdeb4 Compare October 1, 2025 11:16
@Jkintalix Jkintalix force-pushed the feature/filter-system-block-devices branch from 00bdeb4 to 334ba14 Compare October 1, 2025 11:24
@Jkintalix Jkintalix force-pushed the feature/filter-system-block-devices branch 2 times, most recently from 2893cd0 to 40bf349 Compare October 3, 2025 06:47
@Jkintalix Jkintalix force-pushed the feature/filter-system-block-devices branch from 40bf349 to cd7772d Compare October 3, 2025 06:49
@yepmunchun yepmunchun merged commit 8b4a153 into open-edge-platform:3.0-dev Oct 3, 2025
8 of 11 checks passed
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