search for: adv_size

Displaying 20 results from an estimated 30 matches for "adv_size".

Did you mean: add_size
2015 Nov 13
4
[PATCH] extlinux: code cleanup and simplification
...extlinux/main.c b/extlinux/main.c index 6871fb1..a2a396a 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_typ...
2015 Nov 12
1
[PATCH] Unification of ext_(write/read)_adv
....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, syslinux_adv,...
2015 Nov 18
0
[PATCH] extlinux: code cleanup and simplification
....a2a396a 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) > +{ > +...
2015 Nov 26
0
[syslinux:master] extlinux: code cleanup and simplification
...extlinux/main.c b/extlinux/main.c index a715963..a7ebd49 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_typ...
2015 Nov 18
1
[PATCH] extlinux: code cleanup and simplification
....a2a396a 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) > +{ > +? ?...
2013 Jul 26
2
[PATCH 1/1] core: Add a check at ldlinux.sys build time.
On 07/26/2013 01:36 PM, Raphael S Carvalho wrote: > > Bootsector is installed into the 0-512 range, whereas 2 copies of ADV > into (65536 - 2 * ADV_SIZE). > Then basically ldlinux.sys must fit between the bootsector and two > copies of ADV whose size may vary. > > The range 0-64k is laid out something like this, right?! > [0](bootsector)[512](ldlinux.sys)[65536 - 2 * ADV_SIZE](2 copies of > ADV)[65536] > > If so, the size...
2013 Sep 30
2
[PATCH v2] core: Check size of ldlinux.sys at building time.
From: Raphael S. Carvalho <raphael.scarv at gmail.com> v2: Extract ADV_SIZE automatically from libinstaller/setadv.h. Calc the size of ldlinux.sys from ldlinux.bin, and check if it exceeds the limit. ldlinux.sys must fit between the bootsector and two copies of ADV whose size may vary. Thus, the size of ldlinux.sys can be at most: 65536 - 2 * ADV_SIZE - 512 (limit). Cert...
2013 Aug 31
4
[PATCH 1/1] core: Check if ldlinux.sys exceeds the limit at its building time.
Calc the size of ldlinux.sys from ldlinux.bin, and check if it exceeds the limit. ldlinux.sys must fit between the bootsector and two copies of ADV whose size may vary. Thus, the size of ldlinux.sys (limit) can be at most: 65536 - 2 * ADV_SIZE - 512. Certain file systems (such as BTRFS and UFS2) will rely on ldlinux.sys being installed on the 0-64k range, thus it can't exceed the limit, otherwise the superblock would be corrupted. Signed-off-by: Raphael S.Carvalho <raphael.scarv at gmail.com> --- core/Makefile | 1...
2012 Aug 02
0
[PATCH 2/3] ALPHA: first try to fix adv problem
...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, &pos, ADV_S...
2013 Jul 26
2
[PATCH 1/1] core: Add a check at ldlinux.sys build time.
On 07/26/2013 08:10 AM, Matt Fleming wrote: > On Wed, 24 Jul, at 08:05:16AM, Raphael S.Carvalho wrote: >> Check if ldlinux.sys is larger than 64k at build time. >> >> Signed-off-by: Raphael S.Carvalho <raphael.scarv at gmail.com> >> --- >> core/Makefile | 5 +++-- >> core/ldlinux_limit.pl | 31 +++++++++++++++++++++++++++++++ >> 2
2013 Jul 26
0
[PATCH 1/1] core: Add a check at ldlinux.sys build time.
On Fri, Jul 26, 2013 at 5:42 PM, H. Peter Anvin <hpa at zytor.com> wrote: > On 07/26/2013 01:36 PM, Raphael S Carvalho wrote: > > > > Bootsector is installed into the 0-512 range, whereas 2 copies of ADV > > into (65536 - 2 * ADV_SIZE). > > Then basically ldlinux.sys must fit between the bootsector and two > > copies of ADV whose size may vary. > > > > The range 0-64k is laid out something like this, right?! > > [0](bootsector)[512](ldlinux.sys)[65536 - 2 * ADV_SIZE](2 copies of > > ADV)[65536...
2013 Sep 16
2
[PATCH 1/1] core: Check if ldlinux.sys exceeds the limit at its building time.
On Mon, Sep 16, 2013 at 11:08 AM, Matt Fleming <matt at console-pimps.org> wrote: > Peter, does this look OK to you? > > Raphael, I can't work out why ADV_SIZE is a constant in this file? Matt, ADV_SIZE is currently a constant value, but it may change in the future. So it would need some care. Regards, Raphael S. Carvalho
2013 Sep 16
0
[PATCH 1/1] core: Check if ldlinux.sys exceeds the limit at its building time.
Peter, does this look OK to you? Raphael, I can't work out why ADV_SIZE is a constant in this file? On Sat, 31 Aug, at 05:01:20PM, Raphael S.Carvalho wrote: > Calc the size of ldlinux.sys from ldlinux.bin, and check if it exceeds the limit. > ldlinux.sys must fit between the bootsector and two copies of ADV whose size may vary. > Thus, the size of ldlinux.sys...
2014 May 25
0
[PATCH 1/1] core: Check if ldlinux.sys exceeds the limit at its building time.
...p 2013-08-31 om 17:01 schreef Raphael S.Carvalho: > Calc the size of ldlinux.sys from ldlinux.bin, and check if it exceeds the limit. > ldlinux.sys must fit between the bootsector and two copies of ADV whose size may vary. > Thus, the size of ldlinux.sys (limit) can be at most: 65536 - 2 * ADV_SIZE - 512. > > Certain file systems (such as BTRFS and UFS2) will rely on ldlinux.sys being installed on the 0-64k range, > thus it can't exceed the limit, otherwise the superblock would be corrupted. > > Signed-off-by: Raphael S.Carvalho <raphael.scarv at gmail.com> > ---...
2013 May 30
0
Possible bug in ext_read_adv
...e = "extlinux.sys"); if (namep) *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...
2013 Jul 26
0
[PATCH 1/1] core: Add a check at ldlinux.sys build time.
...he test is wrong: we need it to fit into 64K *including* the boot > sector and two copies of the ADV. Currently the ADV is 512 bytes, but > we probably need to make it 4K. > > -hpa > > Bootsector is installed into the 0-512 range, whereas 2 copies of ADV into (65536 - 2 * ADV_SIZE). Then basically ldlinux.sys must fit between the bootsector and two copies of ADV whose size may vary. The range 0-64k is laid out something like this, right?! [0](bootsector)[512](ldlinux.sys)[65536 - 2 * ADV_SIZE](2 copies of ADV)[65536] If so, the size of ldlinux.sys can be at most: 65536 - 2...
2014 May 27
2
[PATCH 1/1] core: Check if ldlinux.sys exceeds the limit at its building time.
...lho: > > > Calc the size of ldlinux.sys from ldlinux.bin, and check if it exceeds > the limit. > > > ldlinux.sys must fit between the bootsector and two copies of ADV whose > size may vary. > > > Thus, the size of ldlinux.sys (limit) can be at most: 65536 - 2 * > ADV_SIZE - 512. > > > > > > Certain file systems (such as BTRFS and UFS2) will rely on ldlinux.sys > being installed on the 0-64k range, > > > thus it can't exceed the limit, otherwise the superblock would be > corrupted. > > Raphael/Paulo: does UFS2 have a hard 64...
2013 Sep 16
0
[PATCH 1/1] core: Check if ldlinux.sys exceeds the limit at its building time.
...to increase out to 4K because of newer drives. Raphael S Carvalho <raphael.scarv at gmail.com> wrote: >On Mon, Sep 16, 2013 at 11:08 AM, Matt Fleming <matt at console-pimps.org> >wrote: >> Peter, does this look OK to you? >> >> Raphael, I can't work out why ADV_SIZE is a constant in this file? > >Matt, ADV_SIZE is currently a constant value, but it may change in the >future. >So it would need some care. > >Regards, >Raphael S. Carvalho -- Sent from my mobile phone. Please pardon brevity and lack of formatting.
2013 Sep 16
1
[PATCH 1/1] core: Check if ldlinux.sys exceeds the limit at its building time.
On Mon, 16 Sep, at 09:49:01AM, H. Peter Anvin wrote: > We probably will need to increase out to 4K because of newer drives. Raphael, is there any way we could extract the ADV_SIZE value from libinstaller/setadv.h and pass it to ldlinux_limit.pl? That would allow things to keep working in future when we do upgrade to 4K. -- Matt Fleming, Intel Open Source Technology Center
2013 Oct 03
0
[PATCH v2] core: Check size of ldlinux.sys at building time.
On Mon, 30 Sep, at 02:14:34AM, Raphael S.Carvalho wrote: > From: Raphael S. Carvalho <raphael.scarv at gmail.com> > > v2: Extract ADV_SIZE automatically from libinstaller/setadv.h. > > Calc the size of ldlinux.sys from ldlinux.bin, and check if it exceeds the limit. > ldlinux.sys must fit between the bootsector and two copies of ADV whose size may vary. > Thus, the size of ldlinux.sys can be at most: 65536 - 2 * ADV_SIZE...