Skip to content
Snippets Groups Projects
Commit fc3261b6 authored by Adam Lewenberg's avatar Adam Lewenberg
Browse files

work on chroot bootstrap issues

parent e284ae3b
No related branches found
No related tags found
No related merge requests found
...@@ -57,8 +57,12 @@ define su_debuild::chroot( ...@@ -57,8 +57,12 @@ define su_debuild::chroot(
} }
} }
file { '/etc/pbuilder':
ensure => directory,
}
# There is a chicken-and-egg problem in getting the stanford # There is a chicken-and-egg problem in getting the stanford
# repository's public key installed. We do this as follows: # repository's public key installed. We work around this as follows:
# #
# 0. Install the chroot WITHOUT the stanford-keyring. # 0. Install the chroot WITHOUT the stanford-keyring.
# 1. Copy the correct distribution's sources.list file to /etc/apt. # 1. Copy the correct distribution's sources.list file to /etc/apt.
...@@ -85,10 +89,17 @@ define su_debuild::chroot( ...@@ -85,10 +89,17 @@ define su_debuild::chroot(
require => Exec["cowbuilder --create ${name}"]; require => Exec["cowbuilder --create ${name}"];
} }
# 2. Copy the correct sources.list. # 2. Install the correct sources.list to /etc/pbuild so we can use
file { "$path/etc/apt/sources.list": # it later. We only need it once.
file { "/etc/pbuilder/sources.list.${name}":
source => "puppet:///modules/su_debuild/etc/apt/sources.list.${name}", source => "puppet:///modules/su_debuild/etc/apt/sources.list.${name}",
require => File["${path}/etc/apt/trusted.gpg.d/stanford-keyring.gpg"], require => File['/etc/pbuilder'],
notify => Exec['copy-correct-sources-list'],
}
exec { 'copy-correct-sources-list':
path => '/usr/sbin:/usr/bin:/bin:/sbin',
refreshonly => true,
command => "cp /etc/pbuilder/sources.list.${name} $path/etc/apt/sources.list",
} }
# 3. Install stanford-keyring. Be sure to run "apt-get update" first. # 3. Install stanford-keyring. Be sure to run "apt-get update" first.
...@@ -99,7 +110,7 @@ define su_debuild::chroot( ...@@ -99,7 +110,7 @@ define su_debuild::chroot(
command => "chroot $path apt-get update; chroot $path apt-get install stanford-keyring", command => "chroot $path apt-get update; chroot $path apt-get install stanford-keyring",
creates => "$path/usr/share/keyrings/stanford-keyring.gpg", creates => "$path/usr/share/keyrings/stanford-keyring.gpg",
require => [ require => [
File["$path/etc/apt/sources.list"], Exec['copy-correct-sources-list'],
File["${path}/etc/apt/trusted.gpg.d/stanford-keyring.gpg"], File["${path}/etc/apt/trusted.gpg.d/stanford-keyring.gpg"],
] ]
} }
......
# /etc/pbuilder/<%= @distribution %> -- Debian override configuration file for pbuilder. # /etc/pbuilder/<%= @distribution %> -- Debian override configuration file for pbuilder.
MIRRORSITE=http://debian.stanford.edu/debian MIRRORSITE=http://debian.stanford.edu/debian
# We always want the "stanford" and "local" Stanford-specific Debian repository.
OTHERMIRROR="deb http://debian.stanford.edu/debian-stanford <%= @distribution %> main contrib non-free"
OTHERMIRROR="$OTHERMIRROR |deb http://debian.stanford.edu/debian-local <%= @distribution %> main contrib non-free"
<%- <%-
if (@include_backports) then if (@include_backports) then
backports_comment_character = ""
backports_message = "We want backports."
else
backports_comment = "# "
backports_message = "Backports distribution either no longer available or not yet\n"
+ "available so omitting"
end
-%> -%>
OTHERMIRROR="deb http://debian.stanford.edu/debian <%= @distribution %>-backports main contrib non-free" <%= backports_message %>
<%- else -%> <%= backports_comment %>OTHERMIRROR="$OTHERMIRROR |deb http://debian.stanford.edu/debian <%= @distribution %>-backports main contrib non-free"
# Backports distribution either no longer available or not yet <%= backports_comment %>OTHERMIRROR="$OTHERMIRROR |deb http://debian.stanford.edu/debian-stanford <%= @distribution %>-backports main contrib non-free"
# available so omitting
# OTHERMIRROR="deb http://debian.stanford.edu/debian <%= @distribution %>-backports main contrib non-free"
<%- end -%>
<%- if (@include_stanford_keyring) then -%> <%- if (@include_stanford_keyring) then -%>
EXTRAPACKAGES="aptitude debconf-utils debhelper gnupg stanford-keyring" EXTRAPACKAGES="aptitude debconf-utils debhelper gnupg stanford-keyring"
<%- else -%> <%- else -%>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment