source: trunk/packages/sipb-xen-guest-installer/partial/post-copy @ 711

Last change on this file since 711 was 245, checked in by price, 17 years ago

Prototype fast installer using a special guest.

Rather than poke directly in the boot sector, partition table,
etc, which caused so much pain last week (r231), we just dd
the entire disk. Then we poke at the bits that need to change
(like secrets, the hostname, the root password, the filesystem uuids).
Since this poking is distribution-dependent, we want it to be
supplied by the image, so to make that safe we run it in a VM.

The plan is

  1. source image is dd'd (in the host) to the target image
  2. special copying-installer image is booted, with access to target and to a small image containing its arguments
  3. copying-installer guest reads arguments, mounts target, runs a script with a well-known name in target, passing arguments.

Bits I haven't done yet include

  • frob grub config in the copying-installer image so it boots with init = the copying-installer script (doing this manually for testing)
  • install script into copying-installer, or into my example image, in a sane automated way (they're checked into partial/ here)
  • all the tasks the image's script ought to actually carry out
  • make this all available from remctl and the web pages.
File size: 164 bytes
Line 
1#!/bin/bash
2TARGET="$1"
3HOSTNAME="$2"
4ROOTPW="$3"
5(printf "%s\n" "$ROOTPW"; sleep .2; printf "%s\n" "$ROOTPW") \
6 | /usr/sbin/chroot "$TARGET" /usr/bin/passwd root
Note: See TracBrowser for help on using the repository browser.