Typo
[linux_from_scratch_hints.git] / OLD / lfscd-remastering-howto-6.1.txt
blob6cba8bb8f31d05e5ff59499f75718d81669f5e58
2 AUTHOR:         Sylvie Migneault <alisou@alixe.org>
4 DATE:           2005-11-07
6 LICENSE:        GNU Free Documentation License Version 1.2
8 SYNOPSIS:       lfscd-remastering-HOWTO
10 DESCRIPTION:    This is a guide that will show you how to remaster LFSliveCD-x86-6.1-3
11                 Note: commands should appear on one line, after the symbol #
13 PREREQUISITES:  - at least 1 GB of FREE RAM+Swap total (e.g. 256M ram, and 750M swap AVAILABLE)         
14                 - 2 GB free on a Linux filesystem formatted disk partition      
15                 - Host System with SquashFS supported
16                 - mksquashfs tools
17                 - mkisofs tools
18                 - link: http://squashfs.sourceforge.net
20 HINT:
22 Contents
23 --------
25     1. Host System Requirements
26     2. LiveCD's structure  
27     3. My working environment
28     4. Boot from the lfslivecd-x86-6.1-3 and mount it
29     5. Mount the work partition, create directories
30     6. Uncompress .root.sqfs
31     7. Copy CD's contents into lfscd (not .root.sqfs)
32     8. Install mksquashfs
33     9. chroot into lfshd
34    10. Install any programs
35    11. Create .root.sqfs
36    12. Create iso file
37    13. Burn and test
40 1. Host System Requirements
41    ------------------------
43         I use lfslivecd-x86-6.1-3 because SquashFS is supported by the kernel.
44         If you want to use your Linux system, patch your kernel with SquashFS.
45         
47 2. LiveCD's structure
48    ------------------
50         /boot
51         /sources
52         .root.sqfs
54         I work with ".root.sqfs" file
57 3. My working environment
58    ----------------------
59         
60         /dev/hdc                my CD drive
61         /mnt/cdrom              content of lfslivecd-x86-0.6-3
62         /mnt/hda5               my working partition
63         /mnt/hda5/lfscd         content of final CD
64         /mnt/hda5/lfshd         chroot environment
65         /mnt/hda5/lfsiso        content of ISO files
66         /mnt/hda5/lfstmp        tempory directory
69 4. Boot from the lfslivecd-x86-6.1-3 and mount it
70    ----------------------------------------------
72         # mkdir /mnt/cdrom
73         # mount /dev/hdc /mnt/cdrom
75                 
76 5. Mount the work partition, create directories
77    --------------------------------------------
79         # mkdir /mnt/hda5
80         # mount /dev/hda5 /mnt/hda5
81         # cd /mnt/hda5
82         # mkdir lfscd lfshd lfstmp lfsiso
85 6. Uncompress .root.sqfs
86    ---------------------
88         # cd /mnt/cdrom
89         # mount .root.sqfs /mnt/hda5/lfstmp -o loop
90         # cd /mnt/hda5/lfstmp
91         # cp -Rp * /mnt/hda5/lfshd
92         # cd ..
93         # umount lfstmp/
94         
96 7. Copy LiveCD's content into lfscd (not .root.sqfs)
97    -------------------------------------------------
99         # cd /mnt/cdrom
100         # cp -Rp * /mnt/hda5/lfscd
101         # cd ..
102         # umount cdrom/
105 8. Install mksquashfs
106    ------------------
107         
108         Before starting, i have downloaded squashfsXX.tar.gz
109         at this URL http://squashfs.sourceforge.net
110         copy it into /sources
112         If squashfsXX.tar.gz is on floppy
113         Insert floppy in the floppy drive
114         # mkdir /mnt/floppy
115         # mount /dev/fd0 /mnt/floppy
116         # cd /mnt/floppy
117         # cp squashfsXX.tar.gs /sources
118         # cd ..
119         # umount floppy/
120         # cd /sources
121         # tar -xvf squashfsXX.tar.gz
122         # cd squashfsXX
123         # cd squashfs-tools
124         # make
126         install mksquashfs into host system
127         # cp mksquashfs /usr/sbin
129         install mksquashfs into chroot environment
130         # cp mksquashfs /mnt/hda5/lfshd/usr/sbin
133 9. chroot into lfshd
134    -----------------
136         create the environment variable TOTO,
137         verify the output
139         # export TOTO=/mnt/hda5/lfshd
140         # echo $TOTO
141         
142         Make sure the output shows is:
143         /mnt/hda5/lfshd
145         run the following command:
146         # chroot "$TOTO" /usr/bin/env -i \
147                 HOME=/root TERM="$TERM" PS1='\u:\w\$ ' \
148                 PATH=/bin:/usr/bin:/sbin:/usr/sbin \
149                 /bin/bash --login +h
151         reference:
152         http://www.linuxfromscratch.org/lfs/view/stable/chapter06/chroot.html
153         
155 10. Install any programs
156     --------------------
158         - ./configure 
159         - make
160         - make install
161         - ...
162         - for exit the chroot environment:
164         # exit
167 11. Create .root.sqfs
168     -----------------
170         # cd /mnt/hda5
171         # mksquashfs lfshd/ /mnt/hda5/lfscd/.root.sqfs
174 12. Create iso file
175     ---------------
177         mkisofs tool is not present on lfslivecd-x86-6.1-3.
178         
179         umount all:
180         # cd /
181         # umount /mnt/hda5
183         Reboot your PC unless lfslivecd.
184         Create ISO file with this command:
186         # mkisofs -pad -l -r -J -v -V "LFS_CD" -no-emul-boot -boot-load-size 4 -boot-info-table \
187                 -b boot/isolinux/isolinux.bin -c boot/boot.cat -hide-rr-moved \
188                 -o /mnt/hda5/lfsiso/livecd-remaster.iso /mnt/hda5/lfscd
191 13. Burn and test
192     -------------
194         «Have a fun!» ;-)
196 ACKNOWLEDGEMENTS:
198         The team of «Linux from scratch» and all users.
199         All users wich contribute at the OpenSource project.    :-)
201 CHANGELOG:
203    [2005-11-07]
204     * Initial hint.