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

Address review comments for pull request #846 #901

Merged
merged 2 commits into from
Aug 28, 2017
Merged

Address review comments for pull request #846 #901

merged 2 commits into from
Aug 28, 2017

Conversation

padmanarayana
Copy link
Contributor

  1. "make target/sonic-broadcom.raw" will create the compressed dd'able image.
  2. This will also update the grub config files (device/dell/*/nos_to_sonic_grub.cfg) with the image versions.

@msftclas
Copy link

@padmanarayana,
Thanks for having already signed the Contribution License Agreement. Your agreement was validated by Microsoft. We will now review your pull request.
Thanks,
Microsoft Pull Request Bot

@lguohan
Copy link
Collaborator

lguohan commented Aug 22, 2017

Hi padman, can you add an iteration on previous #846 so that I can know what changed and what not changed. In case you start a new PR, I need to do a new review again for all the changes.

$(SONIC_RAW_IMAGE)_MACHINE = broadcom
$(SONIC_RAW_IMAGE)_IMAGE_TYPE = raw
$(SONIC_RAW_IMAGE)_DEPENDS += $(BRCM_OPENNSL_KERNEL)
$(SONIC_RAW_IMAGE)_INSTALLS += $(DELL_S6000_PLATFORM_MODULE) \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this becomes hard to manage we need to add platform to both one-image.mk and raw-image.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is better to make raw_image depends on one_image, so that you do not need to duplicate these dependencies.

@@ -406,6 +419,15 @@ else
rm -rf $f
fi
done
else
demo_mnt="build_raw_image_mnt"
demo_dev=$cur_wd/"%%OUTPUT_RAW_IMAGE%%"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in line 44, you have sourced onie-image.conf, which defines OUTPUT_RAW_IMAGE, here you should use that instead of doing sed

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't cur_wd = target?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though onie-image.conf is sourced, the TARGET_MACHINE will be assigned to the default ": ${TARGET_MACHINE:=generic}" resulting in an failed attempt to create sonic-generic.raw rather than sonic-broadcom.raw. The sed expansion is needed to assign the TARGET_MACHINE correctly.

# Tailor the demo installer for OS mode or DIAG mode
sed -i -e "s/%%DEMO_TYPE%%/$demo_type/g" \
-e "s/%%IMAGE_VERSION%%/$image_version/g" \
-e "s/%%ONIE_IMAGE_PART_SIZE%%/$onie_image_part_size/" \
-e "s/%%EXTRA_CMDLINE_LINUX%%/$EXTRA_CMDLINE_LINUX/" \
-e "s@%%OUTPUT_RAW_IMAGE%%@$output_raw_image@" \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not see a must you need to do sed here.

build_image.sh Outdated

if [ "$IMAGE_TYPE" = "raw" ] && [ -f ./device/$VENDOR/$PLATFORM/nos_to_sonic_grub.cfg ]; then
sed -i -e "s/%%IMAGE_VERSION%%/$IMAGE_VERSION/g" ./device/$VENDOR/$PLATFORM/nos_to_sonic_grub.cfg
echo "IMAGE_VERSION is $IMAGE_VERSION/g"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/g? remove?

@@ -27,6 +27,7 @@ echo " OK."

# Untar and launch install script in a tmpfs
cur_wd=$(pwd)
export cur_wd
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure you need export this value.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cur_wd is the absolute path prefix prior to the user's target. say, /home/padman/test/sonic-buildimage. Since the installer (in a "build" mode) does not have a real device to mount, it will fallback to /tmp/tmp... (based on mktmp -d). When the final sonic-broadcom.bin is created under /tmp... build_image.sh cannot correctly extract the sonic-broadcom.bin if there are parallel builds on the same host...

One other way would be to pass the cur_wd equivalent to the installer - but that did not appear to be clean.

Exporting cur_wd will ensure that the image gets built only in the specific target dir where the build was invoked.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A correction : the cur_wd is actually /sonic (from the Makefile's -w /sonic ) and not the absolute build path.. Nevertheless, this path needs to be passed to the installer so that build_image.sh may directly retrieve it in-place after the "build" mode installation.

if [ ! -e /mnt/onie-boot/onie/grub/grub-machine.cfg ]; then
echo "/mnt/onie-boot/onie/grub/grub-machine.cfg not found" >> /etc/migration.log
else
grep "=" /mnt/onie-boot/onie/grub/grub-machine.cfg > /host/machine.conf
Copy link
Collaborator

@lguohan lguohan Aug 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is fragile.

check here. https://github.com/opencomputeproject/onie/pull/227/files

+if [ -r "$grub_machine_cfg" ] ; then
 +    . "$grub_machine_cfg"
 +    grep = $grub_machine_cfg | sed -e 's/onie_//' -e 's/=.*$//' | while read var ; do
 +        eval val='$'onie_$var
 +        printf "%-20s: %s\n" "ONIE ${var}" "$val"
 +    done
 +else

Copy link
Collaborator

@lguohan lguohan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as comments.

Copy link
Contributor Author

@padmanarayana padmanarayana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Address review comments.

@lguohan
Copy link
Collaborator

lguohan commented Aug 27, 2017

retest this please

@@ -27,6 +24,11 @@ if [ "$IMAGE_TYPE" = "onie" ]; then
if [ -f ./device/$VENDOR/$PLATFORM/installer.conf ]; then
cp ./device/$VENDOR/$PLATFORM/installer.conf ./installer/x86_64/platforms/$PLATFORM
fi

if [ "$IMAGE_TYPE" = "raw" ] && [ -f ./device/$VENDOR/$PLATFORM/nos_to_sonic_grub.cfg ]; then
sed -i -e "s/%%IMAGE_VERSION%%/$IMAGE_VERSION/g" ./device/$VENDOR/$PLATFORM/nos_to_sonic_grub.cfg
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the IMAGE_VERSION is not replaced in the nos_to_sonic_grub.cfg, can you check?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my local build, it is getting reset after make target/sonic-broadcom.raw:

padman@ubuntu-16:/gvob/sdchk$ diff ./sonic-buildimage/device/dell/x86_64-dell_s6100_c2538-r0/nos_to_sonic_grub.cfg.base ./sonic-buildimage/device/dell/x86_64-dell_s6100_c2538-r0/nos_to_sonic_grub.cfg
22,23c22,23
< linux /image-%%IMAGE_VERSION%%/boot/vmlinuz-3.16.0-4-amd64 root=/dev/sda8 rw console=tty0 console=ttyS1,9600n8 loop=image-%%IMAGE_VERSION%%/fs.squashfs loopfstype=squashfs apparmor=1 security=apparmor
< initrd /image-%%IMAGE_VERSION%%/boot/initrd.img-3.16.0-4-amd64

    linux   /image-master.0-2d3b064/boot/vmlinuz-3.16.0-4-amd64 root=/dev/sda8 rw console=tty0 console=ttyS1,9600n8 loop=image-master.0-2d3b064/fs.squashfs loopfstype=squashfs apparmor=1 security=apparmor
    initrd  /image-master.0-2d3b064/boot/initrd.img-3.16.0-4-amd64

31,32c31,32
< linux /image-%%IMAGE_VERSION%%/boot/vmlinuz-3.16.0-4-amd64 root=/dev/sda8 rw console=tty0 console=ttyS1,9600n8 loop=image-%%IMAGE_VERSION%%/fs.squashfs loopfstype=squashfs apparmor=1 security=apparmor
< initrd /image-%%IMAGE_VERSION%%/boot/initrd.img-3.16.0-4-amd64

    linux   /image-master.0-2d3b064/boot/vmlinuz-3.16.0-4-amd64 root=/dev/sda8 rw console=tty0 console=ttyS1,9600n8 loop=image-master.0-2d3b064/fs.squashfs loopfstype=squashfs apparmor=1 security=apparmor
    initrd  /image-master.0-2d3b064/boot/initrd.img-3.16.0-4-amd64

padman@ubuntu-16:/gvob/sdchk$

insmod part_msdos
insmod ext2
set root='(hd0,gpt8)'
linux /image-%%IMAGE_VERSION%%/boot/vmlinuz-3.16.0-4-amd64 root=/dev/sda8 rw console=tty0 console=ttyS1,9600n8 loop=image-%%IMAGE_VERSION%%/fs.squashfs loopfstype=squashfs apparmor=1 security=apparmor
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add quiet option to boot linux

@lguohan lguohan merged commit 2d3b064 into sonic-net:master Aug 28, 2017
@padmanarayana padmanarayana deleted the sonic_dd_update2 branch August 29, 2017 09:43
stcheng pushed a commit to stcheng/sonic-buildimage that referenced this pull request May 22, 2019
[vlan] Add pytest case to add max vlan. (sonic-net#881)
[badge]: add vs build badge (sonic-net#898)
Fix PFC watchdog not getting lossless TC (sonic-net#876)
[vstest]: skip test_AddMaxVlan as it takes almost two hours to finish (sonic-net#901)
[test]: Enforce fake port-channel interfaces carrier up

Signed-off-by: Shu0T1an ChenG <shuche@microsoft.com>
lguohan pushed a commit that referenced this pull request May 23, 2019
[vlan] Add pytest case to add max vlan. (#881)
[badge]: add vs build badge (#898)
Fix PFC watchdog not getting lossless TC (#876)
[vstest]: skip test_AddMaxVlan as it takes almost two hours to finish (#901)
[test]: Enforce fake port-channel interfaces carrier up

Signed-off-by: Shu0T1an ChenG <shuche@microsoft.com>
MichelMoriniaux pushed a commit to criteo-forks/sonic-buildimage that referenced this pull request May 28, 2019
[vlan] Add pytest case to add max vlan. (sonic-net#881)
[badge]: add vs build badge (sonic-net#898)
Fix PFC watchdog not getting lossless TC (sonic-net#876)
[vstest]: skip test_AddMaxVlan as it takes almost two hours to finish (sonic-net#901)
[test]: Enforce fake port-channel interfaces carrier up

Signed-off-by: Shu0T1an ChenG <shuche@microsoft.com>
zhenggen-xu pushed a commit to zhenggen-xu/sonic-buildimage that referenced this pull request Oct 17, 2019
* msft_github/master:
  [snmpagent]: Update sonic-snmpagent submodule (sonic-net#1004)
  [swss]: Update the ipinip.j2 template to specify the IPv4 loopback address (sonic-net#998)
  Change all port_config.ini column headers from 'port' to 'index' (sonic-net#1001)
  [docker-platform-monitor]: Remove stale fancontrol.pid file (if exists) before starting fancontrol (sonic-net#1002)
  [swss]: Update swss/common submodules (sonic-net#988)
  [snmp]: Update py-swsssdk/snmpagent submodules (sonic-net#996)
  [Broadcom]: Update SAI version to 3.0.3.2-5 (sonic-net#997)
  [Mellanox]: Update outdated MSN2410 minigraph (sonic-net#995)
  Add time stamp suffix to the dirty images version string (sonic-net#958)
  [Mellanox]: Remove FW upgrade procedure in docker (sonic-net#989)
  [snmp]: Update sonic-snmpagent submodule (sonic-net#986)
  [Broadcom]: Update SAI version to 3.0.3.2-4 (sonic-net#983)
  [Ingrasys]: Add Ingrasys S8900-64XC sfputil function and update submodule (sonic-net#984)
  [mellanox]: Update Mellanox SAI version (sonic-net#979)
  [Ingrasys]: Change hwmon kernel modules installation order (sonic-net#980)
  [Makefile] Allowing interactive session with the slave docker-container (sonic-net#903)
  [snmp]: Update sonic-snmpagent submodule (sonic-net#978)
  Disable snmpd module disk_hw, so no syslog messages about unavailable disks (sonic-net#977)
  [teamd]: Remove deprecated blocking logic before starting teamd (sonic-net#976)
  [Broadcom]: Update libsai version to 3.0.3.2-2 (sonic-net#973)
  [device/accton]: Add a new supported device, AS7312-54X (sonic-net#955)
  [sairedis]: update sairedis submodule (sonic-net#974)
  lacp runner will send lacp update right after it received SIGINT (sonic-net#969)
  [config]: Fix management interface configuration (sonic-net#966)
  [Broadcom]: Update OpenNSL modules (sonic-net#970)
  [utilities]: Update sonic-utilities (sonic-net#968)
  [interfaces]: Change MTU value to 9100  (sonic-net#967)
  Framework to plugin Organization specific scripts during ONIE Image build  (sonic-net#951)
  Always start with Forwarding State flag set for bgpd (sonic-net#963)
  Update sonic-utilities to be compatible with sonic-net#942 (sonic-net#965)
  [swss]: Fix the command to get HWSKU with sonic-cfggen (sonic-net#964)
  [bgp]: Fix the deployment_id with DEVICE_METADATA (sonic-net#962)
  [Ingrasys] Update Ingrasys submodule for S8900-54XC (sonic-net#954)
  [build/onie installer] Install grub for SONiC post migration from another NOS (sonic-net#949)
  [syncd]: Comment out unused docker-ptf-brcm.mk
  [Broadcom]: Update OpenNSL/SAI version (sonic-net#959)
  [swss]: Move swss/common/sairedis submodule to 201709 tag
  [sairedis]: update sairedis submodule head (sonic-net#956)
  [service template] Starting new docker when HWSKU change is detected (sonic-net#946)
  [config] Fix an issue that bgp asn data type is not consistent (sonic-net#953)
  [mellanox]: Update Mellanox SAI version ansd SDK version
  [Ingrasys] update port_config.ini and sfputil for ingrasys platforms (sonic-net#952)
  [frr]: RR client support in minigraph for FRR (sonic-net#923)
  [configdb] Migrate minigraph configurations to DB (sonic-net#942)
  [devices]: Add led plugin for Arista 7060CX-32S and 7260CX3-64 (sonic-net#945)
  [sonic-slave]: SLAVE_TAG should be for both Dockerfile and Dockerfile.user (sonic-net#950)
  [github]: add templates for submitting issues and PR (sonic-net#947)
  [rsyslog]: Use timegenerated instead of timestamp (sonic-net#944)
  [dell]: remove nos_to_sonic_grub.cfg (sonic-net#943)
  [slave.mk]: Apply series of patches to SONIC_PYTHON_STDEB_DEBS targets if they exist (sonic-net#941)
  [rsyslog]: Use SONiC template in containers (sonic-net#940)
  [Broadcom]: Remove BRCM_OPENNSL library and upgrade BRCM_SAI to 3.0.3.2 (sonic-net#938)
  [baseimage]: allocate varlog disk in the initramfs stage (sonic-net#936)
  [sairedis]: revert deadlock fix in sonic-sairedis submodule (sonic-net#934)
  Replace CRLF line endings with LF (sonic-net#932)
  Fix confusing comment (sonic-net#931)
  Update sfputil support for Ingrasys S9100 (sonic-net#929)
  [quagga]: Disable ipv4 over ipv6 and enable ipv6 over ipv4 peer group (sonic-net#922)
  [quagga] enable core dump for bgpd and zebra (sonic-net#927)
  [devices]: Update Dell s6100/z9100 platform modules (sonic-net#925)
  Revert "Migrate DEVICE_METADATA to db (sonic-net#919)" (sonic-net#928)
  Migrate DEVICE_METADATA to db (sonic-net#919)
  [devices]: Bump sonic-platform-modules-arista submodule (sonic-net#924)
  [image]: build sonic-broadcom.raw image for sonic conversion from ftos (sonic-net#901)
  [sonic-slave] Force pyangbind version to 0.5.10 (sonic-net#918)
  [Arista-7260CX3] Rename hwSKU Arista-7260CX3-64 to Arista-7260CX3-C64, introducing new hwSKU Arista-7260CX3-D108C8 (sonic-net#920)
  [devices]: modify sfputil plugins for mellanox devices for new platform API (sonic-net#916)
  [cavm]Update sai revision and packet driver (sonic-net#914)
  [translate-acl] Specify pyangbind version to not introduce new dependency (sonic-net#915)
  Update sfputil support for Arista platforms (sonic-net#912)
  Port speed (sonic-net#879)
  [Accton]: Add a new supported device AS5712-54X (sonic-net#898)
  [kernel]: update kernel submodule (sonic-net#910)
  [device]: Updated dell s6100 submodule to 5ab014 (sonic-net#909)
  [broadcom]: update broadcom sai package to 2.1.5.1-17 (sonic-net#908)
  IPv4 prefixes shouldn't be sent by default over IPv6 session with FRR. (sonic-net#905)
  [submodule]: update sonic linux kernel (sonic-net#906)
  [sonic-sairedis] update sairedis submodule (sonic-net#211, sonic-net#212) (sonic-net#904)
  [mlnx-fw-upgrade]: Define required FW version in build time. (sonic-net#902)
  [SAI]: Remove the SAI submodule from buildimage repo (sonic-net#893)
  [Submodule update]: sonic-utilities (sonic-net#888)
  Revert "[mellanox]: Update Mellanox SAI version"
  [mellanox]: Update Mellanox SAI version
  [utilities]: Update sonic-utilities submodule
  [swss-common]: Update sonic-swss-common submodule
  [mellanox]: Disable fsat boot mode for SX kernel
  [quagga]: Update sonic-quagga submodule
  [Broadcom]: Update Broadcom SAI/SDK version (sonic-net#883)
  Squash merge v1.0.3 branch onto master
madhanmellanox pushed a commit to madhanmellanox/sonic-buildimage that referenced this pull request Mar 23, 2020
lguohan pushed a commit that referenced this pull request May 4, 2020
c2facd8 [show] Fix abbreviations for 'show ip bgp ...' commands (#901)
cb68e7d Add support for multi-ASIC devices (#877)
44ed6e9 Improved route_check tool and adopt to 20191130 image. (#898)
6fba8db [psushow] Add a column to display LED color to show platform psustatus output (#886)
e747456 ssd_mitigation_changes (#829)
stepanblyschak pushed a commit to stepanblyschak/sonic-buildimage that referenced this pull request May 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants