Rooting Toon (or boxx)

Forum about the tweaking of the Eneco Toon.

Moderator: marcelr

Re: Rooting Toon (or boxx)

Postby Rudolf » Tue Dec 05, 2017 7:33 am

passwd is also missing from the busybox-binary, here's the output from --help

Code: Select all
/ # busybox --help
BusyBox v1.27.2 (2017-10-03 14:20:01 CEST) multi-call binary.
BusyBox is copyrighted by many authors between 1998-2015.
Licensed under GPLv2. See source distribution for detailed
copyright notices.

Usage: busybox [function [arguments]...]
   or: busybox --list
   or: function [arguments]...

        BusyBox is a multi-call binary that combines many common Unix
        utilities into a single executable.  Most people will create a
        link to busybox for each function they wish to use and BusyBox
        will act like whatever it was invoked as.

Currently defined functions:
        [, [[, acpid, ar, ash, awk, base64, basename, beep, blkid, blockdev,
        bootchartd, bunzip2, bzcat, cat, chattr, chgrp, chmod, chown, chroot,
        chvt, clear, cmp, conspy, cp, cpio, cut, date, dc, dd, deallocvt, df,
        dhcprelay, diff, dirname, dmesg, dnsdomainname, du, dumpkmap, echo,
        egrep, env, expr, factor, fallocate, false, fatattr, fbset, fbsplash,
        fdisk, fgconsole, fgrep, find, flock, free, freeramdisk, fsck,
        fsfreeze, fstrim, fsync, ftpd, fuser, getopt, grep, groups, gunzip,
        gzip, halt, head, hexdump, hostname, hwclock, i2cdetect, i2cdump,
        i2cget, i2cset, id, ifconfig, ifdown, ifplugd, ifup, init, ionice,
        iostat, ip, ipneigh, kill, killall, klogd, less, link, linux32,
        linux64, linuxrc, ln, loadfont, loadkmap, logger, logname, logread,
        losetup, ls, lsof, lspci, lsscsi, lsusb, lzcat, lzma, lzop, makedevs,
        md5sum, mdev, mkdir, mkdosfs, mke2fs, mkfifo, mkfs.ext2, mkfs.vfat,
        mknod, mkpasswd, mktemp, modinfo, more, mount, mpstat, mv, nbd-client,
        netstat, nice, nl, nohup, nproc, nslookup, ntpd, od, openvt, partprobe,
        paste, pidof, ping, ping6, pivot_root, pmap, poweroff, powertop,
        printf, ps, pstree, pwd, pwdx, rdate, rdev, readlink, readprofile,
        realpath, reboot, renice, reset, rev, rm, rmdir, route, run-parts,
        scriptreplay, sed, seq, setconsole, setfont, setpriv, setserial, sh,
        sha256sum, sha3sum, sha512sum, showkey, shred, shuf, sleep, smemcap,
        sort, ssl_client, start-stop-daemon, strings, stty, svc, swapoff,
        swapon, switch_root, sync, sysctl, syslogd, tail, tar, tee, test, time,
        timeout, top, touch, tr, traceroute, traceroute6, true, truncate, tty,
        tunctl, ubiattach, ubidetach, ubimkvol, ubirename, ubirmvol, ubirsvol,
        ubiupdatevol, udhcpc, uevent, umount, uname, uniq, unlink, unshare,
        unxz, unzip, uptime, usleep, vi, volname, watch, wc, which, whoami,
        whois, xargs, xxd, xz, xzcat, yes, zcat



I agree that replacing the current BusyBox is a dangerous operation.
Wouldn't it be possible to copy the previous executable and recreate the symlinks only for getty and password and continue from there; so you can install dropbear from the non-limited shell as before?

Hmmm, running the post-install script manually returns no errors:
(first part is opkg -V4 install)
Code: Select all
opkg_recurse_pkgs_in_order: pkg hcb-watchdog already visited, skipping.
Configuring dropbear.
pkg_run_script: Running script //usr/lib/opkg/info/dropbear.postinst.
write_status_files_if_changed: Writing status file.
pkg_write_changed_filelists: Saving changed filelists.
hash_table: pkg-hash, 12288 bytes
        n_buckets=1024, n_elements=206, n_collisions=23
        max_bucket_len=2, n_used_buckets=183, ave_bucket_len=1.13
        n_hits=365, n_misses=206
hash_table: file-hash, 12288 bytes
        n_buckets=1024, n_elements=5824, n_collisions=4801
        max_bucket_len=15, n_used_buckets=1023, ave_bucket_len=5.69
        n_hits=20, n_misses=5833
hash_table: obs-file-hash, 768 bytes
        n_buckets=64, n_elements=0, n_collisions=0
        max_bucket_len=0, n_used_buckets=0, ave_bucket_len=0.00
        n_hits=0, n_misses=16
Collected errors:
* pkg_run_script: package "dropbear" postinst script returned status 255.
* opkg_configure: dropbear.postinst returned 255.
/ # ./usr/lib/opkg/info/dropbear.post
dropbear.postinst  dropbear.postrm
/ # ./usr/lib/opkg/info/dropbear.postinst
update-alternatives: Linking //usr/bin/scp to /usr/sbin/dropbearmulti
update-alternatives: Linking //usr/bin/ssh to /usr/sbin/dropbearmulti
Adding system startup for /etc/init.d/dropbear.


After this my system contains /etc/rc5.d/S10dropbear
It still won't run in this shell, because /proc/mounts and /dev/urandom are missing.

Let's reboot:
Code: Select all
INIT: Entering runlevel: 5
Starting Dropbear SSH server: Generating key, this may take a while...


Looks promising...
Rudolf
Starting Member
Starting Member
 
Posts: 6
Joined: December 2017

Re: Rooting Toon (or boxx)

Postby Rudolf » Tue Dec 05, 2017 8:02 am

Here's what I did:

I installed dropbear as per the instructions (but extra verbose); this fails with an error.

Code: Select all
opkg -V4 install dropbear_2015.71-r0_qb2.ipk


Then I re-ran the post-installscript manually, this creates /etc/rc5.d/S10dropbear, which we need in the next step:
Edit that file
Code: Select all
DROPBEAR_EXTRA_ARGS=-B


I created an extra script to install dropbear in runlevel5 (/etc/rc5.d)

Code: Select all
eneco-001-037311:~# cat S50installDropbear
#!/bin/sh

echo Installing dropbear!

opkg -V4 install dropbear_2015.71-r0_qb2.ipk

echo Dropbear installed!


This completed the install succesfully during boot.

You can now login with putty/ssh with root and no password.

It seems that in my setup (possibly due to the reinstall-script?) the '-B'-argument was deleted. Maybe the install in S50 is not required.
Make sure to add it again, before rebooting.
Rudolf
Starting Member
Starting Member
 
Posts: 6
Joined: December 2017

Re: Rooting Toon (or boxx)

Postby phoenixb » Wed Dec 06, 2017 9:53 pm

unfortunately i have update an rooted toon to version 4.9.23 so i have lost my ssh connection.
Now when i follow only the first steps i'm not able default come after an reboot into the eneco-xxx-xxxxxx:~# prompt.

Is this related to the installation of dropbear because in the startup log i see the next info
Code: Select all
Starting Dropbear SSH server: dropbear.

But after the Toon is done with the startup i can not login with "root"

small edit, the first step "setenv addmisc setenv bootargs \$\{bootargs\} mem=\$\{mem\} lpj=999424 init=/bin/sh" shows me with printenv:

Code: Select all
U-Boot> printenv                                                                bootdelay=2
baudrate=115200
loadaddr=0xA1000000
bootdelay=2
mtdids=nand0=mxc_nand
mtdparts=mtdparts=mxc_nand:1M(u-boot)ro,512K(u-boot-env)ro,1536K(splash-image),3M(kernel),3M(kernel-backup),119M(rootfs)
mtdparts_kernel=mtdparts=mxc_nand:512K@0x00100000(u-boot-env)ro,1536K(splash-image),3M(kernel),3M(kernel-backup),119M(rootfs)
mem=128M
autoload=no
backlight_brightness=50
baudrate=115200
console=ttymxc0
addtty=setenv bootargs ${bootargs} console=${console},${baudrate}
addmtd=setenv bootargs ${bootargs} ${mtdparts_kernel}
nandargs=setenv bootargs ubi.mtd=4 root=ubi0:rootfs rw rootfstype=ubifs
boot_nand=run nandargs addmtd addtty addmisc; nand read ${loadaddr} kernel; bootm ${loadaddr}
boot_nand_backup=run nandargs addmtd addtty addmisc; nand read ${loadaddr} kernel-backup; bootm ${loadaddr}
bootcmd=run boot_nand
splashimage=0x180000
ethact=FEC
sn=xx-xx-xxx-xxx
pn=6500-1200-38xx
software_compatibility=0
manufacture_date=2013/02
ethaddr=00:0F:11:01:EE:DA
addmisc=setenv bootargs ${bootargs} mem=${mem} lpj=999424 init=/bin/sh

But when i reboot the Toon the last rule is disappeared, is this ok?
__________________
phoenixb
Member
Member
 
Posts: 485
Joined: July 2009
Location: Netherlands

Re: Rooting Toon (or boxx)

Postby Paul2WR » Thu Dec 07, 2017 12:09 am

Good Evening all, i am new to this forum but eager to start rooting my Toon and integrating it in my home domotica system.

I am a bit confused on which Usb adapter to use, as it clearly states it must be 3,3V, i have found this part on stock which i can puck up tomorrow could any of you conform that this one will do the trick?

I will make a good write up / tutorial including pictures so it will be clear for future rooters."

USB - TTL converter info

USB naar TTL Converter based on the PCP2102 Chip

Image

htfelectronics.nl/nl/usb-naar-ttl-conve ... erter.html

Thank you
Paul2WR
Starting Member
Starting Member
 
Posts: 2
Joined: December 2017

Re: Rooting Toon (or boxx)

Postby gielie » Thu Dec 07, 2017 2:27 pm

phoenixb wrote:unfortunately i have update an rooted toon to version 4.9.23 so i have lost my ssh connection.
Now when i follow only the first steps i'm not able default come after an reboot into the eneco-xxx-xxxxxx:~# prompt.

Is this related to the installation of dropbear because in the startup log i see the next info
Code: Select all
Starting Dropbear SSH server: dropbear.

But after the Toon is done with the startup i can not login with "root"

small edit, the first step "setenv addmisc setenv bootargs \$\{bootargs\} mem=\$\{mem\} lpj=999424 init=/bin/sh" shows me with printenv:

Code: Select all
U-Boot> printenv                                                                bootdelay=2
baudrate=115200
loadaddr=0xA1000000
bootdelay=2
mtdids=nand0=mxc_nand
mtdparts=mtdparts=mxc_nand:1M(u-boot)ro,512K(u-boot-env)ro,1536K(splash-image),3M(kernel),3M(kernel-backup),119M(rootfs)
mtdparts_kernel=mtdparts=mxc_nand:512K@0x00100000(u-boot-env)ro,1536K(splash-image),3M(kernel),3M(kernel-backup),119M(rootfs)
mem=128M
autoload=no
backlight_brightness=50
baudrate=115200
console=ttymxc0
addtty=setenv bootargs ${bootargs} console=${console},${baudrate}
addmtd=setenv bootargs ${bootargs} ${mtdparts_kernel}
nandargs=setenv bootargs ubi.mtd=4 root=ubi0:rootfs rw rootfstype=ubifs
boot_nand=run nandargs addmtd addtty addmisc; nand read ${loadaddr} kernel; bootm ${loadaddr}
boot_nand_backup=run nandargs addmtd addtty addmisc; nand read ${loadaddr} kernel-backup; bootm ${loadaddr}
bootcmd=run boot_nand
splashimage=0x180000
ethact=FEC
sn=xx-xx-xxx-xxx
pn=6500-1200-38xx
software_compatibility=0
manufacture_date=2013/02
ethaddr=00:0F:11:01:EE:DA
addmisc=setenv bootargs ${bootargs} mem=${mem} lpj=999424 init=/bin/sh

But when i reboot the Toon the last rule is disappeared, is this ok?


read my post a few pages back.
gielie wrote:Ok after some trial and error i find out what i had to do. I updated my rooted Toon from 4.8 to 4.9 and i couldnt figure out what steps i had to take. I tried a lot without any luck. But then i had a bright moment (after some beers) and i only changed the ip table part, which was disabled after the update, and voila i had access to my Toon again.

So if you have rooted your Toon before just change the ip table part and your back in business.
Thanks Marcelr for making this possible.
gielie
Starting Member
Starting Member
 
Posts: 29
Joined: November 2017

Re: Rooting Toon (or boxx)

Postby Rudolf » Thu Dec 07, 2017 7:38 pm

phoenixb wrote:But when i reboot the Toon the last rule is disappeared, is this ok?


Yes, this modification is temporary.
You only need a (serial) terminal once; to install dropbear, set a password and configure the firewall.
After that you can login via SSH/dropbear.
Rudolf
Starting Member
Starting Member
 
Posts: 6
Joined: December 2017

Re: Rooting Toon (or boxx)

Postby Paul2WR » Fri Dec 08, 2017 1:43 am

After a lot of trail and error i got further, i have updated the Toon to 4.9.23.

Followed all instructions and Installed drop-bear over serial with minicom, all went great.

Upon install i received an error regarding the post inst script,

Code: Select all
* pkg_run_script: package "dropbear" postinst script returned status 255.
* opkg_configure: dropbear.postinst returned 255.


i saw the post of Rudolf and did the following:

1: Installed in verbose
2: ran the post install script manually
3: found the file in etc/rc5.d/S10dropbear
4: edited the file modifying:
Code: Select all
DROPBEAR_EXTRA_ARGS=-B


At this point i am not sure how to make the install script, i have made a file in /etc/rc5.d called S50Dropbear with the following script (with my toon id)

Code: Select all
eneco-001-(myid):~# cat S50installDropbear
#!/bin/sh

echo Installing dropbear!

opkg -V4 install dropbear_2015.71-r0_qb2.ipk

echo Dropbear installed!


when i reboot the toon i see permission denied, did i do it right?

ATM i am trying if i can connect via SSH, i do see the server start up, i do not have root access.
Paul2WR
Starting Member
Starting Member
 
Posts: 2
Joined: December 2017

Re: Rooting Toon (or boxx)

Postby Rudolf » Mon Dec 11, 2017 9:12 am

I think the installation in the S50-script is redundant, and actually overwrites/undoes our modification that adds the '-B' argument.

In your situation we can safely assume that dropbear has been installed, so you need to login via serial again; remove the S50-script and re-add the -B-parameter and try again.
(As alternative for -B you could add your public key to /root/.ssh/authorized_keys)
Rudolf
Starting Member
Starting Member
 
Posts: 6
Joined: December 2017

Previous

Return to Eneco Toon as Domotica controller

Who is online

Users browsing this forum: No registered users and 1 guest