Skip to contentSkip to conversation

syslinux: support ext2/3/4 device

PATCH New Robert Yang 1 participant 2 messages Feb 13, 2015

lore
Share & tools
lore
#0 lore raw

cover syslinux: support ext2/3/4 device

The following changes since commit 6bf5cbbcac80ee818cc932d69227e70e41ce02d3:

libtool: Fix option parsing performance regression (2015-02-10 22:36:09 +0000)

are available in the git repository at:

git://git.openembedded.org/openembedded-core-contrib rbt/syslinux
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=rbt/syslinux

Robert Yang (1):
syslinux: support ext2/3/4 device

 ...01-linux-syslinux-support-ext2-3-4-device.patch |   84 ++++
 ...002-linux-syslinux-implement-open_ext2_fs.patch |  141 +++++++
 ...-linux-syslinux-implement-install_to_ext2.patch |  116 ++++++
 ...inux-add-ext_file_read-and-ext_file_write.patch |   91 +++++
 ...inux-syslinux-implement-handle_adv_on_ext.patch |  127 ++++++
 ...nux-implement-write_to_ext-and-add-syslin.patch |  215 ++++++++++
 ...slinux-implement-ext_construct_sectmap_fs.patch |   84 ++++
 ...r-syslinuxext-implement-syslinux_patch_bo.patch |  427 ++++++++++++++++++++
 ...inux-syslinux-implement-install_bootblock.patch |   50 +++
 meta/recipes-devtools/syslinux/syslinux_6.03.bb    |   11 +-
 10 files changed, 1345 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-devtools/syslinux/syslinux/0001-linux-syslinux-support-ext2-3-4-device.patch
 create mode 100644 meta/recipes-devtools/syslinux/syslinux/0002-linux-syslinux-implement-open_ext2_fs.patch
 create mode 100644 meta/recipes-devtools/syslinux/syslinux/0003-linux-syslinux-implement-install_to_ext2.patch
 create mode 100644 meta/recipes-devtools/syslinux/syslinux/0004-linux-syslinux-add-ext_file_read-and-ext_file_write.patch
 create mode 100644 meta/recipes-devtools/syslinux/syslinux/0005-linux-syslinux-implement-handle_adv_on_ext.patch
 create mode 100644 meta/recipes-devtools/syslinux/syslinux/0006-linux-syslinux-implement-write_to_ext-and-add-syslin.patch
 create mode 100644 meta/recipes-devtools/syslinux/syslinux/0007-linux-syslinux-implement-ext_construct_sectmap_fs.patch
 create mode 100644 meta/recipes-devtools/syslinux/syslinux/0008-libinstaller-syslinuxext-implement-syslinux_patch_bo.patch
 create mode 100644 meta/recipes-devtools/syslinux/syslinux/0009-linux-syslinux-implement-install_bootblock.patch
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 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.

---
 ...01-linux-syslinux-support-ext2-3-4-device.patch |   84 ++++
 ...002-linux-syslinux-implement-open_ext2_fs.patch |  141 +++++++
 ...-linux-syslinux-implement-install_to_ext2.patch |  116 ++++++
 ...inux-add-ext_file_read-and-ext_file_write.patch |   91 +++++
 ...inux-syslinux-implement-handle_adv_on_ext.patch |  127 ++++++
 ...nux-implement-write_to_ext-and-add-syslin.patch |  215 ++++++++++
 ...slinux-implement-ext_construct_sectmap_fs.patch |   84 ++++
 ...r-syslinuxext-implement-syslinux_patch_bo.patch |  427 ++++++++++++++++++++
 ...inux-syslinux-implement-install_bootblock.patch |   50 +++
 meta/recipes-devtools/syslinux/syslinux_6.03.bb    |   11 +-
 10 files changed, 1345 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-devtools/syslinux/syslinux/0001-linux-syslinux-support-ext2-3-4-device.patch
 create mode 100644 meta/recipes-devtools/syslinux/syslinux/0002-linux-syslinux-implement-open_ext2_fs.patch
 create mode 100644 meta/recipes-devtools/syslinux/syslinux/0003-linux-syslinux-implement-install_to_ext2.patch
 create mode 100644 meta/recipes-devtools/syslinux/syslinux/0004-linux-syslinux-add-ext_file_read-and-ext_file_write.patch
 create mode 100644 meta/recipes-devtools/syslinux/syslinux/0005-linux-syslinux-implement-handle_adv_on_ext.patch
 create mode 100644 meta/recipes-devtools/syslinux/syslinux/0006-linux-syslinux-implement-write_to_ext-and-add-syslin.patch
 create mode 100644 meta/recipes-devtools/syslinux/syslinux/0007-linux-syslinux-implement-ext_construct_sectmap_fs.patch
 create mode 100644 meta/recipes-devtools/syslinux/syslinux/0008-libinstaller-syslinuxext-implement-syslinux_patch_bo.patch
 create mode 100644 meta/recipes-devtools/syslinux/syslinux/0009-linux-syslinux-implement-install_bootblock.patch
meta/recipes-devtools/syslinux/syslinux/0001-linux-syslinux-support-ext2-3-4-device.patch new file +84 -0
new file mode 100644
index 0000000..3ab7875
@@ -0,0 +1,84 @@
+From 60f3833ab2b5899771b4eab654e88f9888b99501 Mon Sep 17 00:00:00 2001
+From: Robert Yang <[email protected]>
+Date: Wed, 31 Dec 2014 16:01:55 +0800
+Subject: [PATCH 1/9] linux/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).
+
+Upstream-Status: Submitted
+
+Signed-off-by: Robert Yang <[email protected]>
+Tested-by: Du Dolpher <[email protected]>
+---
+ linux/syslinux.c | 36 ++++++++++++++++++++++++++++++++++++
+ 1 file changed, 36 insertions(+)
+
+diff --git a/linux/syslinux.c b/linux/syslinux.c
+index 912de71..36fc202 100755
+--- a/linux/syslinux.c
++++ b/linux/syslinux.c
+@@ -256,6 +256,23 @@ int do_open_file(char *name)
+     return fd;
+ }
+ 
++/*
++ * Check whether the device contains an ext2, ext3 or ext4 fs and open it if
++ * true.
++ * return value:
++ * 0: Everything is OK
++ * 1: Not an ext2, ext3 or ext4
++ * -1: unexpected error
++ */
++static int open_ext2_fs(const char *device, const char *subdir)
++{
++}
++
++/* The install func for ext2, ext3 and ext4 */
++static int install_to_ext2(const char *device, int dev_fd, const char *subdir)
++{
++}
++
+ int main(int argc, char *argv[])
+ {
+     static unsigned char sectbuf[SECTOR_SIZE];
+@@ -313,6 +330,24 @@ int main(int argc, char *argv[])
+ 	die("can't combine an offset with a block device");
+     }
+ 
++    /*
++     * Check if it is an ext2, ext3 or ext4
++     */
++    rv = open_ext2_fs(opt.device, subdir);
++    if (rv == 0) {
++        if (install_to_ext2(opt.device, dev_fd, subdir)) {
++            fprintf(stderr, "%s: installation failed\n", opt.device);
++            exit(1);
++        }
++        return 0;
++    /* Unexpected errors */
++    } else if (rv == -1) {
++        exit(1);
++    }
++
++    /* Reset rv */
++    rv = 0;
++
+     xpread(dev_fd, sectbuf, SECTOR_SIZE, opt.offset);
+     fsync(dev_fd);
+ 
+@@ -322,6 +357,7 @@ int main(int argc, char *argv[])
+      */
+     if ((errmsg = syslinux_check_bootsect(sectbuf, &fs_type))) {
+ 	fprintf(stderr, "%s: %s\n", opt.device, errmsg);
++	fprintf(stderr, "%s: supported fs: fat/ntfs/ext2/ex3/ext4\n", program);
+ 	exit(1);
+     }
+ 
+-- 
+1.9.1
+
meta/recipes-devtools/syslinux/syslinux/0002-linux-syslinux-implement-open_ext2_fs.patch new file +141 -0

141 lines not on this page · raw message

meta/recipes-devtools/syslinux/syslinux/0003-linux-syslinux-implement-install_to_ext2.patch new file +116 -0

116 lines not on this page · raw message

meta/recipes-devtools/syslinux/syslinux/0004-linux-syslinux-add-ext_file_read-and-ext_file_write.patch new file +91 -0

91 lines not on this page · raw message

meta/recipes-devtools/syslinux/syslinux/0005-linux-syslinux-implement-handle_adv_on_ext.patch new file +127 -0

127 lines not on this page · raw message

meta/recipes-devtools/syslinux/syslinux/0006-linux-syslinux-implement-write_to_ext-and-add-syslin.patch new file +215 -0

215 lines not on this page · raw message

meta/recipes-devtools/syslinux/syslinux/0007-linux-syslinux-implement-ext_construct_sectmap_fs.patch new file +84 -0

84 lines not on this page · raw message

meta/recipes-devtools/syslinux/syslinux/0008-libinstaller-syslinuxext-implement-syslinux_patch_bo.patch new file +427 -0

427 lines not on this page · raw message

meta/recipes-devtools/syslinux/syslinux/0009-linux-syslinux-implement-install_bootblock.patch new file +50 -0

50 lines not on this page · raw message

meta/recipes-devtools/syslinux/syslinux_6.03.bb +10 -1
index 7e3176e..33dd776 100644
@@ -6,12 +6,21 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \
 
 # If you really want to run syslinux, you need mtools.  We just want the
 # ldlinux.* stuff for now, so skip mtools-native
-DEPENDS = "nasm-native util-linux"
+DEPENDS = "nasm-native util-linux e2fsprogs"
 
 SRC_URI = "${KERNELORG_MIRROR}/linux/utils/boot/syslinux/6.xx/syslinux-${PV}.tar.xz \
            file://syslinux-fix-parallel-building-issue.patch \
            file://syslinux-libupload-depend-lib.patch \
            file://syslinux-remove-clean-script.patch \
+           file://0001-linux-syslinux-support-ext2-3-4-device.patch \
+           file://0002-linux-syslinux-implement-open_ext2_fs.patch \
+           file://0003-linux-syslinux-implement-install_to_ext2.patch \
+           file://0004-linux-syslinux-add-ext_file_read-and-ext_file_write.patch \
+           file://0005-linux-syslinux-implement-handle_adv_on_ext.patch \
+           file://0006-linux-syslinux-implement-write_to_ext-and-add-syslin.patch \
+           file://0007-linux-syslinux-implement-ext_construct_sectmap_fs.patch \
+           file://0008-libinstaller-syslinuxext-implement-syslinux_patch_bo.patch \
+           file://0009-linux-syslinux-implement-install_bootblock.patch \
            "
 
 SRC_URI[md5sum] = "92a253df9211e9c20172796ecf388f13"
Signature · 1 line
1.7.9.5