[syslinux] standalone bootable usb-stick

Alvin Oga aoga at mail.Linux-Consulting.com
Tue Sep 20 09:00:16 PDT 2005


hi ya syslinuxerz 

- i've been slowly working on a making a custom bootable
  standalone usb-stick with X11 and kde

	
- it's basically builds itself off of a slackware-10.1 server

	- create a custom initrd.gz  ( /dev/ram0 ) 
	http://linux-boot.net/Bootable/InitRD/

	- create a custom rootfs.gz  ( /dev/loop0 ) 
	http://linux-boot.net/Bootable/RootFS/

	- create X11 and kde loopfiles
	http://linux-boot.net/Bootable/Patches.X11/
	http://linux-boot.net/Bootable/Patches.KDE/

	( i created this mess because i do not want to use busybox )

- there's nothing odd about initrd.gz, rootfs.gz, x11 and kde  
  since it works ( boots up and runs fine ) with:

	- it boots with lilo-22.7
		http://linux-boot.net/Bootable/Patches.RootFS/ \
			Patches/boot/lilo/lilo.sda.2.4.31.conf

	- it boots with grub ( from cvs )
		http://linux-boot.net/Bootable/Patches.RootFS/ \
			Patches/boot/grub/menu.usb.lst

	- it fails with syslinux

- i suspect i'm missing a line in /linuxrc that is required by syslinux
----------------------------------------------------------------------

	http://linux-boot.net/Bootable/InitRD.LinuxRC/ \
		LinuxRC-2005/linuxrc.cfusb

    ==========
    /linuxrc:
    ==========
	mount -n -o rw,remount /
	mount -t proc proc /proc
	mount -n -o rw,remount -t ext2 /dev/ram0 /
	mount    -o rw,remount -t ext2 /dev/ram0 /
	- load vfat, fat, dos, usb-modules

	# mount the usb stick
	mount /dev/sda1 /mnt/sda1
	losetup /dev/loop0 /mnt/sda1/LoopFile  ( the rootfs )
	mount /dev/loop0 /mnt/RootFS 

	# instead of pivot_root
	echo '0x700' > /proc/sys/kernel/real-root-dev

	# # not used, seems to work without it for lilo/grub
	# exec chroot /mnt/RootFS /sbin/init

	# exit /linurc and turn control over to /sbin/init which
	# works  since i can get into init 3, init 4 or init 5 

---------------------------------------------------------------
- but syslinux cannot find /dev/loop0 for some reason that has
  been driving me batty
---------------------------------------------------------------

	http://linux-boot.net/Bootable/Patches.RootFS \
		Patches/boot/syslinux/syslinux.cfg

	#
	# the 2 lines that i'm wondering about:
	#
	kernel vmlinuz
	append initrd=initrd.gz load_ramdisk=1 ramdisk_size=8192 \
		boot=/dev/ram0 root=/dev/loop0

	- it still will not boot even if i have init=/linuxrc
	or root=700


	- what am i looking at that is flying right past me for 
	configuring syslinux to boot /dev/sda1 ??
        
        - yes, i have USB-HDD and it gets thru initrd and /linuxrc
        but it cannot find /dev/loop



- the script that builds the usb-stick

	http://linux-boot.net/Bootable/Bootable-HOWTO-Scripts \
		Scripts-2005/Standalone.Install.2005.0912.sh.txt

    making the bootable usb-stick
   -------------------------------
	dd if=/dev/zero of=/dev/sda bs=446 count=1 conv=sync
	mkfs.msdos -n USB-Stick -F 16 /dev/sda1

	mount /dev/sda1 /mnt/USB
	cp vmlinuz-2.4.31ow.p4 initrd.gz rootfs.gz /mnt/USB


	# use the mbr form syslinux-3.11
	dd if=/$path/syslinux/mbr.bin of=/dev/sda bs=446 count=1
	cp /$path/syslinux-3.11/isolinux.bin  /mnt/USB


----

another odd thing is syslinux-3.11 ( the way i've built the usb-stick )
does not like the hierachy ( it can't find linux, even if i'm using
vmlinuz ) 

	/boot/vmlinuz
	/boot/syslinux/syslinux.cf

thanx
alvin




More information about the Syslinux mailing list