mirror of
https://github.com/armbian/build
synced 2025-09-24 19:47:06 +07:00
Use fakeroot for dpkg-deb packaging
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 \
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user