SlideShare a Scribd company logo
Recipe of a Linux LiveCD
By
Buddhika Siddhisena
2
Agenda
What is a LiveCD
Why run a LiveCD
Understanding the Linux Boot process
Understanding the Linux LiveCD Boot process
How hardware detection could work
Achieving Data Persistence on LiveCD
Short survey of popular LiveCDs
3
What is a LiveCD
Is a CD that contains an Operating System (OS), capable of booting off
directly, without first having to be installed.
Will generally have automatic hardware detection, as the OS boots.
May contain more data than the physical size of a CDROM (~700MB) by
using on-the-fly decompression of the file system.
Generally slower to boot when compared to HDD, mainly due to slower
access times of CDROM drives.
May offer the ability to remember configuration settings by saving them
on to a drive (USB, floppy or HDD).
May offer it to be installed to the hard disk permanently
4
Why run a LiveCD
Provides an alternative way to try out a new OS/distribution.
Can be used to instantly convert any desktop to your desktop! And you
can't get blamed for doing so.
Can be a valuable resource for recovering data, resetting passwords etc.
Can be used to distribute a demo versions of software thats guaranteed to
work with minimum hassle.
And endless other possibilities....
5
Understanding the Linux Boot process
As the machine boots the BIOS looks for a bootable media depending on
the boot sequence.
BIOS loads the bootloader from a special area in the disk called the
Master Boot Record (MBR). On linux it is usually either LILO or GRUB.
LILO (or GRUB) will attempt to load the kernel and optionally an initial
RAM disk (initrd), if specified.
Control is passed to the kernel as it decompresses the initrd and mounts it
as the root device.
6
Understanding the Linux Boot process
The kernel executes /linuxrc from the root device. It will perform various
pre-boot tasks such as loading of additional drivers.
Once linuxrc exits control is passed back to the kernel which will then
mount the real root device as the root file system.
/sbin/init from the real root system is executed which uses /etc/inittab
configuration to boot rest of the system.
/etc/inittab defines the default runlevel (usually 3 or 5) and as part of
the boot process all scripts in /etc/rcX.d/ are executed.
7
Linux boot process in a nutshell
Power supply ON
PC BIOS starts
BIOS looks for a bootable media
according to the setting and
loads a program(=LILO) written
on MBR of a hard drive, and then
LILO gains control.
LILO loads a
kerne(vmlinuz)and
an initial RAM
disk(initrd)Kerne
l gains control
Kernel expands
initrd and
mounts it as a
temporary root
file system
If an executable /linuxrc exists
in the initrd, the kernel
executes it.
After the /linuxrc is
finished, the kernel
mounts a real root
file system which may
be /dev/hda1
/sbin/init executes
/etc/rc.d/rc.sysinit
according to a
description of
/etc/inittab.
Next, init executes
/etc/rc.d/rc with
a default run level as
an argument
For example, in run level 3, /etc/rc.d/rc
executes shell scripts like
SnnXXXX(nn=number) under /etc/rc.d/rc3.d
directory in order of S00XXXX to S99XXXX
with a start argument
8
Understanding the Linux LiveCD Boot process
BIOS finds a bootable CDROM and loads the bootloader (usually
ISOLINUX which is based on the Syslinux bootloader)
ISOLINUX will load the initrd and the kernel image and transfer control
to the kernel.
The kernel decompresses initrd and mounts it as root and executes the
/linuxrc script from the LiveCD.
9
Understanding the Linux LiveCD Boot process
It will load kernel modules required, attempt to guess the CDROM device and
mount it. Finally linuxrc will change the real root device of the kernel to that
of initrd, or LiveCD and exit.
#!/bin/sh
echo Mounting /proc filesystem
mount -t proc /proc /proc
echo Attempting to Mount CD-ROM
(mount -t iso9660 /dev/hdb /mnt/cdrom && ln -s /dev/hdb /dev/cdrom) ||
(mount -t iso9660 /dev/hdc /mnt/cdrom && ln -s /dev/hdc /dev/cdrom) ||
(mount -t iso9660 /dev/hdd /mnt/cdrom && ln -s /dev/hdd /dev/cdrom) ||
(mount -t iso9660 /dev/hda /mnt/cdrom && ln -s /dev/hda /dev/cdrom) ||
(echo 'cannot mount CD-ROM, dropping you to a shell';sh)
echo 0x0100 > /proc/sys/kernel/real-root-dev
umount /proc
Hardware detection scripts will take over as a runlevel service to
configure the rest of the system.
10
Hardware detection process
Scripts can use tools such as lspci, /proc/bus/pci/devices, /proc/bus/usb/devices
etc. to determine the system hardware.
bud@babytux bud $ /sbin/lspci
0000:00:01.0 PCI bridge: ATI Technologies Inc: Unknown device 7010
0000:00:02.0 USB Controller: ALi Corporation USB 1.1 Controller (rev
03)0000:00:06.0 Multimedia audio controller: ALi Corporation M5451 PCI AC-
Link Controller Audio Device (rev 02)
0000:00:09.0 Network controller: Harris Semiconductor Prism 2.5 Wavelan
chipset(rev 01)
0000:00:10.0 IDE interface: ALi Corporation M5229 IDE (rev c4)
0000:00:12.0 Ethernet controller: National Semiconductor Corporation
DP83815 (MacPhyter) Ethernet Controller
0000:01:05.0 VGA compatible controller: ATI Technologies Inc: Unknown
device 4337
Then by using a database or some sort of pattern matching we can load
the correct kernel modules to drive those devices.
Check out the Linux PCID Repository at http://pciids.sourceforge.net/ or the
file /usr/share/misc/pci.ids
11
Hardware detection process
Other tools such as kudzu(http://rhlinux.redhat.com/kudzu/) that comes
with Redhat or discover(http://hackers.progeny.com/discover/) can
also be used
Configuring X windows can be done using tools such using XFree86 and
tools such as ddcprobe or read-edid to detect monitor refresh rates.
# XFree86 -configure
# get-edid | parse-edid
Usually the /etc, /home and /tmp directories will reside on an ramdisk
and will be symlinked from the LiveCD to be able to save settings
Certain files in the /dev directory should also reside on a ram disk.
(e.g. /dev/tty*, /dev/pts/* etc.)
12
Achieving Data Persistence on LiveCD
Data persistence can be achieved by running a shell script to store the
content of /home or /etc on a USB flash or HDD.
#!/bin/sh
mount /dev/sda1 /mnt/usb
tar -zcvf /mnt/usb/home.tar.gz /home
tar -zcvf /mnt/usb/etc.tar.gz /etc
When booting the live CD using ISOLinux, it is possible to pass
parameters to the kernel, even once that the kernel doesn't understand
boot: linux26 vga=791 home=/mnt/sda etc=/mnt/sda
A bootup script could read this value by examining /proc/cmdline
# cat /proc/cmdline
13
Short survey of popular LiveCDs
Knoppix - Knoppix is a Live Linux CD based on Debian GNU/Linux
Excellent hardware detection
Uses on the fly transparent decompression to store 2.5GB or data
Easy to remaster and make your own LiveCD (e.g. Gnoppix, Damn Small
Linux(DSO), Sinhala Knoppix)
http://www.knoppix.net
Mepis – Based on Debian GNU/Linux
Very Good harware detection.
Uses on the fly decompression to store about 1.1GB or data
Contains some non-free software such as Flash, Java, RealPlayer etc.
Easy to install to the HDD
http://www.mepis.org/
SLAX – Slackware based LiveCD
Fast, works well on slightly older hardware
Fits on to a mini CD since the image is only 185MB
http://slax.linux-live.org/
14
Short survey of popular LiveCDs
LNX/BBC – Portable card-sized distribution
Design to fit to a credit card size CD
http://www.lnx-bbc.org
Mandrake Move – A live CD based on Mandrake Linux
Commercial and free edition available.
http://www.mandrakesoft.com/products/mandrakemove
FreeBSD LiveCD – A LiveCD based FreeBSD OS
http://livecd.sourceforge.net/
15
Thank You!

More Related Content

What's hot

Lavigne bsdmag july
Lavigne bsdmag julyLavigne bsdmag july
Lavigne bsdmag july
Dru Lavigne
 
Linux Common Command
Linux Common CommandLinux Common Command
Linux Common Command
Jeff Yang
 
[ArabBSD] Unix Basics
[ArabBSD] Unix Basics[ArabBSD] Unix Basics
[ArabBSD] Unix Basics
Mohammed Farrag
 
Linux fundamental - Chap 03 file
Linux fundamental - Chap 03 fileLinux fundamental - Chap 03 file
Linux fundamental - Chap 03 file
Kenny (netman)
 
Raspberry Pi 101
Raspberry Pi 101Raspberry Pi 101
Raspberry Pi 101
Tonny Adhi Sabastian
 
2.Accessing the Pi
2.Accessing the Pi2.Accessing the Pi
2.Accessing the Pi
Mayank Joneja
 
Asiabsdcon14 lavigne
Asiabsdcon14 lavigneAsiabsdcon14 lavigne
Asiabsdcon14 lavigne
Dru Lavigne
 
Ilf2011
Ilf2011Ilf2011
Ilf2011
Dru Lavigne
 
Linux fundamental - Chap 10 fs
Linux fundamental - Chap 10 fsLinux fundamental - Chap 10 fs
Linux fundamental - Chap 10 fs
Kenny (netman)
 
Ha opensuse
Ha opensuseHa opensuse
Ha opensuse
Kenny (netman)
 
Linux LVM Logical Volume Management
Linux LVM Logical Volume ManagementLinux LVM Logical Volume Management
Linux LVM Logical Volume Management
Manolis Kartsonakis
 
Advanced Level Training on Koha / TLS (ToT)
Advanced Level Training on Koha / TLS (ToT)Advanced Level Training on Koha / TLS (ToT)
Advanced Level Training on Koha / TLS (ToT)
Ata Rehman
 
Lavigne sept11 bsdmag
Lavigne sept11 bsdmagLavigne sept11 bsdmag
Lavigne sept11 bsdmag
Dru Lavigne
 
Clase4 (consola linux)
Clase4 (consola linux)Clase4 (consola linux)
Clase4 (consola linux)
Miguel Eduardo Luces
 
Linux fundamental - Chap 04 archive
Linux fundamental - Chap 04 archiveLinux fundamental - Chap 04 archive
Linux fundamental - Chap 04 archive
Kenny (netman)
 
vbsd2013
vbsd2013vbsd2013
vbsd2013
krispcbsd
 
eurobsd2013
eurobsd2013eurobsd2013
eurobsd2013
krispcbsd
 
Summit demystifying systemd1
Summit demystifying systemd1Summit demystifying systemd1
Summit demystifying systemd1Susant Sahani
 

What's hot (20)

Lavigne bsdmag july
Lavigne bsdmag julyLavigne bsdmag july
Lavigne bsdmag july
 
Linux Common Command
Linux Common CommandLinux Common Command
Linux Common Command
 
Ch12
Ch12Ch12
Ch12
 
[ArabBSD] Unix Basics
[ArabBSD] Unix Basics[ArabBSD] Unix Basics
[ArabBSD] Unix Basics
 
Linuxppt
LinuxpptLinuxppt
Linuxppt
 
Linux fundamental - Chap 03 file
Linux fundamental - Chap 03 fileLinux fundamental - Chap 03 file
Linux fundamental - Chap 03 file
 
Raspberry Pi 101
Raspberry Pi 101Raspberry Pi 101
Raspberry Pi 101
 
2.Accessing the Pi
2.Accessing the Pi2.Accessing the Pi
2.Accessing the Pi
 
Asiabsdcon14 lavigne
Asiabsdcon14 lavigneAsiabsdcon14 lavigne
Asiabsdcon14 lavigne
 
Ilf2011
Ilf2011Ilf2011
Ilf2011
 
Linux fundamental - Chap 10 fs
Linux fundamental - Chap 10 fsLinux fundamental - Chap 10 fs
Linux fundamental - Chap 10 fs
 
Ha opensuse
Ha opensuseHa opensuse
Ha opensuse
 
Linux LVM Logical Volume Management
Linux LVM Logical Volume ManagementLinux LVM Logical Volume Management
Linux LVM Logical Volume Management
 
Advanced Level Training on Koha / TLS (ToT)
Advanced Level Training on Koha / TLS (ToT)Advanced Level Training on Koha / TLS (ToT)
Advanced Level Training on Koha / TLS (ToT)
 
Lavigne sept11 bsdmag
Lavigne sept11 bsdmagLavigne sept11 bsdmag
Lavigne sept11 bsdmag
 
Clase4 (consola linux)
Clase4 (consola linux)Clase4 (consola linux)
Clase4 (consola linux)
 
Linux fundamental - Chap 04 archive
Linux fundamental - Chap 04 archiveLinux fundamental - Chap 04 archive
Linux fundamental - Chap 04 archive
 
vbsd2013
vbsd2013vbsd2013
vbsd2013
 
eurobsd2013
eurobsd2013eurobsd2013
eurobsd2013
 
Summit demystifying systemd1
Summit demystifying systemd1Summit demystifying systemd1
Summit demystifying systemd1
 

Viewers also liked

Beyond desktop/server with GNU/Linux (archived)
Beyond desktop/server with GNU/Linux (archived)Beyond desktop/server with GNU/Linux (archived)
Beyond desktop/server with GNU/Linux (archived)
Bud Siddhisena
 
Contributing to FOSS (archived)
Contributing to FOSS (archived)Contributing to FOSS (archived)
Contributing to FOSS (archived)
Bud Siddhisena
 
Sub Prime Mortgage Mess
Sub Prime Mortgage MessSub Prime Mortgage Mess
Sub Prime Mortgage MessJustin Gardner
 
Yoo Torture Memo Pt2
Yoo Torture Memo Pt2Yoo Torture Memo Pt2
Yoo Torture Memo Pt2
Justin Gardner
 
Foss Gadgematics
Foss GadgematicsFoss Gadgematics
Foss Gadgematics
Bud Siddhisena
 
FOSS in Sri Lanka (archived)
FOSS in Sri Lanka (archived)FOSS in Sri Lanka (archived)
FOSS in Sri Lanka (archived)
Bud Siddhisena
 
Opensource opportunity
Opensource opportunityOpensource opportunity
Opensource opportunity
Bud Siddhisena
 

Viewers also liked (7)

Beyond desktop/server with GNU/Linux (archived)
Beyond desktop/server with GNU/Linux (archived)Beyond desktop/server with GNU/Linux (archived)
Beyond desktop/server with GNU/Linux (archived)
 
Contributing to FOSS (archived)
Contributing to FOSS (archived)Contributing to FOSS (archived)
Contributing to FOSS (archived)
 
Sub Prime Mortgage Mess
Sub Prime Mortgage MessSub Prime Mortgage Mess
Sub Prime Mortgage Mess
 
Yoo Torture Memo Pt2
Yoo Torture Memo Pt2Yoo Torture Memo Pt2
Yoo Torture Memo Pt2
 
Foss Gadgematics
Foss GadgematicsFoss Gadgematics
Foss Gadgematics
 
FOSS in Sri Lanka (archived)
FOSS in Sri Lanka (archived)FOSS in Sri Lanka (archived)
FOSS in Sri Lanka (archived)
 
Opensource opportunity
Opensource opportunityOpensource opportunity
Opensource opportunity
 

Similar to Recipe of a linux Live CD (archived)

6 stages of linux boot process
6 stages of linux boot process6 stages of linux boot process
6 stages of linux boot process
sagarpdalvi
 
6 stages of linux boot process
6 stages of linux boot process6 stages of linux boot process
6 stages of linux boot process
Hari Shankar
 
Linux basics
Linux basics Linux basics
Linux basics
suniljosekerala
 
Linux basics
Linux basics Linux basics
Linux basics
suniljosekerala
 
FreeBSD Portscamp, Kuala Lumpur 2016
FreeBSD Portscamp, Kuala Lumpur 2016FreeBSD Portscamp, Kuala Lumpur 2016
FreeBSD Portscamp, Kuala Lumpur 2016
Muhammad Moinur Rahman
 
6 stages of linux boot process
6 stages of linux boot process6 stages of linux boot process
6 stages of linux boot processTeja Bheemanapally
 
6 stages of linux boot process
6 stages of linux boot process6 stages of linux boot process
6 stages of linux boot processTeja Bheemanapally
 
Linux conf-admin
Linux conf-adminLinux conf-admin
Linux conf-admin
badamisri
 
Introduction to Operating Systems.pptx
Introduction to Operating Systems.pptxIntroduction to Operating Systems.pptx
Introduction to Operating Systems.pptx
MohamedSaied877003
 
First Responder Course - Session 10 - Static Evidence Collection [2004]
First Responder Course - Session 10 - Static Evidence Collection [2004]First Responder Course - Session 10 - Static Evidence Collection [2004]
First Responder Course - Session 10 - Static Evidence Collection [2004]
Phil Huggins FBCS CITP
 
Linux Booting Process
Linux Booting ProcessLinux Booting Process
Linux Booting Process
Rishabh5121993
 
Linux
LinuxLinux
Unix Administration 2
Unix Administration 2Unix Administration 2
Unix Administration 2
Information Technology
 
101 2.1 design hard disk layout v2
101 2.1 design hard disk layout v2101 2.1 design hard disk layout v2
101 2.1 design hard disk layout v2
Acácio Oliveira
 
Texas 2013
Texas 2013Texas 2013
Texas 2013
krispcbsd
 

Similar to Recipe of a linux Live CD (archived) (20)

6 stages of linux boot process
6 stages of linux boot process6 stages of linux boot process
6 stages of linux boot process
 
6 stages of linux boot process
6 stages of linux boot process6 stages of linux boot process
6 stages of linux boot process
 
101 1.2 boot the system
101 1.2 boot the system101 1.2 boot the system
101 1.2 boot the system
 
Linux filesystemhierarchy
Linux filesystemhierarchyLinux filesystemhierarchy
Linux filesystemhierarchy
 
Linux basics
Linux basics Linux basics
Linux basics
 
Linux basics
Linux basics Linux basics
Linux basics
 
FreeBSD Portscamp, Kuala Lumpur 2016
FreeBSD Portscamp, Kuala Lumpur 2016FreeBSD Portscamp, Kuala Lumpur 2016
FreeBSD Portscamp, Kuala Lumpur 2016
 
6 stages of linux boot process
6 stages of linux boot process6 stages of linux boot process
6 stages of linux boot process
 
6 stages of linux boot process
6 stages of linux boot process6 stages of linux boot process
6 stages of linux boot process
 
Linux Conf Admin
Linux Conf AdminLinux Conf Admin
Linux Conf Admin
 
Linux conf-admin
Linux conf-adminLinux conf-admin
Linux conf-admin
 
Introduction to Operating Systems.pptx
Introduction to Operating Systems.pptxIntroduction to Operating Systems.pptx
Introduction to Operating Systems.pptx
 
First Responder Course - Session 10 - Static Evidence Collection [2004]
First Responder Course - Session 10 - Static Evidence Collection [2004]First Responder Course - Session 10 - Static Evidence Collection [2004]
First Responder Course - Session 10 - Static Evidence Collection [2004]
 
Basic Linux Internals
Basic Linux InternalsBasic Linux Internals
Basic Linux Internals
 
Linux Booting Process
Linux Booting ProcessLinux Booting Process
Linux Booting Process
 
Linux
LinuxLinux
Linux
 
Ch12 system administration
Ch12 system administration Ch12 system administration
Ch12 system administration
 
Unix Administration 2
Unix Administration 2Unix Administration 2
Unix Administration 2
 
101 2.1 design hard disk layout v2
101 2.1 design hard disk layout v2101 2.1 design hard disk layout v2
101 2.1 design hard disk layout v2
 
Texas 2013
Texas 2013Texas 2013
Texas 2013
 

More from Bud Siddhisena

JIT qa-docker
JIT qa-dockerJIT qa-docker
JIT qa-docker
Bud Siddhisena
 
Building apis that don’t suck!
Building apis that don’t suck!Building apis that don’t suck!
Building apis that don’t suck!
Bud Siddhisena
 
Why should you android (archived)
Why should you android (archived)Why should you android (archived)
Why should you android (archived)
Bud Siddhisena
 
Virtualization, The future of computing (archived)
Virtualization, The future of computing (archived)Virtualization, The future of computing (archived)
Virtualization, The future of computing (archived)
Bud Siddhisena
 
Building the Next big thing (archived)
Building the Next big thing (archived)Building the Next big thing (archived)
Building the Next big thing (archived)
Bud Siddhisena
 
GNU/Linux for a better home (archived)
GNU/Linux for a better home (archived)GNU/Linux for a better home (archived)
GNU/Linux for a better home (archived)
Bud Siddhisena
 
Gaming on linux (archived)
Gaming on linux (archived)Gaming on linux (archived)
Gaming on linux (archived)
Bud Siddhisena
 
Choosing your GNU/Linux distribution (archived)
Choosing your GNU/Linux distribution (archived)Choosing your GNU/Linux distribution (archived)
Choosing your GNU/Linux distribution (archived)
Bud Siddhisena
 
Remembering steve
Remembering steveRemembering steve
Remembering steve
Bud Siddhisena
 
Scale Apache with Nginx
Scale Apache with NginxScale Apache with Nginx
Scale Apache with Nginx
Bud Siddhisena
 
Introduction to firewalls through Iptables
Introduction to firewalls through IptablesIntroduction to firewalls through Iptables
Introduction to firewalls through Iptables
Bud Siddhisena
 
FOSS and Security
FOSS and SecurityFOSS and Security
FOSS and Security
Bud Siddhisena
 
Secure your IT infrastructure with GNU/Linux
Secure your IT infrastructure  with GNU/LinuxSecure your IT infrastructure  with GNU/Linux
Secure your IT infrastructure with GNU/Linux
Bud Siddhisena
 
Kernel Configuration and Compilation
Kernel Configuration and CompilationKernel Configuration and Compilation
Kernel Configuration and Compilation
Bud Siddhisena
 

More from Bud Siddhisena (15)

JIT qa-docker
JIT qa-dockerJIT qa-docker
JIT qa-docker
 
Building apis that don’t suck!
Building apis that don’t suck!Building apis that don’t suck!
Building apis that don’t suck!
 
Why should you android (archived)
Why should you android (archived)Why should you android (archived)
Why should you android (archived)
 
Virtualization, The future of computing (archived)
Virtualization, The future of computing (archived)Virtualization, The future of computing (archived)
Virtualization, The future of computing (archived)
 
Building the Next big thing (archived)
Building the Next big thing (archived)Building the Next big thing (archived)
Building the Next big thing (archived)
 
GNU/Linux for a better home (archived)
GNU/Linux for a better home (archived)GNU/Linux for a better home (archived)
GNU/Linux for a better home (archived)
 
Gaming on linux (archived)
Gaming on linux (archived)Gaming on linux (archived)
Gaming on linux (archived)
 
Choosing your GNU/Linux distribution (archived)
Choosing your GNU/Linux distribution (archived)Choosing your GNU/Linux distribution (archived)
Choosing your GNU/Linux distribution (archived)
 
UX talk
UX talkUX talk
UX talk
 
Remembering steve
Remembering steveRemembering steve
Remembering steve
 
Scale Apache with Nginx
Scale Apache with NginxScale Apache with Nginx
Scale Apache with Nginx
 
Introduction to firewalls through Iptables
Introduction to firewalls through IptablesIntroduction to firewalls through Iptables
Introduction to firewalls through Iptables
 
FOSS and Security
FOSS and SecurityFOSS and Security
FOSS and Security
 
Secure your IT infrastructure with GNU/Linux
Secure your IT infrastructure  with GNU/LinuxSecure your IT infrastructure  with GNU/Linux
Secure your IT infrastructure with GNU/Linux
 
Kernel Configuration and Compilation
Kernel Configuration and CompilationKernel Configuration and Compilation
Kernel Configuration and Compilation
 

Recently uploaded

GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 

Recently uploaded (20)

GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 

Recipe of a linux Live CD (archived)

  • 1. Recipe of a Linux LiveCD By Buddhika Siddhisena
  • 2. 2 Agenda What is a LiveCD Why run a LiveCD Understanding the Linux Boot process Understanding the Linux LiveCD Boot process How hardware detection could work Achieving Data Persistence on LiveCD Short survey of popular LiveCDs
  • 3. 3 What is a LiveCD Is a CD that contains an Operating System (OS), capable of booting off directly, without first having to be installed. Will generally have automatic hardware detection, as the OS boots. May contain more data than the physical size of a CDROM (~700MB) by using on-the-fly decompression of the file system. Generally slower to boot when compared to HDD, mainly due to slower access times of CDROM drives. May offer the ability to remember configuration settings by saving them on to a drive (USB, floppy or HDD). May offer it to be installed to the hard disk permanently
  • 4. 4 Why run a LiveCD Provides an alternative way to try out a new OS/distribution. Can be used to instantly convert any desktop to your desktop! And you can't get blamed for doing so. Can be a valuable resource for recovering data, resetting passwords etc. Can be used to distribute a demo versions of software thats guaranteed to work with minimum hassle. And endless other possibilities....
  • 5. 5 Understanding the Linux Boot process As the machine boots the BIOS looks for a bootable media depending on the boot sequence. BIOS loads the bootloader from a special area in the disk called the Master Boot Record (MBR). On linux it is usually either LILO or GRUB. LILO (or GRUB) will attempt to load the kernel and optionally an initial RAM disk (initrd), if specified. Control is passed to the kernel as it decompresses the initrd and mounts it as the root device.
  • 6. 6 Understanding the Linux Boot process The kernel executes /linuxrc from the root device. It will perform various pre-boot tasks such as loading of additional drivers. Once linuxrc exits control is passed back to the kernel which will then mount the real root device as the root file system. /sbin/init from the real root system is executed which uses /etc/inittab configuration to boot rest of the system. /etc/inittab defines the default runlevel (usually 3 or 5) and as part of the boot process all scripts in /etc/rcX.d/ are executed.
  • 7. 7 Linux boot process in a nutshell Power supply ON PC BIOS starts BIOS looks for a bootable media according to the setting and loads a program(=LILO) written on MBR of a hard drive, and then LILO gains control. LILO loads a kerne(vmlinuz)and an initial RAM disk(initrd)Kerne l gains control Kernel expands initrd and mounts it as a temporary root file system If an executable /linuxrc exists in the initrd, the kernel executes it. After the /linuxrc is finished, the kernel mounts a real root file system which may be /dev/hda1 /sbin/init executes /etc/rc.d/rc.sysinit according to a description of /etc/inittab. Next, init executes /etc/rc.d/rc with a default run level as an argument For example, in run level 3, /etc/rc.d/rc executes shell scripts like SnnXXXX(nn=number) under /etc/rc.d/rc3.d directory in order of S00XXXX to S99XXXX with a start argument
  • 8. 8 Understanding the Linux LiveCD Boot process BIOS finds a bootable CDROM and loads the bootloader (usually ISOLINUX which is based on the Syslinux bootloader) ISOLINUX will load the initrd and the kernel image and transfer control to the kernel. The kernel decompresses initrd and mounts it as root and executes the /linuxrc script from the LiveCD.
  • 9. 9 Understanding the Linux LiveCD Boot process It will load kernel modules required, attempt to guess the CDROM device and mount it. Finally linuxrc will change the real root device of the kernel to that of initrd, or LiveCD and exit. #!/bin/sh echo Mounting /proc filesystem mount -t proc /proc /proc echo Attempting to Mount CD-ROM (mount -t iso9660 /dev/hdb /mnt/cdrom && ln -s /dev/hdb /dev/cdrom) || (mount -t iso9660 /dev/hdc /mnt/cdrom && ln -s /dev/hdc /dev/cdrom) || (mount -t iso9660 /dev/hdd /mnt/cdrom && ln -s /dev/hdd /dev/cdrom) || (mount -t iso9660 /dev/hda /mnt/cdrom && ln -s /dev/hda /dev/cdrom) || (echo 'cannot mount CD-ROM, dropping you to a shell';sh) echo 0x0100 > /proc/sys/kernel/real-root-dev umount /proc Hardware detection scripts will take over as a runlevel service to configure the rest of the system.
  • 10. 10 Hardware detection process Scripts can use tools such as lspci, /proc/bus/pci/devices, /proc/bus/usb/devices etc. to determine the system hardware. bud@babytux bud $ /sbin/lspci 0000:00:01.0 PCI bridge: ATI Technologies Inc: Unknown device 7010 0000:00:02.0 USB Controller: ALi Corporation USB 1.1 Controller (rev 03)0000:00:06.0 Multimedia audio controller: ALi Corporation M5451 PCI AC- Link Controller Audio Device (rev 02) 0000:00:09.0 Network controller: Harris Semiconductor Prism 2.5 Wavelan chipset(rev 01) 0000:00:10.0 IDE interface: ALi Corporation M5229 IDE (rev c4) 0000:00:12.0 Ethernet controller: National Semiconductor Corporation DP83815 (MacPhyter) Ethernet Controller 0000:01:05.0 VGA compatible controller: ATI Technologies Inc: Unknown device 4337 Then by using a database or some sort of pattern matching we can load the correct kernel modules to drive those devices. Check out the Linux PCID Repository at http://pciids.sourceforge.net/ or the file /usr/share/misc/pci.ids
  • 11. 11 Hardware detection process Other tools such as kudzu(http://rhlinux.redhat.com/kudzu/) that comes with Redhat or discover(http://hackers.progeny.com/discover/) can also be used Configuring X windows can be done using tools such using XFree86 and tools such as ddcprobe or read-edid to detect monitor refresh rates. # XFree86 -configure # get-edid | parse-edid Usually the /etc, /home and /tmp directories will reside on an ramdisk and will be symlinked from the LiveCD to be able to save settings Certain files in the /dev directory should also reside on a ram disk. (e.g. /dev/tty*, /dev/pts/* etc.)
  • 12. 12 Achieving Data Persistence on LiveCD Data persistence can be achieved by running a shell script to store the content of /home or /etc on a USB flash or HDD. #!/bin/sh mount /dev/sda1 /mnt/usb tar -zcvf /mnt/usb/home.tar.gz /home tar -zcvf /mnt/usb/etc.tar.gz /etc When booting the live CD using ISOLinux, it is possible to pass parameters to the kernel, even once that the kernel doesn't understand boot: linux26 vga=791 home=/mnt/sda etc=/mnt/sda A bootup script could read this value by examining /proc/cmdline # cat /proc/cmdline
  • 13. 13 Short survey of popular LiveCDs Knoppix - Knoppix is a Live Linux CD based on Debian GNU/Linux Excellent hardware detection Uses on the fly transparent decompression to store 2.5GB or data Easy to remaster and make your own LiveCD (e.g. Gnoppix, Damn Small Linux(DSO), Sinhala Knoppix) http://www.knoppix.net Mepis – Based on Debian GNU/Linux Very Good harware detection. Uses on the fly decompression to store about 1.1GB or data Contains some non-free software such as Flash, Java, RealPlayer etc. Easy to install to the HDD http://www.mepis.org/ SLAX – Slackware based LiveCD Fast, works well on slightly older hardware Fits on to a mini CD since the image is only 185MB http://slax.linux-live.org/
  • 14. 14 Short survey of popular LiveCDs LNX/BBC – Portable card-sized distribution Design to fit to a credit card size CD http://www.lnx-bbc.org Mandrake Move – A live CD based on Mandrake Linux Commercial and free edition available. http://www.mandrakesoft.com/products/mandrakemove FreeBSD LiveCD – A LiveCD based FreeBSD OS http://livecd.sourceforge.net/