Browse Source

Create script to fix EoL repos on XO laptops (fixes #3)

pull/4/head
Justin W. Flory 5 years ago
parent
commit
e90e366b0e
No known key found for this signature in database GPG Key ID: 3AA2DC1FF6ABF0B6
3 changed files with 123 additions and 0 deletions
  1. +29
    -0
      scripts/xo-eol-repos/f18/fedora-updates.repo
  2. +29
    -0
      scripts/xo-eol-repos/f18/fedora.repo
  3. +65
    -0
      scripts/xo-eol-repos/f18/fix_repos.sh

+ 29
- 0
scripts/xo-eol-repos/f18/fedora-updates.repo View File

@ -0,0 +1,29 @@
[updates]
name=Fedora $releasever - $basearch - Updates
failovermethod=priority
baseurl=https://archives.fedoraproject.org/pub/archive/fedora/linux/updates/$releasever/$basearch/
enabled=1
gpgcheck=1
metadata_expire=6h
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch
skip_if_unavailable=False
[updates-debuginfo]
name=Fedora $releasever - $basearch - Updates - Debug
failovermethod=priority
baseurl=https://archives.fedoraproject.org/pub/archive/fedora/linux/updates/$releasever/$basearch/debug/
enabled=0
gpgcheck=1
metadata_expire=6h
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch
skip_if_unavailable=False
[updates-source]
name=Fedora $releasever - Updates Source
failovermethod=priority
baseurl=https://archives.fedoraproject.org/pub/archive/fedora/linux/updates/$releasever/SRPMS/
enabled=0
gpgcheck=1
metadata_expire=6h
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch
skip_if_unavailable=False

+ 29
- 0
scripts/xo-eol-repos/f18/fedora.repo View File

@ -0,0 +1,29 @@
[fedora]
name=Fedora $releasever - $basearch
failovermethod=priority
baseurl=https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/$releasever/Everything/$basearch/os/
enabled=1
metadata_expire=28d
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch
skip_if_unavailable=False
[fedora-debuginfo]
name=Fedora $releasever - $basearch - Debug
failovermethod=priority
baseurl=https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/$releasever/Everything/$basearch/debug/
enabled=0
metadata_expire=28d
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch
skip_if_unavailable=False
[fedora-source]
name=Fedora $releasever - Source
failovermethod=priority
baseurl=https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/$releasever/Everything/source/SRPMS/
enabled=0
metadata_expire=28d
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch
skip_if_unavailable=False

+ 65
- 0
scripts/xo-eol-repos/f18/fix_repos.sh View File

@ -0,0 +1,65 @@
#!/bin/bash
#
# Author: Justin W. Flory <me [at] justinwflory [dot] com>
# Language: Shell
# Filename: fix_repos.sh
#
# Description:
# Automatically fixes the One Laptop per Child (OLPC)
# XO laptops to use correct repository files for its
# version of Fedora. For the HFOSS course at the
# Rochester Institute of Technology, most of the XOs
# are running Fedora 18. This script targets setting
# up the EoL (end-of-life) repos for the sake of the
# laptop.
#
# License:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Bash configuration
set -euxo pipefail
# Environment variables
KEYSIGN_DIR="/etc/pki/rpm-gpg"
YUM_REPOS_DIR="/etc/yum.repos.d"
# Make our working space
if [ ! -d "$TMPDIR" ]; then
echo "Working directory does not exist, making temporary directory..."
mkdir $TMPDIR
fi
cd $TMPDIR
# Pull down obsolete keys for Fedora 18 and import
# https://getfedora.org/keys/obsolete.html
# https://getfedora.org/keys/faq/
curl -L -O https://getfedora.org/static/DE7F38BD.txt
curl -L -O https://getfedora.org/static/A4D647E9.txt
sudo rpm --import DE7F38BD.txt && rm DE7F38BD.txt
sudo rpm --import A4D647E9.txt && rm A4D647E9.txt
# Get the new repo files and replace the old ones
curl -L -O https://mirror.justinwflory.com/pub/linux/fedora/eol-repos/fedora.repo
curl -L -O https://mirror.justinwflory.com/pub/linux/fedora/eol-repos/fedora-updates.repo
if [ -d $YUM_REPOS_DIR/fedora.repo ]; then
sudo rm $YUM_REPOS_DIR/fedora.repo
fi
if [ -d $YUM_REPOS_DIR/fedora-updates.repo ]; then
sudo rm $YUM_REPOS_DIR/fedora-updates.repo
fi
sudo mv fedora.repo $YUM_REPOS_DIR
sudo mv fedora-updates.repo $YUM_REPOS_DIR
# Clean up, print out
if [ "$(ls -A $TMPDIR)" ]; then
echo "Directory is not empty. Leaving."
else
rmdir $TMPDIR
fi
echo "Your repos should be fixed! Try 'sudo yum install git' to try it out."

Loading…
Cancel
Save