[syslinux] Trying to create bootable USB flash drive WITHOUT persistence

Gene Cumm gene.cumm at gmail.com
Wed Sep 23 19:17:02 PDT 2015


On Wed, Sep 23, 2015 at 9:29 PM, Paul D. DeRocco via Syslinux
<syslinux at zytor.com> wrote:
> I've got an embedded x86 system built with Yocto, which boots from a USB
> flash drive. It uses a loop mount to give access to an ext3 root file
> system contained within a FAT16 file, which means it has persistent
> storage. What I want is something that boots from the flash drive, but
> copies everything into a large RAM disk, and runs from there, so that it
> doesn't touch the flash drive once it's booted, and has no persistence, so
> that it's always a clean boot. My system has a gig of RAM, and the file
> system is about a third of that, so there should be plenty of room. The
> Yocto build also creates an .iso file, which I believe works that way,
> although I haven't tried it. So I'm wondering if running isohybrid on this
> .iso image will give me what I want.

If the ISO is built that way AND the kernel/initrd know how to find
the ISO.  Just because it's there doesn't imply that the kernel/initrd
have the logic to perform your goals.

On the otherhand, also look at TinyCore Linux ( http://www.tinycorelinux.net ).

> If it does, I have a second question. My USB drive actually has two
> partitions, the first of which is a small FAT partition that contains
> persistent data, and is visible if the drive is ever plugged into a
> Windows system; and a second partition which is the boot partition
> containing the live image produced by the Yocto build. If I use isohybrid,
> it will overwrite everything. Once I've done this, would it be possible to
> manually extract the boot partition with dd, then repartition the device
> the way I need it, and write the boot partition data back to the second
> partition, and have it still work?

isohybrid only affects the image.  There are two basic styles, as a
whole disk image with partition table or as a partition image.  If you
use partition-style and set the MBR accordingly, it should boot the
partition.

> If so, a third question: If I do a new build, can I replace the ROOTFS.IMG
> file in that second partition with the xxx.rootfs.ext3 file created by the
> build, without having to go through all the repartitioning rigamarole?

With isohybrid in partition-style, the entire partition is an ISO9660
file system.  You'll typically need to recompose the ISO to edit
anything inside the ISO.  If your partitions leave space, you won't
need to repartition when applying a new image to the partition.

-- 
-Gene


More information about the Syslinux mailing list