diff --git a/Dockerfile b/Dockerfile index 82fc76ac64..a73fbcecc7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y dist-upgrade && pv bc lzop zip binfmt-support build-essential ccache debootstrap ntpdate gawk gcc-arm-linux-gnueabihf \ qemu-user-static u-boot-tools uuid-dev zlib1g-dev unzip libusb-1.0-0-dev ntpdate parted pkg-config libncurses5-dev whiptail \ debian-keyring debian-archive-keyring f2fs-tools libfile-fcntllock-perl rsync libssl-dev nfs-kernel-server btrfs-tools \ - ncurses-term p7zip-full kmod dosfstools libc6-dev-armhf-cross \ + ncurses-term p7zip-full kmod dosfstools libc6-dev-armhf-cross fakeroot \ curl patchutils python liblz4-tool libpython2.7-dev linux-base swig libpython-dev \ systemd-container udev distcc g++-5-arm-linux-gnueabihf lib32stdc++6 \ libc6-i386 lib32ncurses5 lib32tinfo5 locales ncurses-base zlib1g:i386 aptly pixz diff --git a/lib/compilation.sh b/lib/compilation.sh index 1fbadb605b..c1d454d709 100644 --- a/lib/compilation.sh +++ b/lib/compilation.sh @@ -225,7 +225,7 @@ compile_uboot() [[ -n $atftempdir && -f $atftempdir/license.md ]] && cp $atftempdir/license.md $SRC/.tmp/$uboot_name/usr/lib/u-boot/LICENSE.atf display_alert "Building deb" "${uboot_name}.deb" "info" - (cd $SRC/.tmp/; eval 'dpkg -b $uboot_name 2>&1' ${PROGRESS_LOG_TO_FILE:+' | tee -a $DEST/debug/compilation.log'}) + fakeroot dpkg-deb -b $SRC/.tmp/$uboot_name $SRC/.tmp/${uboot_name}.deb >> $DEST/debug/output.log 2>&1 rm -rf $SRC/.tmp/$uboot_name [[ -n $$atftempdir ]] && rm -rf $atftempdir @@ -271,7 +271,8 @@ compile_kernel() mkdir -p $sources_pkg_dir/usr/src/ $sources_pkg_dir/usr/share/doc/linux-source-${version}-${LINUXFAMILY} $sources_pkg_dir/DEBIAN display_alert "Compressing sources for the linux-source package" - tar cp --directory="$kerneldir" --exclude='./.git/' . | pv -p -b -r -s $(du -sb "$kerneldir" --exclude=='./.git/' | cut -f1) \ + tar cp --directory="$kerneldir" --exclude='./.git/' --owner=root . \ + | pv -p -b -r -s $(du -sb "$kerneldir" --exclude=='./.git/' | cut -f1) \ | pixz -4 > $sources_pkg_dir/usr/src/linux-source-${version}-${LINUXFAMILY}.tar.xz cp COPYING $sources_pkg_dir/usr/share/doc/linux-source-${version}-${LINUXFAMILY}/LICENSE @@ -368,7 +369,7 @@ compile_kernel() Description: This package provides the source code for the Linux kernel $version EOF - dpkg-deb -z0 -b $sources_pkg_dir ${sources_pkg_dir}.deb + fakeroot dpkg-deb -z0 -b $sources_pkg_dir ${sources_pkg_dir}.deb mv ${sources_pkg_dir}.deb $DEST/debs/ rm -rf $sources_pkg_dir diff --git a/lib/desktop-ng.sh b/lib/desktop-ng.sh index d89be68893..1ff73ff6c9 100644 --- a/lib/desktop-ng.sh +++ b/lib/desktop-ng.sh @@ -61,6 +61,7 @@ install_desktop () fi # copy skel to sudo user if [ -n "$SUDO_USER" ]; then cp -R /etc/skel /home/$SUDO_USER; fi + # TODO: change ownership/fix permissions exit 0 EOF chmod 755 $destination/DEBIAN/postinst @@ -96,7 +97,7 @@ install_desktop () # create board DEB file display_alert "Building Armbian desktop package" "$CHOSEN_ROOTFS" "info" - dpkg-deb -b $destination ${destination}.deb + fakeroot dpkg-deb -b $destination ${destination}.deb mkdir -p $DEST/debs/ mv ${destination}.deb $DEST/debs/ # cleanup diff --git a/lib/general.sh b/lib/general.sh index 33426068b2..582495dae9 100644 --- a/lib/general.sh +++ b/lib/general.sh @@ -461,7 +461,7 @@ prepare_host() # packages list for host # NOTE: please sync any changes here with the Dockerfile and Vagrantfile local hostdeps="wget ca-certificates device-tree-compiler pv bc lzop zip binfmt-support build-essential ccache debootstrap ntpdate \ - gawk gcc-arm-linux-gnueabihf qemu-user-static u-boot-tools uuid-dev zlib1g-dev unzip libusb-1.0-0-dev \ + gawk gcc-arm-linux-gnueabihf qemu-user-static u-boot-tools uuid-dev zlib1g-dev unzip libusb-1.0-0-dev fakeroot \ parted pkg-config libncurses5-dev whiptail debian-keyring debian-archive-keyring f2fs-tools libfile-fcntllock-perl rsync libssl-dev \ nfs-kernel-server btrfs-tools ncurses-term p7zip-full kmod dosfstools libc6-dev-armhf-cross \ curl patchutils python liblz4-tool libpython2.7-dev linux-base swig libpython-dev \ diff --git a/lib/makeboarddeb.sh b/lib/makeboarddeb.sh index 7281faa540..3f397d23c5 100644 --- a/lib/makeboarddeb.sh +++ b/lib/makeboarddeb.sh @@ -216,7 +216,7 @@ create_board_package() # create board DEB file display_alert "Building package" "$CHOSEN_ROOTFS" "info" - dpkg-deb -b $destination ${destination}.deb + fakeroot dpkg-deb -b $destination ${destination}.deb mkdir -p $DEST/debs/$RELEASE/ mv ${destination}.deb $DEST/debs/$RELEASE/ # cleanup diff --git a/packages/extras/firmware.sh b/packages/extras/firmware.sh index b3829cb6d5..addc3e2dbe 100644 --- a/packages/extras/firmware.sh +++ b/packages/extras/firmware.sh @@ -43,7 +43,7 @@ build_firmware() cd $SRC/cache/sources # pack mv armbian-firmware${FULL} armbian-firmware${FULL}_${REVISION}_${ARCH} - dpkg -b armbian-firmware${FULL}_${REVISION}_${ARCH} >> $DEST/debug/install.log 2>&1 + fakeroot dpkg -b armbian-firmware${FULL}_${REVISION}_${ARCH} >> $DEST/debug/install.log 2>&1 mv armbian-firmware${FULL}_${REVISION}_${ARCH} armbian-firmware${FULL} mv armbian-firmware${FULL}_${REVISION}_${ARCH}.deb $DEST/debs/ || display_alert "Failed moving firmware package" "" "wrn" } diff --git a/packages/extras/tools.sh b/packages/extras/tools.sh index ca9c7b3927..aa7888ff67 100644 --- a/packages/extras/tools.sh +++ b/packages/extras/tools.sh @@ -55,7 +55,7 @@ compile_tools() cd $tmpdir/armbian-tools-${RELEASE}_${REVISION}_${ARCH} find . -type f ! -regex '.*.hg.*' ! -regex '.*?debian-binary.*' ! -regex '.*?DEBIAN.*' -printf '%P ' | xargs md5sum > DEBIAN/md5sums cd $tmpdir - dpkg -b armbian-tools-${RELEASE}_${REVISION}_${ARCH} >/dev/null + fakeroot dpkg -b armbian-tools-${RELEASE}_${REVISION}_${ARCH} >/dev/null mv $tmpdir/armbian-tools-${RELEASE}_${REVISION}_${ARCH}.deb $DEST/debs cd $SRC/cache rm -rf $tmpdir