1

I use

cpio -idv <rootfs

to extract what all is inside my rootfs.cpio file.

Following are the contents of a defualt rootfs.cpio that I get after compiling petalinux:

[root@xilinx ourput]# ls -ld *
drwxr-xr-x.  2 root root 4096 Apr 14 14:12 bin
drwxr-xr-x.  2 root root 4096 Apr 14 14:12 boot
drwxr-xr-x.  3 root root 4096 Apr 14 14:12 dev
drwxr-xr-x. 15 root root 4096 Apr 14 14:12 etc
drwxr-xr-x.  3 root root 4096 Apr 14 14:12 home
lrwxrwxrwx.  1 root root    9 Apr 14 14:12 init -> sbin/init
drwxr-xr-x.  3 root root 4096 Apr 14 14:12 lib
drwxr-xr-x. 10 root root 4096 Apr 14 14:12 media
drwxr-xr-x.  2 root root 4096 Apr 14 14:12 mnt
drwxr-xr-x.  2 root root 4096 Apr 14 14:12 proc
drwxr-xr-x.  2 root root 4096 Apr 14 14:12 sbin
drwxr-xr-x.  2 root root 4096 Apr 14 14:12 sys
lrwxrwxrwx.  1 root root    8 Apr 14 14:12 tmp -> /var/tmp
drwxr-xr-x.  9 root root 4096 Apr 14 14:12 usr
drwxr-xr-x.  8 root root 4096 Apr 14 14:12 var

also the following is the size of each folder:

[root@xilinx ourput]# du -sb *
680661  bin
4096    boot
8192    dev
160521  etc
8192    home
9       init
2572159 lib
36864   media
4136    mnt
4096    proc
730887  sbin
4096    sys
8       tmp
518578  usr
176548  var

The total size of the filesystem is around 6.9 MB which is too much for my system. I just need a login prompt in my application and nothing else, so why shoiud l I have so much of unnecessary stufs.

What should be my approach to remove packages I dont need, and reatin only login application. I saw in sbin there is a binary tinylogin, so would liek to keep it.But I think cannot blindly remove other files.

So what is the correct approach to reduce the size of the rootfs.cpio

Update I woulkd like to tell that I have got a file named tinylogin, in sbin filder which provides login that I will need. But I have no idea what to do next!

user2799508
  • 1,712

1 Answers1

1

You didn't mention which distribution created the rootfs. It seems, however, as though you just want to create a minimal rootfs. This guide will take you through building a minimal fs from scratch: http://www.tldp.org/HOWTO/Bootdisk-HOWTO/buildroot.html