From 1eff5fc3f6f03d4beccc49f6d5a8c6e37fb9b6c5 Mon Sep 17 00:00:00 2001 From: Katze Miau Date: Fri, 9 Dec 2011 15:28:50 +0000 Subject: create /etc/nodeid on first startup Add a init script that - early during the first boot only - creates /etc/nodeid and fills it with a unique identifer. This nodeid is persistent across reboots and protected from sysupgrades. diff --git a/files/common/etc/init.d/nodeid b/files/common/etc/init.d/nodeid new file mode 100755 index 0000000..c272bdc --- /dev/null +++ b/files/common/etc/init.d/nodeid @@ -0,0 +1,11 @@ +#!/bin/sh /etc/rc.common +START=20 + +start () { + if ! [ -f /etc/nodeid ]; then + cat /etc/nodeid + fi +} + +stop () { +} diff --git a/files/common/etc/sysupgrade.conf b/files/common/etc/sysupgrade.conf new file mode 100644 index 0000000..4ab3e1b --- /dev/null +++ b/files/common/etc/sysupgrade.conf @@ -0,0 +1,3 @@ +## This file contains files and directories that should +## be preserved during an upgrade. +/etc/nodeid -- cgit v0.10.1