mirror of
https://github.com/archlinuxarm/PKGBUILDs.git
synced 2024-11-18 22:54:00 +00:00
core/linux-sun4i to 3.4.103-2
This commit is contained in:
parent
11c470e0ba
commit
37a0a9cf9a
2 changed files with 118 additions and 1 deletions
|
@ -0,0 +1,114 @@
|
|||
From d33b98fc82b0908e91fb05ae081acaed7323f9d2 Mon Sep 17 00:00:00 2001
|
||||
From: Stephen Warren <swarren@nvidia.com>
|
||||
Date: Thu, 8 Nov 2012 16:12:28 -0800
|
||||
Subject: [PATCH] block: partition: msdos: provide UUIDs for partitions
|
||||
|
||||
The MSDOS/MBR partition table includes a 32-bit unique ID, often referred
|
||||
to as the NT disk signature. When combined with a partition number within
|
||||
the table, this can form a unique ID similar in concept to EFI/GPT's
|
||||
partition UUID. Constructing and recording this value in struct
|
||||
partition_meta_info allows MSDOS partitions to be referred to on the
|
||||
kernel command-line using the following syntax:
|
||||
|
||||
root=PARTUUID=0002dd75-01
|
||||
|
||||
Signed-off-by: Stephen Warren <swarren@nvidia.com>
|
||||
Cc: Tejun Heo <tj@kernel.org>
|
||||
Cc: Will Drewry <wad@chromium.org>
|
||||
Cc: Kay Sievers <kay.sievers@vrfy.org>
|
||||
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
|
||||
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
||||
---
|
||||
block/partitions/msdos.c | 21 +++++++++++++++++++--
|
||||
init/do_mounts.c | 4 ++++
|
||||
2 files changed, 23 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/block/partitions/msdos.c b/block/partitions/msdos.c
|
||||
index 5f79a66..8752a5d 100644
|
||||
--- a/block/partitions/msdos.c
|
||||
+++ b/block/partitions/msdos.c
|
||||
@@ -94,6 +94,17 @@ static int aix_magic_present(struct parsed_partitions *state, unsigned char *p)
|
||||
return ret;
|
||||
}
|
||||
|
||||
+static void set_info(struct parsed_partitions *state, int slot,
|
||||
+ u32 disksig)
|
||||
+{
|
||||
+ struct partition_meta_info *info = &state->parts[slot].info;
|
||||
+
|
||||
+ snprintf(info->uuid, sizeof(info->uuid), "%08x-%02x", disksig,
|
||||
+ slot);
|
||||
+ info->volname[0] = 0;
|
||||
+ state->parts[slot].has_info = true;
|
||||
+}
|
||||
+
|
||||
/*
|
||||
* Create devices for each logical partition in an extended partition.
|
||||
* The logical partitions form a linked list, with each entry being
|
||||
@@ -106,7 +117,8 @@ static int aix_magic_present(struct parsed_partitions *state, unsigned char *p)
|
||||
*/
|
||||
|
||||
static void parse_extended(struct parsed_partitions *state,
|
||||
- sector_t first_sector, sector_t first_size)
|
||||
+ sector_t first_sector, sector_t first_size,
|
||||
+ u32 disksig)
|
||||
{
|
||||
struct partition *p;
|
||||
Sector sect;
|
||||
@@ -166,6 +178,7 @@ static void parse_extended(struct parsed_partitions *state,
|
||||
}
|
||||
|
||||
put_partition(state, state->next, next, size);
|
||||
+ set_info(state, state->next, disksig);
|
||||
if (SYS_IND(p) == LINUX_RAID_PARTITION)
|
||||
state->parts[state->next].flags = ADDPART_FLAG_RAID;
|
||||
loopct = 0;
|
||||
@@ -437,6 +450,7 @@ int msdos_partition(struct parsed_partitions *state)
|
||||
struct partition *p;
|
||||
struct fat_boot_sector *fb;
|
||||
int slot;
|
||||
+ u32 disksig;
|
||||
|
||||
data = read_part_sector(state, 0, §);
|
||||
if (!data)
|
||||
@@ -491,6 +505,8 @@ int msdos_partition(struct parsed_partitions *state)
|
||||
#endif
|
||||
p = (struct partition *) (data + 0x1be);
|
||||
|
||||
+ disksig = le32_to_cpup((__le32 *)(data + 0x1b8));
|
||||
+
|
||||
/*
|
||||
* Look for partitions in two passes:
|
||||
* First find the primary and DOS-type extended partitions.
|
||||
@@ -515,11 +531,12 @@ int msdos_partition(struct parsed_partitions *state)
|
||||
put_partition(state, slot, start, n);
|
||||
|
||||
strlcat(state->pp_buf, " <", PAGE_SIZE);
|
||||
- parse_extended(state, start, size);
|
||||
+ parse_extended(state, start, size, disksig);
|
||||
strlcat(state->pp_buf, " >", PAGE_SIZE);
|
||||
continue;
|
||||
}
|
||||
put_partition(state, slot, start, size);
|
||||
+ set_info(state, slot, disksig);
|
||||
if (SYS_IND(p) == LINUX_RAID_PARTITION)
|
||||
state->parts[slot].flags = ADDPART_FLAG_RAID;
|
||||
if (SYS_IND(p) == DM6_PARTITION)
|
||||
diff --git a/init/do_mounts.c b/init/do_mounts.c
|
||||
index c950d7c..1d1b634 100644
|
||||
--- a/init/do_mounts.c
|
||||
+++ b/init/do_mounts.c
|
||||
@@ -189,6 +189,10 @@ done:
|
||||
* used when disk name of partitioned disk ends on a digit.
|
||||
* 6) PARTUUID=00112233-4455-6677-8899-AABBCCDDEEFF representing the
|
||||
* unique id of a partition if the partition table provides it.
|
||||
+ * The UUID may be either an EFI/GPT UUID, or refer to an MSDOS
|
||||
+ * partition using the format SSSSSSSS-PP, where SSSSSSSS is a zero-
|
||||
+ * filled hex representation of the 32-bit "NT disk signature", and PP
|
||||
+ * is a zero-filled hex representation of the 1-based partition number.
|
||||
* 7) PARTUUID=<UUID>/PARTNROFF=<int> to select a partition in relation to
|
||||
* a partition with a known unique id.
|
||||
*
|
||||
--
|
||||
2.1.3
|
||||
|
|
@ -9,7 +9,7 @@ _srcname=linux-sunxi-${_commit}
|
|||
_kernelname=${pkgname#linux}
|
||||
_desc="AllWinner A10"
|
||||
pkgver=3.4.103
|
||||
pkgrel=1
|
||||
pkgrel=2
|
||||
arch=('armv7h')
|
||||
url="http://www.kernel.org/"
|
||||
license=('GPL2')
|
||||
|
@ -18,10 +18,12 @@ options=('!strip')
|
|||
source=("https://github.com/linux-sunxi/linux-sunxi/archive/${_commit}.tar.gz"
|
||||
'0001-Backport-BFP-XOR-operation.patch'
|
||||
'0001-Backport-firmware-loader.patch'
|
||||
'0001-block-partition-msdos-provide-UUIDs-for-partitions.patch'
|
||||
'config')
|
||||
md5sums=('6cdd44f9131a854cdbf5ddad86187c57'
|
||||
'ca5b466850782493b99e824d6efbea4d'
|
||||
'520bde63dd6803f3332e9b26cb34cff9'
|
||||
'8d1f84619971cf0f2b76d86bec253ac8'
|
||||
'4592842f7b5702452815d5601f43ab7a')
|
||||
|
||||
prepare() {
|
||||
|
@ -31,6 +33,7 @@ prepare() {
|
|||
|
||||
git apply ../0001-Backport-BFP-XOR-operation.patch
|
||||
git apply ../0001-Backport-firmware-loader.patch
|
||||
git apply ../0001-block-partition-msdos-provide-UUIDs-for-partitions.patch
|
||||
|
||||
# add pkgrel to extraversion
|
||||
sed -ri "s|^(EXTRAVERSION =)(.*)|\1 \2-${pkgrel}|" Makefile
|
||||
|
|
Loading…
Reference in a new issue