Skip to content

Commit 00511fe

Browse files
committed
builder - rework chroot builder RetroPie-Setup cloning
Previously RetroPie-Setup was cloned from the calling RetroPie-Setup scriptmodule on the host side, but this only worked when the UID/GID of the user was 1000:1000 matching the first user in the chroot. Due to changes in my build system, this required a fix. It now does the clone from within the chroot, so the ownership is correct for chroot pi user. This commit also fixes up the multiline quoting and removes an unnecessary trailing slash on a mkdir.
1 parent 7fad64b commit 00511fe

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

scriptmodules/admin/builder.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,19 +109,19 @@ function chroot_build_builder() {
109109

110110

111111
if [[ ! -d "$chroot_rps_dir" ]]; then
112-
sudo -u $user git clone "$scriptdir" "$chroot_rps_dir"
113112
gpg --export-secret-keys "$__gpg_signing_key" >"$chroot_dir/retropie.key"
114-
rp_callModule image chroot "$chroot_dir" bash -c "\
115-
sudo gpg --import "/retropie.key"; \
116-
sudo rm "/retropie.key"; \
117-
sudo apt-get update; \
118-
sudo apt-get install -y git; \
113+
rp_callModule image chroot "$chroot_dir" bash -c "
114+
sudo gpg --import /retropie.key
115+
sudo rm /retropie.key
116+
sudo apt-get update; sudo apt-get install -y git
117+
cd
118+
git clone https://github.com/RetroPie/RetroPie-Setup.git
119119
"
120120
# copy existing packages from host if building in a clean chroot to avoid rebuilding everything
121-
mkdir -p "$scriptdir/$archive_dir/" "$chroot_rps_dir/$archive_dir"
121+
mkdir -p "$scriptdir/$archive_dir" "$chroot_rps_dir/$archive_dir"
122122
rsync -av "$scriptdir/$archive_dir/" "$chroot_rps_dir/$archive_dir/"
123123
else
124-
sudo -u $user git -C "$chroot_rps_dir" pull
124+
rp_callModule image chroot "$chroot_dir" git -C /home/pi/RetroPie-Setup pull
125125
fi
126126

127127
for platform in $platforms; do

0 commit comments

Comments
 (0)