[arch-general] [PATCH] devtools: give a writable home to nobody for use in makechrootpkg

Gaetan Bisson bisson at archlinux.org
Mon Aug 23 05:21:20 EDT 2010


This is to ensure $HOME is a writable directory during makechrootpkg
runs. I suspect this is helpful to build various packages - in the
example I have in mind (uim in [extra]), the home directory was
determined by getpwuid(getuid())->pw_dir, so simply exporting a new HOME
environment variable in the PKGBUILD wasn't enough.


diff -aur devtools-0.9.9/mkarchroot devtools-0.9.9.new/mkarchroot
--- devtools-0.9.9/mkarchroot	2010-08-20 12:44:16.000000000 +0200
+++ devtools-0.9.9.new/mkarchroot	2010-08-23 11:11:45.036666760 +0200
@@ -194,5 +194,9 @@
 	if [ ! -e "${working_dir}/.arch-chroot" ]; then
 		date +%s > "${working_dir}/.arch-chroot"
+	# give nobody a writable home (for makechrootpkg)
+	chroot "${working_dir}" usermod -d /build nobody
 	# }}}

More information about the arch-general mailing list