On Wednesday 10 November 2010 15:06:28 robert baker wrote: > Back in June I created a patch that covered the command list through > chapter 5. > > I was working with ALFS as I went ensuring the quality of the edits. > The patch can be found in my directory. > > http://www.linuxfromscratch.org/~rbaker/ > > I had yet to even look at the books text. I was only merging the text > file project's progress with the current LFS command list. I was > making edits beyond chapter 5 but never finished. > > Losing the reboot actually makes the patch method considerably less > painful. I never could decide the bast way to approach the problems > inserting another chapter into the book would create using a patch. > > If you would like help editing the XML I would be happy to help. (I > know how much you hate it.) > > RBaker
Hi. Sorry for taking so long to reply. I haven't looked at your patch in a while. I'm just trying to do some catch up work right now. I did some experimenting with the package system. The previous idea of running 'make install' into / as a normal user doesn't work very well. 'make install' likes to change ownership and permissions on directories via the 'install -d' command. The Trip hint doesn't work well when /usr and other directories are on other partitions. What seems to be working best is the fakeroot hint... installing to a fake root as a normal user, and using root to copy the files over to /. This allows for packages to be made if desired, programs to be stripped before installing, group write permissions can be fixed, and using cp -i prevents overwriting existing files. This is what I have: # Kernel headers: # As user 'pkg': make mrproper make headers_check make INSTALL_HDR_PATH=dest headers_install find dest/include \( -name .install -o -name ..install.cmd \) -delete mkdir -pv /tmp/linux-2.6.32.25-headers/DESTDIR/usr/include cp -rv dest/include/* /tmp/linux-2.6.32.25-headers/DESTDIR/usr/include # As 'root': cd /tmp/linux-2.6.32.25-headers/DESTDIR # Install directories that do not already exist: for dir in $(find . -type d); do if test ! -d /$dir; then install -v -d -o bin -g sys /$dir; fi; done # Change ownership to bin:sys, and drop write permission: find . -type f -exec chown bin:sys {} \; -exec chmod -w {} \; # Copy files to /, preserving the bin:sys ownership, and prompting before # overwriting an existing file: for file in $(find . -type f); do cp -vi --preserve=ownership $file /$file; done # Create a file list, removing the leading '.', and compress it: find | sed 's...@^.@@' | bzcat -z > \ /var/db/packages/linux-2.6.32.25-headers.txt.bz2 chown bin:sys /var/db/packages/linux-2.6.32.25-headers.txt.bz2 chmod -w /var/db/packages/linux-2.6.32.25-headers.txt.bz2 # Man pages: # As user 'pkg': make DESTDIR=/tmp/man-pages-3.25/DESTDIR install # As 'root': cd /tmp/man-pages-3.25/DESTDIR for dir in $(find . -type d); do if test ! -d /$dir; then install -v -d -o bin -g sys /$dir; fi; done find . -type f -exec chown bin:sys {} \; -exec chmod -w {} \; for file in $(find . -type f); do cp -vi --preserve=ownership $file /$file; done find | sed 's...@^.@@' | bzcat -z > \ /var/db/packages/man-pages-3.25.txt.bz2 chown bin:sys /var/db/packages/man-pages-3.25.txt.bz2 chmod -w /var/db/packages/man-pages-3.25.txt.bz2 Tar can't be used to copy the files to / because tar does not have an option to prompt before overwriting an existing file (like cp -i). The 'install' command doesn't have an option like this either. If binary packages are made, then tar can be used because conflicting file names would have been identified already. This can be cleaned up a bit more, but it seems to work fine. If 'cp -i' finds a conflicting file, bzgrep in /var/db/ can find which other package shares the file. Su-ing up and and down is a bit messy, so I think using a PKGTMP=/tmp/DESTDIR set in user 'root' and user 'pkg' environment, and 'cd $PKGTMP/man- pages-3.25', would be a little easier to work with. Something else I thought of is identifying hard links in the fake root directory, and recreating them as relative soft links so they're easier to copy or tar. Otherwise the hard links become duplicate files. After adding the gcc patches to chapter 6 I plan to start adding the changes for this package system, modify the 'creating directories' page to change ownerships, and get rid of root owning files where possible. robert
signature.asc
Description: This is a digitally signed message part.
-- http://linuxfromscratch.org/mailman/listinfo/hlfs-dev FAQ: http://www.linuxfromscratch.org/faq/ Unsubscribe: See the above information page