Hello,
I am trying to setup a reliable and easy way to rebuild ONIE in the future, without having the re-learn it all in 5 years.
So I'm making a little script for proxmox that will
- create a debian container
- install due
- install onie
- build onie
- give me my onie recovery iso and updater file
Before getting to the current problem, I want to get anyone else up to speed
First my switch is a dell s6010-on with a dead sata drive.
I have a fresh blank sata ssd in now and that's why I'm rebuilding this.
I did try to use the onie recovery iso from dell
which you can find at
https://www.dell.com/support/home/en-us/drivers/driversdetails?driverid=hf0fk&oscode=naa&productcode=networking-s6010-on
ONIE_3.26.1.0-4.zip
Unfortunately, when you boot that, the GRUB menu never shows, so you cannot choose ONIE: embed
And therefore you cannot install ONIE on the switch, instead it will always boot into ONIE recovery, which apparently can't install ONIE on the switch, it is for fixing the switch's existing OS...
So,
from this page I know that I need debian 9
https://github.com/opencomputeproject/onie/blob/master/build-config/scripts/onie-build-targets.json
from this page ,
https://github.com/CumulusNetworks/DUE/tree/master/templates/onie
I know my build environement creation is
due --create --platform linux/amd64 --name onie-build-debian-9 --prompt ONIE-9 --tag onie-9 --use-template onie --from debian:9 --description 'ONIE Build Debian 9' --image-patch debian/9/filesystem
BTW ONIE build instruction for the dell s6010
https://github.com/opencomputeproject/onie/blob/master/machine/dell/dell_s6010_c2538/INSTALL
Ok, so I tried with a unprivilege debian 12 LXC
Tried installing due with
apt install due -y
This fails with ,
Unrecognized --create argument [ --platform ]
because the apt installed version is 2.3.0 which did not support the --platform parameter but the current due version, 4.1.0 does support it
So instead I used git to obtain current version of due
git clone https://github.com/CumulusNetworks/DUE.git
Then I ran the command
./due --create --platform linux/amd64 --name onie-build-debian-9 --prompt ONIE-9 --tag onie-9 --use-template onie --from debian:9 --description 'ONIE Build Debian 9' --image-patch debian/9/filesystem
This failed with
OCI runtime create failed: container_linux.go:377: starting container process caused: process_linux.go:495: container init caused: process_linux.go:458: setting cgroup config for procHooks process caused: can't load program: operation not permitted: unknown
ERROR [ 1 ] in libdue, line #1020, calls [ 1020 1510 0 ] command: "docker build --no-cache=true --tag due-onie-build-debian-9:onie-9 --file=./Dockerfile.create ."
So I made the LXC container a rooted container by removing
unprivileged: 1
from the LXC config file
And now we get to the current issue I am facing.
Selecting previously unselected package wget.
Preparing to unpack .../21-wget_1.18-5+deb9u3_amd64.deb ...
Unpacking wget (1.18-5+deb9u3) ...
Selecting previously unselected package sudo.
Preparing to unpack .../22-sudo_1.8.19p1-2.1+deb9u3_amd64.deb ...
Unpacking sudo (1.8.19p1-2.1+deb9u3) ...
Selecting previously unselected package libfaketime:amd64.
Preparing to unpack .../23-libfaketime_0.9.6-7+b1_amd64.deb ...
Unpacking libfaketime:amd64 (0.9.6-7+b1) ...
Selecting previously unselected package faketime.
Preparing to unpack .../24-faketime_0.9.6-7+b1_amd64.deb ...
Unpacking faketime (0.9.6-7+b1) ...
Setting up libnpth0:amd64 (1.3-1) ...
Setting up libncurses5:amd64 (6.0+20161126-1+deb9u2) ...
Setting up readline-common (7.0-3) ...
Setting up sudo (1.8.19p1-2.1+deb9u3) ...
Setting up libreadline7:amd64 (7.0-3) ...
Setting up libksba8:amd64 (1.3.5-2) ...
Setting up libprocps6:amd64 (2:3.3.12-3+deb9u1) ...
Setting up libtasn1-6:amd64 (4.10-1.1+deb9u1) ...
Setting up procps (2:3.3.12-3+deb9u1) ...
update-alternatives: using /usr/bin/w.procps to provide /usr/bin/w (w) in auto mode
Setting up libgmp10:amd64 (2:6.1.2+dfsg-1+deb9u1) ...
Processing triggers for libc-bin (2.24-11+deb9u4) ...
Setting up libfaketime:amd64 (0.9.6-7+b1) ...
Setting up libunistring0:amd64 (0.9.6+really0.9.3-0.1) ...
Setting up libsqlite3-0:amd64 (3.16.2-5+deb9u3) ...
Setting up libffi6:amd64 (3.2.1-6) ...
Setting up faketime (0.9.6-7+b1) ...
Setting up libassuan0:amd64 (2.4.3-2) ...
Setting up libidn2-0:amd64 (0.16-1+deb9u1) ...
Setting up libpsl5:amd64 (0.17.0-3) ...
Setting up libhogweed4:amd64 (3.3-1+deb9u1) ...
Setting up libp11-kit0:amd64 (0.23.3-2+deb9u1) ...
Setting up pinentry-curses (1.0.0-2) ...
Setting up gnupg-agent (2.1.18-8~deb9u4) ...
Setting up gnupg (2.1.18-8~deb9u4) ...
Setting up libgnutls30:amd64 (3.5.8-5+deb9u6) ...
Setting up wget (1.18-5+deb9u3) ...
Processing triggers for libc-bin (2.24-11+deb9u4) ...
W: --force-yes is deprecated, use one of the options starting with --allow instead.
___________________________________________________________________________
|
| DONE running onie-build-debian-9 pre install configuration.
|___________________________________________________________________________
___________________________________________________________________________
|
| Running onie-build-debian-9 post install configuration.
|___________________________________________________________________________
/due-configuration/post-install-config.sh Copying files in container /due-configuration/filesystem into /
/due-configuration/post-install-config.sh Appending /etc/due-bashrc to /etc/bashrc
Adding user [ oniebuild ] with UID [ 2201 ] to the container.
chfn: PAM: System error
adduser: `/usr/bin/chfn -f oniebuild' returned error code 1. Exiting.
The command '/bin/sh -c /due-configuration/pre-install-config.sh && mkdir -p /run/sshd && /due-configuration/post-install-config.sh' returned a non-zero code: 1
ERROR [ 1 ] in libdue, line #1020, calls [ 1020 1510 0 ] command: "docker build --no-cache=true --tag due-onie-build-debian-9:onie-9 --file=./Dockerfile.create ."
Looks like the problem is to do with these lines
chfn: PAM: System error
adduser: `/usr/bin/chfn -f oniebuild' returned error code 1. Exiting.
Which according to chatgpt is an issue in
/root/DUE/templates/onie/post-install-config.sh.template
to do with the command called adduser
chatgpt suggest replacing the line
adduser --disabled-password --gecos "" --uid $DUE_USER_ID $DUE_USER_NAME
with
adduser --disabled-password --uid $DUE_USER_ID $DUE_USER_NAME
So looking into that file, I found
# Check based on directory
if [ -d /home/$USER_NAME ];then
echo "User [ $USER_NAME ] exists. Continuing."
else
echo "Adding user [ $USER_NAME ] with UID [ $USER_ID ] to the container."
adduser --home /home/$USER_NAME \
--shell /bin/bash \
--uid $USER_ID \
--gecos "" \
--disabled-password $USER_NAME > /dev/null || exit 1
echo "Adding sudo ability for $USER_NAME"
adduser $USER_NAME sudo > /dev/null || exit 1
echo "Adding sudo without password."
echo "$USER_NAME ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers
#
# make sure directory is owned by user
#
chown $USER_NAME /home/$USER_NAME/.bashrc
fi
And so first thing I'm going to try is to remove this line entirely
--gecos "" \
And now I wipe and re-start this process
./due --create --clean && ./due --create --platform linux/amd64 --name onie-build-debian-9 --prompt ONIE-9 --tag onie-9 --use-template onie --from debian:9 --description 'ONIE Build Debian 9' --image-patch debian/9/filesystem
So I did that but, unfortunately, no effect on the error message
Selecting previously unselected package libfaketime:amd64.
Preparing to unpack .../23-libfaketime_0.9.6-7+b1_amd64.deb ...
Unpacking libfaketime:amd64 (0.9.6-7+b1) ...
Selecting previously unselected package faketime.
Preparing to unpack .../24-faketime_0.9.6-7+b1_amd64.deb ...
Unpacking faketime (0.9.6-7+b1) ...
Setting up libnpth0:amd64 (1.3-1) ...
Setting up libncurses5:amd64 (6.0+20161126-1+deb9u2) ...
Setting up readline-common (7.0-3) ...
Setting up sudo (1.8.19p1-2.1+deb9u3) ...
Setting up libreadline7:amd64 (7.0-3) ...
Setting up libksba8:amd64 (1.3.5-2) ...
Setting up libprocps6:amd64 (2:3.3.12-3+deb9u1) ...
Setting up libtasn1-6:amd64 (4.10-1.1+deb9u1) ...
Setting up procps (2:3.3.12-3+deb9u1) ...
update-alternatives: using /usr/bin/w.procps to provide /usr/bin/w (w) in auto mode
Setting up libgmp10:amd64 (2:6.1.2+dfsg-1+deb9u1) ...
Processing triggers for libc-bin (2.24-11+deb9u4) ...
Setting up libfaketime:amd64 (0.9.6-7+b1) ...
Setting up libunistring0:amd64 (0.9.6+really0.9.3-0.1) ...
Setting up libsqlite3-0:amd64 (3.16.2-5+deb9u3) ...
Setting up libffi6:amd64 (3.2.1-6) ...
Setting up faketime (0.9.6-7+b1) ...
Setting up libassuan0:amd64 (2.4.3-2) ...
Setting up libidn2-0:amd64 (0.16-1+deb9u1) ...
Setting up libpsl5:amd64 (0.17.0-3) ...
Setting up libhogweed4:amd64 (3.3-1+deb9u1) ...
Setting up libp11-kit0:amd64 (0.23.3-2+deb9u1) ...
Setting up pinentry-curses (1.0.0-2) ...
Setting up gnupg-agent (2.1.18-8~deb9u4) ...
Setting up gnupg (2.1.18-8~deb9u4) ...
Setting up libgnutls30:amd64 (3.5.8-5+deb9u6) ...
Setting up wget (1.18-5+deb9u3) ...
Processing triggers for libc-bin (2.24-11+deb9u4) ...
W: --force-yes is deprecated, use one of the options starting with --allow instead.
___________________________________________________________________________
|
| DONE running onie-build-debian-9 pre install configuration.
|___________________________________________________________________________
___________________________________________________________________________
|
| Running onie-build-debian-9 post install configuration.
|___________________________________________________________________________
/due-configuration/post-install-config.sh Copying files in container /due-configuration/filesystem into /
/due-configuration/post-install-config.sh Appending /etc/due-bashrc to /etc/bashrc
Adding user [ oniebuild ] with UID [ 2201 ] to the container.
chfn: PAM: System error
adduser: `/usr/bin/chfn oniebuild' returned error code 1. Exiting.
The command '/bin/sh -c /due-configuration/pre-install-config.sh && mkdir -p /run/sshd && /due-configuration/post-install-config.sh' returned a non-zero code: 1
ERROR [ 1 ] in libdue, line #1020, calls [ 1020 1510 0 ] command: "docker build --no-cache=true --tag due-onie-build-debian-9:onie-9 --file=./Dockerfile.create ."
root@build-onie:~/DUE#
I might have the wrong file ?
Despite running
./due --create --clean
The modified file remains with the modification
adduser --home /home/$USER_NAME \
--shell /bin/bash \
--uid $USER_ID \
--disabled-password $USER_NAME > /dev/null || exit 1
Not sure what to try next other than to try all of this on a new bare metal computer
Hello,
I am trying to setup a reliable and easy way to rebuild ONIE in the future, without having the re-learn it all in 5 years.
So I'm making a little script for proxmox that will
Before getting to the current problem, I want to get anyone else up to speed
First my switch is a dell s6010-on with a dead sata drive.
I have a fresh blank sata ssd in now and that's why I'm rebuilding this.
I did try to use the onie recovery iso from dell
which you can find at
https://www.dell.com/support/home/en-us/drivers/driversdetails?driverid=hf0fk&oscode=naa&productcode=networking-s6010-on
ONIE_3.26.1.0-4.zip
Unfortunately, when you boot that, the GRUB menu never shows, so you cannot choose ONIE: embed
And therefore you cannot install ONIE on the switch, instead it will always boot into ONIE recovery, which apparently can't install ONIE on the switch, it is for fixing the switch's existing OS...
So,
from this page I know that I need debian 9
https://github.com/opencomputeproject/onie/blob/master/build-config/scripts/onie-build-targets.json
from this page ,
https://github.com/CumulusNetworks/DUE/tree/master/templates/onie
I know my build environement creation is
due --create --platform linux/amd64 --name onie-build-debian-9 --prompt ONIE-9 --tag onie-9 --use-template onie --from debian:9 --description 'ONIE Build Debian 9' --image-patch debian/9/filesystemBTW ONIE build instruction for the dell s6010
https://github.com/opencomputeproject/onie/blob/master/machine/dell/dell_s6010_c2538/INSTALL
Ok, so I tried with a unprivilege debian 12 LXC
Tried installing due with
apt install due -yThis fails with ,
Unrecognized --create argument [ --platform ]because the apt installed version is 2.3.0 which did not support the --platform parameter but the current due version, 4.1.0 does support it
So instead I used git to obtain current version of due
git clone https://github.com/CumulusNetworks/DUE.gitThen I ran the command
./due --create --platform linux/amd64 --name onie-build-debian-9 --prompt ONIE-9 --tag onie-9 --use-template onie --from debian:9 --description 'ONIE Build Debian 9' --image-patch debian/9/filesystemThis failed with
OCI runtime create failed: container_linux.go:377: starting container process caused: process_linux.go:495: container init caused: process_linux.go:458: setting cgroup config for procHooks process caused: can't load program: operation not permitted: unknown
ERROR [ 1 ] in libdue, line #1020, calls [ 1020 1510 0 ] command: "docker build --no-cache=true --tag due-onie-build-debian-9:onie-9 --file=./Dockerfile.create ."
So I made the LXC container a rooted container by removing
unprivileged: 1from the LXC config file
And now we get to the current issue I am facing.
Looks like the problem is to do with these lines
Which according to chatgpt is an issue in
/root/DUE/templates/onie/post-install-config.sh.templateto do with the command called adduser
chatgpt suggest replacing the line
adduser --disabled-password --gecos "" --uid $DUE_USER_ID $DUE_USER_NAMEwith
adduser --disabled-password --uid $DUE_USER_ID $DUE_USER_NAMESo looking into that file, I found
And so first thing I'm going to try is to remove this line entirely
--gecos "" \And now I wipe and re-start this process
./due --create --clean && ./due --create --platform linux/amd64 --name onie-build-debian-9 --prompt ONIE-9 --tag onie-9 --use-template onie --from debian:9 --description 'ONIE Build Debian 9' --image-patch debian/9/filesystemSo I did that but, unfortunately, no effect on the error message
I might have the wrong file ?
Despite running
./due --create --cleanThe modified file remains with the modification
Not sure what to try next other than to try all of this on a new bare metal computer