From e35b26881e421dffc0263dc995a9858729f7d68f 2017-08-19 12:50:39 From: drtyhlpr Date: 2017-08-19 12:50:39 Subject: [PATCH] Merge pull request #75 from n3ph/master Preserve user environment when using sudo to allow proxy setups --- diff --git a/bootstrap.d/13-kernel.sh b/bootstrap.d/13-kernel.sh index 919cea8..bd81c8d 100644 --- a/bootstrap.d/13-kernel.sh +++ b/bootstrap.d/13-kernel.sh @@ -24,7 +24,7 @@ if [ "$BUILD_KERNEL" = true ] ; then temp_dir=$(sudo -u nobody mktemp -d) # Fetch current RPi2/3 kernel sources - sudo -u nobody git -C "${temp_dir}" clone --depth=1 "${KERNEL_URL}" + sudo -E -u nobody git -C "${temp_dir}" clone --depth=1 "${KERNEL_URL}" # Copy downloaded kernel sources mv "${temp_dir}/linux" "${R}/usr/src/" diff --git a/bootstrap.d/15-rpi-config.sh b/bootstrap.d/15-rpi-config.sh index 37834cd..998f4bf 100644 --- a/bootstrap.d/15-rpi-config.sh +++ b/bootstrap.d/15-rpi-config.sh @@ -20,13 +20,13 @@ if [ "$BUILD_KERNEL" = true ] ; then temp_dir=$(sudo -u nobody mktemp -d) # Install latest boot binaries from raspberry/firmware github - sudo -u nobody wget -q -O "${temp_dir}/bootcode.bin" "${FIRMWARE_URL}/bootcode.bin" - sudo -u nobody wget -q -O "${temp_dir}/fixup.dat" "${FIRMWARE_URL}/fixup.dat" - sudo -u nobody wget -q -O "${temp_dir}/fixup_cd.dat" "${FIRMWARE_URL}/fixup_cd.dat" - sudo -u nobody wget -q -O "${temp_dir}/fixup_x.dat" "${FIRMWARE_URL}/fixup_x.dat" - sudo -u nobody wget -q -O "${temp_dir}/start.elf" "${FIRMWARE_URL}/start.elf" - sudo -u nobody wget -q -O "${temp_dir}/start_cd.elf" "${FIRMWARE_URL}/start_cd.elf" - sudo -u nobody wget -q -O "${temp_dir}/start_x.elf" "${FIRMWARE_URL}/start_x.elf" + sudo -E -u nobody wget -q -O "${temp_dir}/bootcode.bin" "${FIRMWARE_URL}/bootcode.bin" + sudo -E -u nobody wget -q -O "${temp_dir}/fixup.dat" "${FIRMWARE_URL}/fixup.dat" + sudo -E -u nobody wget -q -O "${temp_dir}/fixup_cd.dat" "${FIRMWARE_URL}/fixup_cd.dat" + sudo -E -u nobody wget -q -O "${temp_dir}/fixup_x.dat" "${FIRMWARE_URL}/fixup_x.dat" + sudo -E -u nobody wget -q -O "${temp_dir}/start.elf" "${FIRMWARE_URL}/start.elf" + sudo -E -u nobody wget -q -O "${temp_dir}/start_cd.elf" "${FIRMWARE_URL}/start_cd.elf" + sudo -E -u nobody wget -q -O "${temp_dir}/start_x.elf" "${FIRMWARE_URL}/start_x.elf" # Move downloaded boot binaries mv "${temp_dir}/"* "${BOOT_DIR}/" diff --git a/bootstrap.d/20-networking.sh b/bootstrap.d/20-networking.sh index bd3ce0a..a1ddd97 100644 --- a/bootstrap.d/20-networking.sh +++ b/bootstrap.d/20-networking.sh @@ -92,8 +92,8 @@ if [ "$ENABLE_WIRELESS" = true ] ; then temp_dir=$(sudo -u nobody mktemp -d) # Fetch firmware binary blob - sudo -u nobody wget -q -O "${temp_dir}/brcmfmac43430-sdio.bin" "${WLAN_FIRMWARE_URL}/brcmfmac43430-sdio.bin" - sudo -u nobody wget -q -O "${temp_dir}/brcmfmac43430-sdio.txt" "${WLAN_FIRMWARE_URL}/brcmfmac43430-sdio.txt" + sudo -E -u nobody wget -q -O "${temp_dir}/brcmfmac43430-sdio.bin" "${WLAN_FIRMWARE_URL}/brcmfmac43430-sdio.bin" + sudo -E -u nobody wget -q -O "${temp_dir}/brcmfmac43430-sdio.txt" "${WLAN_FIRMWARE_URL}/brcmfmac43430-sdio.txt" # Move downloaded firmware binary blob mv "${temp_dir}/brcmfmac43430-sdio."* "${WLAN_FIRMWARE_DIR}/" diff --git a/bootstrap.d/41-uboot.sh b/bootstrap.d/41-uboot.sh index 68198ec..7c61d42 100644 --- a/bootstrap.d/41-uboot.sh +++ b/bootstrap.d/41-uboot.sh @@ -19,7 +19,7 @@ if [ "$ENABLE_UBOOT" = true ] ; then temp_dir=$(sudo -u nobody mktemp -d) # Fetch U-Boot sources - sudo -u nobody git -C "${temp_dir}" clone "${UBOOT_URL}" + sudo -E -u nobody git -C "${temp_dir}" clone "${UBOOT_URL}" # Copy downloaded U-Boot sources mv "${temp_dir}/u-boot" "${R}/tmp/" diff --git a/bootstrap.d/42-fbturbo.sh b/bootstrap.d/42-fbturbo.sh index 0e8b064..8cb2988 100644 --- a/bootstrap.d/42-fbturbo.sh +++ b/bootstrap.d/42-fbturbo.sh @@ -18,7 +18,7 @@ if [ "$ENABLE_FBTURBO" = true ] ; then temp_dir=$(sudo -u nobody mktemp -d) # Fetch fbturbo sources - sudo -u nobody git -C "${temp_dir}" clone "${FBTURBO_URL}" + sudo -E -u nobody git -C "${temp_dir}" clone "${FBTURBO_URL}" # Move downloaded fbturbo sources mv "${temp_dir}/xf86-video-fbturbo" "${R}/tmp/"