1 AUTHOR: (original) Thomas Foecking <thomas@foecking.de> and
2 Christian Hesse <mail@earthworm.de>
3 (updates) Jimmy Anderson <jimmy.anderson1056@gmail.com>
7 LICENSE: GNU Free Documentation License Version 1.2
9 SYNOPSIS: Easy Bootable CD of your LFS
14 With a little effort, a bootable CD/DVD can be created from an LFS system.
15 The CD created by this hint could be used as a rescue CD, an LFS build
16 system, or for whatever other purpose the user can concoct.
18 Briefly the bootable CD provides a root filesystem that is
19 sourced mostly by the (read only) CD contents but with a few
20 certain directories overlayed by ram and thus writable.
22 Briefly, the procedure is: a CD bootloader is
23 added to the LFS system, a kernel and a ramdisk is created, which
24 when booted, mounts the LFS system (written on CD) as the root filesystem
25 and then overlays portions of it with a ram based filesystem which
26 allows the user to 'write' to some portions of the CD based file system.
28 This hint does not create a "live CD". The end result of this hint is a
29 LFS system that runs off of CD but with only a few directories
30 being 'writable' by the user and with (except for /tmp) only a
31 small (few megabytes) amount of writable space. /tmp will be overlayed
32 by a tmpfs file system and (typically) have 100's of megabytes of space.
34 If instead, a live CD is desired, the LFS LiveCD project, or one of
35 the other Live CD projects may be a more appropriate resource to use.
36 The value of this 'bootable CD' is that it is simple to do, and
37 easy to modify and fix.
39 The instructions in this hint have been tested with X86 LFS 6.6 & 6.7.
40 It probably will work with other current LFS books as well. It also
41 works for building a PowerPC bootable CD. This hint assumes 32bit cpu.
43 Note that the instructions in this hint are executed as root. As such, it is
44 possible that a mistyped or misunderstood instruction could destroy the
45 data and/or OS on your system. It is prudent to back up any important
46 data on your system before attempting to use this hint to create a bootable
47 CD. Ideally, you should perform this task on a system which is only
48 used by you and which you can easily reinstall without difficulty. That
49 way, any mistakes you make will not affect others and will have minimal
50 impact on you. Fair notice...
57 Familiarity with building LFS. The build system must have a writable
58 CDROM drive and the tool set required to create (mkisofs) ISO images
59 and write them to CDs. If your system has the 'genisoimage' tool
60 instead of mkisofs, that will work fine also.
67 1. What do you need and what is the idea?
68 2. Configure & compile Kernel, add packages, other tweaks
70 4. Move /etc /var /root /home to /fake/needwrite and make symlinks
71 5. Create boot script which mounts the ramdisk
72 6. Tweaks for running with CD as root fs.
73 7. Create initial ramdisk
74 8. (Optional) compress /usr
75 9. Create initial ramdisk
80 1. What do you need and what is the idea?
81 --------------------------------------
85 First of all you need to build an LFS system, which you want to burn
86 on CD. You may want to have a LFS CD for creating new LFS systems
87 on other computers. Whatever your ideas are, you'll first have to
88 create this special system on your LFS partition.
89 (e.g. I have created a LFS system with xfree86 and windowmaker;
90 now I can boot from CD and create new LFS systems without missing
91 xfree86 & windowmaker)
93 - another linux/unix system to create some stuff and burn the CD
94 - CD-R(W) drive to burn your LFS system and boot image on CD
95 - 1 CD-R + 1 CD-RW is very recommended for saving money
97 - obtain some additional software:
99 (x86) syslinux: (contains isolinux to boot the LFS kernel on CD)
100 ftp://www.kernel.org/pub/linux/utils/boot/syslinux/syslinux-4.03.tar.gz
102 (PowerPC) yaboot: (bootloader for PowerPC)
103 http://yaboot.ozlabs.org/releases/yaboot-1.3.16.tar.gz
106 Download either syslinux (x86) or yaboot (PowerPC) as appropriate
107 for your architecture and put the source in $LFS/sources for later
112 - Create kernel with ramdisk and initrd support
113 - Move /etc /var /root /home to /fake/needwrite
115 /etc -> /fake/needwrite/etc
116 /var -> /fake/needwrite/var
117 /... -> /fake/needwrite/...
118 - Mount /dev/ram0 to /fake/ramdisk
119 - Copy /fake/needwrite/* to /fake/ramdisk/
120 - Remount /dev/ram0 to /fake/needwrite
122 We'll have read-write access on /etc /var /root /home
123 because they point to /fake/needwrite which is then a ramdisk
125 You are able to do the most things from the other linux/unix
126 system by setting LFS to your LFS mountpoint. LFS=/path/to/lfs
131 Don't forget to set LFS again when you do a reboot!
134 2. Build LFS system, configure & compile Kernel
135 --------------------------
137 Do this step in the chroot environment.
139 The first step is to build your LFS system as is described in
140 the LFS book. While in the chroot environment, you will configure &
141 build the kernel. When configuring your kernel, make sure that the
142 following kernel configuration settings are enabled
143 (as builtins, not as modules).
145 You need initrd support!
147 "<*> Initial RAM filesystem and RAM disk ..."
149 You need ramdisk support!
151 "<*> RAM block device support"
152 "(16384) Default RAM disk size"
153 "[*] Initial RAM disk (initrd) support"
155 You need ext2 file system support!
157 "<*> Second extended fs support"
159 You need ISO 9660 CDROM file system support!
161 "<*> ISO 9660 CDROM file system support"
163 You may need to compress your file system (to fit on CD), and to do so
164 will need squashfs also. It may not be required but it is best to
165 just go ahead and enable it anyway while we are building our
166 kernel to keep things simple.
168 (If compressing) You need squashfs file system support!
170 "<*> Squashfs file system support"
172 Then compile and install your kernel & modules just
173 as is described in the LFS book.
175 Copy the newly built kernel and associated .config file to /boot:
177 cp .config /boot/lfskernel.config
180 cp arch/i386/boot/bzImage /boot/lfskernel && cp System.map /boot/
183 cp vmlinux /boot/lfskernel && cp System.map /boot/
185 Set all the configuration settings described in the LFS book
186 as appropriate for your system. Especially important is that you
187 set your LFS system root password (or remove it entirely). If
188 you don't, you will not be able to login when you boot your CD.
190 Space will be tight on a CD (not so much on a DVD) so remove any
191 files and directories that are no longer needed. $LFS/tools
192 is no longer needed and should be removed. If you won't need the
193 files in $LFS/sources when running on the CD, some or all of
194 those can be removed to reduce the size of the image.
196 The /usr file system can (optionally) be compressed (later) to free up
197 space. Compressing it will reduce the size by a couple hundred megabytes
200 Using BLFS (or other techniques) add any additional packages that
201 you require in your LFS system.
203 You will not be able to create directories or files in most portions
204 of the filesystem so think ahead about what you will need to do
205 and add whatever directories or files that you might need later when
206 running on the CD. For example, maybe create /mnt/lfs and it's
207 associated /tools symlink.
211 ln -sv /mnt/lfs/tools /
214 At this point, it might be wise to save off a copy of your LFS system
215 in case you screw up and want to start over again at this point.
218 3. Install the bootloader (isolinux or yaboot)
219 -------------------------------
221 Do this step in the chroot environment.
223 We also need a bootloader on the CD to boot the kernel and ramdisk.
225 isolinux will be used for the bootloader for X86 machines.
227 yaboot will be used for PowerPC MACs. On PowerPC machines
228 that don't use openfirmware, yaboot is not used and you can skip
229 building it. For those machines, you will have to figure out the
230 boot loader installation yourself.
233 # On an X86 machine do:
234 #------------------- copy and paste ------------------------------
236 # Unpack, install and configure isolinux
239 zcat syslinux-4.03.tar.gz | tar x
241 cp syslinux-4.03/core/isolinux.bin /isolinux/
244 # If all files associated with the boot process should be in one
245 # directory we have to move kernel and the Rest of /boot to /isolinux.
249 # Now we create a symlink from boot to isolinux.
255 # Kernel & co can now be found in /boot again.
256 # But isolinux still needs a config-file, so we create it now:
258 cat > /isolinux/isolinux.cfg << "EOF"
265 append initrd=initrd.gz root=/dev/ram0 init=/linuxrc ramdisk_size=16384
269 append initrd=initrd.gz root=/dev/ram0 init=/bin/bash ramdisk_size=16384
272 # isolinux is now installed completely.
274 #------------------- end copy and paste ---------------------------
277 # It's a bit more lengthy on a PowerPC machine. Do:
278 #------------------- copy and paste ------------------------------
283 # If it isn't already installed, build and install yaboot.
286 tar xvfz yaboot-1.3.16.tar.gz
288 sed -i 's%/usr/local%/usr%' man/*
290 make PREFIX=/usr install
292 cp /usr/lib/yaboot/yaboot /ppc/mac
294 # Create an open firmware configuration file.
296 cat > /ppc/mac/ofboot.b << "EOF"
299 MacRISC MacRISC2 MacRISC3 MacRISC4
302 LFS CD PPC bootloader
306 load-base release-load-area
307 boot cd:,\ppc\mac\yaboot conf=cd:,\ppc\ppc32\yaboot.conf
311 f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8
312 f80000000000000000000000000000f8
313 f80000000000000000000000000000f8
314 f80000000000000000000000000000f8
315 f80000000000000000000000000000f8
316 f80000000000000000000000000000f8
317 f80000000000000000000000000000f8
318 f80000000000000000000000000000f8
319 f80000000000000000000000000000f8
320 f80000000000000000000000000000f8
321 f80000000000000000000000000000f8
322 f80000000000000000000000000000f8
323 f80000000000000000000000000000f8
324 f80000000000000000000000000000f8
325 f80000000000000000000000000000f8
326 f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8
327 f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8
328 f80000000000000000000000000000f8
329 f80000000000000000000000000000f8
330 f80000000000000000000000000000f8
331 f80000000000000000000000000000f8
332 f80000000000000000000000000000f8
333 f80000000000000000000000000000f8
334 f80000000000000000000000000000f8
335 f80000000000000000000000000000f8
336 f80000000000000000000000000000f8
337 f80000000000000000000000000000f8
338 f80000000000000000000000000000f8
339 f80000000000000000000000000000f8
340 f80000000000000000000000000000f8
341 f80000000000000000000000000000f8
342 f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8
343 ffffffffffffffffffffffffffffffff
344 ffffffffffffffffffffffffffffffff
345 ffffffffffffffffffffffffffffffff
346 ffffffffffffffffffffffffffffffff
347 ffffffffffffffffffffffffffffffff
348 ffffffffffffffffffffffffffffffff
349 ffffffffffffffffffffffffffffffff
350 ffffffffffffffffffffffffffffffff
351 ffffffffffffffffffffffffffffffff
352 ffffffffffffffffffffffffffffffff
353 ffffffffffffffffffffffffffffffff
354 ffffffffffffffffffffffffffffffff
355 ffffffffffffffffffffffffffffffff
356 ffffffffffffffffffffffffffffffff
357 ffffffffffffffffffffffffffffffff
358 ffffffffffffffffffffffffffffffff
364 # Create a yaboot message file
366 cat > /ppc/ppc32/yaboot.msg << "EOF"
367 MacRISC type machine...
368 ____________________________________________________
371 GNU/Linux LFS PPC - 32bit
376 # Create a yaboot configuration file.
378 cat > /ppc/ppc32/yaboot.conf << "EOF"
379 message=/ppc/ppc32/yaboot.msg
382 init-message = "\nWelcome to LFS bootCD 2 \nHit <TAB> for boot options.\n\n"
389 image=/boot/lfskernel
391 initrd=/boot/initrd.gz
392 append="rootdelay=2 init=/linuxrc root=/dev/ram0 ramdisk_size=16384"
396 image=/boot/lfskernel
398 initrd=/boot/initrd.gz
399 append="rootdelay=2 init=/bin/bash root=/dev/ram0 ramdisk_size=16384"
406 #------------------- end copy and paste ---------------------------
411 4. Move /etc /var /root /home to /fake/needwrite
412 --------------------------------------------------
414 Do this step in the chroot environment.
417 This step will all directories needing write access to /fake/needwrite
418 and create symlinks from their original locations.
420 #------------------- copy and paste ------------------------------
424 mkdir -p /fake/{needwrite,ramdisk}
426 mv etc/ var/ root/ home/ fake/needwrite/
428 # create symlinks so that everything seems to be as before
430 ln -s fake/needwrite/etc etc
431 ln -s fake/needwrite/var var
432 ln -s fake/needwrite/root root
433 ln -s fake/needwrite/home home
436 # You should see the following symlinks.
438 # etc -> fake/needwrite/etc
439 # home -> fake/needwrite/home
440 # root -> fake/needwrite/root
441 # var -> fake/needwrite/var
443 #------------------- end copy and paste ---------------------------
448 5. Create boot script which mounts the ramdisk
449 --------------------------------------------
451 Do this step in the chroot environment.
453 Ok, we have /etc /var /root /home linked to
454 /fake/needwrite which is first read-only.
455 To be able to login (and to run services on runlevel x
456 which need write access to /etc /var /root or /home)
457 we must call a script from our /etc/rc.d/init.d/ directory which
458 creates a ramdisk to /fake/needwrite with write access.
460 The following script creates a ramdisk to /fake/ramdisk and
461 will copy everything of /fake/needwrite to /fake/ramdisk.
462 Then it remounts the ramdisk to /fake/needwrite.
464 #------------------- copy and paste ------------------------------
466 cat > /etc/rc.d/init.d/create_ramdisk << "EOF"
470 dir_ramdisk=/fake/ramdisk
471 dir_needwrite=/fake/needwrite
473 source /etc/rc.d/init.d/functions
477 echo -n "Creating ext2fs on $dev_ram ... "
478 /sbin/mke2fs -m 0 -i 1024 -q $dev_ram > /dev/null 2>&1
481 echo -n "Mounting ramdisk on $dir_ramdisk ... "
482 mount -n $dev_ram $dir_ramdisk
485 echo -n "Copying files to ramdisk ... "
486 cp -dpR $dir_needwrite/* $dir_ramdisk > /dev/null 2>&1
489 echo -n "Remount ramdisk to $dir_needwrite ... "
490 umount -n $dir_ramdisk > /dev/null 2>&1
492 mount -n $dev_ram $dir_needwrite
496 echo "Usage: $0 {start}"
501 chmod 0755 /etc/rc.d/init.d/create_ramdisk
503 # create_ramdisk should be the first script excecuted by init,
504 # so we set this link:
505 # /etc/rc.d/rcsysinit.d/S00create_ramdisk -> ../init.d/create_ramdisk
507 cd /etc/rc.d/rcsysinit.d
508 ln -s ../init.d/create_ramdisk S00create_ramdisk
510 #------------------- end copy and paste ---------------------------
515 6. Configure LFS to run from CD
516 ----------------------
518 Do this step in the chroot environment.
520 Since the root filesystem will be mounted from our startup script,
521 we have to change /etc/fstab of LFS. Delete all entries you don't need.
522 (e.g. all /dev/hd*) and add /tmp as a tmpfs file system. Also, the
523 startup scripts need to be tweaked for running on a CD (file systems
524 don't need to be checked or remounted rw). And since the startup
525 script runs before the device nodes have been populated, we have to
526 manually create some device nodes for it.
529 #------------------- copy and paste ------------------------------
531 cat > /etc/fstab << "EOF"
532 # Begin /etc/fstab for a bootable CD
534 # file system mount-point type options dump fsck
536 #/dev/EDITME / EDITME defaults 1 1
537 #/dev/EDITME swap swap pri=1 0 0
538 proc /proc proc defaults 0 0
539 sysfs /sys sysfs defaults 0 0
540 devpts /dev/pts devpts gid=4,mode=620 0 0
541 tmpfs /dev/shm tmpfs defaults 0 0
542 tmp /tmp tmpfs defaults 0 0
547 # Remove file system check.
549 rm -f /etc/rc.d/rcsysinit.d/S30checkfs
551 # Disable remounting of / as rw in S40mountfs
554 cp -f mountfs origmountfs
555 grep -v 'remount' origmountfs >mountfs
558 # Ensure that /dev/loop0 exists (compressed /usr requires it).
559 mknod /lib/udev/devices/loop0 b 7 0
561 #------------------- end copy and paste ---------------------------
565 7. Create initial ramdisk
566 ----------------------
568 If you are chrooted into your LFS system, exit from chroot and return
569 to your host system. Unmount any virtual file systems that are mounted
572 To ensure that everything is in a good state for the remainder of this
573 procedure, it may be best to simply shutdown and restart your host system.
575 Make sure LFS is set after rebooting!!
579 #------------------- copy and paste ------------------------------
580 # Add device nodes that will be needed before /dev has been
583 mknod $LFS/dev/ram0 b 1 0
585 #------------------- end copy and paste ---------------------------
587 Now we create the initrd image file and filesystem.
589 #------------------- copy and paste ------------------------------
592 dd if=/dev/zero of=$LFS/boot/initrd bs=1024 count=8192
593 mke2fs -m 0 -i 1024 -F $LFS/boot/initrd
595 mount -o loop $LFS/boot/initrd $LFS/mnt
597 mkdir bin lib dev proc mnt
599 mknod $LFS/mnt/dev/ram0 b 1 0
600 mknod $LFS/mnt/dev/null c 1 3
601 mknod $LFS/mnt/dev/zero c 1 5
602 mknod $LFS/mnt/dev/console c 5 1
603 mknod $LFS/mnt/dev/ttyS0 c 4 64
604 mknod $LFS/mnt/dev/sr0 b 11 0
605 mknod $LFS/mnt/dev/sr1 b 11 1
606 mknod $LFS/mnt/dev/sda b 8 0
607 mknod $LFS/mnt/dev/sdb b 16 0
608 mknod $LFS/mnt/dev/sdc b 32 0
609 mknod $LFS/mnt/dev/sdd b 48 0
610 mknod $LFS/mnt/dev/hda b 3 0
611 mknod $LFS/mnt/dev/hdb b 3 64
612 mknod $LFS/mnt/dev/hdc b 22 0
613 mknod $LFS/mnt/dev/hdd b 22 64
614 mknod $LFS/mnt/dev/hde b 33 0
616 cp $LFS/bin/{bash,mount,grep,umount,echo} $LFS/mnt/bin/
617 cp $LFS/usr/bin/test $LFS/mnt/bin/
618 cp $LFS/usr/sbin/chroot $LFS/mnt/bin/
619 cp $LFS/sbin/pivot_root $LFS/mnt/bin/
620 ln -s bash $LFS/mnt/bin/sh
621 ln -s test $LFS/mnt/bin/[
623 cp $LFS/lib/{libncursesw.so.5,libdl.so.2,} $LFS/mnt/lib/
624 cp $LFS/lib/{libc.so.6,libreadline.so.6} $LFS/mnt/lib/
625 cp $LFS/lib/{libhistory.so.6,libblkid.so.1,libuuid.so.1} $LFS/mnt/lib/
626 if [ -f $LFS/lib/ld-linux.so.2 ]
628 cp -f $LFS/lib/ld-linux.so.2 $LFS/mnt/lib/
630 if [ -f $LFS/lib/ld.so.1 ]
632 cp -f $LFS/lib/ld.so.1 $LFS/mnt/lib/
636 # cat, sleep & mknod are optional, but often useful to have when something
637 # gos wrong so put them in the initrd also.
639 cp $LFS/bin/{cat,sleep,mknod} $LFS/mnt/bin/
641 # The first program executed by the kernel is /linuxrc. As it does not
642 # exist we create it. Our script will find the CD in the correct
643 # CD-ROM drive and then mount it as rootfs / and run /sbin/init 3.
646 cat > $LFS/mnt/linuxrc << "EOF"
650 #ID is the volume id / label of the LFS boot CD that will be looked for.
653 echo "ID=\"LFS_$(date +%Y%m%d)\"" >> $LFS/mnt/linuxrc
655 cat >> $LFS/mnt/linuxrc << "EOF"
658 PATH="/bin:/sbin:/usr/bin:/usr/sbin"
660 #this script searches for cdrom devices and then tries to find
661 #the LFS boot CD in order to mount it as / (rootfs)
663 #you need following programs:
664 #- /bin/sh (e.g. bash)
666 #- [ (which is linked to test)
673 #you need following devices:
674 #- /dev/hd*, /dev/sd*, /dev/sr* or /dev/cdrom*
677 #you need following directories:
681 CHECK_TYPE="try_mount"
683 if [ ! -d "/proc/" ]; then
687 mount -n proc /proc -t proc
689 #1. Create a list of possible cdrom devices.
691 CDROM_LIST="/dev/sr0 /dev/sr1 /dev/cdrom /dev/hda /dev/hdb /dev/hdc /dev/hdd
692 /dev/hde /dev/sda /dev/sdb"
694 #2. now we try to find the LFS boot CD (we use ID as identification)
697 echo "Using $CHECK_TYPE"
698 for cdrom_device in $CDROM_LIST
700 echo -n "Checking $cdrom_device ... "
702 if [ "$CHECK_TYPE" = "try_mount" ]; then
703 mount -n -t iso9660 $cdrom_device $TMP_MOUNT > /dev/null 2>&1
707 if [ $media_found -eq 0 ]; then
709 echo -n "media found"
710 if [ "$CHECK_TYPE" = "try_mount" ]; then
711 [ -e "$TMP_MOUNT/$ID" ]
715 if [ "$CHECK_TYPE" = "try_mount" ]; then
716 umount -n $cdrom_device > /dev/null 2>&1
719 if [ $media_lfs -eq 0 ]; then
720 echo ", LFS boot CD found. Ready!"
721 LFS_CDROM_DEVICE="$cdrom_device"
724 echo ", not LFS boot CD."
733 #3. mount LFS CD as / (root fs)
734 if [ "$LFS_CDROM_DEVICE" = "" ]; then
736 echo "No LFS boot CD found!!! You will have to fix this to continue"
737 echo "do: mount -n -o ro -t iso9660 'your cd device' $TMP_MOUNT"
738 echo "Then exit shell to continue"
743 echo "Booting from $LFS_CDROM_DEVICE ... "
745 mount -n -o ro -t iso9660 $LFS_CDROM_DEVICE $TMP_MOUNT
749 umount -n /mnt/proc >/dev/null 2>&1
750 exec chroot . sh -c 'umount -n /mnt >/dev/null 2>&1;\
751 exec -a init.new /sbin/init 3'\
752 <dev/console >dev/console 2>&1
756 # To make this script executable run
758 chmod 0755 $LFS/mnt/linuxrc
760 # Ok, that's it. Unmount the image and compress it.
764 gzip $LFS/boot/initrd
766 #------------------- end copy and paste ---------------------------
769 8) (Optional) compress /usr.
771 This step is optional. It's only needed if your media is
772 too small or if you just want to minimize the size of the ISO
775 Before you go further, check the size of your LFS tree:
779 Verify that it will fit on your media (approx 700MB for a CD..)
781 If it will not fit, and there isn't anything that can easily
782 be removed to make it fit, you can compress the /usr file
783 system to reduce the size by a couple hundred megabytes.
785 To compress your $LFS/usr directory, use mksquashfs to create
786 a 'squashed' version of $LFS/usr, remove the original $LFS/usr
787 and modify $LFS/etc/fstab to mount the squashed /usr during
790 The kernel squashfs support does not universally work with
791 any squashfs filesystems. Make sure you are using
792 a version of squashfs tools (likely version 4 or better...)
793 which creates squashfs files that are compatible with your
796 chroot is in /usr and must be moved to /sbin if compression
799 #------------------- copy and paste ------------------------------
800 mv $LFS/usr/sbin/chroot $LFS/sbin/chroot
801 mksquashfs $LFS/usr $LFS/usr.sqsh
803 cat >> $LFS/etc/fstab << "EOF"
804 /usr.sqsh /usr squashfs loop,ro 0 0
806 #------------------- end copy and paste ---------------------------
809 9. Create Boot CD ISO Image
812 If you have a CD-RW you may want to use it for testing. When
813 your system boots quite good from CD-RW you can burn it on a CD-R.
814 (I give you this advice, because I got the clue after burning
815 about 10 CD-Rs that didn't work ;-)
817 Because linuxrc must be able to identify the CD you have to create a
818 file called "LFS_YYYYMMDD".
820 #------------------- copy and paste ------------------------------
821 touch $LFS/LFS_$(date +%Y%m%d)
822 #------------------- end copy and paste ---------------------------
824 Now create the ISO image of your bootable CD.
827 #------------------- copy and paste ------------------------------
831 mkisofs -R -l -L -D -b isolinux/isolinux.bin -c isolinux/boot.cat \
832 -no-emul-boot -boot-load-size 4 -boot-info-table -V "LFS_$(date +%Y%m%d)" \
835 #------------------- end copy and paste ---------------------------
837 # On a powerpc do this:
838 #------------------- copy and paste ------------------------------
840 # Create a mapping file.
842 cat > $LFS/boot/map.hfs << "EOF"
843 # ext. xlate creator type comment
844 .b Raw 'chrp' 'tbxi' "bootstrap"
845 yaboot Raw 'unix' 'boot' "bootstrap"
846 .conf Ascii 'unix' 'text' "config"
847 .msg Ascii 'unix' 'text' "text"
848 * Raw '????' '????' "unknown"
854 mkisofs -r -V "LFS_$(date +%Y%m%d)" -iso-level 4 -chrp-boot -hfs \
855 -part -probe -no-desktop \
856 -hfs-bless $LFS/ppc/mac -map $LFS/boot/map.hfs \
857 -b ppc/mac/yaboot -no-emul-boot \
858 -hide-rr-moved -o lfsbootcd.iso $LFS
860 #------------------- end copy and paste ---------------------------
863 9a) Burn the ISO image
866 The ISO image lfsbootcd.iso is complete. Either use your favorite
867 CD burning tools to burn it or use the cdrecord utility as such:
870 dev=0,0,0 is the device number of your CD-Writer
871 Check your SCSI devices with "cdrecord -scanbus"
872 speed=4 should be changed to (max) speed of your CD-Writer.
873 If you are using a CD-RW add blank=fast to the cdrecord-command!
875 cat lfsbootcd.iso |cdrecord -v -eject dev=0,0,0 speed=4 -
881 Reboot and let your Bios boot from CD. (On PowerPC press the
882 and hold the 'c' key after reset).
884 /tmp will have lots of free space (approx 1/2 of your RAM).
885 The remaining 'writable' directories (/home and such) will
886 have about 10meg of free space for you to use.
888 Enjoy the kernel messages and login prompt ;-)
890 ------------------------------------------------------------------
893 Special thanks for bug reports and help to:
894 David Maus <oneyed@gmx.de>
899 Thomas Foecking <thomas@foecking.de>
900 Christian Hesse <mail@earthworm.de>
902 Updated: Jimmy Anderson <jimmy.anderson1057@gmail.com>
903 Updated to current LFS, added /usr/compression and
904 building for PowerPC. Adjusted hint format to template.