sonic-net / sonic-buildimage

Scripts which perform an installable binary image build for SONiC
Other
723 stars 1.38k forks source link

'make reset' cannot remove fsroot* #10268

Open iMasaruOki opened 2 years ago

iMasaruOki commented 2 years ago

Description

Run 'make reset' in sonic-buildimage after build image, fsroot* should be removed, but isn't it.

Steps to reproduce the issue:

  1. cd sonic-buildimage; make init; make configure PLATFORM=broadcom; make sll
  2. make reset
  3. git status

Describe the results you received:

Untracked files:
  (use "git add <file>..." to include in what will be committed)
    fsroot-broadcom-dnx/
    fsroot-broadcom/

Describe the results you expected:

nothing to commit, working tree clean

Tested on master and 202111 branch.

zhangyanzhao commented 2 years ago

@Xuhui Miao please help to take a look. Thanks.

TafkaMax commented 6 months ago

Same problem here.

I am trying to integrate this into a gitlab-runner and the generated gitlab-runner user has gets the same error.

I am also trying to create a sudoers file for gitlab-runner, but it is really hard. As make reset calls out other functions and I am getting sudoers file exceptions.

All in all quite the predicament that the sonic-builder repo is...

EDIT: I am using git checkout 202311

EDIT2:

~/builds/y1RF96qX/0/sysadm/sonic-builder/sonic-buildimage

Warning! All local changes will be lost. Proceed? [y/N]: y
Resetting local repository. Please wait...
[sudo] password for gitlab-runner: 
Sorry, user gitlab-runner is not allowed to execute '/usr/bin/rm -rf fsroot*' as root on REDACTED
TafkaMax commented 6 months ago

I think I found the issue bro.

For me make reset works when I added my runner user to the sudo group.

e.g. usermod -aG sudo <USER-WHO-BUILDS-SONIC>