search for: syslinux_adv

Displaying 13 results from an estimated 13 matches for "syslinux_adv".

2015 Nov 13
4
[PATCH] extlinux: code cleanup and simplification
...2a396a 100644 --- a/extlinux/main.c +++ b/extlinux/main.c @@ -338,6 +338,59 @@ static int patch_file_and_bootblock(int fd, const char *dir, int devfd) return rv; } +static int ext_read_adv_offset(int devfd, off_t offset) +{ + const size_t adv_size = 2 * ADV_SIZE; + + if (xpread(devfd, syslinux_adv, adv_size, offset) != adv_size) + return -1; + + return syslinux_validate_adv(syslinux_adv) ? 1 : 0; +} + +static int ext_read_adv(const char *path, int devfd, const char **namep) +{ + int err; + const char *name; + + if (fs_type == BTRFS) { + /* btrfs "ldlinux.sys" is in...
2015 Nov 12
1
[PATCH] Unification of ext_(write/read)_adv
...it a/extlinux/main.c b/extlinux/main.c index 6871fb1..385b364 100644 --- a/extlinux/main.c +++ b/extlinux/main.c @@ -1415,21 +1415,12 @@ static int open_device(const char *path, struct stat *st, char **_devname) return devfd; } -static int btrfs_read_adv(int devfd) -{ - if (xpread(devfd, syslinux_adv, 2 * ADV_SIZE, BTRFS_ADV_OFFSET) - != 2 * ADV_SIZE) - return -1; - - return syslinux_validate_adv(syslinux_adv) ? 1 : 0; -} - -static inline int xfs_read_adv(int devfd) +static int ext_read_adv_offset(int devfd, off_t offset) { const size_t adv_size = 2 * ADV_SIZE; - if (xpread(devfd,...
2015 Nov 18
0
[PATCH] extlinux: code cleanup and simplification
...ux/main.c > @@ -338,6 +338,59 @@ static int patch_file_and_bootblock(int fd, const char > *dir, int devfd) > return rv; > } > > +static int ext_read_adv_offset(int devfd, off_t offset) > +{ > + const size_t adv_size = 2 * ADV_SIZE; > + > + if (xpread(devfd, syslinux_adv, adv_size, offset) != adv_size) > + return -1; > + > + return syslinux_validate_adv(syslinux_adv) ? 1 : 0; > +} > + > +static int ext_read_adv(const char *path, int devfd, const char **namep) > +{ > + int err; > + const char *name; > + > + if (fs_ty...
2015 Nov 26
0
[syslinux:master] extlinux: code cleanup and simplification
...7ebd49 100644 --- a/extlinux/main.c +++ b/extlinux/main.c @@ -338,6 +338,59 @@ static int patch_file_and_bootblock(int fd, const char *dir, int devfd) return rv; } +static int ext_read_adv_offset(int devfd, off_t offset) +{ + const size_t adv_size = 2 * ADV_SIZE; + + if (xpread(devfd, syslinux_adv, adv_size, offset) != adv_size) + return -1; + + return syslinux_validate_adv(syslinux_adv) ? 1 : 0; +} + +static int ext_read_adv(const char *path, int devfd, const char **namep) +{ + int err; + const char *name; + + if (fs_type == BTRFS) { + /* btrfs "ldlinux.sys" is in...
2015 Nov 18
1
[PATCH] extlinux: code cleanup and simplification
...ux/main.c > @@ -338,6 +338,59 @@ static int patch_file_and_bootblock(int fd, const char > *dir, int devfd) >? ? ? return rv; >? } > > +static int ext_read_adv_offset(int devfd, off_t offset) > +{ > +? ? const size_t adv_size = 2 * ADV_SIZE; > + > +? ? if (xpread(devfd, syslinux_adv, adv_size, offset) != adv_size) > +? ? ? return -1; > + > +? ? return syslinux_validate_adv(syslinux_adv) ? 1 : 0; > +} > + > +static int ext_read_adv(const char *path, int devfd, const char **namep) > +{ > +? ? int err; > +? ? const char *name; > + > +? ? if (fs_ty...
2012 Aug 02
0
[PATCH 2/3] ALPHA: first try to fix adv problem
...(const char *path, int devfd, struct stat *rst) goto bail; } + /* FIXME copied above */ + sector_size = fs_type == BTRFS ? SECTOR_SIZE : get_sector_size(devfd); + /* Write it the first time */ - if (xpwrite(fd, boot_image, boot_image_len, 0) != boot_image_len || - xpwrite(fd, syslinux_adv, 2 * ADV_SIZE, - boot_image_len) != 2 * ADV_SIZE) { + pos = 0; + if (xpwrite(fd, boot_image, boot_image_len, pos) != boot_image_len || + !inc_and_align(fd, &pos, boot_image_len, sector_size) || + xpwrite(fd, syslinux_adv, ADV_SIZE, pos) != ADV_SIZE || + !inc_and_align(fd, &...
2013 May 30
0
Possible bug in ext_read_adv
...) *namep = name; return err; } } beside the name is quite confusing (ext from extlinux and ext from ext2/3 filesystem), for XFS code xfs_read_adv is called which is static inline int xfs_read_adv(int devfd) { const size_t adv_size = 2 * ADV_SIZE; if (xpread(devfd, syslinux_adv, adv_size, boot_image_len) != adv_size) return -1; return syslinux_validate_adv(syslinux_adv) ? 1 : 0; } boot_image_len for me is about 53 kb so it read after 53 kb after start of partition however comment on ext_read_adv state that 2kb is used. Also in ext_write_adv adv is written wi...
2014 Dec 24
14
[PATCH 0/8] extlinux: support unmounted ext2/3/4 filesystem
Hello syslinux, Merry Christmas! These patches will make extlinux work with umounted ext2/3/4 filesystem, for example: $ extlinux -i /dev/sdXN or $ extlinux -i file_block Also it can work with something like: $ extlinux /dev/sdXN --reset-adv or $ extlinux file_block --reset-adv We don't use a new option (I planed to use "-d" but it is already in use), it will check whether the
2014 Dec 24
0
[PATCH 1/8] extlinux/main.c: support unmounted ext2/3/4 filesystem
...led(devfd)) { fprintf(stderr, "%s: no previous syslinux boot sector found\n", @@ -1469,29 +1487,38 @@ static int install_loader(const char *path, int update_only) return 1; } - /* Read a pre-existing ADV, if already installed */ - if (opt.reset_adv) { - syslinux_reset_adv(syslinux_adv); - } else if (ext_read_adv(path, devfd, NULL) < 0) { - close(devfd); - return 1; - } + if S_ISDIR(st.st_mode) { + /* Read a pre-existing ADV, if already installed */ + if (opt.reset_adv) { + syslinux_reset_adv(syslinux_adv); + } else if (ext_read_adv(pat...
2015 Jan 02
13
[PATCH 0/9] linux/syslinux: support ext2/3/4 device
Hello, Happy New Year! These patches make syslinux/linux support ext2/3/4, and it doesn't require the root privilege, I'd like to add a separate e2fs/syslinux, if that is more appropriate, it should be easy to do that. I put these patches on github so that you can easily get them in case you'd like to test them. (The repo's name is sys_tmp, which avoids confusing others, I will
2013 Jul 22
1
[PATCH 1/1 v2] Add UFS1/2 support to Extlinux installer.
...static int ext_write_adv(const char *path, const char *cfg, int devfd) { - if (fs_type == BTRFS) { /* btrfs "ldlinux.sys" is in 64k blank area */ + /* btrfs/ufs2 "ldlinux.sys" is in 64k blank area */ + if (fs_type == BTRFS || fs_type == UFS2) { if (xpwrite(devfd, syslinux_adv, 2 * ADV_SIZE, BTRFS_ADV_OFFSET) != 2 * ADV_SIZE) { perror("writing adv"); diff --git a/extlinux/ufs.h b/extlinux/ufs.h new file mode 100644 index 0000000..d324699 --- /dev/null +++ b/extlinux/ufs.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2013 Raphael S. Carvalho <raphael.scarv at...
2013 Jul 12
2
[PATCH 001/001] Add UFS1/2 support to Extlinux installer.
...static int ext_write_adv(const char *path, const char *cfg, int devfd) { - if (fs_type == BTRFS) { /* btrfs "ldlinux.sys" is in 64k blank area */ + /* btrfs/ufs2 "ldlinux.sys" is in 64k blank area */ + if (fs_type == BTRFS || fs_type == UFS2) { if (xpwrite(devfd, syslinux_adv, 2 * ADV_SIZE, BTRFS_ADV_OFFSET) != 2 * ADV_SIZE) { perror("writing adv"); diff --git a/extlinux/ufs.h b/extlinux/ufs.h new file mode 100644 index 0000000..d324699 --- /dev/null +++ b/extlinux/ufs.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2013 Raphael S. Carvalho <raphael.scarv at...
2012 Sep 03
1
[GIT-PULL] XFS filesystem driver
...0) { + perror(filename); + return -1; + } + + /* Write boot image data into LDLINUX.SYS file */ + ret = xpwrite(fd, boot_image, boot_image_len, 0); + if (ret != boot_image_len) { + perror("writing bootblock"); + goto error; + } + + /* Write ADV */ + ret = xpwrite(fd, syslinux_adv, 2 * ADV_SIZE, boot_image_len); + if (ret != 2 * ADV_SIZE) { + fprintf(stderr, "%s: write failure on %s\n", program, filename); + goto error; + } + + sscanf(filename, "%s%cldlinux.sys", path, &slash); + + /* Map the file, and patch the initial sector accordingly...