[syslinux] Syslinux, initramfs

Neal Nelson neal at nna.com
Fri Nov 18 13:43:09 PST 2011

I have been using syslinux and slackware 12.2 for several
years to make a bootable thumb drive that loads and runs
linux from a ram disk.

I recently switched to slackware 13.37 with syslinux 3.84.

That switch resulted in the limit=32768 and panic problem.

I have searched and read many comments and see that
initramfs might be a better option than initrd.

I have not been able to properly configure and run using
initramfs nor have I been able to find a good sample that
is similar to my desired use.

The shell script that I used to create the thumb drive under
12.2 is listed below.

Can someone tell me how to alter this for initramfs?  The
initrd line is the 5th from the bottom.

Thanks in advance. - Neal Nelson


umask 0
set -x
dd if=/dev/zero of=/tmp/pt0100 bs=1k count=1500000
mkfs -t ext2 -i 8192 -b 1024 -F /tmp/pt0100
mkdir /tmp/mnt
mount -o loop /tmp/pt0100 /tmp/mnt
mkdir /tmp/mnt/mnt /tmp/mnt/tmp /tmp/mnt/proc/
cp -a /bin /tmp/mnt
cp -a /boot /tmp/mnt
cp -a /dev /tmp/mnt
cp -a /etc /tmp/mnt
cp -a /home /tmp/mnt
cp -a /lib /tmp/mnt
cp -a /media /tmp/mnt
cp -a /opt /tmp/mnt
cp -a /root /tmp/mnt
cp -a /sbin /tmp/mnt
cp -a /srv /tmp/mnt
cp -a /sys /tmp/mnt
mkdir /tmp/mnt/usr
mkdir /tmp/mnt/usr/bin
cp -a /usr/bin /tmp/mnt/usr
mkdir /tmp/mnt/usr/sbin
cp -a /usr/sbin /tmp/mnt/usr
mkdir /tmp/mnt/usr/spool
cp -a /usr/spool /tmp/mnt/usr
mkdir /tmp/mnt/usr/local
cp -a /usr/local /tmp/mnt/usr
mkdir /tmp/mnt/usr/share
cp -a /usr/share /tmp/mnt/usr
mkdir /tmp/mnt/usr/lib
cp -a /usr/lib /tmp/mnt/usr
cp -a /var /tmp/mnt
umount /tmp/mnt
gzip -c -9 /tmp/pt0100 > /tmp/pt0100.gz
mkdosfs -F 16 /dev/sdb1
dd if=/usr/lib/syslinux/mbr.bin of=/dev/sdb
syslinux  /dev/sdb1
mount /dev/sdb1 /tmp/mnt
echo "DEFAULT Lite" > /tmp/mnt/syslinux.cfg
echo "PROMPT 1" >> /tmp/mnt/syslinux.cfg
echo "IMPLICIT 0" >> /tmp/mnt/syslinux.cfg
echo "TIMEOUT 30" >> /tmp/mnt/syslinux.cfg
echo " " >> /tmp/mnt/syslinux.cfg
echo "LABEL Lite" >> /tmp/mnt/syslinux.cfg
echo " KERNEL vmlinuz" >> /tmp/mnt/syslinux.cfg
echo "APPEND initrd=pt0100.gz ramdisk=1500000 rw root=/dev/ram" >>
cp /boot/vmlinuz /tmp/mnt
cp /tmp/pt0100.gz /tmp/mnt
fdisk /dev/sdb
umount /tmp/mnt

Neal Nelson & Associates

More information about the Syslinux mailing list