-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
89 lines (72 loc) · 4.31 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
THIS SOFTWARE IS VERY INCOMPLETE
INTRODUCTION
- CYOS is a thin layer of package management for GNU/Linux with a focus on Git.
- Some degree of intimacy with the usage of GNU/Linux and Git is assumed.
- Instructions are provided to build a "core" set of packages and introduce the underlying concepts of CYOS.
PREPARING CORE
- Boot into an existing GNU/Linux host system.
- The host must have reasonably recent versions of the packages listed in the file "core".
- Prepare a reasonably large (20GiB+) filesystem.
- Export the shell variable CYOSROOT to the absolute path of this filesystem.
# cd "$CYOSROOT/"
# git clone git://github.com/cinolt/cyos.git
# cd cyos/
# mkdir git/ && cd git/
# for url in $(cat ../core-clone); do git clone --bare --depth 1 "$url"; done
- "core-clone" contains URL's for the "core" packages with Git repositories.
# cd ..
# mkdir tar/ && cd tar/
# wget -i ../core-get
- "core-get" contains URL's for the "core" packages with only release tarballs.
# cd ..
# mkdir work/ && cd work/
# for tar in ../tar/*; do tar xf "$tar" --no-same-owner; done
# for work in *; do ../init.sh "$work"; done
- "init.sh" initializes Git repositories from working directories.
# cd ../git/
# for git in *; do ../apply.sh "$git"; done
- "apply.sh" creates CYOS branches and applies diff's in the given repository.
# cd ..
# ./pkgio.sh
- "pkgio.sh" builds and installs "pkgio/" into "$CYOSROOT/cyos/".
# ./hier.sh
- "hier.sh" creates essential directories and symlinks in "$CYOSROOT/".
BUILDING CORE
- We build "core" with "--prefix=$CYOSROOT/usr".
- We chroot into "$CYOSROOT/"
- We rebuild "core" with "--prefix=/usr".
- We build binutils+gcc that do not search for libraries and headers belonging to the host.
- We build the rest of the "core" using the built binutils+gcc.
# TODO: set PATH
# TODO: must make sure that host gcc uses host ld and as
# for pkg in $(cat core); do ./pkg.sh "$pkg"; done
- "pkg.sh" builds and installs the given package.
- You may need to rebuild pkgio, binutils, or gcc if there are .so version mismatches between the host and CYOS, otherwise it is not necessary.
- The CYOS filesystem now contains enough packages to rebuild itself when chroot'd into.
- However the packages expect to be found in "$CYOSROOT/usr", which will appear as "/usr" post-chroot.
- We rename "$CYOSROOT/usr" to "$CYOSROOT$CYOSROOT/usr" so the original "$CYOSROOT/usr" will appear the same.
# mkdir "$CYOSROOT$CYOSROOT"
# mv "$CYOSROOT/usr" "$CYOSROOT$CYOSROOT"
# ./chroot.sh
- "chroot.sh" does ... TODO
- Leave the shell variable CYOSROOT unset.
# TODO: set PATH
# TODO: rebuild core
- The "$CYOSROOT" directory (the variable as was set pre-chroot, but now in post-chroot) is no longer needed.
- You should now prepare and build packages as appropriate for your new CYOS system.
POST-CORE CONSIDERATIONS
- For a bootable system you need to install a kernel, an init system, and configure a boot-loader as appropriate.
INTERNALS
- "pkgio/" contains 3 utilities: "pkgin", "pkgck" and "pkgout".
- "pkgin" recursively link(2)'s all files in the source directory to the destination directory, mkdir(2)'ing along the way.
- "pkgck" does the same as "pkgin" except it unlink(2)'s any successful link(2) and eventually rmdir(2)'s any successful mkdir(2), serving as a no-op to check for any obvious errors "pkgin" might encounter.
- "pkgout" unlink(2)'s files in the destination directory for each file in the source directory recursively, rmdir(2)'ing along the way.
- Every Git repository is to contain one or more "cyos-*" branches which alter the "master" branch as necessary.
- The script "diff.sh" produces diff's between each "cyos-*" branch and the "master" branch in the given repository into corresponding subdirectories of "$CYOSROOT/cyos/diff/".
- The script "apply.sh" applies these diffs into the corresponding repository.
- Every "cyos-*" branch is to contain the script ".cyos/build.sh" which builds and installs the package into the corresponding subdirectory of "$CYOSROOT/cyos/pkg/".
- "update.sh" updates a repository with a remote.
- "update-tar.sh" updates a repository without a remote but with a release tarball.
- Both update scripts rebase all "cyos-*" branches which can cause merge conflicts but should be seldom.
- "work/" and "diff/" can be regenerated from data intrinsically stored in "git/".
- "git/" can be backed up as is for future instances of CYOS.