Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

DIY: Slackware Live DVD/CD

10 views
Skip to first unread message

Douglas Mayne

unread,
Dec 9, 2005, 2:11:26 PM12/9/05
to
I just made my own live DVD/USB setup of Slackware 10.2! The key
component is the unionfs,
http://www.unionfs.org

The unionfs filesystem enables combining read-only and read-write
media into a unified filesystem. I built a baseline for my live
filesystem using a DVD (RO) and a small USB flash drive (RW).

Its performance is not bad;
I am running XFCE, Mozilla, and Pan right now. Performance could be
improved by substituting a faster device (probably an external USB
disc). (Obviously, if you can use an internal disc, then you should
go ahead and install Slackware in the normal way.) I've tried knoppix
and slax, and they work great (and they're polished!). The main
benefit this method provides is the ability to run Slackware (proper)
and do your own customizations, or to only boot to the command line, etc.
Now, you can do it yourself! And as P.V. says, "Have a lot of fun."

Here is a broad outline of what I did. If anyone is interested, then
maybe I can post more detailed information later.

I used the same techniques as I discussed in the posts below.
Loopback Slackware Linux:
http://groups.google.com/group/alt.os.linux.slackware/msg/032f33d74178ee0d?hl=en&

Slackware Rescue CD Updated for 10.2:
http://groups.google.com/group/alt.os.linux.slackware/msg/eafc3c1ad5b5a32e?hl=en&

DISCLAIMER: There is NO WARRANTY or claim of suitability for a specific
purpose for the method presented below. Verify all commands are correct
and appropriate for your specific situation before proceeding. You are
responsible for any commands you issue on your system.

I setup a baseline slackware on a test machine which included all of the
packages from a,ap,d,l,n,x,xap. I added the 2.6.14.3 kernel, compiled the
unionfs module, and added some other misc utilities. This baseline was
backed up to a loopback file. I used 3G to stay within the 4G limit for
DVD's (and used the UDF option for mkiso). I made a bootable DVD using the
instructions here:
http://www.gnu.org/software/grub/manual/html_node/Making-a-GRUB-bootable-CD_002dROM.html#Making-a-GRUB-bootable-CD_002dROM

Here is the grub stanza which loads the live dvd/usb:
title Slackware 10.2
root (cd)
kernel /boot/vmlinuz-2.6.14.3m-acpi-7 rw root=/dev/ram prompt_ramdisk=0 load_ramdisk=1 ramdisk_size=32768 init=/linuxrc
initrd /boot/initrd

I made the initial ramdisk using this as a basis:
http://mirrors.xmission.com/slackware/slackware-10.2/rootdisks/rescue.dsk
I increased the size to 32M and then updated the files to match 10.2 -
maybe that wasn't necessary. I put all of the kernel modules (gz) on the rescue
disk (just to be done with it and avoid missing modules.)

Then I updated my linuxrc file (shown below).

Here are some stats of it running:

#cat /proc/version
Linux version 2.6.14.3m-acpi-7 (root@lorraine-dell) (gcc version 3.3.6) #1 Tue Dec 6 18:25:01 MST 2005

# top
top - 11:24:12 up 1:25, 3 users, load average: 0.16, 0.09, 0.06
Tasks: 58 total, 2 running, 56 sleeping, 0 stopped, 0 zombie
Cpu(s): 4.7% us, 0.5% sy, 0.0% ni, 89.3% id, 4.2% wa, 1.1% hi, 0.3% si
Mem: 1027764k total, 455128k used, 572636k free, 37172k buffers
Swap: 0k total, 0k used, 0k free, 327648k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1 root 16 0 684 252 216 S 0.0 0.0 0:00.76 init
2 root 34 19 0 0 0 S 0.0 0.0 0:00.01 ksoftirqd/0
3 root 10 -5 0 0 0 S 0.0 0.0 0:00.04 events/0
4 root 11 -5 0 0 0 S 0.0 0.0 0:00.01 khelper
5 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 kthread
7 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 kacpid
(abbreviated)

# df
Filesystem 1K-blocks Used Available Use% Mounted on
unionfs 3076787 2196735 723653 76% /

I know it is a bit rough (hardwired parameters, etc), but here is the
critical startup file, linuxrc,
# cat /initrd/linuxrc
#!/bin/bash
echo Hi...
echo Path is $PATH
PATH=/sbin:/bin:/usr/bin
#
# First try at a Live DVD/USB combo of Slackware 10.2.
# using k2.6.14.3m-acpi-7 and unionfs
#
RO_DEV=hdc
RW_DEV=sdb1
FIRST=/tmpfs
NR=${FIRST}/union

for i in 0 1; do
[ $i -ne 0 ] && continue
mkdir ${FIRST}
mount -t tmpfs tmpfs ${FIRST}

MPRW=${FIRST}/${RW_DEV}
MPRO=${FIRST}/${RO_DEV}
MPF=${FIRST}/loop
mkdir -p $MPRO
mkdir -p $MPRW
mkdir -p $MPF
# modprobe ahci
modprobe ohci_hcd
modprobe uhci_hcd
modprobe ehci_hcd
modprobe usb_storage
modprobe unionfs
#
# Sleep while flash is recognized
#
sleep 8
#
# First stage mount
#
mount -t ext2 /dev/${RW_DEV} $MPRW
[ ! -e ${MPRW}/etc/fstab ] && continue
[ ! -e ${MPRW}/mnt ] && continue
rm -fr ${MPRW}/mnt
rm ${MPRW}/etc/mtab
touch ${MPRW}/etc/mtab
mkdir -p ${MPRW}/mnt/floppy
mkdir -p ${MPRW}/mnt/flash
mkdir -p ${MPRW}/mnt/cdrom

mount -t iso9660 -o ro /dev/${RO_DEV} $MPRO
F1=${MPRO}/LOOP.1
echo "Looking for loopback file"
[ ! -e $F1 ] && continue
echo "$F1 : found as loopback"
mount -o loop -t ext2 $F1 $MPF
#
# Union mount
#
mkdir $NR
[ ! -e $NR ] && continue
mkdir $NR/sbin
[ ! -e $NR/sbin ] && continue
mount -t unionfs -o dirs=$MPRW=rw:$MPF=ro unionfs $NR


cp $NR/usr/bin/chroot $NR/sbin/chroot
cd $NR
[ ! -e initrd ] && mkdir initrd
/sbin/pivot_root . initrd
[ ! -e /tmp ] && continue
exec /sbin/chroot . /sbin/init <dev/console >dev/console 2>&1

done
echo "Leaving Interior Loop, Only for Error Condition."
bash
umount /dev/$RW_DEV
echo Bye...
#end of /initrd/linuxrc

Soon, everyone will have their own "live" DVD. Perhaps, these instructions
will help if you are having trouble getting started.

--
Johnny: I need a computer!
http://www.imdb.com/title/tt0113481/quotes

Grant

unread,
Dec 9, 2005, 10:14:21 PM12/9/05
to
On Fri, 09 Dec 2005 12:11:26 -0700, Douglas Mayne <do...@localnet.com> wrote:

>Here is a broad outline of what I did. If anyone is interested, then
>maybe I can post more detailed information later.

Interesting, as commodity computing may very well evolve to little more
than this week's latest OS on DVD plus a USB Flash memory for the user's
persistent data, carried between OS. Say bye-bye to hard drives? ;)


>DISCLAIMER: There is NO WARRANTY or claim of suitability for a specific

...
Why not release under GPL? There's no need to paraphrase disclaimer. ;)

> I added the 2.6.14.3 kernel, compiled the
>unionfs module,

Details? Link to kernel's .config?

> and added some other misc utilities.

Such as?

>Here is the grub stanza which loads the live dvd/usb:
>title Slackware 10.2
> root (cd)
> kernel /boot/vmlinuz-2.6.14.3m-acpi-7 rw root=/dev/ram prompt_ramdisk=0 load_ramdisk=1 ramdisk_size=32768 init=/linuxrc
> initrd /boot/initrd

Sometimes lilo is out of its league... Methinks this is one of those.

...


>Then I updated my linuxrc file (shown below).

...


>I know it is a bit rough (hardwired parameters, etc), but here is the
>critical startup file, linuxrc,

Rough? Woof! Woof! :o)

Try pseudo-coding the script first, designing control flow, then
detail the specifics. Abusing the 'for' does little for clarity
in a script that is bringing up the OS? I'm lazy, I'd rewrite the
thing once I could test it.

>Soon, everyone will have their own "live" DVD. Perhaps, these instructions
>will help if you are having trouble getting started.

If I duplicate you effort, I'll send a startup script with some
improved clarity, at the moment there seems not quite enough info,
but a very good starting point.

Thanks,
Grant.

Douglas Mayne

unread,
Dec 10, 2005, 11:26:56 AM12/10/05
to
On Sat, 10 Dec 2005 03:14:21 +0000, Grant wrote:

> On Fri, 09 Dec 2005 12:11:26 -0700, Douglas Mayne <do...@localnet.com> wrote:
>
>>Here is a broad outline of what I did. If anyone is interested, then
>>maybe I can post more detailed information later.
>
> Interesting, as commodity computing may very well evolve to little more
> than this week's latest OS on DVD plus a USB Flash memory for the user's
> persistent data, carried between OS. Say bye-bye to hard drives? ;)
>

When flash hits the 8G milestone, watch out!

>
>>DISCLAIMER: There is NO WARRANTY or claim of suitability for a specific
> ...
> Why not release under GPL? There's no need to paraphrase disclaimer. ;)

This is newsgroups ;-). Disclaimers are always in order here. Good idea,
though. In the future, I'll add a link to the GPL "COPYING" file. Any
code I (may) have previously posted to newsgroups is retro-actively GPL,
as was my intent. But, as you pointed out, some of my scripts barely
qualify as code ;-).

>
>> I added the 2.6.14.3 kernel, compiled the
>>unionfs module,
>
> Details? Link to kernel's .config?

http://www.xmission.com/~ddmayne/slackware.live/config-2.4.14.3m-acpi-7
(see notes below)

>
>> and added some other misc utilities.
>
> Such as?

ntfstools, unionfs

The full "d" series is installed, so you can compile anything (that will
fit on your flash drive.)

>
>>Here is the grub stanza which loads the live dvd/usb:
>>title Slackware 10.2
>> root (cd)
>> kernel /boot/vmlinuz-2.6.14.3m-acpi-7 rw root=/dev/ram prompt_ramdisk=0 load_ramdisk=1 ramdisk_size=32768 init=/linuxrc
>> initrd /boot/initrd
>
> Sometimes lilo is out of its league... Methinks this is one of those.
>

I wanted to test grub from a CD. The command line element works as it
does when booting from a hard disc. Also, isolinux could be used as an
alternate loader.

> ...
>>Then I updated my linuxrc file (shown below).
> ...
>>I know it is a bit rough (hardwired parameters, etc), but here is the
>>critical startup file, linuxrc,
>
> Rough? Woof! Woof! :o)
>
> Try pseudo-coding the script first, designing control flow, then detail
> the specifics. Abusing the 'for' does little for clarity in a script
> that is bringing up the OS? I'm lazy, I'd rewrite the thing once I
> could test it.

Where I say "for," think "try." Bash has no try, so that construct is
a poor-man's try. The thing I like about it, especially for testing, is
errors can be "thrown" out. "Deconstructors" can execute at the
bottom of the block. Sometimes "exit" is too harsh.

>
>>Soon, everyone will have their own "live" DVD. Perhaps, these
>>instructions will help if you are having trouble getting started.
>
> If I duplicate you effort, I'll send a startup script with some improved
> clarity, at the moment there seems not quite enough info, but a very
> good starting point.

There's a little bit more (initrd.gz below)
>
> Thanks,
> Grant.
>
Thanks for your feedback. Note comments inline.

[ OT ]
I have linked to the kernel configuration, above. I am not sure if you'd
want it, though. It is quite specific to this laptop I have been trying
to get working with ACPI, a Dell D610. BTW, I had to compile so many
things, I felt like I'd joined the Gentoo camp. I found a lot of good
resources online:
http://gentoo-wiki.com/HARDWARE_Dell_Latitude_D610
http://forums.gentoo.org/viewtopic-t-364512-start-0-postdays-0-postorder-asc-highlight-.html

but I still don't quite have it resuming properly from sleep state 3.
This kernel is at "Pentium M" level, and support for 1-4G memory is enabled.
I pruned out some things which I didn't want at all. I had to remove
80211 and the wireless drivers from the kernel (and replace them with more
recent drivers for ipw2200 and firmware). Then, the alsa-driver package
for this kernel. I also had to update X for the i915g chipset to work with
X's i810 driver. That allows for the VideoRam parameter to be specified.

[ On Topic ]

Besides the kernel configuration, I have included the initrd:
http://www.xmission.com/~ddmayne/slackware.live/initrd.gz

I have removed the kernel modules from the image (which reduces its
size to about 3M (gz). If you want to test, you can add your own kernel
modules. This file has the md5sums:
http://www.xmission.com/~ddmayne/slackware.live/MD5SUMS

9bd113867d2a6ebb87c12534e09bbc98 ./config-2.4.14.3m-acpi-7
9e5c8da8e9ad2ef9f2d868c1ac0baae1 ./initrd.gz

--
Johnny: They'll negotiate; they're corporate.
Jane: So's the Yakuza.
http://www.imdb.com/title/tt0113481/quotes

Douglas Mayne

unread,
Dec 10, 2005, 12:05:43 PM12/10/05
to
On Sat, 10 Dec 2005 09:26:56 -0700, Douglas Mayne wrote:

> On Sat, 10 Dec 2005 03:14:21 +0000, Grant wrote:
>

<snip>

Oops. I meant 2.6.x, not 2.4.x
http://www.xmission.com/~ddmayne/slackware.live/config-2.6.14.3m-acpi-7
<snip>
>
>
I have corrected the filename (above). It was just misnamed when I
uploaded it, otherwise, it is the correct file.

This file is correct also:

http://www.xmission.com/~ddmayne/slackware.live/MD5SUMS

9bd113867d2a6ebb87c12534e09bbc98 ./config-2.6.14.3m-acpi-7
9e5c8da8e9ad2ef9f2d868c1ac0baae1 ./initrd.gz

--
Douglas Mayne

Grant

unread,
Dec 10, 2005, 3:52:47 PM12/10/05
to
On Sat, 10 Dec 2005 09:26:56 -0700, Douglas Mayne <do...@slackware-3.localnet> wrote:

>
>Where I say "for," think "try."

Oh please don't, someone might read that and offer an OO shell :o)


> It is quite specific to this laptop I have been trying
>to get working with ACPI, a Dell D610.

Sure, but there's some stuff I'd get answers to from looking at the
Kconfig, of course I'd not expect to use it as is :)

>but I still don't quite have it resuming properly from sleep state 3.

You shutting down networking prior to going S3? Perhaps 2.6.16 will
bring some joy (~Mar'06).

Grant.

Grant

unread,
Dec 10, 2005, 3:59:08 PM12/10/05
to
On Sat, 10 Dec 2005 10:05:43 -0700, Douglas Mayne <do...@slackware-3.localnet> wrote:

>http://www.xmission.com/~ddmayne/slackware.live/config-2.6.14.3m-acpi-7

Take another look at your CPUFreq choices, turn off the K6/K7 powernow
and other non-pentium-M stuff?

Grant.

0 new messages