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

gf-oemid: Support replacing oemid #177

Merged
merged 1 commit into from
Oct 18, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/gf-oemid
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,19 @@ coreos_gf_run_mount "${tmp_dest}"
# Inject OEM label in all relevant places:
# * grub config
# * BLS config (for subsequent config regeneration)
# First, the grub config.
grubcfg_path=/boot/loader/grub.cfg
coreos_gf download ${grubcfg_path} ${tmpd}/grub.cfg
# Remove any oemid currently there
sed -i -e 's, coreos.oem.id=[a-zA-Z0-9]*,,g' ${tmpd}/grub.cfg
# Insert our new oemid
sed -i -e 's,^\(linux16 .*\),\1 coreos.oem.id='${oemid}',' ${tmpd}/grub.cfg
coreos_gf upload ${tmpd}/grub.cfg ${grubcfg_path}
# Now the BLS version
blscfg_path=$(coreos_gf glob-expand /boot/loader/entries/ostree-*.conf)
coreos_gf download ${blscfg_path} ${tmpd}/bls.conf
# Remove any oemid currently there
sed -i -e 's, coreos.oem.id=[a-zA-Z0-9]*,,g' ${tmpd}/bls.conf
sed -i -e 's,^\(options .*\),\1 coreos.oem.id='${oemid}',' ${tmpd}/bls.conf
coreos_gf upload ${tmpd}/bls.conf ${blscfg_path}

Expand Down