Displaying 15 results from an estimated 15 matches for "pi_begin".
2014 Jun 29
0
[PATCH 4/6] chain: add missing pi_del() in find*() functions
...struct part_iter *boot_part = NULL;
+ struct part_iter *iter = NULL;
struct disk_info diskinfo;
int drive;
for (drive = 0x80; drive < 0x80 + fixed_cnt; drive++) {
if (disk_get_params(drive, &diskinfo))
continue; /* Drive doesn't exist */
- if (!(boot_part = pi_begin(&diskinfo, opt.piflags)))
- continue;
- /* Check for a MBR disk */
- if (boot_part->type != typedos) {
- pi_del(&boot_part);
+ if (!(iter = pi_begin(&diskinfo, opt.piflags)))
continue;
- }
- if (boot_part->dos.disk_sig == mbr_sig) {
+ /* Check for a matching MBR disk...
2014 Jun 29
10
[PATCH 0/6] chain.c32 patches
...9;d want to do what I mentioned in older discussion
with Ady - backport missing patches from 6.x to 5.x and 4.x so all versions
have up to date chain version.
Michal Soltys (6):
chain/partiter: fix and improve gpt handling in buggy cases
chain/partiter: fix possible non-NULL value returned by pi_begin() on error
chain/partiter: adjust error reporting
chain: add missing pi_del() in find*() functions
chain: implement strict=<0|1|2>
chain/partiter: correct gpt header checks
com32/chain/chain.c | 64 ++++++-------
com32/chain/mangle.c | 6 +-
com32/chain/options.c | 30 +...
2012 Nov 06
50
chain.c32 (and partiter) updates v2
This is a bit updated set of chain.c32 changes that simplifies a few things
(and in partiter part), fixes few minor issues and adds a few new features.
Details are in the following commits, below is the summary and pull details at
the end.
Shao - any chance to peek over them ? Most of those are relatively simple
changes and well tested, though of course something might have slipped my
attention.
2016 Jul 14
3
[PATCH] : Adding dlabel option to chain.c32
On 07/14/16 05:56, Ady Ady via Syslinux wrote:
>
> @Peter, Erwan, Gene, Michal, (and anyone else interested)...
>
> Although I haven't actually tested Erwan's patch, would it be
> acceptable by you (all) if I were to send a patch to this Syslinux
> Mailing List with the same code while changing the wording as I
> previously suggested in a prior email? Would it be
2014 Jun 29
0
[PATCH 1/6] chain/partiter: fix and improve gpt handling in buggy cases
...gpth->lba_first_usable ||
+ !sane(gpth->lba_last_usable, gpt_lcnt) ||
+ gpth->lba_last_usable + gpt_lcnt >= gpth->lba_alt ||
+ gpth->lba_alt >= di->lbacnt ||
+ gpth->part_size < sizeof(struct disk_gpt_part_entry))
+ return -1;
+
+ return 0;
+}
+
/* pi_begin() - validate and and get proper iterator for a disk described by di */
struct part_iter *pi_begin(const struct disk_info *di, int flags)
{
- int gptprot, ret = -1;
+ int isgpt = 0, ret = -1;
struct part_iter *iter;
struct disk_dos_mbr *mbr = NULL;
struct disk_gpt_header *gpth...
2010 Aug 08
1
PATCH/RFC chain.c: update iterator code, yank from chain.c, move both to separate directory
...udes:
- extra small sanity check
- empty partition is characterized by type guid == 0, not lba_first == 0
- automatic label rewrite from UCS2-LE to asciiz (to separate buffer)
- export of partition guid (also to separate buffer)
2d) iterators *include* disk during iteration
Right after creation, pi_begin() (previously get_first_partition()) does not
iterate to first partition.
2e) available data at any time
- disk guid or disk signature (sub.gpt.disk_guid or sub.dos_disk_sig)
- parition guid (sub.gpt.part_guid)
- parition label, asciiz (sub.gpt.part_label)
- pointer to record holding unaltered pa...
2016 Jul 15
0
[PATCH] : Add diskbypartname option to chain.c32
...*label, struct part_iter **_boot_part)
+{
+ struct part_iter *iter = NULL;
+ struct disk_info diskinfo;
+ int drive;
+
+ for (drive = 0x80; drive < 0x80 + fixed_cnt; drive++) {
+ if (disk_get_params(drive, &diskinfo))
+ continue; /* Drive doesn't exist */
+ if (!(iter = pi_begin(&diskinfo, opt.piflags)))
+ continue;
+ /* Check for a matching GPT Partition Name */
+ if (iter->type == typegpt)
+ while (!pi_next(iter)) {
+ if (!strcmp(label, iter->gpt.part_label))
+ // We don't care about the actual partition that matched
+ pi_del(&iter);...
2016 Jul 16
0
[PATCH] : Adding dlabel option to chain.c32
...6fb847366ce3f1ddbf6ffd8fd4d408fcR165
+ // We don't care about the actual partition that matched
+ pi_del(&iter);
i.e.
https://github.com/ErwanAliasr1/syslinux/commit/ebf8cbf#diff-6fb847366ce3f1ddbf6ffd8fd4d408fcR167
+ // Let's return the disk itself instead
+ iter = pi_begin(&diskinfo, opt.piflags);
+ goto ok;
Still, there is no GPT label, but *GPT* *Partition* *name* ;)
https://en.wikipedia.org/wiki/GUID_Partition_Table#Partition_entries
2014 Jun 29
0
[PATCH 3/6] chain/partiter: adjust error reporting
...-- a/com32/chain/partiter.h
+++ b/com32/chain/partiter.h
@@ -42,7 +42,7 @@
/* status */
-enum {PI_OK, PI_DONE, PI_INSANE, PI_ERRLOAD};
+enum {PI_ERRLOAD = -31, PI_INSANE, PI_OK = 0, PI_DONE};
/* flags */
@@ -103,11 +103,6 @@ extern const struct itertype * const typeraw;
struct part_iter *pi_begin(const struct disk_info *, int flags);
void pi_del(struct part_iter **);
-static inline int pi_errored(struct part_iter *iter)
-{
- return iter->status > PI_DONE;
-}
-
/* inline virtuals */
static inline int pi_next(struct part_iter *iter)
{
--
1.7.10.4
2016 Jul 16
5
[PATCH] : Adding dlabel option to chain.c32
The idea is to boot a disk in an mbr fashion while using the GPT (not
filesystem) label to detect the disk.
That is useful when you use grub2 & gpt. I was in case where my nodes
(100s) have 8 disks each and no guarantee of which disk is "bootable" in
the disk.
This way I can tell "please boot the disk that have one partition labelled
"xyz"".
So nothing related
2013 Oct 18
0
[RFC/PATCH 1/3] Move partiter from com32/chain to com32/lib/syslinux
...if (!(iter = malloc(sizeof *iter)))
- critm();
- else
- memset(iter, 0, sizeof *iter);
- return iter;
-}
-
-/* pi_del() - delete iterator */
-void pi_del(struct part_iter **_iter)
-{
- if(!_iter || !*_iter)
- return;
- pi_dtor(*_iter);
- free(*_iter);
- *_iter = NULL;
-}
-
-/* pi_begin() - validate and and get proper iterator for a disk described by di */
-struct part_iter *pi_begin(const struct disk_info *di, int flags)
-{
- int gptprot, ret = -1;
- struct part_iter *iter;
- struct disk_dos_mbr *mbr = NULL;
- struct disk_gpt_header *gpth = NULL;
- struct disk_gpt_...
2015 Jul 22
0
[PULL 1/8] Move partiter from com32/chain to com32/lib/syslinux
...s GPT partition list.", desc);
- goto out;
- }
- if (!valid_crc_gptl(gpth, gptl, flags)) {
- sprintf(errbuf, "Invalid checksum of %s GPT partition list.", desc);
- goto out;
- }
- return gptl;
-out:
- try_gpt_we(errbuf, alt);
- free(gptl);
- return NULL;
-}
-
-/* pi_begin() - validate and and get proper iterator for a disk described by di */
-struct part_iter *pi_begin(const struct disk_info *di, int flags)
-{
- int isgpt = 0, ret = -1;
- struct part_iter *iter;
- struct disk_dos_mbr *mbr = NULL;
- struct disk_gpt_header *gpth = NULL;
- struct disk_gp...
2013 Oct 18
0
[RFC/PATCH 3/3] Wire up MultiFS support.
...eturn NULL;
+}
+
+/*
+ * Attempt to find a partition based on drive and partition numbers.
+ *
+ * @ret: 0 on success, -1 on failure.
+ */
+static int find_partition(struct part_iter **_iter, struct disk_info *diskinfo,
+ int partition)
+{
+ struct part_iter *iter = NULL;
+
+ if (!(iter = pi_begin(diskinfo, 0)))
+ return -1;
+
+ do {
+ if (iter->index == partition)
+ break;
+ } while (!pi_next(iter));
+
+ if (iter->status) {
+ dprintf("MultiFS: Request disk/partition combination not found.\n");
+ goto bail;
+ }
+ dprintf("Mu...
2015 Jul 22
13
[PULL 0/8] MultiFS suppport for BIOS and EFI
So last week I was wondering if XFS was still working -- even with its
last on-disk structure changes -- and it _suprisingly_ worked as
expected. Right, now I can finally get rid of GRUB and use Syslinux to
boot my Linux on EFI from a rootfs with xfs. Shit, I have two
partitions (the first one being the required ESP) so there is no way to
access the other partitions since because Syslinux does not
2012 Aug 20
13
[PATCH 00/12] Multidisk support
Hello,
the following patches should get multidisk access working.
The syntax accepted is the following:
(hdx,y)/path/to/file
where x is the disk number and start at 0 and the y is the partition number starting at 1. So (hd0,1) is the first partition of the first disk.
the other accepted syntax is using MBR's 32 bits disk signature so for example:
(mbr:0x12345678,2)/foo/bar
would address