 Today we're going to be looking at using the bootstrap to create ARM images for devices such as Pogo plugs or to get Debian running in a churroot on your Android device. If you enjoy my tutorials and would like to see more, please think about contributing to my Patreon account at patreon.com forward slash metal x 1000. Okay, we're going to be creating an image that will contain an ARM file system for use on different ARM devices and that can be churrooted into an Android device or any Linux device that you have root access to that is ARM based. Okay, so here we go. I am in a folder. It's an empty folder. There's nothing in here. I'm going to create a folder in here. I'm just going to call it MNT. We're going to create the image first that I'm going to mount it to that folder we just created called MNT. So I'm going to use... there's different techniques to create file images. I'm just going to use DD. Again, just like last tutorial, pretty much everything I'm going to do in this tutorial requires sudo or root access. So I'm just logged in as root on my system. Some people frown upon that. If you prefer, just put sudo before most of the commands. So I'm going to say DD. I'll give it a bs of 512. I'm assuming that you're somewhat familiar with the DD command. But what we're going to do here is give it a count. So if we don't give it a count, it's just going to keep creating an image that goes on and on and on and on. And we're going to say 5400 looking at my notes. And I have that written down as approximately a 2 gig file. There might be another way to write that out. That's easier to remember, but that's what I have on my notes. So now we're going to give it an in file. So this is information we're going to put into the image. We don't want to put really any real image information in there. So we're just going to use the device zero. This is going to fill the image with a bunch of zeros. And then we're going to say out, our of out file equals, and whatever we want to name the image, I'll call it Debian underscore arms so that I know it's an arm image.img. I'll hit enter, give it a few seconds here. Hopefully shouldn't take too long. And we will have a 2 gig image approximately, which we then will have to format and mount. And then we will go in there and create. So yeah, well, a little bigger than I thought, 2.8 gigs. So almost three gigs. So you can tweak this number somewhat. That gives us enough room for the file system and room to do install the software that we want on there. So now I'm going to use MKFS.ext4 because I want to make it ext4 file system. And I'm going to point it at that image. We're not creating, so right here it's telling us there's no block special device. That's because we didn't create a partition. The whole image is going to be a partition. Depending on what you're doing, and I've gone over this in previous tutorials, you may or may not want partitions in there. We don't want, you know, separate partitions. We just want to write to, like if you think of this image as a hard drive, we're writing directly to the hard drive without any permissions or partitions. Okay, so now we can mount it. Mount. And again, don't forget I'm running as root. If you're not, you have to put sudo before these commands. I'm going to dash o loop. We're going to loop back to the image. The image is called debianoscore and arm.img. And where do I want to mount it? I'm just going to mount it in the folder. I just created the beginning of the tutorial called MNT. It is in the current folder. If I list what is inside that folder, it just has the lost and found folder which has to do with ext and how it writes to the files. Another tutorial talking about that. Okay, so at this point, there's a few things that I'm going to want to install. I'm going to want to install the bootstrap, which I already have installed. And a few other tools for once it's done being installed, which I'll explain more about momentarily, or once after we do our install, I'm going to say aptitude or apt get, whatever you use, install bin FMT dash support, QMU, which is an emulator, and then QMU dash, user dash static. And then if you don't already have installed the bootstrap as well, which I do have installed, in fact, I probably might have this stuff installed. Yeah, looks like I already have all that stuff installed because I've done this before. Okay, so now what I'm going to do is I'm going to use the bootstrap similar to what we did in a previous tutorial, the bootstrap. But since we're not using, you know, a regular 32 bit or 64 bit, you know, standard desktop processor, I'm going to say, foreign dash dash. And let's tell it I want to do an architecture of RML. Now the version of Debian I want to install, I'm just going to do Sid, which is unstable, depending on what you're using is for you may want Sid, you may want Wheezy, Lenny's the old stable, I've been using unstable for so long, I've been using Sid, I don't even know what other versions are at. But I'm going to say Sid, where I want to install to MNT the folder that is within the folder we're in. And then you can tell it what server you want to install from. If you leave a blanket should just use the default Debian servers and it is. So it's going to Debian.org. And it's going there and it's going, ah, okay, he wants to do a the bootstrap install of Sid, but he wants an arm. So it redirects me to the right folder and it starts downloading all these packages. Just like the last tutorial I'll try to talk here while this is downloading. I may pause the video since this will probably take a little bit. Again, right now we're doing, we're downloading all these files to this folder MNT, not in the root directory, but within the folder we're in that we just created. Again, that's what we created. It may be called something else. But which that is actually the image because we mounted our image to that folder. So right now it's putting all these files, all these minimal tools that the Debian system needs to run. And actually there's ways to make it even more minimal. But we'll consider this minimal for now. Into this image, at which point we can churrood into an arm system. Now I should also mention there's two ways of doing this. I like doing it this way. And this way I'm going to be able to do everything right here on my desktop. Most instructions will tell you to do a two-stage install where you start, it pulls down the files, but then you load that file onto an arm device and then start doing whatever you need to do from there. It does the rest of the install with the second stage. What I'm doing it here is I'm pulling down all the stuff, all the arm files, which obviously can't run on my processor, on my desktop here because I don't have an arm processor. But that is why we installed QMU and those other, I pronounce it QMU. I'm not sure if that's really how you pronounce it. It's Q-E-M-U, which is a virtual machine that supports different architectures. I've gone over it before in the past where we actually did an arm install using it using the Debian net CD. So we're kind of doing the same thing here but without that CD and actually without needing QMU to pull down the file system. But what I'm going to do is I'm going to go into the, I'm going to churroot into it which would normally not work, but I'm going to show you how you can access an arm file system from a regular processor right now. There are some long commands that I am going to mostly copy and paste, but I'll put them in a link in the description so that you can have those. So we did that. Okay, so now I'm going to say copy from my current system, the USR bin folder, the QMU-arm-static file that we installed. And I'm going to copy that into the new file system we just created underneath MNT, USR bin. Boom, so we put that there. Now we're going to set some settings on our system so that when we churroot into that, it's going to use that emulator that's in that image so that we can actually run stuff in the churroot even though it's an arm system on our, this is a 64-bit AMD processor. So this is what we're going to type. And I'm going to do some copy and pasting. So case sensitive here, Debian frontend equals non-interactive. Then we're going to say debconfig non-interactive seen true. And then we're going to say lcall equals c, language equals c, lang equals c. Again, this is all I got off the internet a while ago. I'm not even sure what a lot of this means. Then we're going to put in our churroot command, the directory where our debutstrap was installed to. And then we're going to say debutstrap, debutstrap dash dash second dash stage. And I'm going to hit enter. And I got a failed. Fail to run command. No such directory. I spell everything right. Nope, I did not. I think there's needs to be a T there. debutstrap. There we go. So as I was saying, we did the first stage of installation. Most tools will tell you to do that. Then load this file system onto an ARM device and continue the second stage there. One, I like to do everything on my desktop when I can. Two, I'm just going to assume that it's faster doing it this way because my desktop's faster than, let's say, my phone. So what we had to do to do that was just install QMU, copy the file over, and then add in these settings here, which again will be in a link in the description of this video. Okay, so now it's doing the second stage. Before it pulled down files, now it's actually doing its churrooting in and doing the second stage install. At this point, I'm going to pause the video, and we will continue from there because this will probably take a little while for it to unpackage everything. Okay, that took a couple of minutes, probably around five minutes, probably a little bit less. Download and configure a bunch of stuff. Now we're going to do another command similar. So I'm going to hit up arrow because it's all the same up until this last part here. We already did the second stage, and this time when we churroot into the thing, we're going to say dpkg-dash-configure-a. Okay, so now that we've done that, we should be able to churroot into the system. So let's do churroot, the folder that we want to churroot into, and I'm pretty sure if I type just bash, it's not going to work. Oh, also if we type churroot correctly. Oh, it did work. Okay, so let's see. Let's think of a command. Let's do aptitude, get aptitude install. Well, let's check something before I try running that. catetc-apt-source-list. Notice there's nothing in there. So what we want to do is add the server that we want to download from, and let me just see. I think that we should just be able to do one. I think nano will be installed by default. And in here, let's say debhttp, forward slash forward slash, I think it's ftp.debian.org, forward slash, I think it's debian, Sid main, I think. I'll give that a try, otherwise I have to look at my notes. Now if we do aptitude update, we'll see if that's correct. Yep, seems to be working. And it knows based on our system that we are an ARM system, so it's going to download the repository list for ARM. But at this point I could do aptitude install nmap. And it'll download install nmap. Now remember, everything I'm doing right here is being done on an ARM file system. And it's made possible to churroot into an ARM file system with this debootstrap install because we did the QMU. Again, I don't know if I'm pronouncing that right. QEMU, emulator file, and we copied that over so that when we churroot into it, the churroot knows to use that so that we can run these ARM programs on a non-arm processor. So right now, again, we're working with inside the image we created, install whatever packages you think you want on your phone, and then you can copy this to your SD card, or if you have enough storage on the memory on the phone, you can do that. You can mount it. And if you have root access, you can mount it. And then you can use, if you have a full version of busybox on there, if not, lots of times a lot of Android devices have a slimmed down version of busybox. You'll have to get the full version, which you can find online, which has churroot built into it. You churroot into this Debian image after mounting it, and you'll have a full running Debian system on your phone. And obviously, you can't run the standard GUI applications in the Android interface, but there are ways to kill the Android Zygote, which is the process that starts the Android interface. You can kill that. And if you know about Xorg configuration files, you can configure it and actually get Xorg running. And actually, on any Android device with a little bit of tweaking and an image like this that we just created, you can have a full Debian desktop running on any Android device. The biggest drawback would be getting video drivers to work, because if you do start up Xorg, at least when I've done it on my Android devices and I have done it on both my tablets. I haven't really done it on my phone, because I don't want to mess up my phone, even though I have everything backed up. FrameBuffer is the way that I go for displaying Xorg, so you're not going to get any acceleration and good luck getting the touchscreen calibrated. I have not been able to really figure that out, but I have been able to get things like Mplayer and at least the desktop open and other applications open to on an Android device using the FrameBuffer, but actually having a full working desktop, I myself have not been, but that's also, I don't know very much about the Xorg configuration file, because I've only been using Linux for eight, nine years now, and pretty much my entire, you know, the last seven years at least, you don't have to touch the configuration file. Linux is so good at configuring everything for you for most hardware, so this is going to take a little while to install. There's a lot of packages required for the Nmap that where it wasn't installed yet, but that's it. Very simple, mostly similar, very similar to the previous video, but with the add a little using the QMU to be able to access that true on standard desktop. I encourage you to play around with this. I know I personally love having Debian installed on my Android device. What I normally do is I write out scripts on the Android device that automatically mount the true route and run a script and then save the output as HTML and open up Firefox. So on my phone, for example, I open up a terminal. I use connect bot and then I just I SU into route and I can type in scan and my script automatically does a double ARP scan, grabbing a range of IPs on the local network and then outputs those as HTML to a file and opens up Firefox. At that point, the script continues running in the background, doing different scans like Nmap and other network scans continuously updating the HTML file, which I then have the GUI interface as HTML that in that case I use Firefox. I have my script open up Firefox. So at that point, like it scans if it finds a server running on port 80, it gives me a link. I can click on that and the browser opens it up. Very, very convenient. I mean, a lot of which you can do with a full version of busy box, but it's nice to have the full Debian system for that sort of stuff. So I'm just going to let this go. Toriel is pretty much over. I thank you for watching. I hope you enjoyed it. Again, this video was what was voted on with my Patreon viewers. If you enjoy my tutorials and you want to support my videos, my work and my website and continue seeing videos, think about contributing to my Patreon account over at patreon.com forward slash metal X 1000. I much appreciate it. Plus, as a patron, there are different reward levels, one of which is you get to vote on what series I'm doing next. And this time around, it was voted on the bootstrap. So I've done this is the second video on the bootstrap. I've got at least one more, which is going to be a simple bootstrap through Gremel. I think it's how you pronounce. It's great, great live CD Debian based for I hate using power users, you know, but it's very lightweight and very powerful with lots of great scripts on it. So I'll probably look at that in the next tutorial. And so if you like this topic, great. If you like other topics and want to have a say, consider going to my Patreon account. And there's different levels with different amounts of input that you can give. So of course, you get stuff as well, including early access to videos and downloadable links to add free videos. So now that I've promoted myself enough, I want to say have a great day. Please visit filmsbychrist.com. That's Chris with the K. There's a link in the description. And I hope that you have a great day. It's got a 250 gig hard drive, which I love. We also have a slightly cheaper model. If you need to, at this point, you can practice this little circle with the person in it. That's accessibility things has things like on screen reader. And you can choose, you know, on screen keyboard. And there's a few options for the keyboard there. We can close that. And you can see the gnome keyboard here starts up.