[PATCH 4/5] sandbox: dts: populate $global.machine_id

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



/etc/machine-id is 0444 by default, so it makes sense to use it for
sandbox machine ID. Do so.

Note that the machine ID will be constant, but not equal as barebox
will hash the ASCII representation.

Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx>
---
 arch/sandbox/dts/sandbox.dts | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/arch/sandbox/dts/sandbox.dts b/arch/sandbox/dts/sandbox.dts
index 5b2cab219e2a..cd0022f777ed 100644
--- a/arch/sandbox/dts/sandbox.dts
+++ b/arch/sandbox/dts/sandbox.dts
@@ -13,6 +13,7 @@
 	};
 
 	chosen {
+		barebox,machine-id-path = &machine_id;
 		environment {
 			compatible = "barebox,environment";
 			device-path = &part_env;
@@ -101,6 +102,33 @@
 		};
 	};
 
+	machine-id {
+		compatible = "barebox,hostfile";
+		barebox,filename = "/etc/machine-id";
+		barebox,read-only;
+		reg = <0 0 0 0>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition@0 {
+				compatible = "nvmem-cells";
+				reg = <0x0 0x20>;
+				label = "nvmem";
+				#address-cells = <1>;
+				#size-cells = <1>;
+
+				machine_id: machine-id@0 {
+					reg = <0x0 0x20>;
+				};
+			};
+		};
+	};
+
 	power {
 		compatible = "barebox,sandbox-power";
 		nvmem-cell-names = "reset-source";
-- 
2.30.2


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux