#20 f26: atomic: only create new ref if needed, install/update from different repo, break up newlines
Merged 6 years ago by mohanboddu. Opened 6 years ago by dustymabe.
dustymabe/fedora-lorax-templates dusty-f26  into  f26

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

  ##     but the package enables itself by default

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

  

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

- append usr/share/anaconda/interactive-defaults.ks "ostreesetup --nogpg --osname=${ostree_osname} --remote=${ostree_osname} --url=file:///ostree/repo --ref=${ostree_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 ${ostree_osname} '${ostree_repo}'\ncp /etc/skel/.bash* /root\n%end\n"

+ ## Args:

+ ##  - ostree_osname      - the name of the os/name of remote

+ ##  - ostree_install_repo- the url of the remote during ISO creation

+ ##  - ostree_update_repo - the url of the remote for updates of an installed system

+ ##  - ostree_install_ref - the ref to use when creating the ISO  

+ ##  - ostree_update_ref  - the ref to use for updates of an installed system

+ 

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

+ append usr/share/anaconda/interactive-defaults.ks "ostreesetup --nogpg --osname=${ostree_osname} --remote=${ostree_osname} --url=file:///ostree/repo --ref=${ostree_update_ref}"

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

+ 

+ append usr/share/anaconda/interactive-defaults.ks "%post --erroronfail"

+ append usr/share/anaconda/interactive-defaults.ks "rm -f /etc/ostree/remotes.d/${ostree_osname}.conf"

+ append usr/share/anaconda/interactive-defaults.ks "ostree remote add --set=gpg-verify=false ${ostree_osname} '${ostree_update_repo}'"

+ append usr/share/anaconda/interactive-defaults.ks "cp /etc/skel/.bash* /root"

+ append usr/share/anaconda/interactive-defaults.ks "%end"

  

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

  ## 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="root, ostree_repo, ostree_osname, ostree_ref"/>

+ ## Args:

+ ##  - root               - the root directory of the iso tree

+ ##  - ostree_osname      - the name of the os/name of remote

+ ##  - ostree_install_repo- the url of the remote during ISO creation

+ ##  - ostree_update_repo - the url of the remote for updates of an installed system

+ ##  - ostree_install_ref - the ref to use when creating the ISO  

+ ##  - ostree_update_ref  - the ref to use for updates of an installed system

+ 

+ <%page args="root, ostree_osname, ostree_install_repo, ostree_update_repo, ostree_install_ref, ostree_update_ref"/>

  runcmd mkdir ${root}/ostree

  runcmd ostree --repo=${root}/ostree/repo init --mode=bare

- runcmd ostree --repo=${root}/ostree/repo remote add ${ostree_osname} --set=gpg-verify=false ${ostree_repo}

- runcmd ostree --repo=${root}/ostree/repo pull --mirror ${ostree_osname} ${ostree_ref}

+ runcmd ostree --repo=${root}/ostree/repo remote add ${ostree_osname} --set=gpg-verify=false ${ostree_install_repo}

+ runcmd ostree --repo=${root}/ostree/repo pull --mirror ${ostree_osname} ${ostree_install_ref}

+ runcmd bash -c 'if [ "${ostree_install_ref}" != "${ostree_update_ref}" ]; then ostree --repo=${root}/ostree/repo refs ${ostree_install_ref} --create ${ostree_update_ref}; fi'

+ runcmd ostree --repo=${root}/ostree/repo summary -u

  • atomic: set up for 2wk updates
  • atomic: add some documentation of arguments
  • atomic: only create new ref if needed
  • atomic: create update/install ostree repo vars
  • atomic: break up append statements into multiple lines

Pull-Request has been merged by mohanboddu

6 years ago