Skip to content

Commit

Permalink
Merge pull request #347 from stdweird/switch_to_var_tmp_aii
Browse files Browse the repository at this point in the history
On at least EL9, if no dedicated partition is used for /tmp in the filesystem layout , it defaults to tmpfs during postinstall. This breaks post-reboot scripting that uses the "temporary" DNF/YUM config written at install time.
  • Loading branch information
jrha authored Sep 17, 2024
2 parents 5c3e9ff + 3a42162 commit a0d73f1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
13 changes: 7 additions & 6 deletions aii-ks/src/main/perl/ks.pm
Original file line number Diff line number Diff line change
Expand Up @@ -996,7 +996,7 @@ sub ksinstall_rpm

my $packager = $version >= ANACONDA_VERSION_EL_8_0 ? "dnf" : "yum";
print join("\\\n ",
"$packager -c /tmp/aii/yum/yum.conf -y install",
"$packager -c /var/tmp/aii/yum/yum.conf -y install",
(map {s/^-//; "-x '$_'"} grep {$_ =~ /^-/} @pkgs),
(grep {$_ !~ /^-/} @pkgs)
), " || fail 'Unable to install packages'\n";
Expand Down Expand Up @@ -1542,10 +1542,11 @@ sub yum_setup
}

print <<EOF;
mkdir -p /tmp/aii/yum/repos
chmod 700 /tmp/aii
mkdir -p /var/tmp/aii/yum/repos
chmod 700 /var/tmp/aii
ln -s /var/tmp/aii /tmp/aii
cat <<end_of_yum_conf > /tmp/aii/yum/yum.conf
cat <<end_of_yum_conf > /var/tmp/aii/yum/yum.conf
[main]
EOF

Expand All @@ -1559,7 +1560,7 @@ EOF
plugins => 1,
installonly_limit => 3,
clean_dependencies_on_remove => 1,
reposdir => '/tmp/aii/yum/repos',
reposdir => '/var/tmp/aii/yum/repos',
obsoletes => $obsoletes,
};

Expand All @@ -1574,7 +1575,7 @@ EOF
print <<EOF;
end_of_yum_conf
cat <<end_of_repos > /tmp/aii/yum/repos/aii.repo
cat <<end_of_repos > /var/tmp/aii/yum/repos/aii.repo
EOF

$self->debug(5, "Adding YUM repositories...");
Expand Down
8 changes: 4 additions & 4 deletions aii-ks/src/test/resources/regexps/kickstart_yum_setup
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Test the yum_setup
---
---
^mkdir -p /tmp/aii/yum/repos$
^cat <<end_of_yum_conf > /tmp/aii/yum/yum.conf$
^mkdir -p /var/tmp/aii/yum/repos$
^cat <<end_of_yum_conf > /var/tmp/aii/yum/yum.conf$
^\[main\]$
^cachedir=/var/cache/yum/\\\$basearch/\\\$releasever$
^clean_dependencies_on_remove=1$
Expand All @@ -15,10 +15,10 @@ Test the yum_setup
^logfile=/var/log/yum.log$
^obsoletes=0$
^plugins=1$
^reposdir=/tmp/aii/yum/repos$
^reposdir=/var/tmp/aii/yum/repos$
^retries=40$
^end_of_yum_conf$
^cat <<end_of_repos > /tmp/aii/yum/repos/aii.repo$
^cat <<end_of_repos > /var/tmp/aii/yum/repos/aii.repo$
^\[repo0\]$
^name=repo0$
^baseurl=http://www.example.com$
Expand Down

0 comments on commit a0d73f1

Please sign in to comment.