360 Commits

Author SHA1 Message Date
Colin Walters
5f3b029638 ostbuild: Flesh out chroot build to use ostbuild-user-chroot
One thing that made this take significantly longer than it might
have otherwise is that we have to keep PWD "up to date" - otherwise
we hit bugs in glibc's getcwd() implementation.
2011-12-19 21:44:32 -05:00
Colin Walters
28a5714abd gnomeos: Pull in ostree from working copy directly
We'll just try to keep it stable.
2011-12-19 21:43:51 -05:00
Colin Walters
557487b1c7 core: Install unversioned .so, and kill .la file
This avoids Yocto barfing on a versioned shared library symbolic link
without a -dev package.
2011-12-18 18:37:48 -05:00
Colin Walters
11d57d63e3 core: Support --owner-uid and --owner-gid options for commit
This allows us to more easily import user-built tarballs into
a root-owned OSTree repo.
2011-12-18 17:36:46 -05:00
Colin Walters
a287274935 tests: Ensure we quote grep pattern
Otherwise we fail if the pattern starts with -
2011-12-18 17:35:30 -05:00
Colin Walters
134283afbf core: In user mode checkouts of archives, use hard links
Now that we've done all the gyrations to separate content from
metadata in archives, we can just hard link when doing user checkouts.
2011-12-15 16:12:31 -05:00
Colin Walters
e014b2d9c2 core: Fix a few memory leaks 2011-12-15 15:17:27 -05:00
Colin Walters
c9c4dbfb22 gnomeos: Don't make device files
We don't need them any more inside a chroot now that we have
ostbuild-user-chroot.
2011-12-15 15:03:29 -05:00
Colin Walters
9a71ab187d core: INCOMPATIBLE CHANGE: Split archive files in two parts (meta and content)
This will allow us to have hardlink checkouts of archives.  A key use
case here is an archive repo of an OS (with root-owned files etc.)
where we want to do builds in a user tree.

A positive side effect of doing things this way is that now the SHA256
checksums for a given file should be identical regardless of whether
it's stored in an archive or bare repository.
2011-12-15 13:14:06 -05:00
Colin Walters
ecbffd4915 core: Don't insert null byte in temporary file names 2011-12-15 13:10:41 -05:00
Colin Walters
8ab2296a70 core: Add utility functions to convert a OstreeObjectType to/from a string 2011-12-15 13:09:51 -05:00
Colin Walters
b8e8b58585 core: INCOMPATIBLE CHANGE: Name repo files with their type (e.g. .dirmeta)
This makes inspection easier.  Internally the code gets simpler because
metadata and files are more unified; there is just one object type.
2011-12-12 12:29:09 -05:00
Colin Walters
db9b7b7be6 osbuild: Make a MS_NOSUID bind mount over /
This closes a serious issue in that we still do a uid switch to 0 when
executing a suid binary, even though we're not gaining capabilities.
2011-12-12 12:13:32 -05:00
Colin Walters
dc4164993b core: Initialize variables in fsck
Otherwise we segfault on an unhandled filename.
2011-12-08 18:23:25 -05:00
Colin Walters
d3058629fd core: Change fsck to use packfile parsing API 2011-12-08 18:04:37 -05:00
Colin Walters
f6117de8d3 core: s/pack/archived/
This completes the rename from the previous commit.
2011-12-08 17:45:37 -05:00
Colin Walters
d6ceb91c35 core: Make ot_transfer_out_value() take a & for the second argument
As Ray Strode argued, it's confusing to have something that looks like
a function be magical.  And OT_TRANSFER_OUT_VALUE is uglier.
2011-12-08 17:31:45 -05:00
Colin Walters
35fa68a74c core: INCOMPATIBLE CHANGE: Rename .packfile to .archive
It's too confusing that we call the mode "archive" but the actual
files ".packfile".  Also, git already has a "packfile" that serves a
totally different purpose.
2011-12-08 17:15:59 -05:00
Colin Walters
30c53a967c core: Switch is_archive to an enumeration
This is in preparation for adding a third mode.
2011-12-08 17:05:16 -05:00
Colin Walters
7932811fbb core: Delete some dead code 2011-12-08 14:55:41 -05:00
Colin Walters
dccd106731 core: Clean up checkout code
Take a GFile * for destination.  Also, we only need one recursive
function, not two.
2011-12-08 10:28:44 -05:00
Colin Walters
15d23546ff user-chroot: Add --unshare-pid, --unshare-net, and --mount-proc
To use CLONE_NEWPID we have to actually call clone() because it's
not supported by unshare().

To enable CLONE_NEWPID to be useful, we have to allow creating a new
proc mount rather than binding an existing one.
2011-12-07 10:52:42 -05:00
Colin Walters
fbb09d71a6 ostbuild: Add --unshare-ipc flag for user-chroot
This optionally closes down more paths to the host, which is
a good thing.
2011-12-07 09:48:38 -05:00
Colin Walters
d70950e891 core: Add -U option for checkout to skip lchown() and xattrs
This is useful for checking out an OS filesystem tree as a regular
user, and not caring about /dev and stuff.
2011-12-06 21:38:04 -05:00
Colin Walters
a94e0b8bf8 core: Ensure we chown created directories too 2011-12-06 20:16:03 -05:00
Colin Walters
c32141c2bf core: Remove some useless wrapping of packfile unpacking in checkout 2011-12-06 20:09:09 -05:00
Colin Walters
5c7f019580 ostbuild: Compile and install ostbuild-user-chroot
It still needs to be made setuid.
2011-12-06 19:37:01 -05:00
Colin Walters
fb5ecdac42 ostbuild: Also allow making directories read-only 2011-12-06 19:36:42 -05:00
Colin Walters
a4b249e333 ostbuild: Clarify "safely" for user-chroot 2011-12-06 14:39:30 -05:00
Colin Walters
d32b2cb572 ostbuild: Recursively make mount points private
This ensures we're not going to mutate any global state.
2011-12-06 14:36:57 -05:00
Colin Walters
3042724698 ostbuild: Allow binding arbitrary directories, don't hardcode /proc /dev
This is just more flexible, and eventually we want this to be a
generic user-chroot tool.
2011-12-06 14:06:45 -05:00
Colin Walters
0fb40b201f ostbuild: Ensure user chroot mounts are not shared
It's possible that the root filesystem mount is global; we need
to undo that in order to be sure that our "private" bind mounts
really are private.
2011-12-06 12:18:17 -05:00
Colin Walters
e68d0d25c0 ostbuild: Update user-chroot to bind mount /proc and /dev 2011-12-06 10:43:01 -05:00
Colin Walters
ce7345d51e core: Major cleanup to internal import API 2011-12-05 14:21:18 -05:00
Colin Walters
b8000c00d5 core: Further unify code for importing from local FS and libarchive
Note this change makes it so we no longer call link() from an import
filesystem tree to the repository.  This is a Good Thing really; it
makes local FS commits slower, but also less prone to corruption.
2011-12-05 11:20:14 -05:00
Colin Walters
267bf8ef4a core: Ensure we initialize checksum in FIFO case too 2011-12-05 11:15:12 -05:00
Colin Walters
9d39517554 core: Add _from_input variant of checksum API 2011-12-05 10:28:42 -05:00
Colin Walters
7093ed4c57 ostbuild: ostbuild-user-chroot: New Linux-specific utility for safe chroots 2011-12-04 17:09:03 -05:00
Colin Walters
f812720fc6 gnomeos: Make run script transparently update existing FS image
This is noticeably faster.
2011-12-04 14:56:21 -05:00
Colin Walters
26de73ea55 gnomeos: commit-yocto-build.sh: Directly import tar files
Oh wow...this is fast.
2011-12-04 14:55:33 -05:00
Colin Walters
78f435d245 core: Fix handling of hardlinks for tar commits
We were creating files with the wrong name.  Add a test.
2011-12-04 14:38:30 -05:00
Colin Walters
17cc772cf3 core: Support for committing from any libarchive-supported format
We really want the ability to take a .tar.gz and directly import
it into a repository, without creating a temporary filesystem tree.

First, doing it this way is significantly faster.  Also, this allows
us to handle importing tar files with e.g. uid 0 files into packed
repositories as non-root, which is very useful for tests and builds.
2011-12-04 14:08:55 -05:00
Colin Walters
f9315e8f82 core: Fix a memory leak in checkout 2011-12-04 14:08:55 -05:00
Colin Walters
45addeadf0 core: Handle NULL xattrs in packfile generation, throw error on invalid mode 2011-12-04 13:12:06 -05:00
Colin Walters
56e0f231b5 core: Correctly map S_ISDIR to G_FILE_TYPE_DIRECTORY 2011-12-04 13:12:06 -05:00
Colin Walters
ae3a5e3c07 core: Clean up filename utility API
Remove more unused functions, and change pathname splitting to handle
more cases like duplicate //, and to throw an error on .. as a filename.
2011-12-04 12:12:34 -05:00
Colin Walters
1f6d49cdb9 core: Initialize checksums for non-regular files, handle NULL xattrs 2011-12-04 12:11:29 -05:00
Colin Walters
7545405b73 core: Delete some dead utility code 2011-12-02 19:54:53 -05:00
Colin Walters
0003e101f6 core: New ot_transfer_out_value() macro
This makes out values considerably less typing.
2011-12-02 18:17:06 -05:00
Colin Walters
32c8166b25 core: Ensure we clean up leftover directories during merge
(Not sure why this regressed)
2011-12-02 17:58:45 -05:00