mirror of
https://git.yoctoproject.org/git/poky
synced 2026-01-01 13:58:04 +00:00
* 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>
51 lines
1.4 KiB
Diff
51 lines
1.4 KiB
Diff
From 76c465e87312dbc6cffd05427f1f4d2ebdee4f13 Mon Sep 17 00:00:00 2001
|
|
From: Robert Yang <liezhi.yang@windriver.com>
|
|
Date: Fri, 2 Jan 2015 12:28:35 +0800
|
|
Subject: [PATCH 9/9] linux/syslinux: implement install_bootblock()
|
|
|
|
Refer to the install_bootblock() in extlinux/main.c to make
|
|
linux/syslinux.c's install_bootblock() which only supports ext2/3/4.
|
|
|
|
Upstream-Status: Submitted
|
|
|
|
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
|
|
Tested-by: Du Dolpher <dolpher.du@intel.com>
|
|
---
|
|
linux/syslinux.c | 20 ++++++++++++++++++++
|
|
1 file changed, 20 insertions(+)
|
|
|
|
diff --git a/linux/syslinux.c b/linux/syslinux.c
|
|
index c741750..917f83a 100755
|
|
--- a/linux/syslinux.c
|
|
+++ b/linux/syslinux.c
|
|
@@ -419,6 +419,26 @@ static int ext_file_write(ext2_file_t e2_file, const void *buf, size_t count,
|
|
*/
|
|
int install_bootblock(int fd, const char *device)
|
|
{
|
|
+ struct ext2_super_block sb;
|
|
+
|
|
+ if (xpread(fd, &sb, sizeof sb, EXT2_SUPER_OFFSET + opt.offset) != sizeof sb) {
|
|
+ perror("reading superblock");
|
|
+ return 1;
|
|
+ }
|
|
+
|
|
+ if (sb.s_magic != EXT2_SUPER_MAGIC) {
|
|
+ fprintf(stderr,
|
|
+ "no ext2/3/4 superblock found on %s\n", device);
|
|
+ return 1;
|
|
+ }
|
|
+
|
|
+ if (xpwrite(fd, syslinux_bootsect, syslinux_bootsect_len, 0)
|
|
+ != (signed)syslinux_bootsect_len) {
|
|
+ perror("writing bootblock");
|
|
+ return 1;
|
|
+ }
|
|
+
|
|
+ return 0;
|
|
}
|
|
|
|
/* The file's block count */
|
|
--
|
|
1.9.1
|
|
|