The revised PKGBUILD which incorporates a build of sudopwd
pkgname=piclone-git
pkgver=r160.8b9c6c6
pkgrel=1
pkgdesc="Raspberry Pi system clone utility"
arch=(x86_64 i686 armv7h aarch64)
url="https://github.com/raspberrypi-ui/piclone"
license=(GPL2)
depends=(gtk3 glib2 parted dosfstools e2fsprogs coreutils util-linux zenity dbus gvfs)
makedepends=(git intltool meson cmake wayland-protocols)
# uncomment to add the install script
#install=piclone.install
source=(
"git+https://github.com/raspberrypi-ui/piclone.git"
"https://archive.raspberrypi.com/debian/pool/main/s/sudopwd/sudopwd_0.3.tar.xz"
)
sha256sums=('SKIP'
'd4989ff0ea15ce4b0bc53f9b5b04fba96e003865eb7a9d6b75228f98c56c3d31')
pkgver() {
cd piclone
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
prepare() {
# piclone
cd "${srcdir}/piclone"
if [[ -d builddir ]]; then
rm -r ./builddir
fi
meson setup builddir --prefix=/usr
# sudopwd
cd "${srcdir}/sudopwd"
if [[ -d builddir ]]; then
rm -r ./builddir
fi
meson setup builddir --prefix=/usr
}
build() {
# piclone
cd ${srcdir}/piclone/builddir
meson compile
# sudopwd
cd ${srcdir}/sudopwd/builddir
meson compile
}
package() {
local piclone_src="${srcdir}/piclone"
local sudopwd_src="${srcdir}/sudopwd"
# install piclone files
install -D -t "${pkgdir}/usr/share/applications" ${piclone_src}/builddir/data/piclone.desktop
install -D -t "${pkgdir}/usr/share/piclone" ${piclone_src}/data/piclone.ui
install -D -t "${pkgdir}/usr/bin" ${piclone_src}/builddir/src/piclone
install -d "${pkgdir}/usr/share/locale"
cp -r ${piclone_src}/po/* ${pkgdir}/usr/share/locale
# install sudopwd files
install -D -t "${pkgdir}/usr/bin" ${sudopwd_src}/builddir/src/sudopwd
install -D -t "${pkgdir}/usr/share/sudopwd" ${sudopwd_src}/src/sudopwd.ui
install -D -t "${pkgdir}/usr/share/applications" ${sudopwd_src}/data/sudopwd.desktop
}
As noted above the uuid binary called in the source is not found on Arch Linux. A workaround is to symlink uuidgen as uuid
sudo ln -s /usr/bin/uuidgen /usr/bin/uuid
Technically one could (should) add a piclone.install to create a symlink to uuidgen binary but as I will no longer maintain the PKGBUILD I have not done so.
Sample piclone.install script to create the uuid symlink to uuidgen
post_install() {
ln -s /usr/bin/uuidgen /usr/bin/uuid
}
post_remove() {
rm /usr/bin/uuid
}
Remember to run updpkgsums or makepkg --geninteg and update the sha256sums array.
EDIT
It turns out I was wrong… I was confused by the sheer number of times I was challenged to authorise the app.
The final package works - with the caveat that it will ask for password for every privileged action and this is quite a lot…
- the app creates new partitions on the target device
- it formats the partitions
- it mounts an existing partition to a temporary mount
- it mounts the target partition to a temporary mount
All of these actions will require the operator to provide the authorisation using sudopwd.
I am thinking the reason it does so on an Arch Linux system is related to the fact that a Raspberry Pi OS has a sudo configuration that allows the app to run without the need to ask for permissions for every action.
Yet another reason to use the shrink-backup script linked above…
I have updated the AUR source with the changes - but as I have no desire to continue maintenance - the delete request still stands…
EDIT:
Curiosity…
Looking into how a pi desktop is constructed - I realise it uses wayland, hence the added builddep on wayland-protocols.
But my test sd card is running an old barebone Manjaro with lxqt desktop added and it is using X11 - I think the PKGBUILD dependencies needs a cleanup.
EDIT:
Do you have a download location for EndeavourOS ARM running on Wayland?
Don’t bother - I found it https://github.com/endeavouros-arm/images/releases
EDIT:
After testing using latest image and setting up Plasma - the piclone utility fails to copy the sd-card.
I appears the utility expects/requires the source partition table to be MSDOS style and therefore it refuses to work.
Yet another reason to use the shrink-backup script.