Rooting Toon (or boxx)

Forum about the tweaking of the Eneco Toon.

Moderator: marcelr

Re: Rooting Toon (or boxx)

Postby marcelr » Tue Feb 13, 2018 1:47 pm

Found it. The encryption method for the passwords is set elsewhere in the configuration scripts (not under the tab "password").
Options: DES, MD5, SHA256, SHA512. Defaults to DES, so that's cleared now.

Will change it to SHA512 and release a new version of busybox.
marcelr
Advanced Member
Advanced Member
 
Posts: 834
Joined: May 2012
Location: Ehv

Re: Rooting Toon (or boxx)

Postby marcelr » Tue Feb 13, 2018 2:20 pm

Busybox-1.27.2-r4 has been released on the fileserver.
You can find it here:

~/Toon/apps/busybox-1.27.2-r4/*.ipk

Changes:
- changed default password encryption from DES to SHA512
- Aligned applets to reflect all options from busybox-1.27.2-r1 and 1.18.3-r42.1 combined, plus a few more. Some applets are quite useless, but hey, I didn't do the configuration at Quby's :-).

EDIT: posted URL's in the Downloads thread as well.
marcelr
Advanced Member
Advanced Member
 
Posts: 834
Joined: May 2012
Location: Ehv

Re: Rooting Toon (or boxx)

Postby TheHogNL » Tue Feb 13, 2018 3:05 pm

marcelr wrote:Found it. The encryption method for the passwords is set elsewhere in the configuration scripts (not under the tab "password").
Options: DES, MD5, SHA256, SHA512. Defaults to DES, so that's cleared now.

Will change it to SHA512 and release a new version of busybox.


Great work! SHA512 should be enough for the next couple of years 8)
TheHogNL
Member
Member
 
Posts: 288
Joined: August 2017

Re: Rooting Toon (or boxx)

Postby Prutzer » Mon Feb 19, 2018 8:26 pm

Prutzer wrote:Mmm Maybe my serial connection is read only. I will try another USB to serial adapter.


I had a problem with typing the password. It was not receiving any key. The solution in Minicom: Set hardware flow controll: NO
Prutzer
Starting Member
Starting Member
 
Posts: 5
Joined: February 2018

Re: Rooting Toon (or boxx)

Postby djxfma » Fri Feb 23, 2018 9:30 am

Hi fellow tooncitizens!

I made an oopsie, and was wondering if I still can get into: busybox, because
I could not install the opkg packages after uploading them with minicom from my RPI.
After that I read that you could overwrite the busybox with another one so it would
allow the needed commands. BUT! after the overwrite I only get /etc/init.d errors with
permission denied, and most of initial boot fails.

My question can I even fix this? And if yes, how should I fix this terrible mistake..

A fellow tooncitizen.

Kind regards,
DJXFMA
djxfma
Starting Member
Starting Member
 
Posts: 11
Joined: February 2018

Re: Rooting Toon (or boxx)

Postby marcelr » Fri Feb 23, 2018 12:22 pm

Unless the hardware is damaged, anything can be fixed.
However, the information you provide is sparse, to put it mildly :-).

Just a few questions:

What did you do?
What output do you get from your toon;
can you still get in,
and if so, how,
what firmware are you on ...
marcelr
Advanced Member
Advanced Member
 
Posts: 834
Joined: May 2012
Location: Ehv

Re: Rooting Toon (or boxx)

Postby djxfma » Fri Feb 23, 2018 1:15 pm

What did I do:
I followed the rooting guide step by step.
My u-boot is 2010.09-R8 so the password worked as noted.

I have modified the /etc/inittab and /etc/passwd as described by the notes,
for my model. After that reboot I could not see an login string anywhere, I
tried root but did not work for me. So from there I tried below:

After that I tried to wget my opkg (ipk) packages from my webserver,
and wget command did not work, but could have been that the connection
was not up somehow. So I used an Raspberry Pi true Serial and connected with
Minicom and uploaded the ipkg.b64 encoded packages, after I decoded them
on Minicom terminal from Toon, and tried to install them, and it gave me 255 errors,
like already described before.

So I wanted to overwrite the busybox so I exctracted the busybox from the 7-zip,
and put it on my Raspberry Pi, after I encoded it as well with B64 and uploaded
it with the ASCII upload file send method. After I decoded the B64 and copied
the busybox file from /root to /bin/busybox. Soon after that I got permissions
errors on the screen. Then I rebooted to see if that would load the busybox
properly, but then I got stuck.. As for now I could not enter the busybox, there
are errors saying permission denied.

I can still boot into the u-boot (2010.09-R8) but after doing the following code:
setenv addmisc setenv bootargs \$\{bootargs\} mem=\$\{mem\} lpj=999424 init=/bin/sh
run boot_nand

It will load the boot up, but hangs at the permission errors, and this has to do with me
overwriting the busybox file earlier.. :roll:

I have an log file from the tries from yesterday:
U-Boot 2010.09-R8 (Dec 03 2012 - 12:50:30)
* Kernel [20G 2.6.36-R10-h27 (print_boot_msg)
* Firmware [20G qb2/uni/4.11.6-1205-0 (print_boot_msg)
* Hostname [20G eneco-001-xxxxxx (print_boot_msg)

Hope this is a bit more clear.
djxfma
Starting Member
Starting Member
 
Posts: 11
Joined: February 2018

Re: Rooting Toon (or boxx)

Postby TheHogNL » Fri Feb 23, 2018 8:15 pm

So you screwed up your 'busybox' .. :roll:
I think this will be a hard one to recover from. Hopefully you can restore the root filesystem from u-boot but then you need a working rootfs-image and u-boot needs to be able to read it from somewhere (tftp server, usb stick?). I'm not into u-boot enough to tell you what you need to do. I hope for you that someone else can.
TheHogNL
Member
Member
 
Posts: 288
Joined: August 2017

Re: Rooting Toon (or boxx)

Postby marcelr » Fri Feb 23, 2018 11:01 pm

Looks like you screwed up your busybox. Just copying the uploaded file to /bin/busybox is a no-go, you have to install it using the installer.
Anyway, it can be fixed, but this will require booting from an uploaded kernel through tftp, and configured for a rootfs on nfs, which in turn needs to be in place and working. A minimal image will do. Then you can mount the original rootfs, chroot to that and reinstall busybox. I've done it before, this method works. But it takes quite some effort.
marcelr
Advanced Member
Advanced Member
 
Posts: 834
Joined: May 2012
Location: Ehv

Re: Rooting Toon (or boxx)

Postby djxfma » Fri Feb 23, 2018 11:12 pm

Yeah that's all on me. Gonna figure something out with the process, does it matter what uploaded kernel is used? It does not need to be a kernel from Toon/Quby it self?
Yes this will take some time to fix, but I accept the challenge. Gonna do some searching then.
djxfma
Starting Member
Starting Member
 
Posts: 11
Joined: February 2018

Re: Rooting Toon (or boxx)

Postby marcelr » Fri Feb 23, 2018 11:27 pm

You will need a custom kernel with NFS rootfs support built in. Quby's stuff is useless for this. Two years ago (almost to the date) I posted a method to get this working. I can supply a kernel image and a barebones root filesystem if you need them.
marcelr
Advanced Member
Advanced Member
 
Posts: 834
Joined: May 2012
Location: Ehv

Re: Rooting Toon (or boxx)

Postby djxfma » Sat Feb 24, 2018 1:55 am

That would be great If you could provide me with that. I already did some research and its doable, just takes some time to figure all things out.
As well I found some information that it should be possible to load the kernel and boot it with just ckermit and load the boadimg to kermit it self.
Was already looking how to build/mkimage an u-boot suitable kernel with rootfs, will look further when I have the change.

As well I will try to look for that post you did back 2 years ago, thanks for the help!
djxfma
Starting Member
Starting Member
 
Posts: 11
Joined: February 2018

Re: Rooting Toon (or boxx)

Postby TheHogNL » Sat Feb 24, 2018 9:40 am

Would only a rootfs on usbstick work? The kernel has usb support. So then he would only need to change the bootvars from u-boot to start rootfs from usb, but use the normal kernel from /dev/mtd2
TheHogNL
Member
Member
 
Posts: 288
Joined: August 2017

Re: Rooting Toon (or boxx)

Postby marcelr » Sat Feb 24, 2018 9:47 am

Nope,

Rootfs on NFS is not built into the standard kernels, nor is USB support, vfat/ext2/3/4/ntfs/jfs/reiserfs/hfs/xfs/<whatever filesystem> support, so there's no way to mount another rootfs than the standard one, with the standard kernel.

@djxfma: will start digging for the images later today.
marcelr
Advanced Member
Advanced Member
 
Posts: 834
Joined: May 2012
Location: Ehv

Re: Rooting Toon (or boxx)

Postby marcelr » Sat Feb 24, 2018 11:53 am

Uploaded images to the file server:

Kernel:
http://files.domoticaforum.eu/uploads/T ... uImage-nfs

Root filesystem (tarred and gzipped):
http://files.domoticaforum.eu/uploads/T ... qb2.tar.gz

(both were built from the oe-development tree as published by quby, quite some time ago).

Booting from NFS rootfs (repair manual for corrupted rootfs, no need to follow through on the ubifs image rebuild):
https://www.domoticaforum.eu/viewtopic. ... 270#p79224

When you have successfully booted your toon from an NFS-mounted rootfs, you need to mount the original ubifs-type rootfs:
Do the following:
Create a ubi device from the flash partition where the rootfs resides.
(Depending on your flash layout, you may want to remove the -O 2048 option):
Code: Select all
ubiattach -p /dev/mtd4 -O 2048

Test for the presence of the ubi device:
Code: Select all
cat /proc/devices | grep ubi0

This gives (example output):
Code: Select all
252 ubi0

Make a device special file for this device:
Code: Select all
mknod /dev/ubi0 c 252 0

and mount:
Code: Select all
mount -t ubifs /dev/ubi0:rootfs /mnt

or:
Code: Select all
mount -t ubifs /dev/ubi0!rootfs /mnt

Caveat: Mounting the original rootfs may not work very well on some toons. Not sure why (yet).

After mounting, you can chroot to /mnt,
Code: Select all
chroot /mnt

and install whatever needs installing. Transfer the install images to the nfs rootfs (on the nfs server, just copy-paste with your favourite file manager), and then on to the original rootfs (/mnt/root in this example).
You may also need to copy /bin/busybox from the nfs-mounted rootfs to /mnt/bin/busybox first, if it's really FUBAR.
marcelr
Advanced Member
Advanced Member
 
Posts: 834
Joined: May 2012
Location: Ehv

PreviousNext

Return to Eneco Toon as Domotica controller

Who is online

Users browsing this forum: Toonz and 1 guest