Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Aboot] Fix mount point discovery in boot0 for overlayfs #1959

Merged
merged 1 commit into from
Aug 21, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions files/Aboot/boot0.j2
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ cmdline_base="$target_path/kernel-params-base"
cmdline_image="$image_path/kernel-cmdline"

bootconfigvars="KERNEL INITRD CONSOLESPEED PASSWORD NETDEV NETAUTO NETIP NETMASK NETGW NETDOMAIN NETDNS NETHW memtest"
flash_re=" /mnt/flash| /host"

parse_environment_config() {
for n in ${bootconfigvars}; do
Expand Down Expand Up @@ -148,7 +149,8 @@ platform_specific() {
# set varlog size to 100MB
local varlog_size=100

local flash_size=$(($(df | grep -E '/mnt/flash|/host' | tr -s ' ' | cut -f2 -d' ') / 1000))
# detect the size of the flash partition from name in Aboot/EOS/SONiC
local flash_size=$(($(df | grep -E "$flash_re" | tr -s ' ' | cut -f2 -d' ') / 1000))

if [ "$platform" = "raven" ]; then
aboot_machine=arista_7050_qx32
Expand Down Expand Up @@ -241,8 +243,8 @@ write_boot_configs() {

# setting root partition if not overridden by kernel-params
if ! grep -q "root=" /tmp/append; then
rootdev="$(mount | grep -E '/mnt/flash|/host' | cut -f1 -d' ')"
rootfstype="$(mount | grep -E '/mnt/flash|/host' | cut -f5 -d' ')"
rootdev="$(mount | grep -E "$flash_re" | cut -f1 -d' ')"
rootfstype="$(mount | grep -E "$flash_re" | cut -f5 -d' ')"
rootuuid="$(get_uuid_for $rootdev)"
if [ -z "$rootuuid" ] || [ "$rootfstype" = "vfat" ] ; then
echo "root=$rootdev" >> /tmp/append
Expand Down