@@ -26,6 +26,7 @@ usage() {
26
26
echo " -c <fwup.conf> Default is $NERVES_SDK_IMAGES /fwup.conf"
27
27
echo " -f <firmware output file> Default is $PROJECT_DIR .fw"
28
28
echo " -o <image output file> Default is $PROJECT_DIR .img"
29
+ echo " -p <file priorities> The ordering of files in the rootfs (may be specified more than once)"
29
30
echo
30
31
echo " Barring errors, the firmware file is always created. The raw image is only"
31
32
echo " created if specified."
@@ -35,7 +36,18 @@ usage() {
35
36
echo " $SCRIPT_NAME -f $PROJECT_DIR .fw -o $PROJECT_DIR .img _rel"
36
37
}
37
38
38
- while getopts " :a:c:f:o:" opt; do
39
+ # Create a base priority file
40
+ #
41
+ # Seed it with erlinit being the highest priority since we know those
42
+ # files are guaranteed to be in the filesystem and accessed first on
43
+ # boot.
44
+ SQUASHFS_PRIORITIES=" $TMP_DIR /squashfs.priority"
45
+ cat > " $SQUASHFS_PRIORITIES " << END
46
+ sbin/init 32764
47
+ etc/erlinit.config 32763
48
+ END
49
+
50
+ while getopts " a:c:f:o:p:" opt; do
39
51
case $opt in
40
52
a)
41
53
ROOTFS_ADDITIONS=" $ROOTFS_ADDITIONS $OPTARG "
@@ -49,6 +61,10 @@ while getopts ":a:c:f:o:" opt; do
49
61
o)
50
62
IMG_FILENAME=" $OPTARG "
51
63
;;
64
+ p)
65
+ # Append priorities to the master list
66
+ cat " $OPTARG " >> " $SQUASHFS_PRIORITIES "
67
+ ;;
52
68
\? )
53
69
echo " $SCRIPT_NAME : ERROR: Invalid option: -$OPTARG "
54
70
usage
@@ -138,7 +154,7 @@ if [[ "$ROOTFS_ADDITIONS" ]]; then
138
154
fi
139
155
140
156
# Merge the Erlang/OTP release onto the base image
141
- " $NERVES_SYSTEM /scripts/merge-squashfs" " $NERVES_SDK_IMAGES /rootfs.squashfs" " $TMP_DIR /combined.squashfs" " $TMP_DIR /rootfs-additions"
157
+ " $NERVES_SYSTEM /scripts/merge-squashfs" " $NERVES_SDK_IMAGES /rootfs.squashfs" " $TMP_DIR /combined.squashfs" " $TMP_DIR /rootfs-additions" " $SQUASHFS_PRIORITIES "
142
158
143
159
# Build the firmware image
144
160
echo " Building $FW_FILENAME ..."
0 commit comments