Updates for new partition layout and mount management.

This commit is contained in:
Jeffrey Townsend
2016-04-13 18:37:24 -07:00
parent a920b9ae63
commit c9ba39388d
6 changed files with 16 additions and 47 deletions

View File

@@ -26,8 +26,6 @@ packages:
summary: Open Network Linux System Loader Common Initscripts
files:
src/bin/initblockdev : /sbin/
src/bin/initmounts : /sbin/
src/bin/initnetdev : /sbin/
changelog: Change changes changes.,

View File

@@ -23,9 +23,9 @@ field "$ONL_PLATFORM" " Platform: $ONL_PLATFORM"
field "MA1_ADDR" " ma1: $MA1_ADDR"
echo "*"
echo "************************************************************"
if [ -f /mnt/flash/boot-config ]; then
if [ -f /etc/onl/boot-config ]; then
msg_info "boot-config"
cat /mnt/flash/boot-config
cat /etc/onl/boot-config
else
if [ -f /bin/boot-config.py ]; then

View File

@@ -49,7 +49,7 @@ Usage: $0 [-h|--help] [-t|--testonly] [--rootfs ROOTFS] --cache LOCATION [SWI]
format of the SWI argument:
DEV:PATH
/mnt/DEV/PATH
/mnt/onl/DEV/PATH
Loads a SWI file from local storage device DEV (e.g. flash).
http://[USER:PASSWORD@]SERVER[:PORT]/PATH
ftp://[USER:PASSWORD@]SERVER[:PORT]/PATH
@@ -111,18 +111,18 @@ case "${SWI}" in
fi
;;
*)
# Parse dev:file or dev:/file or /mnt/dev/file
parselocal='s#\(\([^:/]*\):/\?\|/mnt/\([^/]*\)/\)\?\(.*\)#dev="\2\3" file="\4"#p'
# Parse dev:file or dev:/file or /mnt/onl/dev/file
parselocal='s#\(\([^:/]*\):/\?\|/mnt/onl/\([^/]*\)/\)\?\(.*\)#dev="\2\3" file="\4"#p'
eval $(echo "${SWI}" | sed -n "${parselocal}")
if [ "${dev}" ] ; then
# Wait for /mnt/dev to show up
waitforblockdev "/mnt/${dev}"
:
else
# Assume file is relative, parse absolutified file
eval $(realpath "${file}" | sed -n "${parselocal}")
SWI="${dev}:${file}"
fi
swipath="/mnt/${dev}/${file}"
swipath="/mnt/onl/${dev}/${file}"
[ -f "${swipath}" ] || { echo "${SWI} not found or not a file"; exit 1; }
;;
esac

View File

@@ -53,7 +53,6 @@ while read -r l; do
esac
done
# Populate platform-specific settings
. /lib/platform-detect
@@ -62,46 +61,23 @@ if [ ! -f /etc/onl/abort ]; then
# Tell kernel to invoke mdev when devices are added or removed
echo /sbin/mdev >/proc/sys/kernel/hotplug
# Initialize any block and net devices already present
( cd /sys/class/block; for d in *; do initblockdev $d add; done )
if [ -d /sys/class/ubi ]; then
( cd /sys/class/ubi; for d in *; do initblockdev $d add; done )
fi
# Initialize net devices
( cd /sys/class/net; for d in *; do initnetdev $d add; done )
# Initialize platform mounts
initmounts
# Perform recovery if necessary; reboot automatically
if /bin/recover; then
initmounts
else
restoreconsole
echo "Recovery failed."
echo "Press CR now to exit sysinit and access the loader shell."
echo "Otherwise, the system will reboot in 3s."
if read -t 3 prompt; then
trap - EXIT
exit
fi
reboot -f
fi
initmounts -q
if [ -f /etc/issue ]; then
cat /etc/issue
fi
waitforblockdev /mnt/flash
sleep 1 # wait for external block devices to be mounted
[ ! -f /mnt/flash/boot-config ] || cat /mnt/flash/boot-config >>/etc/onl/boot-config
[ ! -f /mnt/onl/boot/boot-config ] || cat /mnt/onl/boot/boot-config >>/etc/onl/boot-config
#
# Initialize the /mnt/flash/boot area.
#
mkdir -p /mnt/flash/boot
rm -rf /mnt/flash/boot/*
#mkdir -p /mnt/data/boot
#rm -rf /mnt/flash/boot/*
fi

View File

@@ -14,11 +14,11 @@ if [ ! "${SWI}" ]; then
exit 200
fi
if [ "${SWI}" = "flash2::latest" ]; then
# Boot the latest (by mtime) SWI in the flash2 partition.
SWI=`ls /mnt/flash2/*.swi -t | head -n1`
if [ "${SWI}" = "images::latest" ]; then
# Boot the latest (by mtime) SWI in the images partition.
SWI=`ls /mnt/onl/images/*.swi -t | head -n1`
if [ -z "${SWI}" ]; then
msg_error "No SWI available in /mnt/flash2. SWI booting cannot continue."
msg_error "No SWI available in /mnt/onl/images. SWI booting cannot continue."
exit 200
fi
fi

View File

@@ -13,21 +13,16 @@
/etc/passwd f 644 0 0 - - - - -
/bin/autoboot f 755 0 0 - - - - -
/bin/boot f 755 0 0 - - - - -
/bin/discoverbootconf f 755 0 0 - - - - -
/bin/help f 755 0 0 - - - - -
/bin/ifget f 755 0 0 - - - - -
/bin/ifup f 755 0 0 - - - - -
/bin/initblockdev f 755 0 0 - - - - -
/bin/initnetdev f 755 0 0 - - - - -
/bin/login f 755 0 0 - - - - -
/bin/netconf f 755 0 0 - - - - -
/bin/recover f 755 0 0 - - - - -
/bin/swiinfo f 755 0 0 - - - - -
/bin/switchroot f 755 0 0 - - - - -
/bin/sysinit f 755 0 0 - - - - -
/bin/udhcpc f 755 0 0 - - - - -
/bin/waitforblockdev f 755 0 0 - - - - -
/bin/wipe f 755 0 0 - - - - -
/bin/zcip f 755 0 0 - - - - -
/lib/udhcpc-script f 755 0 0 - - - - -
/lib/zcip-script f 755 0 0 - - - - -