Skip to content

Commit c776a71

Browse files
committed
allows for the use of . in onie identifiers and updates documentation
1 parent 14dd72b commit c776a71

File tree

6 files changed

+25
-50
lines changed

6 files changed

+25
-50
lines changed

docs/BootProcess.md

+15-14
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Detailed Boot Process
2424
8. The ONL loader runs `/bin/boot $URL`
2525
9. The ONL loader retrieves the SWI file
2626
a) if the URL is remote (e.g., http://, ftp://, etc.), verify that there is a locally cached copy
27-
of the SWI in /mnt/flash2 or if not, download it
27+
of the SWI in /mnt/onl/images or if not, download it
2828
b) if the URL is local, verify that the device is accessible
2929
c) if the URL is a Zero Touch Networking (ZTN) URL, the execute the ZTN protocol to get the SWI (see below)
3030
10. The ONL loader reads the 'rootfs' file out of the SWI and mounts it using overlayfs[1] (SWI contents described below)
@@ -51,23 +51,24 @@ Partition 4+: Free space (unused)
5151
Mass Storage Device:
5252

5353
Partition 1: ONL loader kernel -- the format of this partition varies depending on what formats uBoot supports on the specific platform
54-
Partition 2: ONL Loader configuration files (mounts as "/mnt/flash" both during the loader and the main ONL phases)
55-
Partition 3: ONL SWitch Images (SWIs) partition (mounts as "/mnt/flash2" both during the loader and the main ONL phases)
54+
Partition 2: ONL Loader configuration files (mounts as "/mnt/onl/boot" both during the loader and the main ONL phases)
55+
Partition 3: ONL SWitch Images (SWIs) partition (mounts as "/mnt/onl/images" both during the loader and the main ONL phases)
5656

5757
ONL file system layout
5858
-----------------------
5959

60-
root@onl-powerpc:/bin# df
61-
Filesystem 1K-blocks Used Available Use% Mounted on
62-
rootfs 72040 176 71864 1% /
63-
devtmpfs 1024 0 1024 0% /dev
64-
none 72040 176 71864 1% /
65-
tmpfs 48028 148 47880 1% /run
66-
tmpfs 5120 0 5120 0% /run/lock
67-
/dev/sda2 71177 7 71170 1% /mnt/flash
68-
/dev/sda3 3791960 98172 3693788 3% /mnt/flash2
69-
tmpfs 96040 0 96040 0% /run/shm
70-
60+
root@as5712-2:/mnt/onl/images# df
61+
Filesystem 1K-blocks Used Available Use% Mounted on
62+
rootfs 1215292 145904 1069388 13% /
63+
devtmpfs 1024 0 1024 0% /dev
64+
none 1215292 145904 1069388 13% /
65+
/dev/sdb5 1032088 276700 702960 29% /mnt/onl/images
66+
/dev/sdb6 6313528 143612 5849200 3% /mnt/onl/data
67+
/dev/sdb3 126931 37007 83371 31% /mnt/onl/boot
68+
/dev/sdb4 126931 5651 114727 5% /mnt/onl/config
69+
tmpfs 810196 208 809988 1% /run
70+
tmpfs 5120 0 5120 0% /run/lock
71+
tmpfs 1620380 0 1620380 0% /run/shm
7172

7273
SWI
7374
--------

docs/GettingStarted.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,9 @@ To enable NFS mounted root partition:
160160
1) Run the ONL installer normally (e.g., via the manual mode per above) so that the ONL
161161
loader is installed.
162162

163-
2) Edit /mnt/flash/boot-config, enable DHCP, and change the SWI variable to point to a URL of the form "nfs://$ip[:port]/path/to/directory/". For example, on my machine, this looks like:
163+
2) Edit /mnt/onl/boot/boot-config, enable DHCP, and change the SWI variable to point to a URL of the form "nfs://$ip[:port]/path/to/directory/". For example, on my machine, this looks like:
164164

165-
# cat /mnt/flash/boot-config
165+
# cat /mnt/onl/boot/boot-config
166166
SWI=nfs://10.6.0.4/home/robs/export/ly2-1/ # trailing '/' is critical
167167
NETAUTO=dhcp # optional, but likely what you want
168168
NETDEV=ma1 # leave untouched

docs/PersistWorkflow.md

+5-31
Original file line numberDiff line numberDiff line change
@@ -18,38 +18,12 @@ It has the following properites:
1818

1919
* Any file that is editted/removed/etc is transparently copied into a RAM disk via overlayfs
2020
* Thus, any changes to files appear as you would expect, until a reboot
21-
* Any file that is uneditted remains backed by the /mnt/flash2 file system, so you
21+
* Any file that is uneditted remains backed by the /mnt/onl/data file system, so you
2222
do not need to have enough RAM to store the entire rootfs. This is important with
2323
switches that do not have much RAM to begin with.
2424

25-
That said, ONL does have a provision to persist explicitly marked files
26-
across a reboot. This document shows how this works.
25+
If you want to persist files, you can either install the image directly to disk using
26+
the Installed installer, put debian files to the /mnt/onl/data/install-debs directory.
27+
Or use rc.boot files to do system management (/mnt/onl/$dir/rc.boot)
2728

28-
29-
# Persisting Files
30-
31-
Just run `/sbin/persist /path/to/file` to mark a file as 'persisted'. This
32-
file will be saved to the /mnt/flash persistent storage device and automatically
33-
put back into place on reboot. Once a file has been persisted, it will always
34-
be persisted across reboots. If you really want to unpersist a file, manually remove it from
35-
'/persist/rootfs/path/to/file'.
36-
37-
# Under the covers
38-
39-
Running `/sbin/persist file` makes a hardlink of that file, e.g., /foo/bar/baz, to
40-
/persist/rootfs/foo/bar/baz.
41-
42-
The `/etc/init.d/restorepersist` script runs on bootup and does a number of things:
43-
44-
* Restores the previously saved cpio archive from /mnt/flash/persist/rootfs into both / and /persist/rootfs
45-
* Sets up hard links between /persist/rootfs/foo/bar/baz and /foo/bar/baz
46-
* Starts a `watchdir` process for changes in /persist/rootfs
47-
48-
`watchdir` in turn uses the inotify(3) subsystem to, upon a change, run `/sbin/savepersist /persist/rootfs`.
49-
50-
And so, any change to a persisted file is noticed by watchdir and saved
51-
to /mnt/flash in a cpio archive automatically using /sbin/savepersist.
52-
53-
# Limitations
54-
55-
You cannot persist any file that is read/used before `/etc/rcS.d/S03restorepersist` is run, including this script itself. Also, it is NOT recommended for persisting logging files, e.g., /var/log/*. While technically this will work, you will likely quickly exceed the write cycle limit of the underlying flash memory. Better to use a syslog server.
29+
Packages present and listed in /mnt/onl/data/install-debs/list will be installed.

docs/PortingGuide.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ specific hardware (an ethernet driver) to a device-agnostic form
8484

8585
The following files need to be populated by the $platform boot script:
8686
* /etc/onl/net : The PCI device name and interface name of the management ethernet
87-
* /etc/onl/mounts : The devices that correspond to /mnt/flash and /mnt/flash2 at boot
87+
* /etc/onl/rootfs and /etc/onl/loader : The devices that correspond to /mnt/onl/data and /mnt/onl/boot at boot
8888
* /etc/fw_env.config : The device and configuration of the firmware device, for fw_printenv, fw_setenv
8989

9090

packages/base/all/vendor-config-onl/src/python/onl/install/App.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ def findPlatform(self):
224224
arch = getattr(self.machineConf, 'onie_arch', None)
225225
if plat and arch:
226226
self.log.info("ONL installer running under ONIE.")
227-
plat = plat.replace('_', '-')
227+
plat = plat.replace('_', '-').replace('.', '-')
228228
elif os.path.exists("/etc/onl/platform"):
229229
with open("/etc/onl/platform") as fd:
230230
plat = fd.read().strip()

packages/base/all/vendor-config-onl/src/python/onl/platform/current.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def import_subsystem_platform_class(subsystem='onl', klass='OnlPlatform'):
3232
if platform is None:
3333
raise RuntimeError("cannot find a platform declaration")
3434

35-
platform_module = platform.replace('-', '_')
35+
platform_module = platform.replace('-', '_').replace('.', '_')
3636

3737
# Import the platform module
3838
m = importlib.import_module('%s.platform.%s' % (subsystem, platform_module))

0 commit comments

Comments
 (0)