yashsingh1/xdaforums huggingface dataset:
[Nook Color Android Development] worldindo1:
Hey inportb,

I am a fellow Nook Color owner. I was wondering if there is a way to contain BotBrew's data on the emmc partition. I have alot of big apps installed and I prefer to have space for the apps. My emmc goes basically unused except for TWRP packages and a few html files.

Thanks, worldindo1.
[Nook Color Android Development] inportb:
Darn it. This looks like exactly the same problem I'm seeing on my G1. I can coerce an installation using the command line, but even then, it's kinda shaky. As I noted in the other thread, there's no way to change the logging level, but I'll put that into BotBrew+1, which is due soon for a prerelease. I'll let you know when that's ready!

With the current version of BotBrew, no. This is because emmc is a FAT partition (like sdcard), which is unsuitable for *nix-like systems. For the next major release, I'm entertaining the idea of automatically supporting loop-mounted disk images, which should work just fine on pretty much any filesystem. I'm looking forward to a prerelease soon.
[Nook Color Android Development] AdamOutler:
Heres some motivation... im going to be doing a few linux oriented xdatv episodes soon because Samsung has asked us to step up our production 2.5x our current number of XDATV episodes this month... anyway.. http, ssh, and ftp will come in handy. Id like to feature your app.
[Nook Color Android Development] AdamOutler:
I tried to run the bootstrap but for some reason it had not extracted the /data/botbrew tar.gz or the control tar.gz
[Nook Color Android Development] AdamOutler:
Also, the /system folder was not mounted RW..

I came up with some mega-ultra-script-fu for this..

mount -o remount,rw -t `mount|grep system |awk -F " " '{ print $3 }'` `mount|grep system |awk -F " " '{ print $1 }'` `mount|grep system |awk -F " " '{ print $2 }'`

It makes a Mount -rw command out of whatever is already mounted by using the mount command :).... it came up as busy on my system which I'm not sure what I've got going on right now.. i'm sure it's alot though.

Still a problem with the actual "botbrew" command not installing properly.. opkg works everything seems to work fine, just not botbrew itself, and when I get into botbrew manually, it throws an error

shell@android:/data/botbrew/bin $ ./botbrew
link_image[1936]: 2842 could not load needed library 'libbusybox.so.1.19.4' for 'busybox' (load_library[1091]: Library 'libbusybox.so.1.19.4' not found)CANNOT LINK EXECUTABLE

this error does not happen when running as root.

At this point I can opkg install files, but not install from the GUI package manager.
[Nook Color Android Development] worldindo1:
The really great thing is I didn't have to question a single word in that. I most certainly look forward to being able to use eMMC as a viable storage option for my *nix tools. Any idea on what kind of size it will take up? Or possibly a partitioner in the setup that allows us to choose a size (like Ubuntu)? I'll be camping out waiting for the next big release. Can't wait to dig into BotBrew a bit more.
[Nook Color Android Development] inportb:
I've learned that we can't really assume that the base Android system would give us anything useful, since every ROM is different. So most likely, we'd bootstrap with a fixed 100MB image, then install tools within BotBrew that let us resize the image as needed.
[Nook Color Android Development] AdamOutler:
Not necessarily...

/local/bin:$PATH
app_66@android:/ $ df
Filesystem Size Used Free Blksize
/dev 347M 32K 347M 4096
/mnt/asec 347M 0K 347M 4096
/mnt/obb 347M 0K 347M 4096
/system 643M 295M 347M 4096
/data 13G 3G 9G 4096
/cache 425M 7M 418M 4096
/factory 19M 8M 11M 4096
/mnt/sdcard 13G 3G 9G 4096
/botbrew 13G 3G 9G 4096
/botbrew/run 347M 0K 347M 4096
app_66@android:/ $

If you deploy a version of busybox and use that to get the df command, you can grep, then awk it and make some sort of interperater.
[Nook Color Android Development] inportb:
This is exactly how the base installation satisfies its own dependencies (until you install coreutils, etc). Then to grow the image a bit, all you need to do is dd some more bytes into the file, resize2fs, and fsck. Alternatively, we could ship a small (8MB) base installation, have it create a bigger image, and copy its contents over.
[Nook Color Android Development] AdamOutler:
That sounds like a great idea. You'd be surprised how quickly modern devices can read if=/dev/zero of=myfileOrdevice bs=4096. On my nook tablet it was 12 Gigs in 2 Minutes for my Ubuntu Recovery to wipe the /sdcard/ partition.
[Nook Color Android Development] viulian:
Hello!

I did not know this project exists - I've been tipped off about this project by fellow member mateorod. Congratulations inportb :) very well structured and clean project.

I'm also working with cross-compiling, for now I have gcc, lighttpd, php-5.4.2 with curl and openssl as well as mysql statically linked. I took a different approach - building one package at a time to serve different needs.

Good luck, I've subscribed here so I can keep track of the progress.
[Nook Color Android Development] tiger2wander:
Great app for dev and I'm interesting with loopback mount support.

Keep up your good work. I have good experience with Linux, if I you need my help then don't hesitate to contact me via PM.
[Nook Color Android Development] inportb:
Thanks for all the support, folks! I know I haven't been posting a lot, but here's a little screenshot to show that a working pre-release is imminent. There's still a lot of work to do, but I'd like to at least support installing/upgrading/removing packages. The reason for the delay is that dpkg+apt is substantially more complex than opkg, and there was a lot of planning involved. Anyway:

​

Package maintainers: you might have noticed that opk's are very similar to deb's. Tools for building deb's are widely available, and could be used in much the same way as opkg-utils. You could continue to host repos via your favorite file host (i.e. Dropbox) if you want. The difference is that debs have some more control fields (to support a more powerful package management experience), and some of them may be interpreted differently. I'll keep you posted. Thanks for using this project!
[Nook Color Android Development] tiger2wander:
Look great, we will have apk, dpkg package management for .deb :-)

I think there are so many Debian's repositories for ARM, so we will have more *nix stuffs inside Android.
[Nook Color Android Development] tiger2wander:
Forgot to give you guys that there are already a set of command lines bundled inside app which allow us to write, compile android app to .apk directly on android.

https://play.google.com/store/apps/details?id=com.spartacusrex.spartacuside

It will be great if we have all: javac, java, dex, dx inside BotBrew to able to build and package .apk like that.

If you want a GUI editor with many advanced features like: autocomplete, code refactor, document for Android dev much like you are done with Eclipse, give a look for this app: https://play.google.com/store/apps/details?id=com.aide.ui

Good cross fingers.
[Nook Color Android Development] mateorod:
I've tried both of those apps, having more success with the AIDE than Terminal IDE, although the fault has a fine chance of being just mine.

Have you tried the javavm package in Botbrew? I use it with the baksmali binaries, although the Nook Color somewhat chugs through the smali.jar operations...
[Nook Color Android Development] tiger2wander:
Not tried javavm yet because of I've just update new ROM. Will be try soon.

For me, both AIDE and Terminal IDE work well. To get started with Terminal IDE you should have a look at builder.sh and run.sh inside system/src/demo* directories. I love this one because of I can run my App without install/update .apk package.
[Nook Color Android Development] inportb:
I haven't put anything new on Google Play yet, but I've gone ahead and pushed the source to GitHub. I've also loaded the issue tracker with some of what I want to do.

We're getting close!
[Nook Color Android Development] tiger2wander:
Well, it's great step man!

I'm pulling repositories and giving it a try now :-)

Thanks!
[Nook Color Android Development] inportb:
Alright, here's a very rough build that is able to bootstrap the base system and do some basic package management. Services do not work yet, but they're coming soon! This app may be used in parallel with the current-stable BotBrew release, without conflict.

Source: https://github.com/jyio/botbrew-gui

Issues: https://github.com/jyio/botbrew-gui/issues

Thanks for the help testing this thing! If you have bugs to report or features to request, feel free to post here or (if you have a GitHub account) open issues directly.

Quick Start

Let's assume that you bootstrapped to /data/botbrew-basil. The bootstrap process helps you prepare BotBrew for some common usage patterns. In case you want to do it manually, just keep reading.

Running Commands

For convenience, you could just install the botbrew-wrapper package. This gives you a botbrew2 command, just like the old-style botbrew command. Run it without arguments to start a shell, or prefix your commands with it.

If you like doing things the long way, you could do without the botbrew2 wrapper. For one-shot jobs, you may simply prefix your commands:

/data/botbrew-basil/init -- command goes here

If you want a shell so you don't need to prefix everything:

/data/botbrew-basil/init
first command
second command
...

Installing Debian

Before you could install Debian, you must enable a Debian repository. Just install repository-emdebian.

There are currently two "flavors" available to you:

Install botbrew-debian-apt for a robust installation of apt/dpkg. This does not include things like grep and findutils, which some packages need; keep that in mind when you see these errors, and install the required packages.

For full Debian support, also install botbrew-debian-minimal afterwards.

Removing BotBrew

To remove everything other than the app, first exit the system from the preferences window, then:

rm -r /data/botbrew-basil

Enjoy!
[Nook Color Android Development] cashmundy:
Tried Basil from Market on vibrantmtd running CM7 RC2 with Anise and PDroid patch via repo-matereod. Basil won't install: "Package file invalid." Tried twice.
[Nook Color Android Development] inportb:
This seems to be a common problem with Play/Market. Would you please try clearing Google Play Store's cache? Or dalvik-cache if it still fails. I just reinstalled "basil" via Play on CM7 RC2 and had no trouble. You could install the latest apk directly, but then you'd lose the update notifications (and it's very much in flux right now).
[Nook Color Android Development] cashmundy:
I just tried to install something else, and then tried a reinstall of an apk, with the same error, so something is amiss with my system, not Basil. Sorry about that: jumped to the conclusion that the experimental package was at fault, not the phone.

So, "never mind..."

:o

---------- Post added at 06:08 PM ---------- Previous post was at 05:56 PM ----------

Ok, moving right along... (ahem!)

I did a reboot and installed Basil just fine. I think the problem was that a new version of the PDroid package had appeared in repo-matereod, and I skipped the reboot after uninstalling old and installing new. Bad idea.

Anyways, Basil is failing with "Whoops! I failed to download the required file."

Note that I have AdBlock running.

And speaking of the crass and demeaning Google Play: here's to replacing it completely with BotBrew!
[Nook Color Android Development] closedcircuit:
Samsung T-959 vibrantmtd running AOKP Build 36. After installing Botbrew Basil, no packages list even after refreshing many times. When searching for repository-mateorod i get "Error retreiving information about package repository-mateorod"
[Nook Color Android Development] tiger2wander:
Worked like charm for me and I love apt / dpkg package management.

Some problem with direct install from apt-get:

shell@android:/ # apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up dropbear (2012.55-1em1) ...
/var/lib/dpkg/info/dropbear.postinst: 89: /var/lib/dpkg/info/dropbear.postinst: update-rc.d: not found
dpkg: error processing dropbear (--configure):
subprocess installed post-installation script returned error exit status 127
Errors were encountered while processing:
dropbear
E: Sub-process /usr/bin/dpkg returned an error code (1)

Also, install-debian was failed to execute:

shell@android:/ # /sdcard/botbrew-basil/init install-debian apt
whoops: cannot run `install-debian apt'

@cashmundy: I'm using adblock too and it can live well with BotBrew :-)

@all: I have made a flashable package for Desire Z / T-Mobile G2 to give you maximized experience with built-in mobile hardware keyboard, check it down if u r interesting: http://xdaforums.com/showthread.php?t=1659080
[Nook Color Android Development] inportb:
Alright, let's get to the bottom of this :)

Since you're using PDroid: does the app have networking privileges? And are you also connected to the Internet?

If so, please see if there's a pkg.zip or img.zip within the directory /data/data/com.botbrew.basil/cache

So the problem is that it's not able to pull the package feeds off the Internet. Would you please get me a logcat snippet while you try to refresh? If it contains private information that you don't want to share with the world, feel free to PM me or email botbrew at inportb dot com.

Thanks.
[Nook Color Android Development] cashmundy:
No problem with permissions.

Only thing in /datadata/etcetc is a symlink:

lib -> /mismatched_uid/settings_10114/fs_10110

I tried again, still no luck. Cleared data, no luck.
[Nook Color Android Development] inportb:
I just built a version that outputs more information while downloading the bootstrap seed package (with some more fixes). Please install it and grab me a logcat dump while trying to bootstrap. Since I did not do a version bump, you might need to remove the app before installing; alternatively:

adb install -r BotBrewBasil.apk

@cashmundy @closedcircuit: May I PM you about these issues? I'll post a public summary of the fixes when we figure them out.

You could probably fool dropbear into configuring by writing a blank file to /data/botbrew-basil/usr/sbin/update-rc.d (and making it executable). However, we don't have a service manager yet and start-stop-daemon has been neutered in preparation for runit. I'm looking to provide a dropbear-run package with a runit script, when service management is implemented.
[Nook Color Android Development] tiger2wander:
Yeah, it caused by missing Debian's init service, it can simply fixed by post-make that folder. But it should better if we have completely Debian's init style for more package compatible.

Also, I don't see the service management on BotBrew Basil, is it caused not complete init support?
[Nook Color Android Development] inportb:
package-compatible is not optimal for mobile devices, though. Debian has no concept of services, just background processes. So we cannot get a list of services and query/control each individual service with a uniform interface. On a desktop/server we don't need to micromanage services, but cpu/ram/battery resources are limited on mobile devices so we need to be frugal. Even high-end devices use a large chunk of processing power to make the UI feel smooth, and we would not want to have a laggy UI just because we have too many services running.

The plan is to copy the service management stuff from "anise", and the provide packages for runit scripts. These packages would depend on the original Debian packages. There are obviously lots of services to account for, but I think it'd be manageable if we make these scripts as they are requested.

You gotta install botbrew-debian-installer first, which provides the install-debian script :)
[Nook Color Android Development] tiger2wander:
Thanks! I got it :)
[Nook Color Android Development] cashmundy:
(Weird, my last post didn't take).

Earlier today, I removed old Basil, installed the new apk. It appeared to bootstrap fine, but I ended up with no packages installed or available. Saw some error chatter about busybox during install.

---------- Post added at 11:21 PM ---------- Previous post was at 11:12 PM ----------

Just found the "rebootstrap" button, tried that and updates, still just empty repos.

BTW, anyone can PM me, but I may not notice immediately.
[Nook Color Android Development] inportb:
The problem has been fixed. Thanks, cashmundy.

Meanwhile, I went ahead and revamped the Debian installer.

Originally, installing Debian required a script because packages had to be installed in a certain order. I just realized that dpkg provided a way to work around this issue, using the pre-depends system. Pre-dependencies are similar to dependencies, except they are unpacked and configured first.

Thus, installing Debian now involves installing two packages, something that could be done using the GUI. I've updated the informational post to reflect this, and cleaned it up a bit.

A new build (0.0.1.9) will be showing up on Google Play soon, too.

(I've started working on the reinstdb system for detecting package breakage. It does not work yet, in case you're wondering why the list is always empty!)

Cheers :cool:
[Nook Color Android Development] AdamOutler:
I'm trying to install on my Samsung Captivate running older firmware. Apparently the shell does not have access to the web interface in Android 2.2. Here is pictures:

So, I upgraded to 2.3.4, rooted, installed busybox and this is what I got on both botbrew.apk and botbrew.debug.apk

Dunno, I'm going to keep hacking.
[Nook Color Android Development] 白い熊:
@inportb

I'd like to ask you a couple of philosofical questions regarding botbrew.

I'm using an Ubuntu chroot extensively and have been toying with building some basic tools like mc etc, so I could use them in the terminal on the phone without going into chroot. That's how I discovered your project.

Anyhow reading more into, I'm starting to have doubts about going the botbrew way.

My question, what do you see as the benefit of building the botbrew dev version, with apt etc. over a Debian chroot? I didn't inquire how your scripts work, but since you bootstrap into a subdir of data, you then what, modify PATH etc, to make stuff runable from the Android terminal?

From what I've read above you need to init the botbrew shell, and only then issue commands. Isn't that basically a chroot analogy. I can just chroot, have the android base system bindmounted into the chroot and isn't that the same?

Not trying to be negative. Quite conversely, am trying to see the benefit of your way. Could you give me some tips on why you think botbrew is better than a chroot?
[Nook Color Android Development] inportb:
@AdamOutler: fwiw, this is the same thing I see when I try to install BotBrew anise on my G1 running a distro of Android 2.3.7. It is possible to bootstrap on the command line, somehow, but the result is still somewhat fragile. I saw you on IRC many hours ago, but I figured you were away. I'd like to incorporate that fix into BotBrew+1, if it's still a problem!

I was hoping somebody would ask ;) Thanks for your interest.

BotBrew is primarily a package management utility. It delivers software that needs to run in a chroot (such as most Debian packages) and software that works just fine either way (such as the original Opkg packages). BotBrew tries to standardize the distribution of community-generated tools and enhancements; it does not try to impose more restrictions than necessary (i.e. packaging format). Here's a brief comparison between chrooted Debianoids and "native" Android...

Native

if it builds, it should (in most cases) work as expected

Android-specific adjustments could easily be incorporated

building everything from source is a lot of work, so there is only a small collection of packages

Chroot

there's a vast library of prebuilt binaries in Debian

most packages depend on bulky libraries such as (e)glibc

the Android kernel is missing many features that some GNU/Linux programs are built to expect, leading to undefined behavior

I was attempting to run OpenSSH and Dropbear from Debian in a chroot last night, and discovered that neither worked. Everything was fine until the client opened the remote shell, at which point it was able to send maybe a couple of characters until it locked up. Android is deficient in terminal handling capabilities, so we had to work around the deficiencies while building from source. It is not a problem with the chroot itself, you see.

So if all you need is a GNU/Linux chroot, why, there's no better way than to just chroot. BotBrew looks beyond software that is already available in Debianoid repositories, and brings additional value to the Android community. In terms of implementation, we'd like to use the most flexible and least intrusive methods. Running apt/dpkg within the chroot means that we could support both types of software. Most users would not see the difference, since the GUI handles it just fine. Command line users would find the botbrew2 wrapper handy.

This was how BotBrew worked before we realized that /system was sometimes way too small to support some of the things that people want to install. There's a place in the build scripts where you could change /botbrew to /system to put things back. But of course, if your program doesn't care about the filesystem layout, then you could run it from anywhere.

Ultimately, it's the community developer who decides whether his/her software should be installed into the chroot or /botbrew or /system. BotBrew supports all three cases.
[Nook Color Android Development] AdamOutler:
inportb yeah, it's still a problem. I think botbrew needs to be rooted in /data/botbrew. I also think there may be some sandboxing with certain calls... like when you attempt to access / on some systems it may be /data.
[Nook Color Android Development] inportb:
What perplexes me is why some things work when done over ADB but not from the app. Is the app unable to extract itself into /data/botbrew-basil for you? I've taken care to remove the busybox dependency for the initial installation -- it's just a single archive that self-extracts wherever you want it to go.
[Nook Color Android Development] AdamOutler:
I never saw a superuser request... are you calling su as a canonical path or a system call to 'su'? Also, where are you storing the package.gz file? This is where it is failing.

Can you include all required binaries in the package? You could always just use the system su -c call and then deploy a statically linked busybox to the /data/local folder and access busybox that way.

See my pro-tip#3 video on XDATV for a statically linked busybox binary. You can use my java FileOperations.copyFromResourceToFile to deploy busybox. http://code.google.com/p/android-casual/source/browse/trunk/GUI/src/CASUAL/FileOperations.java#46

Like.. new FileOperations().copyFromResourceToFile("/com/package/resources/busybox", "/data/local/busybox");

This will work for all ARM processors. You may need a new binary for x86 devices.

Where is your repository for this project? I dont have time to learn it, but maybe i can help a bit.
[Nook Color Android Development] AdamOutler:
I just installed basil on my Galaxy Nexus and it went through. There are several broken packages in the core though.

setting up lighttpd "ln: /botbrew/service/enabled/lighttpd: no such file or directory" - failed at the end of install

----I'm now getting failures on everything trying to remove lighttpd however lighttpd installed and is working----

mtr: Depends: ncurses-common:armeabi but it is not installable. you have held borken packages.

when I run su; botbrew; opkg, it cannot find opkg, did you switch to dpkg?

I'll try this on my captivate later when I get home.