1 -*- mode:text; eval:(footnote-balloons) -*-
2 Time-stamp: <Saturday Mar 8, 2014 17:30:08 steve>
7 Here are the tools I use for package management on bastard. It is
8 based _very_ heavily on the LFS hint:
10 "More control and package management using package users (v1.4)"
12 Which I have included in this repo (see LFS-pkgusr-hint.txt) and is
13 considered essential reading.
15 The main differences (enhancements?) these tools have over the
16 original LFS hint are:
18 o A set of convenience shell functions for pkg users, and a
19 pseudo "master installer"[1]
21 o Make it easy to give individual settings to each pkg user.
22 For example, some pkg users may need ssh/gnupg or $DISPLAY
25 o Better build script and .project templates
27 As of v1.4 of the hint, Matt uses a central build script
28 and each pkgusr has a "build.conf"... an interesting idea
29 and I may switch to that method one day, but for now I use
30 a build script for each pkgusr.
32 o Better uninstall script.
34 o Most of the "wrapper" scripts have been updated or
37 o Includes a `which' script.
39 o Includes a `/bin/mail' script.
41 o Includes a `lesspipe.sh' script (unashamedly stolen from
42 Pat Volkerding and Slackware. Thanks, Pat!)
44 o A more complete list of "install" directories.
45 Everyone's needs and tastes are different so not everything
46 I have in my list of install directories you'll want. Edit
49 o Includes an elisp library that implements much of the
50 convenience shell functions. [2]
52 o Allow pkgusr to run ldconfig as root safely via a wrapper
55 Matt uses a setuid C wrapper that calls execve(2) to do
56 this. Which, IMO, is not the right way to go.
59 You should understand that not everything here can be used straight away.
60 The /bin/mail script, for example, needs Zsh, and Sendmail installed
61 (could probably be rewritten to use bash with very little effort); the
62 ldconfig wrapper needs sudo; if you want to set yourself up as a "master
63 installer", OpenSSL and OpenSSH are needed; and pkgusr.el needs SXEmacs
64 (or XEmacs/Emacs) obviously.
69 1. Install bison, flex, nano, and less (in that order) into your
70 /tools dir. Bison, and flex are needed to build binutils in the
71 chroot. And nano and less make life for the package user so
74 As of LFS SVN-20140303, they still do not install bison and
75 flex in chapter 5. I think it might be because they install
76 the binutils from gnu (eww), whereas I install the _proper_
77 optimised for Linux binutils from kernel.org which requires
78 bison/flex. It is also odd that in chapter 6 when they do
79 install these 2 packages, they do them in the wrong order
80 (bison should be done before flex).
82 2. At the point in the book where it has you mount the devpts
83 filesystem, it neglects to mention that you have to specify a
85 mount -vt devpts devpts ${LFS}/dev/pts -o gid=5,mode=620
87 Update: I think LFS has this now, but check anyway.
89 3. Install sudo into your /tools dir. Sudo is used to let pkgusrs
90 run ldconfig as root, thereby bypassing the annoyance of getting
91 errors about /etc/ld.so.cache not being able to be updated.
93 I don't have a LFS build chain anymore so I am not 100% certain
94 if this is possible, but I cannot think of any reasons why it
95 shouldn't be. Let me know if you have an issue with this step.
97 4. When creating the initial /etc/group file, I don't use the LFS
98 book suggestions. I have my own set groups that I've been using
99 since 1995, and old habits are so hard to break. :-)
101 Anyhoo, here's my initial group file...
136 Step 1... Go read that LFS hint. You'll probably want to read it
137 through a couple of times.
139 Step 2... Don't follow the instructions in the LFS hint for how to set
140 things up and where to dump the scripts etc. Instead see the next
141 section, "Pkgusr Specific Installation".
143 Pkgusr Specific Installation
144 ============================
146 In the hint it tells you how where and when to put the helper scripts and
147 stuff, which is great, but I have not included the "more-control-scripts"
148 tarball in this repo. I've rewritten/tweaked most of the scripts and
149 split them out into their respective directories so that I can easily
150 modify and track them. Because of that you may get a little lost in
151 aligning what the hint says to the files you have in this repo.
155 Right _BEFORE_ installing linux libc headers at start of Chap 6 in the
160 From _OUTSIDE_ the chroot environment
170 PKGUSR=/path/to/your/pkgusr/repo/working/dir && ## Yeah, edit this bit!
171 cp -va ${PKGUSR}/etc/pkgusr ${LFS}/etc &&
172 chown -vR 0:0 ${LFS}/etc/pkgusr &&
173 install -v -m711 -o0 -g0 -d ${LFS}/etc/sudoers.d &&
174 install -v -m440 -o0 -g0 ${PKGUSR}/etc/sudoers.d/99-pkgusr \
175 ${LFS}/etc/sudoers.d &&
176 install -v -m644 ${PKGUSR}/installdir.lst ${LFS}/root &&
177 install -v -m755 ${PKGUSR}/bin/{which,mail} ${LFS}/bin &&
178 install -v -m755 ${PKGUSR}/usr/bin/* ${LFS}/bin &&
179 install -v -m750 -o0 -g9999 -d ${LFS}/usr/lib/pkgusr &&
180 install -v -m550 -o0 -g9999 ${PKGUSR}/usr/lib/pkgusr/* \
181 ${LFS}/usr/lib/pkgusr &&
182 install -v -m755 ${PKGUSR}/usr/sbin/{add_package_user,install_package} \
184 install -v -m755 ${PKGUSR}/usr/sbin/{group,user}add ${LFS}/tools/bin &&
187 From this point on you need to re-enter the chroot environment. So
188 these next (and final) steps are done _INSIDE_ the chroot (as root).
190 Create the install group:
191 ------------------------
193 groupadd -g 9999 install
196 Set up the install directories:
197 ------------------------------
198 (you did peruse and edit this list getting rid of things you know for
199 sure you won't need, didn't you?)
202 if [ ! -d ${dir} ]; then
203 install -v -m1775 -o0 -g9999 -d ${dir}
205 done < /root/installdir.lst
210 ln -sv /tools/lib/libncurses.so.5 /usr/lib/libncursesw.so.5
212 (don't forget you'll have to remove that before you install ncurses
215 Alright, where are we up to now? Well, in the LFS hint you are up to:
217 7.2 Walkthrough: Installing linux-libc-headers
219 And in the LFS book, you are up to:
221 6.7. Linux-3.13.5 API Headers
223 So have fun building the rest of your LFS system!
227 [1] The "master installer" is just someone who can change their
228 identity to a pkg user. It _could_ be root, though I don't
229 recommend it. I use a ssh->root->su->pkgusr from my personal A/C
230 which is a single "step" (I'm not stopping in a root shell).
232 [2] pkgusr.el is probably fairly SXEmacs-centric, but should work
233 with perhaps minor changes on XEmacs or even GNU/Emacs.