Linux.com

Home Linux Community Forums Linux System Administration Linux Security To create a bootable iso of a self made distro

To create a bootable iso of a self made distro

Link to this post 30 Aug 10

Hi Robin,

I checked Remastersys out and it works well with Debian and Ubuntu. However, nothing much has been said about CentOS.

I also tried a workaround to resolve my initial issue. I have already made a initrd.img and a compressed linux kernel image (vmlinuz). In the initrd image, I use a very small file system that contains essential files that aid boot up. I have also configured a standalone busybox shell that I use here in the initrd image. This small file system is loaded to the RAM at boot up time. After that I get a busybox shell prompt.

Once I am here, I mount my cd-rom, that contains all the files and directories of my CentOS distro. Then I chroot into the mounted file system. My problem is that as the cd-rom contains iso9660 file system, which is essentially read only, some of my programs would not work as they require to touch certain files in /var and /tmp directories.

As a workaround, what I have done is, after I chroot into the mounted read only file system, I mount /dev and /tmp on the RAM by the following commands;

mount -t tmpfs tmpfs /var
mount -t tmpfs tmpfs /tmp

As soon as these directories are loaded onto the RAM, they become read write and I am able to access them. Verified that by "Touch-ing" some files. This works absolutely fine.

A small glitch here is that as soon as I mount /var and /tmp as tmpfs, it removes the precious files there. So I have to manually recreate all the files needed. Can anyone point me a better/easier way to do the same. It would be very helpful as I have been on this issue for quiet some time, without a permanent solution.

Thanks,
-=Srijan

Link to this post 01 Sep 10

I got it to work....:-), though there are some rough edges, which I shall try to smoothen.

I already had the initrd image booting from the RAM, that gave me the busybox standalone shell. From this shell, I first mounted my hard drive to /root. Formatted it and changed the file system. Then I mounted my cd-rom to /mnt, which was after all a read only file system. Then I copied the contents of the /mnt to /root. Then I chroot-ed, into /root and that gave me a read write environment. So it's done.

The only thing that needs to be done now is that after chroot-ing in /root, I need to run /sbin/init....which is not happening as of now. As a workaround I have create a bash script, that manually starts the processes I need. As it is a Firewall that I have made, I just start ssh, iptables, snort_inline, zebra...to name a few.

Thanks and Regards,
-=Srijan

Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board