1

If I start a new distro (e.g. LFS):

  1. How can I change the directory structure?
  2. What should I expect after it's ready? (probably can't install most of the packages without modification, right?

But, before you down vote: I've been asked to make a new distro for a specific project which they need (actually, want) a new directory structure with a few changes, for example remove the var and bin directories, but without halting the system. The application of this distro is so limited, so i think it shouldn't be a big deal as they need just a few packages to be installed.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Mahdi
  • 9,247
  • 9
  • 53
  • 74

2 Answers2

2

These are few pointers that come to my mind and definitely it is not complete:

  1. Your PATH should be updated in the startup scripts like ~/.bashrc, /etc/profile.d, and so on to reflect the updated directories.
  2. Configuration files tend to use /var quite often. (/var/log, /var/tmp) You'd need to modify all these location references.
  3. Basically your kernel is going to start /sbin/init which is going to start the initialization at /etc/rc.d or equivalent. If you start tracing all the scripts and services invoked in these startup scripts, I believe you should be able to capture all the places you'd need to modify the path names.
Tuxdude
  • 47,485
  • 15
  • 109
  • 110
  • Thanks for the answer and also pointing out the `/sbin/init` and `/etc/rc.d`, that should be a nice start! :) – Mahdi Mar 01 '13 at 07:53
2

you can create a folder called system and the move all the files into the /system folder. and after that create symlinks, so the system can still be used. example:

su -i

cd /

mkdir system

mv /usr /system/usr

ln -s /system/usr /usr

I just did it........it broke my system XD (i think it was because i moved all the files into /system , including /boot witch is used by GRUB)

The chance of breaking the system is huge if you don't have background knowledge. Example if you move /bin to /system/bin, then you won't be able to create the symlink afterwards because the ln command (which is a program) is located in the /bin folder so moving it will end up in an error.

also, check out gobolinux.org which is based around what i just did. The entire system has been reorganized and to maintain compatibility, they have created symlinks so that they don't have to reprogram an app when porting applications.

user69969
  • 341
  • 2
  • 10