mukund
Posts: 15
Joined: Tue Jun 18, 2013 2:04 pm
Location: Nagpur, India.
Contact: Website

Wheezy - Just 13.3 Mb image

Thu Jun 20, 2013 9:46 am

Hello,

I have made a small (13.3 Mb download) image from wheezy.
You can download it from here. http://www37.zippyshare.com/v/54778766/file.html


What it has -
- Uses GCC
- Uses static busybox
- Can port any software from wheezy
- Nano editor is ported as proof of concept.
- Connect to Ethernet ( dhcp)
- You can telnet or use serial TTY
- root password is root. And another user pi has password as raspberry.


The whole story is here -

Recently brought couple of Raspberry pi for one of my project.
I tried all the images available like wheezy, buildroot even tried rolling out with debootstrap and spindle. But all them were either large or not suitable for embedded application.

Basically I wanted an image which is,
1. Based on latest distribution like wheezy
2. Tiny in size so that it can be flashed easily
3. Should be able to compile small C code.

I know it's like asking too much, but then found the way. This how I did it,


Installed latest wheezy image on one SD card ( call it wheezy card)
Inserted the card in Raspberry
Downloaded Busybox source
Compiled with static library option
So busybox (around 2 MB) with GCC library was ready.
Copied it to PC

Now on my PC
Made one build-root uclibc image for Raspberry PI ( There plenty ready images on the net )
Installed this image on another card (call it miniwheezy card)
Inserted the card in Raspberry, Got boot prompt. OK
Removed the card
Copied busybox from PC,which we copied earlier from wheezy card, to miniwheezy card.
Inserted miniwheezy card in Raspberry. Got boot prompt. OK


Removed /lib and /usr/lib (yes!) from miniwheezy card.
Copied nano (editor) and required library ( check it with ldd /bin/nano ) from wheezy card to miniwheezy card.
Copied required modules from wheezy card to miniwheezy card.
Copied libnss library ( nslookup does not work with static library - learned it hard way) from wheezy card to miniwheezy card.
Inserted miniwheezy card in Raspberry. Got boot prompt.

So finally you have a small distribution for raspberry
Running latest kernel 3.6
You can port any software from wheezy card to miniwheezy.card ( Taking care of required library)
You can compile C code on wheezy card and copy it to miniwheezy card.


Bricks and bats most welcome..........
-mukund

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

Re: Wheezy - Just 13.3 Mb image

Thu Jun 20, 2013 12:25 pm

Awesome work, I was doing this a while ago but never managed to get it down to 13.3mb :D
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

mukund
Posts: 15
Joined: Tue Jun 18, 2013 2:04 pm
Location: Nagpur, India.
Contact: Website

Re: Wheezy - Just 13.3 Mb image

Fri Jun 21, 2013 1:00 am

Actually the image size would come down to just 5 Mb, if partition is zero out with dd. I will post new image tomorrow.
-mukund

mukund
Posts: 15
Joined: Tue Jun 18, 2013 2:04 pm
Location: Nagpur, India.
Contact: Website

Re: Wheezy - Just 13.3 Mb image

Sat Jun 22, 2013 7:33 am

Here is 6 Mb image for raspbian miniwheezy. The size reduction is due to zeroing out of all partitions using dd.
Enjoy!!
-mukund

mukund
Posts: 15
Joined: Tue Jun 18, 2013 2:04 pm
Location: Nagpur, India.
Contact: Website

Re: Wheezy - Just 13.3 Mb image

Sat Jun 22, 2013 7:34 am

-mukund

PiLuscious
Posts: 4
Joined: Sun Jan 13, 2013 6:45 pm

Re: Wheezy - Just 13.3 Mb image

Sat Jun 22, 2013 4:38 pm

6 MB! This is awesome!

I know the root password is normally disabled in Debian/Raspbian but since we don't have sudo, how do we get root access?

Also, since we don't have aptitude, apt-get, dpkg, etc., is the only way to add packages to manually copy directories from the full Raspbian/Wheezy armhf distro on another SD card? It would be nice to be able to list installed packages too. Or is there another trick for doing this using a custom utility for small images like this?

EDIT: WiFi support would also be really nice, which should be only tens of KBs for the drivers, config files, etc., AIUI.

Thanks!

samson241
Posts: 81
Joined: Fri Apr 05, 2013 7:07 am
Location: Western United States

Re: Wheezy - Just 13.3 Mb image

Sat Jun 22, 2013 4:55 pm

Nice job!
I realize this question must seem stupid and i apologize in advance.

User avatar
Jim Manley
Posts: 1600
Joined: Thu Feb 23, 2012 8:41 pm
Location: SillyCon Valley, California, and Powell, Wyoming, USA, plus The Universe
Contact: Website

Re: Wheezy - Just 13.3 Mb image

Sat Jun 22, 2013 6:40 pm

You should ask the mods to edit the title of the thread to read something like "Mini-Wheezy - New and Improved - Now Only 6 MBs!"
The best things in life aren't things ... but, a Pi comes pretty darned close! :D
"Education is not the filling of a pail, but the lighting of a fire." -- W.B. Yeats
In theory, theory & practice are the same - in practice, they aren't!!!

PiLuscious
Posts: 4
Joined: Sun Jan 13, 2013 6:45 pm

Re: Wheezy - Just 13.3 Mb image

Sun Jun 23, 2013 4:52 am

Ah, figured out the root password is the same as the userid. Still thinking about how to install packages without dpkg, aptitude, apt-get, etc. This is a fun challenge!

mukund
Posts: 15
Joined: Tue Jun 18, 2013 2:04 pm
Location: Nagpur, India.
Contact: Website

Re: Wheezy - Just 13.3 Mb image

Sun Jun 23, 2013 7:05 am

Thanks for the interest shown in mini-wheezy.
The root password is root.
You can access it by serial terminal on ttyAMA0 or through telnet.
The telnetd does not allow root access, so you have to login with pi:raspberry.
Busybox provide 'su' command for root access, you need to provide root password.
The mini-wheezy is basically for the embedded system, so size and speed is main concern.
For porting a package to mini-wheezy, install / run the binary on full wheezy. Then check library dependency with ldd command.
Then copy binary, library, and config files to mini-wheezy.
I have ported nano editor to mini-wheezy in same way, and plan to add some more packages like msmtp for email , hostapd for WiFi access point, dropbear -a small sshd , wiringpi in future
Any suggestion for adding packages, for embedded application, would be welcome.

I think this thread should be shifted to raspbian section.
-mukund

User avatar
Jim Manley
Posts: 1600
Joined: Thu Feb 23, 2012 8:41 pm
Location: SillyCon Valley, California, and Powell, Wyoming, USA, plus The Universe
Contact: Website

Re: Wheezy - Just 13.3 Mb image

Sun Jun 23, 2013 3:44 pm

I would second having WiFi autoconfig and at least dpkg and apt-get, or whatever would be the minimum necessary to be able to download something like a .deb via wget (which I was glad to see included). I'm going to be needing to stick WiFi dongles into upwards of hundreds of Model As at Jams, classes, etc., and apt-get installing whatever packages are needed above-and-beyond the absolute minimum this distro nicely provides. Each user may have different needs for their Pi, so it may not be possible to just copy a single image significantly larger than this mini-Wheezy distro to many cards that can fit all of the package variations that will be needed.

Being able to use old, small SD cards well under 1 GB in size that are readily available for free is a big plus for educational users for whom even a dollar for an SD card is more than they can afford. These are poor individuals such as legal migrant agricultural workers and small non-profits trying to help people become literate, let alone computing literate, who number in the tens of millions in the U.S., alone.
The best things in life aren't things ... but, a Pi comes pretty darned close! :D
"Education is not the filling of a pail, but the lighting of a fire." -- W.B. Yeats
In theory, theory & practice are the same - in practice, they aren't!!!

PiLuscious
Posts: 4
Joined: Sun Jan 13, 2013 6:45 pm

Re: Wheezy - Just 13.3 Mb image

Mon Jun 24, 2013 1:07 am

I don't seem to see a compiler or other build tools included, e.g., gcc, make, etc. That seems a bit strange as they're the kind of tools that an embedded developer is definitely going to need, and the Pi has the ability to run them quite well, which less powerful embedded systems can't, so cross-building is common for them. I can see leaving out the gobs of libraries that typically come with most distros, but the basic tools should be there, IMHO. It takes a lot of work to get gcc installed because of various dependencies and having it there already would be a big help, especially since we're teaching people to create software. Thanks!

alanyih
Posts: 14
Joined: Fri Dec 23, 2011 3:28 am

Re: Wheezy - Just 13.3 Mb image

Mon Jun 24, 2013 8:03 am

Code: Select all

/lib/arm-linux-gnueabihf/libc.so.6 
/lib/ld-linux-armhf.so.3: No such file or directory

mikerr
Posts: 2774
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: Wheezy - Just 13.3 Mb image

Mon Jun 24, 2013 9:48 am

6MB is a great achievement !
Jim Manley wrote:I would second having WiFi autoconfig and at least dpkg and apt-get, or whatever would be the minimum necessary to be able to download something like a .deb via wget (which I was glad to see included).
You might want to take a look at the less stripped, but still minimal images here:
http://www.linuxsystems.it/2012/06/rasp ... mal-image/

(109MB) - but with less functionality removed (still includes apt-get)

or

http://www.raspberrypi.org/phpBB3/viewt ... 66&t=17028
http://moebiuslinux.sourceforge.net/
(900MB) - still fits on a 1GB card.
Android app - Raspi Card Imager - download and image SD cards - No PC required !

mukund
Posts: 15
Joined: Tue Jun 18, 2013 2:04 pm
Location: Nagpur, India.
Contact: Website

Re: Wheezy - Just 13.3 Mb image

Mon Jun 24, 2013 4:19 pm

Hello,
Thanks for the interest shown in mini-wheezy.
Sorry for the ld-linux.so goof up.
Copy these files from /lib/arm.... to /lib/
Should solve the loader problem.
Regarding WiFi, I have added support for devices using 8192cu ( reported a RT81XX by kernel? ) module. I have compiled hostapd, wpa_supplicant which support RTL devices.
Now you can have WiFi hot spot with dhcp server.
I have also added msmtp for email. So you can send mail using gmail.
Also trying to add sudo and dropbear.
The new image will be posted in couple of days.
BTW, can any one lend me space on ftp server, where these images can be posted?
The zippyshare is very crappy.

Addition of apt would eat up more than 200Mb, so its out of question.
The tool chain with binaries, include files, libraries will also add more than 200 Mb.

As pointed out by mikerr, there are plenty of images on net which can fit on 1GB card. These images are basically without Desktop, but have all ingredients for development and installation of additional packages.

You can install , test the packages, or develop C program on wheezy and then port it to mini-wheezy.

I am planning to write a shell script for package porting, which would collect the binary file, configuration files, and libraries from wheezy image and make a tar file. This tar file can be simply extracted to mini-wheezy.
-mukund

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

Re: Wheezy - Just 13.3 Mb image

Tue Jun 25, 2013 1:27 am

mukund wrote:Hello,
Thanks for the interest shown in mini-wheezy.
Sorry for the ld-linux.so goof up.
Copy these files from /lib/arm.... to /lib/
Should solve the loader problem.
Regarding WiFi, I have added support for devices using 8192cu ( reported a RT81XX by kernel? ) module. I have compiled hostapd, wpa_supplicant which support RTL devices.
Now you can have WiFi hot spot with dhcp server.
I have also added msmtp for email. So you can send mail using gmail.
Also trying to add sudo and dropbear.
The new image will be posted in couple of days.
BTW, can any one lend me space on ftp server, where these images can be posted?
The zippyshare is very crappy.

Addition of apt would eat up more than 200Mb, so its out of question.
The tool chain with binaries, include files, libraries will also add more than 200 Mb.

As pointed out by mikerr, there are plenty of images on net which can fit on 1GB card. These images are basically without Desktop, but have all ingredients for development and installation of additional packages.

You can install , test the packages, or develop C program on wheezy and then port it to mini-wheezy.

I am planning to write a shell script for package porting, which would collect the binary file, configuration files, and libraries from wheezy image and make a tar file. This tar file can be simply extracted to mini-wheezy.
Good job !
I use Google Drive to host my stuff, so that's an option
Or dropbox which is also free, and with your tiny linux, it'll be plenty of space :)

Apt and libraries are a big reason why my Raspbian Server Edition is still at 600 Megs.
The dependencies start snowballing when you start including everything you want.
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

User avatar
Jim Manley
Posts: 1600
Joined: Thu Feb 23, 2012 8:41 pm
Location: SillyCon Valley, California, and Powell, Wyoming, USA, plus The Universe
Contact: Website

Re: Wheezy - Just 13.3 Mb image

Tue Jun 25, 2013 4:09 am

mikerr wrote:You might want to take a look at the less stripped, but still minimal images here:
http://www.linuxsystems.it/2012/06/rasp ... mal-image/
(109MB) - but with less functionality removed (still includes apt-get)
or
http://www.raspberrypi.org/phpBB3/viewt ... 66&t=17028
http://moebiuslinux.sourceforge.net/
(900MB) - still fits on a 1GB card.
Hi Mike - thanks for the links, but I've been tracking the minimal distros pretty much all along (long-time Puppy and Damn Small Linux distros on other platforms), and many still require at least a 2 GB card for the image, even though the distro is much smaller. Staying under 100 MB is a magic sweet spot, as cards of that size are available for free, there are tons of them Out There, and that's critical for the poor and the non-profits with no income that exist solely on volunteer efforts and donated materials.
mukund wrote:Sorry for the ld-linux.so goof up.
Copy these files from /lib/arm.... to /lib/
Should solve the loader problem.
That suggests there are build tools including a compiler, but it's not gcc or cc. Considering that the original Unix's compiler could compile itself and then the entire rest of the OS with only a few KBs of assembler needed to port the OS to any platform, it seems like some minimal compiler could be included.
mukund wrote:Regarding WiFi, I have added support for devices using 8192cu ( reported a RT81XX by kernel? ) module. I have compiled hostapd, wpa_supplicant which support RTL devices.
Now you can have WiFi hot spot with dhcp server.
Super! Does this also mean client support will be there, too?
mukund wrote:I have also added msmtp for email. So you can send mail using gmail.
Also trying to add sudo and dropbear.
Very much appreciated!
mukund wrote:Addition of apt would eat up more than 200Mb, so its out of question.
The tool chain with binaries, include files, libraries will also add more than 200 Mb.
Geez! What the heck is in there, besides obviously the kitchen sink, refrigerator, dishwasher, pantry, etc.??? :lol:
I suppose dpkg has similar dependencies as apt.
mukund wrote:I am planning to write a shell script for package porting, which would collect the binary file, configuration files, and libraries from wheezy image and make a tar file. This tar file can be simply extracted to mini-wheezy.
That would definitely help. I wonder if apt-get can be stripped down in source to just the install option, as that's what's really needed. I can see how the search and other options can cause the dependencies to explode.
mikerr wrote:Apt and libraries are a big reason why my Raspbian Server Edition is still at 600 Megs.
The dependencies start snowballing when you start including everything you want.
One of my gripes with most *n*xes today is they're missing the original spirit of Unix being a small collection of dozens of very powerful utilities that each do one thing very well, and more complex functionality could be implemented by just combining those relatively few utilities (at last count, there were over 3,000 individual executables in a typical distro). The reason for oddball names like cp, vi, awk and sed (beside some inside jokes) is that, in the day, every single byte of memory was precious, hardware virtual memory didn't exist yet, and frequently-used utilities had to remain in memory in order to get anything done within a lifetime. Short names didn't just mean less typing, but also small script files. I'm pretty sure that there's a lot that could be done to tease out the most-used parts of key Linux build and installation utilities from the mountains of dependencies currently needed.

An excellent thesis topic could be to use statistical analysis to determine the most frequently-used functionality and then implement a few special utilities using just the code needed from the library stacks. Another idea I've been thinking about is distributed computing where whatever functionality is needed can reside elsewhere on the network if it's not locally available (not client-server, but something like discoverable services). That can be done now on a one-off basis per function with a lot of work, but it would be much more powerful as a uniform, general capability across an entire distro. So much fun, so little time!
The best things in life aren't things ... but, a Pi comes pretty darned close! :D
"Education is not the filling of a pail, but the lighting of a fire." -- W.B. Yeats
In theory, theory & practice are the same - in practice, they aren't!!!

mukund
Posts: 15
Joined: Tue Jun 18, 2013 2:04 pm
Location: Nagpur, India.
Contact: Website

Re: Wheezy - Just 13.3 Mb image

Thu Jun 27, 2013 4:33 pm

Hello,
Back again..
The new image ( 8 Mb ) is now available at source forge
http://sourceforge.net/projects/mini-wh ... 001.img.xz

New additions to previous image.
1. ld-linux goof up corrected, now ldd also works.
2. System clock update with ntpd.
3. Time zone data added.
4. USB WiFi (RTL8192 based) support added with hostapd and wpa_supplicant.
5. The WiFi default mode is hotspot 'RPI with dhcp server.
6. A skeleton support for dpkg (again provided by busybox) added.

Comments awaited...
-mukund

User avatar
Jim Manley
Posts: 1600
Joined: Thu Feb 23, 2012 8:41 pm
Location: SillyCon Valley, California, and Powell, Wyoming, USA, plus The Universe
Contact: Website

Re: Wheezy - Just 13.3 Mb image

Fri Jun 28, 2013 3:25 am

mukund wrote:The new image ( 8 Mb ) is now available
Just downloaded it and will be trying it out tonight. Folks should be aware that it's a ~262 MB image after it's decompressed, whereas the previous version was only a ~64 MB image decompressed. Not sure whether it will fit within a 256 MB card, but I will dig one up and see what happens. If it requires a 1 GB card, that's still much better than a 2 or 4 GB card.

Looking forward to the WiFi and dpkg additions the most (and having working ld and ldd will be nice ;) ). ntpd is very cool and will eliminate one more little hassle with setup of lots of Pii at Jams, schools, etc. I can't thank you enough as I don't have time to do this sort of thing with all of the other tasks on my plate to help get folks up-to-speed on the Pi.

More to Come, So Stay Tuned!
The best things in life aren't things ... but, a Pi comes pretty darned close! :D
"Education is not the filling of a pail, but the lighting of a fire." -- W.B. Yeats
In theory, theory & practice are the same - in practice, they aren't!!!

mukund
Posts: 15
Joined: Tue Jun 18, 2013 2:04 pm
Location: Nagpur, India.
Contact: Website

Re: Wheezy - Just 13.3 Mb image

Fri Jun 28, 2013 1:40 pm

The uncompressed image size is due to extra ext4 partition. The partition size is now as under.
1. boot = 50 Mb
2. root =100 Mb
3. extra partition ext4 =100


The partition size hardly make any difference to compressed image size as all partitions are zeroed out before writing files.

The dpkg support is minimal.
For proper operation, you will have to build /var/lob/dpkg/status. The dependencies are snowballing.
May be I need to find some other option, like a script to collect all binary , library, config files from wheezy, and untar on mini-wheezy.
-mukund

mukund
Posts: 15
Joined: Tue Jun 18, 2013 2:04 pm
Location: Nagpur, India.
Contact: Website

Re: Wheezy - Just 13.3 Mb image

Tue Jul 09, 2013 12:55 pm

Hi,
New mini-wheezy-2013-002 is released at sourceforge.
https://sourceforge.net/projects/mini-wheezy/
The size is around 9 Mb.
There has been lots of download, which has encouraged me to this release.

Whats new?

Changes in mini-wheezy-2013-002
- dropbear ( ssh server ) added
- syslogd and klogd added
- udhcpd replaced with dnsmasq
- init.d scripts added
- sudo command added
- modified command prompt
- arp-scan added (useful tool for Ethernet debugging)
-mukund

furryface
Posts: 5
Joined: Thu Jun 14, 2012 4:52 pm

Re: Wheezy - Just 13.3 Mb image

Wed Jul 10, 2013 10:57 am

I haven't tried the other older images yet, but the latest (mini-wheezy-2013-002) fails to boot with the error, "/etc/init.d/rcS: line 26: /etc/init.d/S81wpa_supplicant: permission denied".

mukund
Posts: 15
Joined: Tue Jun 18, 2013 2:04 pm
Location: Nagpur, India.
Contact: Website

Re: Wheezy - Just 13.3 Mb image

Fri Jul 12, 2013 6:56 am

Hi,
The wpa_supplicant error is obvious, because it's not executable. You can run hostapd or wpa_supplicant, but not both.
You probably tried console login?
By mistake I have disabled console login, edit the /etc/innitab file to enable console login.
Will correct the mistake in next release.
If any one want it now, I will upload the modified image.
-mukund

mukund
Posts: 15
Joined: Tue Jun 18, 2013 2:04 pm
Location: Nagpur, India.
Contact: Website

Re: Wheezy - Just 13.3 Mb image

Sat Jul 13, 2013 9:43 am

New file uploaded mini-wheezy-2013-003.img.xz
https://sourceforge.net/projects/mini-wheezy/

Changes
- Console login enabled
- Serial Port login on ttyAMA0 enabled.
-mukund

Return to “General discussion”