Displaying 20 results from an estimated 22 matches for "xpwrite".
Did you mean:
pwrite
2012 Aug 02
0
[PATCH 2/3] ALPHA: first try to fix adv problem
...d, unsigned *pos, unsigned bytes, unsigned align)
+{
+ char buf[512];
+ unsigned left;
+
+ *pos += bytes;
+ left = *pos % align;
+ left = (align - left) % align;
+ while (left > 0) {
+ unsigned l = left > sizeof(buf) ? sizeof(buf) : left;
+ memset(buf, 0, sizeof(buf));
+ if (xpwrite(fd, buf, l, *pos) != l)
+ return 0;
+ left -= l;
+ *pos += l;
+ }
+ return 1;
+}
+
+static int ext2_fat_install_file(const char *path, int devfd, struct stat *rst)
{
char *file, *oldfile;
int fd = -1, dirfd = -1;
int modbytes;
int r1, r2;
+ unsigned sector_size;
+...
2015 Nov 10
2
[PATCH] mtools: Remove local xpread/xpwrite, use ones from syslxcom
...);
- if (rv == 0) {
- die("short read");
- } else if (rv == -1) {
- if (errno == EINTR) {
- continue;
- } else {
- die(strerror(errno));
- }
- } else {
- bufp += rv;
- offset += rv;
- done += rv;
- count -= rv;
- }
- }
-
- return done;
-}
-
-ssize_t xpwrite(int fd, const void *buf, size_t count, off_t offset)
-{
- const char *bufp = (const char *)buf;
- ssize_t rv;
- ssize_t done = 0;
-
- while (count) {
- rv = pwrite(fd, bufp, count, offset);
- if (rv == 0) {
- die("short write");
- } else if (rv == -1) {
- if (errno ==...
2015 Nov 13
4
[PATCH] extlinux: code cleanup and simplification
...x.sys");
+ if (err == 2) /* ldlinux.sys does not exist */
+ err = read_adv(path, name = "extlinux.sys");
+ if (namep)
+ *namep = name;
+ return err;
+ }
+}
+
+static int ext_write_adv_offset(int devfd, off_t offset)
+{
+ const size_t adv_size = 2 * ADV_SIZE;
+
+ if (xpwrite(devfd, syslinux_adv, adv_size, offset) != adv_size) {
+ perror("writing adv");
+ return 1;
+ }
+
+ return 0;
+}
+
+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 */
+ retu...
2015 Nov 10
0
[PATCH] mtools: Remove local xpread/xpwrite, use ones from syslxcom
On Tue, 10 Nov 2015 14:51:04 +0100
Nicolas Cornu via Syslinux <syslinux at zytor.com> wrote:
> From: Nicolas Cornu <ncornu at aldebaran.com>
>
> ---
> mtools/Makefile | 1 +
> mtools/syslinux.c | 59
> +------------------------------------------------------ 2 files
> changed, 2 insertions(+), 58 deletions(-)
Applied. Please, next time make sure you
2015 Nov 11
1
[PATCH] mtools: Remove local xpread/xpwrite, use ones from syslxcom
2015-11-10 23:18 UTC+01:00, Paulo Alcantara via Syslinux <syslinux at zytor.com>:
> On Tue, 10 Nov 2015 14:51:04 +0100
> Nicolas Cornu via Syslinux <syslinux at zytor.com> wrote:
>
>> From: Nicolas Cornu <ncornu at aldebaran.com>
>>
>> ---
>> mtools/Makefile | 1 +
>> mtools/syslinux.c | 59
>>
2015 Nov 18
0
[PATCH] extlinux: code cleanup and simplification
...*/
> + err = read_adv(path, name = "extlinux.sys");
> + if (namep)
> + *namep = name;
> + return err;
> + }
> +}
> +
> +static int ext_write_adv_offset(int devfd, off_t offset)
> +{
> + const size_t adv_size = 2 * ADV_SIZE;
> +
> + if (xpwrite(devfd, syslinux_adv, adv_size, offset) != adv_size) {
> + perror("writing adv");
> + return 1;
> + }
> +
> + return 0;
> +}
> +
> +static int ext_write_adv(const char *path, const char *cfg, int devfd)
> +{
> + if (fs_type == BTRFS) {
> + /* btrfs...
2015 Nov 26
0
[syslinux:master] extlinux: code cleanup and simplification
...x.sys");
+ if (err == 2) /* ldlinux.sys does not exist */
+ err = read_adv(path, name = "extlinux.sys");
+ if (namep)
+ *namep = name;
+ return err;
+ }
+}
+
+static int ext_write_adv_offset(int devfd, off_t offset)
+{
+ const size_t adv_size = 2 * ADV_SIZE;
+
+ if (xpwrite(devfd, syslinux_adv, adv_size, offset) != adv_size) {
+ perror("writing adv");
+ return 1;
+ }
+
+ return 0;
+}
+
+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 */
+ retu...
2015 Nov 18
1
[PATCH] extlinux: code cleanup and simplification
...? ? ? err = read_adv(path, name = "extlinux.sys");
> +??? if (namep)
> +??? ? ? *namep = name;
> +??? return err;
> +? ? }
> +}
> +
> +static int ext_write_adv_offset(int devfd, off_t offset)
> +{
> +? ? const size_t adv_size = 2 * ADV_SIZE;
> +
> +? ? if (xpwrite(devfd, syslinux_adv, adv_size, offset) != adv_size) {
> +??? perror("writing adv");
> +??? return 1;
> +? ? }
> +
> +? ? return 0;
> +}
> +
> +static int ext_write_adv(const char *path, const char *cfg, int devfd)
> +{
> +? ? if (fs_type == BTRFS) {
> +???...
2015 Nov 12
1
[PATCH] Unification of ext_(write/read)_adv
..."ldlinux.sys");
if (err == 2) /* ldlinux.sys does not exist */
@@ -1455,17 +1446,26 @@ static int ext_read_adv(const char *path, int devfd, const char **namep)
}
}
+static int ext_write_adv_offset(int devfd, off_t offset)
+{
+ const size_t adv_size = 2 * ADV_SIZE;
+
+ if (xpwrite(devfd, syslinux_adv, adv_size, offset) != adv_size) {
+ perror("writing adv");
+ return 1;
+ }
+
+ return 0;
+}
+
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 */
- if (xp...
2015 Nov 13
4
[PATCH 1/4] extlinux: simplification
...== '/' ? "" : "/");
+ if (rv < 0 || !file) {
+ perror(program);
+ return 1;
+ }
+
+ fd = open(file, O_WRONLY | O_TRUNC | O_CREAT | O_SYNC,
+ S_IRUSR | S_IRGRP | S_IROTH);
+ if (fd < 0) {
+ perror(file);
+ free(file);
+ return 1;
+ }
+
+ rv = xpwrite(fd, (const char _force *)syslinux_ldlinuxc32,
+ syslinux_ldlinuxc32_len, 0);
+ if (rv != (int)syslinux_ldlinuxc32_len) {
+ fprintf(stderr, "%s: write failure on %s\n", program, file);
+ rv = 1;
+ } else
+ rv = 0;
+
+ close(fd);
+ free(file);
+
+ return rv;
+}
+
int ext2_...
2002 Jun 23
1
Using MTOOLS in place of loopback mounting
...e 10);
# these are the offset and length of the portion of the boot sector
# which stays the same and is not to be altered by copying in the
# SYSLINUX boot sector.
BSCOPYSTART=11
BSCOPYLEN=51
# xpread(dev_fd, sectbuf, 512, offset);
# memcpy(bootsect+bsCopyStart, sectbuf+bsCopyStart, bsCopyLen);
# xpwrite(dev_fd, bootsect, 512, offset);
$DD if=$IMAGE of=$TEMP bs=512 count=1
$DD conv=notrunc if=ldlinux.bss of=$IMAGE bs=512 count=1
$DD conv=notrunc if=$TEMP of=$IMAGE bs=1 seek=$BSCOPYSTART skip=$BSCOPYSTART count=$BSCOPYLEN
rm $TEMP
grep -v "#TEMP" $MTOOLSRC > $MTOOLSRC.NEW
mv $MTOOLSRC....
2011 Apr 15
0
[GIT PULL] syslinux command-line
..._fd, buffer, 8, 3);
+ return !memcmp(buffer, "SYSLINUX", 8) || !memcmp(buffer, "EXTLINUX",
8);
+}
diff --git a/libinstaller/syslxcom.h b/libinstaller/syslxcom.h
index 39ca09d..bf186ca 100644
--- a/libinstaller/syslxcom.h
+++ b/libinstaller/syslxcom.h
@@ -18,5 +18,6 @@ ssize_t xpwrite(int fd, const void *buf, size_t count,
off_t offset);
void clear_attributes(int fd);
void set_attributes(int fd);
int sectmap(int fd, sector_t *sectors, int nsectors);
+int syslinux_already_installed(int dev_fd);
#endif
diff --git a/linux/syslinux.c b/linux/syslinux.c
index 97b6a30..c7a9ecc 10...
2017 Apr 19
4
[PATCH v2 0/2] daemon: Move the useful 'is_zero' function into common code.
v1 -> v2:
The first patch is the same (the pure refactoring), but in the second
patch I implement Eric Blake's suggested version.
Rich.
2017 Apr 19
2
[PATCH] daemon: Move the useful 'is_zero' function into common code.
...@@ -681,7 +663,7 @@ worker_thread (void *vp)
/* Don't write if the block is all zero, to preserve output file
* sparseness. However we have to update oposition.
*/
- if (!is_zero (outbuf, wsz)) {
+ if (!is_zero ((char *) outbuf, wsz)) {
if (xpwrite (global->ofd, outbuf, wsz, oposition) == -1) {
perror (global->outputfile);
return &state->status;
diff --git a/daemon/daemon.h b/daemon/daemon.h
index 332e2966a..a317139a5 100644
--- a/daemon/daemon.h
+++ b/daemon/daemon.h
@@ -327,24 +327,6 @@ extern void pul...
2008 Oct 25
2
Linux syslinux-3.72 does not update boot block for SD devices
Hi all. I am new to the list. I am trying to make a SD flash bootable.
I have a MSI Wind netbook running Fedora 9 with a built-in card reader
that detects the SD flash properly. However, when I run syslinux, it
does not update the boot block. I also tried using a SD -> USB
adapter, but I get the same behavior. Fedora 9 uses an older syslinux
3.61, but I also tried the latest 3.72 with
2012 Sep 03
1
[GIT-PULL] XFS filesystem driver
...r btrfs superblock found on %s\n",
- device);
+ fprintf(stderr,
+ "no fat, ntfs, ext2/3/4, btrfs or xfs superblock found on %s\n",
+ device);
return 1;
}
+
if (fs_type == VFAT) {
struct fat_boot_sector *sbs = (struct fat_boot_sector *)syslinux_bootsect;
if (xpwrite(fd, &sbs->FAT_bsHead, FAT_bsHeadLen, 0) != FAT_bsHeadLen ||
@@ -385,6 +423,12 @@ int install_bootblock(int fd, const char *device)
perror("writing ntfs bootblock");
return 1;
}
+ } else if (fs_type == XFS) {
+ if (xpwrite(fd, syslinux_bootsect,...
2012 Aug 02
0
[PATCH 1/3] ALPHA: make sector size dynamic in extlinux
...sectmap_fib(fd, sectors, nsectors, sector_size);
}
/*
diff --git a/libinstaller/syslxcom.h b/libinstaller/syslxcom.h
index 8b3b461..111b634 100644
--- a/libinstaller/syslxcom.h
+++ b/libinstaller/syslxcom.h
@@ -8,7 +8,7 @@ ssize_t xpread(int fd, void *buf, size_t count, off_t offset);
ssize_t xpwrite(int fd, const void *buf, size_t count, off_t offset);
void clear_attributes(int fd);
void set_attributes(int fd);
-int sectmap(int fd, sector_t *sectors, int nsectors);
+int sectmap(int fd, sector_t *sectors, int nsectors, unsigned sector_size);
int syslinux_already_installed(int dev_fd);
#en...
2006 Aug 21
12
SCSI synchronize cache cmd
Hi,
I work on a support team for the Sun StorEdge 6920 and have a
question about the use of the SCSI sync cache command in Solaris
and ZFS. We have a bug in our 6920 software that exposes us to a
memory leak when we receive the SCSI sync cache command:
6456312 - SCSI Synchronize Cache Command is flawed
It will take some time for this bug fix to role out to the field so we
need to understand
2013 Jul 22
1
[PATCH 1/1 v2] Add UFS1/2 support to Extlinux installer.
...t char **namep)
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...
2013 Jul 12
2
[PATCH 001/001] Add UFS1/2 support to Extlinux installer.
...t char **namep)
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...