dentproject / dentOS

dentOS SwitchDev based NOS
Other
206 stars 60 forks source link

initrd decode error #287

Open deep5050 opened 1 year ago

deep5050 commented 1 year ago

i was trying to run dent on a qemu/kvm:

git this error:


ONIE:/ # onie-nos-install DENTOS-HEAD_ONL-OS9_2023-06-22.2143-d97c46b_AMD64_INST
ALLED_INSTALLER
discover: Rescue mode detected. No discover stopped.
ONIE: Executing installer: DENTOS-HEAD_ONL-OS9_2023-06-22.2143-d97c46b_AMD64_INSTALLED_INSTALLER
installer: computing checksum of original archive
installer: checksum is OK
installer: extracting pad
1+0 records in
1+0 records out
512 bytes (512B) copied, 0.000009 seconds, 54.3MB/s
installer: copying file before resetting pad
installer: resetting pad
1+0 records in
1+0 records out
512 bytes (512B) copied, 0.000013 seconds, 37.6MB/s
installer: extracting shar into /tmp/sfx-CPcbZI
installer: invoking installer installer.sh
Found installer tmpfs on /tmp/sfx-CPcbZI (/tmp) using opts rw,noatime
Resizing tmpfs /tmp to 1048576k
Unpacking ONL installer files...
Extracting from /tmp/sfx-CPcbZI/onie-installer.zip: onl-loader-initrd-amd64.cpio.gz ...
Archive:  /tmp/sfx-CPcbZI/onie-installer.zip
  inflating: onl-loader-initrd-amd64.cpio.gz
Extracting initrd to /tmp/sfx-CPcbZI/initrd-ZDxHfr
64769 blocks
Setting up /dev
Setting up /run
Setting up mounts
modprobe: can't change directory to '/lib/modules': No such file or directory
Launching ONL installer
Unmounting /mnt/onie-boot (--force)
Unmounting /boot/efi (--force)
Extracting from /tmp/sfx-CPcbZI/onie-installer.zip: preinstall.sh ...
Archive:  /tmp/sfx-CPcbZI/onie-installer.zip
  inflating: preinstall.sh
Invoking pre-install actions
Hello from preinstall
Chroot is /tmp/sfx-CPcbZI/initrd-ZDxHfr
Examining /dev/vdb --> USB-DRIVE
Examining /dev/vda2 --> ONIE-BOOT
Found ONIE boot partition at /dev/vda2
Examining /dev/vda1 --> EFI System
Found EFI System partition at /dev/vda1
Found a clean GPT partition table
getting installer configuration
+ blkid
found ONIE boot device /dev/vda2
found ONIE boot mounted at /mnt/onie-boot
found ONIE initrd at /mnt/onie-boot/onie/initrd.img-5.4.86-onie.sig
extracting initrd /mnt/onie-boot/onie/initrd.img-5.4.86-onie.sig
+ /bin/mkdir /tmp/sfx-CPcbZI/chroot-6bzstB.d
runner failed
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/onl/install/App.py", line 410, in main
    code = app.run()
  File "/usr/lib/python2.7/dist-packages/onl/install/App.py", line 54, in run
    return self.runLocal()
  File "/usr/lib/python2.7/dist-packages/onl/install/App.py", line 235, in runLocal
    halp = osi.help
  File "/usr/lib/python2.7/dist-packages/onl/install/ShellApp.py", line 312, in help
    return self._runArgs('-h')
  File "/usr/lib/python2.7/dist-packages/onl/install/ShellApp.py", line 304, in _runArgs
    with OnieBootContext(log=self.log) as ctx:
  File "/usr/lib/python2.7/dist-packages/onl/install/ShellApp.py", line 130, in __enter__
    with InitrdContext(initrd=initrd, log=self.log) as self.ictx:
  File "/usr/lib/python2.7/dist-packages/onl/install/InstallUtils.py", line 1058, in __enter__
    self._unpack()
  File "/usr/lib/python2.7/dist-packages/onl/install/InstallUtils.py", line 969, in _unpack
    raise ValueError("cannot decode initrd")
ValueError: cannot decode initrd
Install failed.
Oct 15 04:31:49 onie local0.info onie: Starting: klogd...
Oct 15 04:31:49 onie local0.info onie:  done.
Oct 15 04:31:49 onie local0.info onie: Starting: dropbear ssh daemon...
Oct 15 04:31:51 onie local0.info onie:  done.
Oct 15 04:31:51 onie local0.info onie: Starting: telnetd...
Oct 15 04:31:51 onie local0.info onie:  done.
Oct 15 04:35:49 onie local0.info onie-exec: ONIE: Executing installer: DENTOS-HEAD_ONL-OS9_2023-06-22.2143-d97c46b_AMD64_INSTALLED_INSTALLER
Oct 15 04:35:49 onie local0.info os-install: installer: computing checksum of original archive
Oct 15 04:35:49 onie local0.info os-install: installer: checksum is OK
Oct 15 04:35:49 onie local0.info os-install: installer: extracting pad
Oct 15 04:35:49 onie local0.info os-install: 1+0 records in
Oct 15 04:35:49 onie local0.info os-install: 1+0 records out
Oct 15 04:35:49 onie local0.info os-install: 512 bytes (512B) copied, 0.000009 seconds, 54.3MB/s
Oct 15 04:35:49 onie local0.info os-install: installer: copying file before resetting pad
Oct 15 04:35:50 onie local0.info os-install: installer: resetting pad
Oct 15 04:35:50 onie local0.info os-install: 1+0 records in
Oct 15 04:35:50 onie local0.info os-install: 1+0 records out
Oct 15 04:35:50 onie local0.info os-install: 512 bytes (512B) copied, 0.000013 seconds, 37.6MB/s
Oct 15 04:35:50 onie local0.info os-install: installer: extracting shar into /tmp/sfx-CPcbZI
Oct 15 04:35:50 onie local0.info os-install: installer: invoking installer installer.sh
Oct 15 04:35:50 onie local0.info os-install: Archive:  /tmp/sfx-CPcbZI/onie-installer.zip
Oct 15 04:35:50 onie local0.info os-install:   inflating: onl-loader-initrd-amd64.cpio.gz
Oct 15 04:35:50 onie local0.info os-install: 64769 blocks
Oct 15 04:35:50 onie local0.info os-install: modprobe: can't change directory to '/lib/modules': No such file or directory
Oct 15 04:35:50 onie local0.info os-install: Archive:  /tmp/sfx-CPcbZI/onie-installer.zip
Oct 15 04:35:50 onie local0.info os-install:   inflating: preinstall.sh
Oct 15 04:35:50 onie local0.info os-install: Hello from preinstall
Oct 15 04:35:50 onie local0.info os-install: Chroot is /tmp/sfx-CPcbZI/initrd-ZDxHfr
Install failed. See log messages above for details
Unmounting /tmp/sfx-CPcbZI/initrd-ZDxHfr/sys/firmware/efi/efivars
Unmounting /tmp/sfx-CPcbZI/initrd-ZDxHfr/sys
Unmounting /tmp/sfx-CPcbZI/initrd-ZDxHfr/proc
Unmounting /tmp/sfx-CPcbZI/initrd-ZDxHfr/mnt/onie-boot
Unmounting /tmp/sfx-CPcbZI/initrd-ZDxHfr/mnt/installer
Unmounting /tmp/sfx-CPcbZI/initrd-ZDxHfr/dev/pts
Unmounting /tmp/sfx-CPcbZI/initrd-ZDxHfr/dev
Remounting /tmp with options rw,noatime,size=50%
Rebooting in 3s
Hit CR to continue, CTRL-D or CTRL-C to stop... timeout, rebooting
signal -127, stopped
discover: Rescue mode detected. No discover stopped.
Stopping: dropbear ssh daemon... done.
Stopping: telnetd... done.
Stopping: klogd... done.
Stopping: syslogd... done.
Info: Unmounting kernel filesystems
umount: tmpfs busy - remounted read-only
umount: can't remount tmpfs read-only
umount: devtmpfs busy - remounted read-only
umount: can't unmount /: Invalid argument
The system is going down NOW!
Sent SIGTERM to all processes
Terminated
Sent SIGKILL to all processes
Requesting system reboot

any help?

KorelU commented 4 months ago

Hi @deep5050,

I had the same message when I tried to run DENT on a qemu/kvm. Thankfully there is some documentation on the DENT wiki to help.

Visit: How-to-install-DENT-on-a-virtual-machine

Break Down of Steps:

  1. In order to run DENT on a qemu/kvm you will need to first download the ONIE source code and build an ONIE iso image. DUE is the recommended environment for building ONIE at the time of writing this and it has been used for debug and release generation since 2019.

Here is a helpful article I used: Building and Installing ONIE on KVM/QEMU (Open Network Install Environment) with DUE

  1. After you build the iso image download the Version of DENT you want to install.

Releases of different versions can be found here: DENTOS Releases.

  1. When I used the onie-vm.sh script to create the virtual qemu/kvm I ran into the message you are now facing. My recommendation would be to use virt-manager instead. The virt-manager application is a desktop user interface for managing virtual machines through libvirt. This is the application that is referenced in the How-to-install-DENT-on-a-virtual-machine

  2. The How-to-install-DENT-on-a-virtual-machine guide will show the steps you need to take to create the VM.

For the OS option I have only tested the Generic or unknown OS as the "Debian Lenny" version in the documentation was no longer listed.

image

In order to add the Serial Device, at the bottom left select Add Hardware->Serial->Finish. Once the Serial is added configure a bind to your host machine. The example documentation uses port 40031.

image.

I ended up setting a tcp connection. If you need a reference XML for this you may use the following

image

Once the VM has started running Open a new console on your device and use telnet to access the local host at port 40031.

Ex. $ telnet 127.0.0.1 40031

To login to ONIE Username: root Password: onie

To login to DENT Username: root Password: onl

image

I hope this helps feel free to reach out for clarification.

Thanks, Korel Ucpinar