init: Add a hook to download files

Add a hook to download a read-only file system image file from
a URL using TFTP, HTTP, or FTP.  The URL is retrieved from a
u-boot environment variable unless the file is already in the
initramfs image.  Only execute this command if the previously
established options file has a keyword trigger.  Do not even
consider the option if a build option flag is not set to y,
and allow each protocol to be disabled by simiar build options.

This allows one to specify at u-boot commands that would download
a read-only file system into memory for execution this boot instead
of needing to create a custom initramfs to netboot or specifying
debug-init-sh, entering the password, and doing the download from
the shell.

Note: Access to set u-boot environment variables implys the
ability to replace the kernel and initramfs session.  Access to
the variables and the serial console likely gives full root access
to the system at this time.  The existing shutdown and update
scripts have paths that expose a root shell to the serial port
without a prior password challenge.

Signed-off-by: Milton Miller <miltonm@us.ibm.com>
1 file changed
tree: f354defbb093b40e80437f277ec5d1a5de12bed5
  1. classes/
  2. common/
  3. conf/
  4. COPYING.apache-2.0
  5. COPYING.MIT
  6. LICENSE