From: Rod Whitby <rod@whitby.id.au>
To: openembedded-devel@lists.openembedded.org
Subject: RFC: customisable pivot-root functionality
Date: Thu, 25 Jan 2007 13:45:13 +1030 [thread overview]
Message-ID: <45B820C1.1090100@whitby.id.au> (raw)
In-Reply-To: <45B66852.6020801@whitby.id.au>
As part of the "remove all slugos-specific stuff from OE, and make it
generally useful and available to multiple distributions" effort, I need
to replicate the current slugos-init pivot-root functionality, and I
want to do it in a way which might be useful for other OE platforms (or
at least is not tied to one specific NSLU2 distribution). At a minimum,
I want to use it for a derivative of Angstrom, which I'm calling
"MokoSlug" and possible retro-fit it into the Unslung firmware too.
First I'll describe how it currently works, and then I'll ask for input
on how the same functionality might be useful on other OE platforms.
When an NSLU2 boots the OpenEmbedded-based SlugOS firmware, the kernel
and rootfs are loaded from internal flash. The JFFS2 rootfs is
functional as-is on first boot, and has enough functionality
out-of-the-box to run ipkg update and ipkg install. The trouble is that
there is not much room in an 8MB flash for a kernel, functional rootfs,
and additional packages. Also, you don't want to be continually writing
to the internal flash (yes, you can use ramdisks for some things, but
you often want persistant regular changes to your rootfs that don't
require a copy-on-shutdown to preserve the information).
So we have a script called "turnup" which allows you to modify the jffs2
rootfs's /linuxrc file to load the rootfs from an external disk (or over
nfs for that matter). I've included the help text from turnup at the
end of this message.
Then on the next boot, the new /linuxrc file is executed, and the rootfs
is loaded from external disk - giving you all the room in the world to
install new packages (without having to go through ipkg-link or bind
mount contortions).
The other advantage of this scheme is that if your external disk fails
(or is unplugged), then the boot falls back to the internal flash, which
has enough functionality to debug and fix the reasons why the boot from
external disk failed (assuming it wasn't your cat unplugging the usb cable).
So the questions are:
1) Is there similar functionality elsewhere in OE that I haven't seen,
and could just use as-is?
2) Would this functionality be of use to any other devices that use OE?
3) Who else is interested in giving input to, and reviewing the output
of, this effort?
Thanks,
-- Rod
[turnup script help follows]
root@nslu2:~$ turnup
usage: turnup command [options]
commands:
help
output this help
init
correct errors in network information
initialise network information when DHCP is not available
change network information
disk [-i] [-s<seconds>] <device>|<uuid> [mount options]
With -i make <device> a bootable file system then (with or
without -i) arrange for the next reboot to use that device.
The device must already be formatted as a file system, with
-i it must be completely empty, without it must contain an
apparently bootable file system. -s (for example -s5)
specifies a delay in seconds to wait at boot time before
mounting the device.
memstick [-i] <device>|<uuid> [mount options]
Behaves as disk however options appropriate to a flash memory
stick are automatically added
nfs [-i] <nfs mount path> [mount options]
<nfs mount path> must be a mountable NFS file system. With
-i the partition must be empty and is initialised with a
bootable file system. Without -i the partition must already
contain a bootable file system. In either case the NFS
partition must be available to be mounted without root id
sqashing (i.e. root must be root) and it will be selected
as the root file system for subsequent reboots.
A default set of -o options are provided, additional options
may be given on the command line (multiple -o options will
be combined into a single -o).
flash
Revert to booting from the flash disk on next reboot.
ram
Boot (once) into a ramdisk, subsequent boots will be to
the flash file system.
preserve
Save the system configuration to the SysConf partition, you
will need to create the SysConf partition from the boot loader
before using this if SysConf does not already exist. This
just runs 'sysconf save'.
restore
Restore a previously saved system configuration. This just
runs 'sysconf restore'.
disk formatting:
The argument to 'nfs' or 'disk' must be an empty partition
of sufficient size to hold the root file system (at least
16MByte but more is recommended to allow package installation).
An appropriate ext3 partition can be made using the command:
mke2fs -j <device> # for example: /dev/sda1
An appropriate NFS partition can be emptied using 'rm', but
must be set up (exported) on the NFS server.
root@nslu2:~$
next prev parent reply other threads:[~2007-01-25 3:15 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-22 0:12 RFC: Adding a new global MACHINE_ENDIAN variable Rod Whitby
2007-01-22 17:01 ` Koen Kooi
2007-01-22 19:14 ` Rod Whitby
2007-01-22 20:03 ` Koen Kooi
2007-01-23 0:10 ` Deprecating ixp4xx, nslu2 in favour of endian-specific machine settings (Was: RFC on MACHINE_ENDIAN) Rod Whitby
2007-01-23 5:40 ` Removal of the proprietary Intel IXP ethernet driver (ixp4{00, 25}-eth, ixp-osal, ixp4xx-csr) from OE Rod Whitby
2007-01-23 19:23 ` Robert Wörle
2007-01-23 19:56 ` Rod Whitby
2007-01-25 3:15 ` Rod Whitby [this message]
2007-01-25 3:53 ` RFC: customisable pivot-root functionality Justin Patrin
2007-01-25 12:45 ` Cliff Brake
2007-01-25 16:54 ` Hans Henry von Tresckow
2009-04-20 5:52 ` Removal of the proprietary Intel IXP ethernet driver (ixp4{00, 25}-eth, ixp-osal, ixp4xx-csr) from OE Rod Whitby
2007-01-23 11:13 ` Deprecating ixp4xx, nslu2 in favour of endian-specific machine settings (Was: RFC on MACHINE_ENDIAN) Richard Purdie
2007-01-23 19:37 ` Rod Whitby
2007-01-23 20:34 ` Richard Purdie
2007-01-24 6:41 ` SITEINFO_ENDIAN(N)ESS (NN, not N) Rod Whitby
2007-01-24 6:44 ` Rod Whitby
2007-01-28 12:41 ` Deprecating ixp4xx, nslu2 in favour of endian-specific machine settings (Was: RFC on MACHINE_ENDIAN) Rod Whitby
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=45B820C1.1090100@whitby.id.au \
--to=rod@whitby.id.au \
--cc=openembedded-devel@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.