Skip to content

Commit

Permalink
Fix config saving when building inside tmpfs (#285)
Browse files Browse the repository at this point in the history
When building inside tmpfs, ``$srcdir`` and ``$pkgdir``, their parent
directory will not be the directory with PKGBUILD, but /tmp. So we need
to read symlink of one of the files in ``$srcdir`` to figure out where
the directory with PKGBUILD actually is.
  • Loading branch information
ventureoo authored Aug 25, 2024
1 parent a496470 commit cc66dc6
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 11 deletions.
3 changes: 2 additions & 1 deletion linux-cachyos-bore/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,8 @@ prepare() {

### Save configuration for later reuse
echo "Save configuration for later reuse..."
cat .config > "${srcdir}/../config-${pkgver}-${pkgrel}${pkgbase#linux}"
local basedir="$(dirname "$(readlink "${srcdir}/config")")"
cat .config > "${basedir}/config-${pkgver}-${pkgrel}${pkgbase#linux}"

if [ -n "$_build_nvidia" ]; then
cd "${srcdir}"
Expand Down
3 changes: 2 additions & 1 deletion linux-cachyos-deckify/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,8 @@ prepare() {

### Save configuration for later reuse
echo "Save configuration for later reuse..."
cat .config > "${srcdir}/../config-${pkgver}-${pkgrel}${pkgbase#linux}"
local basedir="$(dirname "$(readlink "${srcdir}/config")")"
cat .config > "${basedir}/config-${pkgver}-${pkgrel}${pkgbase#linux}"

if [ -n "$_build_nvidia" ]; then
cd "${srcdir}"
Expand Down
3 changes: 2 additions & 1 deletion linux-cachyos-echo/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,8 @@ prepare() {

### Save configuration for later reuse
echo "Save configuration for later reuse..."
cat .config > "${srcdir}/../config-${pkgver}-${pkgrel}${pkgbase#linux}"
local basedir="$(dirname "$(readlink "${srcdir}/config")")"
cat .config > "${basedir}/config-${pkgver}-${pkgrel}${pkgbase#linux}"

if [ -n "$_build_nvidia" ]; then
cd "${srcdir}"
Expand Down
3 changes: 2 additions & 1 deletion linux-cachyos-eevdf/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,8 @@ prepare() {

### Save configuration for later reuse
echo "Save configuration for later reuse..."
cat .config > "${srcdir}/../config-${pkgver}-${pkgrel}${pkgbase#linux}"
local basedir="$(dirname "$(readlink "${srcdir}/config")")"
cat .config > "${basedir}/config-${pkgver}-${pkgrel}${pkgbase#linux}"

if [ -n "$_build_nvidia" ]; then
cd "${srcdir}"
Expand Down
3 changes: 2 additions & 1 deletion linux-cachyos-hardened/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,8 @@ prepare() {

### Save configuration for later reuse
echo "Save configuration for later reuse..."
cat .config > "${srcdir}/../config-${pkgver}-${pkgrel}${pkgbase#linux}"
local basedir="$(dirname "$(readlink "${srcdir}/config")")"
cat .config > "${basedir}/config-${pkgver}-${pkgrel}${pkgbase#linux}"

if [ -n "$_build_nvidia" ]; then
cd "${srcdir}"
Expand Down
3 changes: 2 additions & 1 deletion linux-cachyos-lts/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,8 @@ prepare() {

### Save configuration for later reuse
echo "Save configuration for later reuse..."
cat .config > "${srcdir}/../config-${pkgver}-${pkgrel}${pkgbase#linux}"
local basedir="$(dirname "$(readlink "${srcdir}/config")")"
cat .config > "${basedir}/config-${pkgver}-${pkgrel}${pkgbase#linux}"

if [ -n "$_build_nvidia" ]; then
cd "${srcdir}"
Expand Down
3 changes: 2 additions & 1 deletion linux-cachyos-rc/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,8 @@ prepare() {

### Save configuration for later reuse
echo "Save configuration for later reuse..."
cat .config > "${srcdir}/../config-${pkgver}-${pkgrel}${pkgbase#linux}"
local basedir="$(dirname "$(readlink "${srcdir}/config")")"
cat .config > "${basedir}/config-${pkgver}-${pkgrel}${pkgbase#linux}"

if [ -n "$_build_nvidia" ]; then
cd "${srcdir}"
Expand Down
3 changes: 2 additions & 1 deletion linux-cachyos-rt-bore/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,8 @@ prepare() {

### Save configuration for later reuse
echo "Save configuration for later reuse..."
cat .config > "${srcdir}/../config-${pkgver}-${pkgrel}${pkgbase#linux}"
local basedir="$(dirname "$(readlink "${srcdir}/config")")"
cat .config > "${basedir}/config-${pkgver}-${pkgrel}${pkgbase#linux}"

if [ -n "$_build_nvidia" ]; then
cd "${srcdir}"
Expand Down
3 changes: 2 additions & 1 deletion linux-cachyos-sched-ext/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,8 @@ prepare() {

### Save configuration for later reuse
echo "Save configuration for later reuse..."
cat .config > "${srcdir}/../config-${pkgver}-${pkgrel}${pkgbase#linux}"
local basedir="$(dirname "$(readlink "${srcdir}/config")")"
cat .config > "${basedir}/config-${pkgver}-${pkgrel}${pkgbase#linux}"

if [ -n "$_build_nvidia" ]; then
cd "${srcdir}"
Expand Down
3 changes: 2 additions & 1 deletion linux-cachyos-server/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,8 @@ prepare() {

### Save configuration for later reuse
echo "Save configuration for later reuse..."
cat .config > "${srcdir}/../config-${pkgver}-${pkgrel}${pkgbase#linux}"
local basedir="$(dirname "$(readlink "${srcdir}/config")")"
cat .config > "${basedir}/config-${pkgver}-${pkgrel}${pkgbase#linux}"

if [ -n "$_build_nvidia" ]; then
cd "${srcdir}"
Expand Down
3 changes: 2 additions & 1 deletion linux-cachyos/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,8 @@ prepare() {

### Save configuration for later reuse
echo "Save configuration for later reuse..."
cat .config > "${srcdir}/../config-${pkgver}-${pkgrel}${pkgbase#linux}"
local basedir="$(dirname "$(readlink "${srcdir}/config")")"
cat .config > "${basedir}/config-${pkgver}-${pkgrel}${pkgbase#linux}"

if [ -n "$_build_nvidia" ]; then
cd "${srcdir}"
Expand Down

0 comments on commit cc66dc6

Please sign in to comment.