Commit Graph

53 Commits

Author SHA1 Message Date
Jan Steffens 0af05a48ab Use Btrfs snapshots for chroot copies, when available
This is much faster than using Rsync to clone.

Rsync stays available when the chroots are not on a Btrfs.
2011-03-22 19:47:48 +01:00
Jan Steffens 174ff59dba Add flock-based locking to chroots
This prevents accidents when chroots are shared between multiple users.
2011-03-22 19:47:32 +01:00
Jan Steffens 3491ea5d79 Syntax cleanup
No functional change.
2011-03-14 02:31:20 +01:00
Pierre Schmitz bcf8cd7eb1 mkarchroot: return 0 if there was no package to update in SyncFirst 2011-01-08 17:29:56 +01:00
Pierre Schmitz 14ba11dcdf mkarchroot: pass inline shell script to chroot 2011-01-06 10:28:10 +01:00
Pierre Schmitz d09d34d77a mkarchroot: Ensure all packages have been updated
In reference to FS#22304 run pacman -Su again if there are still updates available.
This is the case for packages listed in SyncFirst.
2011-01-06 09:22:57 +01:00
Pierre Schmitz 7a369b3c35 mkarchroot: add missing devices nodes
/dev/tty, /dev/tty0 and /dev/full
2010-12-04 15:03:15 +01:00
Pierre Schmitz d6792db31c mkarchroot: create a minimal /dev instead of using the one of the host 2010-12-02 13:09:34 +01:00
Pierre Schmitz 394d9c8b54 Create pacman sync dir on chroot creation
See https://bugs.archlinux.org/task/21125
2010-11-16 13:27:33 +01:00
Pierre Schmitz db7a90ccd2 Use pacman to determine the host's mirror 2010-09-11 19:25:54 +02:00
Pierre Schmitz 2f18ca1836 Use findmnt to generate a mtab
Instead of just copying the hosts mtab use findmnt. This way only reachable mount points are shown.
2010-08-22 20:26:33 +02:00
Pierre Schmitz fc6efdc38a reduce pacman's verbosity 2010-08-17 19:30:54 +02:00
Pierre Schmitz 87f5eb6300 Use host mirror in chroot environment
* Set first enabled mirror found mirrorlist as mirror within the chroot.
* If the mirror is local bind its directory read-only into the chroot.
* Fallback is the kernel.org mirror.
2010-08-17 19:23:16 +02:00
Pierre Schmitz 1418bfbf42 Use default locale instead of copying from host
Use en_US.UTF-8 and de_DE.UTF-8 by default (the latter is needed for some packages like gcc)
2010-08-17 18:38:47 +02:00
Pierre Schmitz cfddde22be Fix typo 2010-08-16 21:30:44 +02:00
Pierre Schmitz f7b67c25ff Provide /dev/{shm,pts} within chroot
implements FS#20246
2010-08-12 18:26:07 +02:00
Pierre Schmitz 85251a1d7b removed mode lines; was not a good idea after all 2010-06-24 10:01:20 +02:00
Eric Bélanger 5036f1250e mkarchroot: Added default pacman cache in usage help
Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2010-02-21 19:34:11 +01:00
Pierre Schmitz 362a99b995 apply common coding style 2010-02-13 19:47:16 +01:00
Allan McRae 7a8130fec8 Further fixes to cache_dir handling
1) Typo cachedir -> cache_dir
2) Use $cache_dir when calling pacman

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2010-02-13 15:55:23 +01:00
Allan McRae a6e1f8cfd3 Read cachedir from pacman.conf in working dir
This allows setting a different cachedir for (e.g.) i686 and x86_64
chroots.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2010-02-13 09:57:49 +01:00
Pierre Schmitz 70d7baee68 set umask to 0022
this fixes commit 7ce9cd6965
2010-02-13 07:22:54 +01:00
Pierre Schmitz 9e14e8691d Fall back to default if CacheDir is not set 2010-02-12 10:14:04 +01:00
Pierre Schmitz c39e59892d make sure pacman cache dir exists 2010-02-11 23:28:02 +01:00
Pierre Schmitz 30cfcdc501 Add missing -n option to getopt list for mkarchroot
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2010-02-11 14:41:45 +01:00
Pierre Schmitz 3e3b32641d Reduce verbosity to a sane minimum 2010-02-11 12:49:28 +01:00
Pierre Schmitz 16dd1fe6e0 Read pacman cache dir from pacman.conf or cli 2010-02-11 11:23:41 +01:00
Byron Clark 7ce9cd6965 Reset umask before touching the chroot.
This prevents problems when running with a umask that masks permissions
for others.

Signed-off-by: Byron Clark <byron@theclarkfamily.name>
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2010-01-11 10:25:43 -08:00
Aaron Griffin 9dd60741bd Add a param to NOT copy config files to the chroot
This is primarilly needed for archiso creation, but
could be useful elsewhere.

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-01-24 16:52:54 -06:00
Aaron Griffin a80fe69f4b Only run locale-gen if the target root has /etc/locale.gen
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-10-20 01:09:43 -05:00
Simo Leone e0f139ad0e Separate mounting from config copying
Copying the configs before installing stuff
caused conflicts. Running the host's pacman
uses the host's configuration anyway, so
there is no need to copy them in this case.

Signed-off-by: Simo Leone <simo@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-06 10:09:07 -06:00
Aaron Griffin a8a3c856bf Remove DBPath from mkarchroot
No longer needed in pacman 3.1

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-01-23 16:11:38 -06:00
Aaron Griffin bc8a791ad6 Copy resolv.conf each time just like mtab
Resolv.conf changes, like mtab, so we can't just trust it to copy on build only

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2007-11-28 22:18:26 -06:00
Aaron Griffin 5472d5ab5a Fixed a typo (mkarchchroot -> mkarchroot)
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2007-11-28 21:28:29 -06:00
Dan McGee f05495dfc8 Whitespace fixes/cleanup to all of the scripts
Add the same vim modeline to all the files, as well as cleanup the newly
added scripts a bit. If you look at this diff with the -w option, you'll see
it really isn't all that significant.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-28 21:20:24 -06:00
Dan McGee f7ab112f9a Use user's locale.gen instead of sed-magic
The sed-magic was wrong in many cases, including my default locale:
LANG=en_US.utf8
locale.gen line: en_US.UTF-8

If we copy the user's locale.gen file, we will generate all of their locales
instead of just the current one.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-28 14:44:59 -06:00
Dan McGee e23b176f3e Fix some bashisms (but change #! to /bin/bash)
We need to use bash due to the usage of arrays, but we might as well fix
some bashisms that were used in the scripts anyways.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-28 09:10:41 -06:00
Armin Luntzer e71c9784b5 mkarchroot: create $working_dir/etc (fixes error msg when trying to copy /etc/mtab during chroot creation)
Signed-off-by: Jason Chu <jchu@xentac.net>
2007-11-27 16:45:28 -08:00
Armin Luntzer e16136b8e8 mkarchroot: copy /etc/resolv.conf to chroot
Signed-off-by: Jason Chu <jchu@xentac.net>
2007-11-27 16:45:28 -08:00
Armin Luntzer 9e660ee86e mkarchroot: add -M switch for a custom makepkg.conf
Signed-off-by: Jason Chu <jchu@xentac.net>
2007-11-27 16:45:28 -08:00
Jason Chu e782cbd00b Copy mtab over to chroot so that pacman can detect disk space 2007-11-04 14:55:42 -08:00
Jason Chu 3ce2983ad6 Pass $RUN to chroot so that all the params are expanded properly 2007-11-04 14:55:02 -08:00
Jason Chu b528eba028 Install the custom pacman.conf in the chroot so that it can be used for later updates 2007-11-03 09:57:26 -07:00
Daniel Isenmann 7bb2c48c8f add -C option to mkarchroot
Signed-off-by: Jason Chu <jchu@xentac.net>
2007-11-03 09:40:18 -07:00
Dan McGee a6863ff7cb mkarchroot: move check for root below option parsing
This way people can at least see the usage instructions.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-10-29 21:31:16 -05:00
Dan McGee 67dc59299a mkarchroot: clean up/unify output messages
Also remove an extra EUID check, we do this at the beginning.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-10-29 21:31:16 -05:00
Jason Chu 26fc26adf8 Make sure that var/lib/pacman is created
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2007-10-23 23:51:15 -05:00
Aaron Griffin a26b93d779 Added 'update' to mkarchroot
Allows automated updating of a chroot

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2007-10-23 23:50:39 -05:00
Aaron Griffin 0b7d43615b Added GPL headers
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2007-10-21 21:08:55 -05:00
Aaron Griffin a336e5a91c Generate current locale in new chroots by default
This is a slightly hackish way of auto-filling locale information based on the
locale at the time of chroot building.

Further locale changes must be done manually.

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2007-10-07 12:30:30 -05:00