diff options
author | Robert Yang <liezhi.yang@windriver.com> | 2015-02-13 00:59:08 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-02-15 21:58:29 +0000 |
commit | a2bfd4b1fb055e63a48d80e7e55a6cff475e06d1 (patch) | |
tree | 104a6937a3153b4dbf78e6111c36be6cd213be13 /meta/recipes-devtools/syslinux/syslinux/0009-linux-syslinux-implement-install_bootblock.patch | |
parent | 06ff3c420ca3b4237271879571d9933bbe6463ec (diff) | |
download | poky-a2bfd4b1fb055e63a48d80e7e55a6cff475e06d1.tar.gz |
syslinux: support ext2/3/4 device
* Support ext2/3/4 deivce.
* The open_ext2_fs() checks whether it is an ext2/3/4 device,
do the ext2/3/4 installation (install_to_ext2()) if yes, otherwise go
on to the fat/ntfs.
* The ext2/3/4 support doesn't require root privileges since it doesn't need
mount (but write permission is required).
Next:
* Get rid of fat filesystem from the boot image.
These patches have been sent to upstream, we may adjust them (maybe put
the extX support to syslinux-mtools), I will go on working with the
upstream.
(From OE-Core rev: d5af8539c0a1718a7254bcdcfa973e3c887dfbd6)
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/syslinux/syslinux/0009-linux-syslinux-implement-install_bootblock.patch')
-rw-r--r-- | meta/recipes-devtools/syslinux/syslinux/0009-linux-syslinux-implement-install_bootblock.patch | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/meta/recipes-devtools/syslinux/syslinux/0009-linux-syslinux-implement-install_bootblock.patch b/meta/recipes-devtools/syslinux/syslinux/0009-linux-syslinux-implement-install_bootblock.patch new file mode 100644 index 0000000000..cd89d92485 --- /dev/null +++ b/meta/recipes-devtools/syslinux/syslinux/0009-linux-syslinux-implement-install_bootblock.patch | |||
@@ -0,0 +1,50 @@ | |||
1 | From 76c465e87312dbc6cffd05427f1f4d2ebdee4f13 Mon Sep 17 00:00:00 2001 | ||
2 | From: Robert Yang <liezhi.yang@windriver.com> | ||
3 | Date: Fri, 2 Jan 2015 12:28:35 +0800 | ||
4 | Subject: [PATCH 9/9] linux/syslinux: implement install_bootblock() | ||
5 | |||
6 | Refer to the install_bootblock() in extlinux/main.c to make | ||
7 | linux/syslinux.c's install_bootblock() which only supports ext2/3/4. | ||
8 | |||
9 | Upstream-Status: Submitted | ||
10 | |||
11 | Signed-off-by: Robert Yang <liezhi.yang@windriver.com> | ||
12 | Tested-by: Du Dolpher <dolpher.du@intel.com> | ||
13 | --- | ||
14 | linux/syslinux.c | 20 ++++++++++++++++++++ | ||
15 | 1 file changed, 20 insertions(+) | ||
16 | |||
17 | diff --git a/linux/syslinux.c b/linux/syslinux.c | ||
18 | index c741750..917f83a 100755 | ||
19 | --- a/linux/syslinux.c | ||
20 | +++ b/linux/syslinux.c | ||
21 | @@ -419,6 +419,26 @@ static int ext_file_write(ext2_file_t e2_file, const void *buf, size_t count, | ||
22 | */ | ||
23 | int install_bootblock(int fd, const char *device) | ||
24 | { | ||
25 | + struct ext2_super_block sb; | ||
26 | + | ||
27 | + if (xpread(fd, &sb, sizeof sb, EXT2_SUPER_OFFSET + opt.offset) != sizeof sb) { | ||
28 | + perror("reading superblock"); | ||
29 | + return 1; | ||
30 | + } | ||
31 | + | ||
32 | + if (sb.s_magic != EXT2_SUPER_MAGIC) { | ||
33 | + fprintf(stderr, | ||
34 | + "no ext2/3/4 superblock found on %s\n", device); | ||
35 | + return 1; | ||
36 | + } | ||
37 | + | ||
38 | + if (xpwrite(fd, syslinux_bootsect, syslinux_bootsect_len, 0) | ||
39 | + != (signed)syslinux_bootsect_len) { | ||
40 | + perror("writing bootblock"); | ||
41 | + return 1; | ||
42 | + } | ||
43 | + | ||
44 | + return 0; | ||
45 | } | ||
46 | |||
47 | /* The file's block count */ | ||
48 | -- | ||
49 | 1.9.1 | ||
50 | |||