#10 Update the ref to be used, install_ref != update_ref
Merged 7 years ago by maxamillion. Opened 7 years ago by puiterwijk.
puiterwijk/fedora-lorax-templates f25-newref  into  f25

@@ -4,8 +4,8 @@ 

  ##     but the package enables itself by default

  ##  3) Work around https://bugzilla.redhat.com/show_bug.cgi?id=1193590

  

- <%page args="ostree_osname, ostree_ref"/>

- append usr/share/anaconda/interactive-defaults.ks "ostreesetup --nogpg --osname=${ostree_osname} --remote=${ostree_osname} --url=file:////run/install/repo/content/repo --ref=${ostree_ref}\n"

+ <%page args="ostree_osname, ostree_repo, ostree_install_ref, ostree_update_ref"/>

+ append usr/share/anaconda/interactive-defaults.ks "ostreesetup --nogpg --osname=${ostree_osname} --remote=${ostree_osname} --url=file:////run/install/repo/content/repo --ref=${ostree_install_ref}\n"

  append usr/share/anaconda/interactive-defaults.ks "services --disabled cloud-init,cloud-config,cloud-final,cloud-init-local\n"

- append usr/share/anaconda/interactive-defaults.ks "%post --erroronfail\nrm -f /etc/ostree/remotes.d/${ostree_osname}.conf\nostree remote add --set=gpg-verify=false fedora-atomic 'https://kojipkgs.fedoraproject.org/atomic/25/'\ncp /etc/skel/.bash* /root\n%end\n"

+ append usr/share/anaconda/interactive-defaults.ks "%post --erroronfail\nrm -f /etc/ostree/remotes.d/${ostree_osname}.conf\nostree remote add --set=gpg-verify=false ${ostree_osname} '${ostree_repo}'\nostree admin set-origin --index=0 ${ostree_osname} ${ostree_repo} ${ostree_update_ref}\ncp /etc/skel/.bash* /root\n%end\n"

  

@@ -4,9 +4,9 @@ 

  ## Note that we pull with depth=0 to only get *one* commit into the

  ## ISO, because we obviously don't want the full history.

  

- <%page args="workdir, ostree_osname, ostree_repo, ostree_ref"/>

+ <%page args="workdir, ostree_osname, ostree_repo, ostree_install_ref, ostree_update_ref"/>

  runcmd mkdir -p ${workdir}/iso-graft/content/repo

  runcmd ostree --repo=${workdir}/iso-graft/content/repo init --mode=archive-z2

  runcmd ostree --repo=${workdir}/iso-graft/content/repo remote add ostree-mirror --set=gpg-verify=false ${ostree_repo}

- runcmd ostree --repo=${workdir}/iso-graft/content/repo pull --mirror ostree-mirror ${ostree_ref}

+ runcmd ostree --repo=${workdir}/iso-graft/content/repo pull --mirror ostree-mirror ${ostree_install_ref}

  runcmd find ${workdir}/iso-graft/content/repo/objects -name '*.commitmeta' -delete

no initial comment

please don't merge this yet

ostree admin set-origin fedora-atomic should probable be ostree admin set-origin ${ostree_osname} to keep things consistent

also, discussed with patrick and kojipkgs.fedoraproject.org is the wrong URL for us to be using. We should be using the dl.fp.o URL. he will open a separate PR for that

rebased

7 years ago

Did you test this? I am pretty sure today ostree admin set-origin is going to error out because it's not in a booted deployment. I think it will work with --index 0. Though even that depends on being able to do ostree things at all from %post...we should make it work if it doesn't, but I'm not sure it will today, since anaconda needs to have the mounts set up correctly.

Did you test this? I am pretty sure today ostree admin set-origin is going to error out because it's not in a booted deployment. I think it will work with --index 0. Though even that depends on being able to do ostree things at all from %post...we should make it work if it doesn't, but I'm not sure it will today, since anaconda needs to have the mounts set up correctly.

I ran that on a booted system and it worked but I have not tried it in anaconda %post. I'm working on updating the kickstart files for the atomic qcow. I'll run a test to see if it works in %post.

Otherwise, seems sane to me.

Did you test this? I am pretty sure today ostree admin set-origin is going to error out because it's not in a booted deployment. I think it will work with --index 0. Though even that depends on being able to do ostree things at all from %post...we should make it work if it doesn't, but I'm not sure it will today, since anaconda needs to have the mounts set up correctly.

You were right. it works with --index 0. Patrick can you update the PR to have ostree admin set-origin --index 0 ?

rebased

7 years ago

Pull-Request has been merged by maxamillion

7 years ago