28
NCHU System & Network Lab NCHU System & Network Lab Lab #1 Lab #1 Install Linux & How to Install Linux & How to Build Live CD Build Live CD Operating System Lab

Lab #1 Install Linux & How to Build Live CD

  • Upload
    nathan

  • View
    66

  • Download
    5

Embed Size (px)

DESCRIPTION

Lab #1 Install Linux & How to Build Live CD. Operating System Lab. Install Linux. Install Linux(1/6). There are two methods to install and execute Linux. Directly Install with CD or DVD By VM Install Linux on a VM (Virtual Machine) VM (Virtual Machine) - PowerPoint PPT Presentation

Citation preview

Page 1: Lab #1  Install Linux & How to Build Live CD

NCHU System & Network LabNCHU System & Network Lab

Lab #1 Lab #1 Install Linux & How to Build Live Install Linux & How to Build Live

CDCDOperating System Lab

Page 2: Lab #1  Install Linux & How to Build Live CD

NCHU System & Network LabNCHU System & Network Lab

Install LinuxInstall Linux

Page 3: Lab #1  Install Linux & How to Build Live CD

NCHU System & Network LabNCHU System & Network Lab

Install Linux(1/6)Install Linux(1/6)

• There are two methods to install and execute Linux.– Directly

• Install with CD or DVD

– By VM• Install Linux on a VM (Virtual Machine)

• VM (Virtual Machine)– A virtual machine is software that creates a virtualized

environment between the computer platform and its operating system.

Page 4: Lab #1  Install Linux & How to Build Live CD

NCHU System & Network LabNCHU System & Network Lab

Install Linux(2/6)Install Linux(2/6)

Page 5: Lab #1  Install Linux & How to Build Live CD

NCHU System & Network LabNCHU System & Network Lab

Install Linux(3/6)Install Linux(3/6)

Page 6: Lab #1  Install Linux & How to Build Live CD

NCHU System & Network LabNCHU System & Network Lab

Install Linux(4/6)Install Linux(4/6)

Page 7: Lab #1  Install Linux & How to Build Live CD

NCHU System & Network LabNCHU System & Network Lab

Install Linux(5/6)Install Linux(5/6)

Page 8: Lab #1  Install Linux & How to Build Live CD

NCHU System & Network LabNCHU System & Network Lab

Install Linux(6/6)Install Linux(6/6)

Select swap & ext3

Swap:1024MB/ :20480MB

Page 9: Lab #1  Install Linux & How to Build Live CD

NCHU System & Network LabNCHU System & Network Lab

Install Linux with VM(1/5)Install Linux with VM(1/5)

• Use VMware

Page 10: Lab #1  Install Linux & How to Build Live CD

NCHU System & Network LabNCHU System & Network Lab

Install Linux with VM Install Linux with VM (2/5)(2/5)

Page 11: Lab #1  Install Linux & How to Build Live CD

NCHU System & Network LabNCHU System & Network Lab

Install Linux with VM Install Linux with VM (3/5)(3/5)

The data of VM will be save there

Page 12: Lab #1  Install Linux & How to Build Live CD

NCHU System & Network LabNCHU System & Network Lab

Install Linux with VM Install Linux with VM (4/5)(4/5)

Page 13: Lab #1  Install Linux & How to Build Live CD

NCHU System & Network LabNCHU System & Network Lab

Install Linux with VM Install Linux with VM (5/5)(5/5)

change set

Page 14: Lab #1  Install Linux & How to Build Live CD

NCHU System & Network LabNCHU System & Network Lab

Build Live CDBuild Live CD

Page 15: Lab #1  Install Linux & How to Build Live CD

NCHU System & Network LabNCHU System & Network Lab

What is Live CDWhat is Live CD

• Live CD is a simple and small operating system– Executed upon boot, without installation on a hard drive.– It saves a lot of time to install OS and save the space of HD.– When your OS has some mistakes that make your PC can n

ot boot, we can use Live CD to save your important data.– We can build a Live CD which is easy to customise with th

e user's preferred applications.

Page 16: Lab #1  Install Linux & How to Build Live CD

NCHU System & Network LabNCHU System & Network Lab

Live CD-Step1-1Live CD-Step1-1

• Live-cd tools RPM– Squashfs-tools and yum are needed by Live-cd tool

• Squashfs is a file system for Live CD• yum install squashfs-tools• yum install yum

• Get live-cd tools RPM– http://people.redhat.com/davidz/livecd/i386/– Get and install livecd-tools-001-1.i386.rpm .

• wget -c http://people.redhat.com/davidz/livecd/i386/livecd-tools-001-1.i386.rpm

• rpm -ivh livecd-tools-001-1.i386.rpm

Page 17: Lab #1  Install Linux & How to Build Live CD

NCHU System & Network LabNCHU System & Network Lab

Live CD-Step1-2Live CD-Step1-2• livecd-creator commands

– livecd-creator • No packages specified. usage: livecd-creator [--help]

[--repo=<name1>,<url1> ...] [--repo=<name2>,<url2>] --package=<p1> [--package=<p2> ...] [--exclude-package=<e1>] --exclude-package=<e2> ...] [--base-on=<path-to-iso-file>] [--fslabel=<label>]

• --help : Print usage and exit • --repo : Path to yum repository • --package : Include this package • --exclude-package : Exclude this package • --base-on : Add packages to an existing live CD iso9660 image • --fslabel : File system label (default: livecd-YYYYMMDD-HHMI)

Page 18: Lab #1  Install Linux & How to Build Live CD

NCHU System & Network LabNCHU System & Network Lab

Live CD-Step2Live CD-Step2• Create the local data storage of fedora core 6

– Get and install createrepo.• wget -c http://tqmcube.com/files/createrepo-0.4.3-5.1.noarch.rpm• rpm -ivh createrepo-0.4.3-5.1.noarch.rpm

– Creating a local repository of core packages• mkdir –p /var/www/html/repo/core/• cp <PATH TO RPMs> /var/www/html/repo/core/

– Can download form internet or fedora core 6• createrepo /var/www/html/repo/core/

– It may need some time to copy.

Page 19: Lab #1  Install Linux & How to Build Live CD

NCHU System & Network LabNCHU System & Network Lab

Live CD-Step3Live CD-Step3

• Createrepo– Creating a local repository of configuration packages

• mkdir –p /root/Desktop/base_packages• cd /root/Desktop/base_packages • wget -c

http://people.redhat.com/davidz/livecd/i386/fedora-livecd-6-1.i386.rpm

• createrepo /root/Desktop/base_packages

Page 20: Lab #1  Install Linux & How to Build Live CD

NCHU System & Network LabNCHU System & Network Lab

Live CD-Step4Live CD-Step4

• Creating a minimal Live CD – livecd-creator

--repo=c6,file:///var/www/html/repo/core --package=bash --package=kernel --package=grub--repo=lcd6,file:///root/Desktop/base_packages--package=fedora-livecd --fslabel=Fedora-minimal-LiveCD

Page 21: Lab #1  Install Linux & How to Build Live CD

NCHU System & Network LabNCHU System & Network Lab

Live CD with GNOMELive CD with GNOME

• Createrepo– Creating a local repository of configuration packages

• mkdir –p /root/Desktop/newbase_packages• cd /root/Desktop/newbase_packages • wget -c http://people.redhat.com/davidz/livecd/i386/fedora-livecd-

6-1.i386.rpm• wget -c http://people.redhat.com/davidz/livecd/i386/fedora-livecd-g

nome-6-1.i386.rpm• wget -c http://people.redhat.com/davidz/livecd/i386/fedora-livecd-d

esktop-6-1.i386.rpm• createrepo /root/Desktop/newbase_packages

Page 22: Lab #1  Install Linux & How to Build Live CD

NCHU System & Network LabNCHU System & Network Lab

Live CD with GNOMELive CD with GNOME• fedora-livecd-gnome bases on fedora-base and with GNOME.• fedora-livecd-desktop bases on fedora-gnome and provides ma

ny api and other utilities for GNOME.

Page 23: Lab #1  Install Linux & How to Build Live CD

NCHU System & Network LabNCHU System & Network Lab

Live CD with GNOMELive CD with GNOME

• livecd-creator --repo=c6,file:///var/www/html/repo/core --repo=lcd6,file:///root/Desktop/newbase_packages --package=fedora-livecd-gnome --repo=e6,http://download.fedora.redhat.com/pub/fedora/linux/extras/6/i386 --fslabel=My-Fedora-LiveCD-1

Page 24: Lab #1  Install Linux & How to Build Live CD

NCHU System & Network LabNCHU System & Network Lab

Adding New Packages to An Existing Adding New Packages to An Existing Live CD ISOLive CD ISO

• livecd-creator --repo=c6,file:///var/www/html/repo/core --base-on=old-live-cd.iso --package=package --fslabel=My-LiveCD-New

Page 25: Lab #1  Install Linux & How to Build Live CD

NCHU System & Network LabNCHU System & Network Lab

Creating Custom Configuration Creating Custom Configuration PackagesPackages

• fedora-livecd-gnome.conf• In fedora-livecd-gnome-6-1.i

386.rpm– Extract Here– Modify etc/livecd/20-fedora-li

vecd-gnome.conf

Page 26: Lab #1  Install Linux & How to Build Live CD

NCHU System & Network LabNCHU System & Network Lab

Creating New RPMsCreating New RPMs

• Spec:– http://people.redhat.com/davidz/livecd/spec/fedora-livecd.s

pec– cd /usr/src/redhat/SOURCE

• Put all .config and file inside

– rpmbuild -bb fedora-livecd.spec– ls /usr/src/redhat/RPMS/i386

Page 27: Lab #1  Install Linux & How to Build Live CD

NCHU System & Network LabNCHU System & Network Lab

How to Use USB Disk to BootHow to Use USB Disk to Boot• Modify the fedora live cd iso that we did.

• Step1:– Format usb disk, and let it’s file system be FAT32

• Step2 – syslinux /dev/sda1– mount /dev/sda1 /mountpoint //mount usb

• Step3 – mount /dev/hdc /mnt/cdrom //mount iso– cp -Rpf /mnt/cdrom/* /mountpoint

• Step4 – cp -Rpf /mnt/cdrom/* /mountpoint– Change the file names

• isolinux.bin =>syslinux.bin • isolinux.cfg=>syslinux.cfg

Page 28: Lab #1  Install Linux & How to Build Live CD

NCHU System & Network LabNCHU System & Network Lab

ReferenceReference• Linux system management• Wikipedia

– http://en.wikipedia.org/wiki/Live_cd• IBM

– Build a Fedora Live CD: http://www.ibm.com/developerworks/linux/library/l-fedora-livecd

• Fedora Taiwan user group– http://fedora.tw/modules/newbb/viewtopic.php?viewmode=flat&topic_

id=1488&forum=2– http://fedora.tw/modules/news/article.php?storyid=19

• PUD GNU/LINUX:– http://pud-linux.sourceforge.net/index.en.html