From 7df987a652b93d55dd8eca363706d3bacc469b55 Mon Sep 17 00:00:00 2001 From: William Harrington Date: Thu, 27 Nov 2014 16:29:31 -0600 Subject: Initial commit message for lfs live howto. --- book/building.html | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 book/building.html (limited to 'book/building.html') diff --git a/book/building.html b/book/building.html new file mode 100644 index 0000000..68b6794 --- /dev/null +++ b/book/building.html @@ -0,0 +1,22 @@ + +6.1. Building the USB live system

6.1. Building the USB live system

Creating the USB live system is quite easy. Either install your LFS/BLS system on the USB media, if you used a package manager, or copy your system to the USB media:

Because you're propably running the wanted system now, let's repeat a little part of the LFS book; create the directory structure

mkdir -pv -m 755 $LFSMOUNT/{bin,boot,dev/{pts,shm},etc,home,include,lib,media,mnt,opt,proc,run,sbin,share,srv,sys,usr}
+mkdir -pv -m 755 $LFSMOUNT/var/{opt,cache,lib/{misc,locate},local,log,mail,spool} 
+install -dv -m 0750 $LFSMOUNT/root
+install -dv -m 1777 $LFSMOUNT/tmp $LFSMOUNT/var/tmp
+ln -s /run $LFSMOUNT/var/run
+ln -s /run/lock $LFSMOUNT/var/lock

Udev populates /dev so copying /dev is not necessary. However create some basic device nodes:

mknod -m 600 $LFSMOUNT/dev/console c 5 1
+mknod -m 666 $LFSMOUNT/dev/null c 1 3
+mknod $LFSMOUNT/dev/ram0 b 1 0 

Now copy the system:

cp -av /bin /boot /etc /include /lib /opt /sbin /share /srv /usr $LFSMOUNT

Modify mtab and fstab in etc

echo "" > $LFSMOUNT/etc/mtab
+echo "# Begin /etc/fstab" > $LFSMOUNT/etc/fstab
+echo >> $LFSMOUNT/etc/fstab
+echo "# file system   mount-point    type    options           dump  fsck" >> $LFSMOUNT/etc/fstab
+echo "#                                                              order" >> $LFSMOUNT/etc/fstab
+echo >> $LFSMOUNT/etc/fstab
+echo "LABEL=$LFSLIVE  /              ext3    defaults          1     1" >> $LFSMOUNT/etc/fstab
+echo "proc            /proc          proc    defaults          0     0" >> $LFSMOUNT/etc/fstab
+echo "sysfs           /sys           sysfs   defaults          0     0" >> $LFSMOUNT/etc/fstab
+echo "devpts          /dev/pts       devpts  gid=4,mode=620    0     0" >> $LFSMOUNT/etc/fstab
+echo "tmpfs           /run           tmpfs   defaults          0     0" >> $LFSMOUNT/etc/fstab
+echo >> $LFSMOUNT/etc/fstab
+echo "# End /etc/fstab" >> $LFSMOUNT/etc/fstab
+

Copy our previous created initrd.gz to /boot of the media.

cp <PATH-TO-INITRD>/initrd.gz $LFSMOUNT/boot

-- cgit v1.2.3-54-g00ecf