Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

example: add script to generate bios mbr raw disks #98

Merged
merged 1 commit into from
Sep 20, 2023
Merged

Conversation

mudler
Copy link
Member

@mudler mudler commented Sep 20, 2023

this needs refactoring and add to auroraboot, but it needs a cloud config of this format (the install block is relevant here, where it automatically power off after install):

#cloud-config

hostname: kairos-{{ trunc 4 .MachineID }}

# Automated install block
install:
  # Device for automated installs
  device: "auto"
  # Reboot after installation
  reboot: false
  # Power off after installation
  poweroff: true
  # Set to true to enable automated installations
  auto: true

## Login
users:
- name: "kairos"
  lock_passwd: true
  ssh_authorized_keys:
  - github:mudler

stages:
  boot:
  - name: "Repart image"
    layout:
      device:
        label: COS_PERSISTENT
      expand_partition:
        size: 0 # all space
    commands:
      # grow filesystem if not used 100%
      - |
         [[ "$(echo "$(df -h | grep COS_PERSISTENT)" | awk '{print $5}' | tr -d '%')" -ne 100 ]] && resize2fs /dev/disk/by-label/COS_PERSISTENT

Signed-off-by: mudler <mudler@kairos.io>
@mudler mudler requested a review from a team September 20, 2023 13:45
@Itxaka
Copy link
Member

Itxaka commented Sep 20, 2023

at this point...do we move to packer to generate raw images instead? We can plug them both in CI and earthly pipelines easily and this seems like a convoluted way of doing so.

plus we got experience already .... xDDD

@mudler
Copy link
Member Author

mudler commented Sep 20, 2023

at this point...do we move to packer to generate raw images instead? We can plug them both in CI and earthly pipelines easily and this seems like a convoluted way of doing so.

plus we got experience already .... xDDD

isn't packer even more complex at this point? this just works with a line of qemu and no configuration at all :->

@mudler mudler merged commit 497ecf9 into master Sep 20, 2023
9 checks passed
@jimmykarily
Copy link
Collaborator

we should at least add the needed cloud config as a comment (the relevant parts) in the script. Otherwise nobody will know what is needed to run the script.

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.

3 participants