summaryrefslogtreecommitdiffstats
path: root/README
blob: 0a6d422557638d16d6cf38d903f1ec3db8940a9d (plain)
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
    The LinHES development is divided into two different git repositories.
The first repository is linhes-pkgbuild, and it contains all the PKGBUILD
files that make up LinHES. The second repository is called linhes-dev and is
intended to create a chroot for all development to occur within (development
enviroment). By using a chroot development work will not affect the existing
LinHES installation and can also be done on non-LinHES machines. The reason
for the linhes-pkgbuild and linhes-dev split is so that PKGBUILDs may be
downloaded and modified without requiring the entire development environment
be built.
 
------ linhes-pkgbuild -----------
 
The layout of the linhes-pkgbuild repository is:
-- abs
    |-- core
    |-- core-testing
    |-- extra
    |-- extra-testing
 
core is the set of packages that make up the "core" of LinHES. Iin other
words all the packages needed to create a fully functioning system.
 
extra contains all the packages used by LinHES, but not necessarily needed
to create a fully functioning system. For example this would include
mplayer, xine and Chrome.

The core and extra repositories are intended for the current public release
and are considered stable. The core-testing and extra-testing repositories
are intended for developers and testers in preparing the next release.
 
------ linhes-dev ----------------
 
    linhes-dev contains the tools and scripts for a working development
environment. However, linhes-dev is not a working development by itself.
A working development enviroment also needs linhes-pkbuild. The script
setup_env.sh will do all the work in creating a working development
environment. Get setup_env.sh at: http://linhes.org/repo/setup_env.sh

    The setup_env.sh script will download and install the required packages
(by default, from the current stable release) into a directory called
build_root and create a script that can be used to enter the chroot. 

     Because LinHES can support multiple architectures, setup_env.sh
requires arguments telling it which architecture to work with as well 
as which repository (stable or testing) you'd like to develop on.
Beginning with R8.0 x86_64 is the only working architecture option.

	For example, running "setup_env.sh x86_64 testing" will create a 
working x86_64 LinHES development environment named build_root.x86_64 using 
the testing repos. setup_env.sh also creates an empty directory called pkg_repo,
this is used by kmsync.sh (which will be discussed later). Likewise, running
"setup_env.sh x86_64 release" will create a development enviroment using
the core and extra repos.
 
    To enter the chroot development environment run: "sudo ./enter_build_root.x86_64"
        The enter_build_root.x86_64 script will take care of the following things:
        a) mounting proc,sys,dev/pts
        b) bind mounting linhes-dev/build_tools to build_root/build_tools
        c) bind mounting linhes-pkgbuild to build_root/data/linhes-pkgbuild
        d) bind mounting pkg_repo to build_root/data/pkg_repo.
        e) unmount the above directories when leaving the chroot
 
The following is a list of tools available inside the chroot:
- mpv2.py
        Script to build a package from the PKGBUILD and copy it to the pkg_repo.
        v2 of mp.py with many enhancements. Must be called from the same
        directory as the PKGBUILD.

- mp.py (depreciated and replaced by mpv2.py)
        Python script to replace mp. Must be called from the same directory
        that contains the PKGBUILD.

- update_db_repo 
        Used to completely regenerate the the local package database.
        Takes two arguments  the directory with packages, and the name of
        the repository.  Example:
        update_db_repo  /data/pkg_repo/i686/core-testing core-testing
 
- kmsync.sh (testing|release|chroot-devel|source[testing|release|chroot-devel]
        This script is used to synchronize the contents of the compiled
        packages on linhes.org and the ones on your local machine. 
        The script takes 1 or 2 arguments telling it which repository with which
        to sync up.  The first time it's run with any given option the local
        directory (/data/pkg_repo/x86_64/core|extra|chroot-devel)
                MUST MUST MUST be empty.   
        Please use this script with care, any changes that are made in the
        local mirror will be copied to the linhes.org server.
        This includes the possibility to completely erase all the packages.
        Normally the source packages are synced when the binary packages are
        synced. The source option is present to force an update, and isn't
        normally required to be run.
 
        Finally this script uses a shared user account on linhes.org that
        is a locked account. SSH keys must be setup for this script to work.

- build_tools/go.sh (depreciated; replaced by build_tools/archiso-19/mythvantage/go.sh)
        Menu driven frontend to create an ISO with selected profile.
        The following profiles are available to create an iso.
    a ) x86_64-RELEASE-REMOTE
        Create an iso from the release repo using packages from linhes.org
    b ) x86_64-testing-REMOTE
        Create an ISO from the testing repo using packages from linhes.org
    c ) x86_64-testing-local
        Create an ISO from the testing repo using packages from the local mirror
    d ) x86_64-testing-local-httpdir-structure
        Create an ISO from the testing repo using packages from a local web
        server name "localmirror"
 
        After the process finishes it will let you know the final name and
location of the resulting ISO. For any of the local profiles to work, it
requires that kmsync.sh be run at least once to populate the local mirror.
 
------ Quick Start ------------------
Example process to create the chroot and build an ISO.
############
Create the chroot for x86_64 (see above).
 
Make sure base-devel is installed: pacman -S base-devel
Make sure you have the following entries in /etc/pacman.conf:
 
[core-testing]
Server = http://linhes.org/repo/x86_64/core-testing
 
[extra-testing]
Server = http://linhes.org/repo/x86_64/extra-testing
 
Then run: pacman -Syu
 
Checkout the repo. You will need to have been given a dev account on 
linhes.org. This involves creating a public ssh key and supplying it to
one of the linhes.org admins. The key is created using ssh-keygen. The 
resulting public key will be stored in .ssh/id_rsa.pub.
 
The recommended location for the checkout is /myth/dev.
        cd /myth/dev
 
- Restricted dev accounts should use
        git clone $USER@linhes.org:linhes-pkgbuild
        git clone $USER@linhes.org:linhes-dev
 
- Unresticted dev account should use
        git clone ssh://$USER@linhes.org/mount/repository/linhes-dev
        git clone ssh://$USER@linhes.org/mount/repository/linhes-pkgbuild
 
- Edit linhes-dev/templates/pacman.conf.chroot. Comment out the core and 
extra lines and uncomment the core-testing and extra-testing.
 
- Run these commands:
        cd linhes-dev/
        sudo ./setup_env.sh x86_64
        cd ..
 
- Set up the ssh keys inside the build root. If the ssh public key you 
provided to the linhes.org admin was created by root on an r6 install:
        cp -R /root/.ssh build_root.x86_64/root/.ssh
 
- Then to enter the chroot:
        sudo ./enter_dev_chroot.x86_64
 
-- To build an ISO from linhes.org:
        cdb <= alias to build_tools
        cd archiso-19/mythvantage/
        ./go.sh
         (select x86_64-testing-REMOTE)
 
-- To build an ISO locally:
Before running kmsync.sh for the first time, for reasons explained above, 
ensure the local directories (/data/pkg_repo/x86_64/core|extra)
are empty. Then run:
 
        kmsync.sh testing
        cd archiso-19/mythvantage/
        ./go.sh
          (Select x86_64-testing-local)
 
#---------
############
Commands used to build a package (tar in this example), and update linhes.org

Before building ANY packages you __MUST__ run "kmsync.sh testing" at least once 
while the local package directories are still empty. Doing this step now will avoid 
sync headaches down the road.
 
cdl  <= alias that takes you the the top level PKGBUILD directory
cd core
cd tar
vi PKGBUILD  <= edit and increment pkgrel by 1; remove md5sums
mpv2.py --md5  <= builds the package and all dependencies and copies the pkg to
                  pkg_repos; --md5 is optional but will remove the md5sums in PKGBUILD

# At this point you should test the package, either by building
# a new iso or installing the package.

# In order to make your source change(s) available to others, you will have
# to commit your change(s) to your local copy of the linhes-pkgbuild repo.
# If this is your first time using the git command, set up your user name
# and email address (You only need to do this once, not every time):

  git config --global user.name "Your Name"
  git config --global user.email "you@yourdomain.com"

# Next, commit your changes to your local linhes-pkgbuild repo:

  git commit -a -m "commit message"

# and then push the change(s) to the public repo:

  git push

# In order to make your new package(s) available to others, you will need to
# upload changed packages using kmsync.sh:

kmsync.sh testing  <= this will pull down all new packages from linhes.org
                      and upload the new tar package. This will also sync up 
                      the src packages.
 
-----------------------
Misc.
Directory structure after a functioning chroot is created for x86_64
|-- linhes-pkgbuild
|-- linhes-dev
|-- build_root.x86_64
|-- enter_dev_chroot.x86_64.sh
`-- pkg_repo
 
-----------------------
# End