linux/Documentation
Dr. Tilmann Bubeck 393d1d1d76 ext4: implementation of a new ioctl called EXT4_IOC_SWAP_BOOT
Add a new ioctl, EXT4_IOC_SWAP_BOOT which swaps i_blocks and
associated attributes (like i_blocks, i_size, i_flags, ...) from the
specified inode with inode EXT4_BOOT_LOADER_INO (#5). This is
typically used to store a boot loader in a secure part of the
filesystem, where it can't be changed by a normal user by accident.
The data blocks of the previous boot loader will be associated with
the given inode.

This usercode program is a simple example of the usage:

int main(int argc, char *argv[])
{
  int fd;
  int err;

  if ( argc != 2 ) {
    printf("usage: ext4-swap-boot-inode FILE-TO-SWAP\n");
    exit(1);
  }

  fd = open(argv[1], O_WRONLY);
  if ( fd < 0 ) {
    perror("open");
    exit(1);
  }

  err = ioctl(fd, EXT4_IOC_SWAP_BOOT);
  if ( err < 0 ) {
    perror("ioctl");
    exit(1);
  }

  close(fd);
  exit(0);
}

[ Modified by Theodore Ts'o to fix a number of bugs in the original code.]

Signed-off-by: Dr. Tilmann Bubeck <t.bubeck@reinform.de>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-04-08 12:54:05 -04:00
..
2012-12-15 13:03:48 -08:00
2012-04-03 13:09:18 +02:00
2012-10-08 13:50:12 +10:30
2013-03-05 17:22:08 -08:00
2012-12-14 08:48:59 +01:00
2013-03-18 21:19:49 +01:00
2012-07-18 18:35:57 -07:00
2013-03-02 20:09:50 +00:00
2013-01-10 01:27:46 +01:00
2012-11-11 18:10:46 -08:00
2013-02-23 17:50:23 -08:00
2012-12-18 21:10:22 -08:00
2013-02-21 12:05:51 -08:00
2012-03-16 20:35:01 +00:00
2012-07-29 21:11:05 -03:00
2012-12-10 15:54:27 +01:00
2012-12-05 23:52:10 +00:00
2013-02-19 08:42:37 +01:00
2012-02-28 16:05:06 +01:00
2013-03-08 15:05:34 -08:00
2013-03-08 15:05:34 -08:00