HT: File Permissions of files in /system/bin at compile time
HowTo set file permissions of files in /system/bin at compile time of kernel. example : the command reboot under system/bin has persmissions as lrwxr-xr-x -- reboot Is it done throught setting some Kconfig/config variables?? thanks in Advance Goudagunta Pradeep Kumar,
On Mon, Jan 17, 2011 at 10:41 AM, Pradeep Kumar <pradeepkernel@gmail.com>wrote:
HowTo set file permissions of files in /system/bin at compile time of kernel.
example : the command reboot under system/bin has persmissions as lrwxr-xr-x -- reboot
Is it done throught setting some Kconfig/config variables??
If I can recall correctly kernel is not setting any permission to any file system. and what do u meant by compile time? While compiling or building only kernel binaries are created.
Its the filesystem utilities that create a particular directory or binaries in that particular directory. Some compilation of kernel and filesystem is done together. That is one build system which creates kernel using kernel build system and other system to create to binaries(lets say busybox etc), This filesystem build system has rules for setting permission to any binary or directory in that file system. once entire filesystem is created its bundled in form of an archive, which is then converted in filesystem image for any file system(ext2, jjfs etc).
On Mon, Jan 17, 2011 at 5:41 AM, Pradeep Kumar <pradeepkernel@gmail.com> wrote:
HowTo set file permissions of files in /system/bin at compile time of kernel. example : the command reboot under system/bin has persmissions as lrwxr-xr-x -- reboot Is it done throught setting some Kconfig/config variables??
thanks in Advance Goudagunta Pradeep Kumar,
/sbin/reboot is part of the sysvinit package on my distro. Why would the kernel build / install have anything to setting its permissions? If you are working with a typical Makefile process, permissions are set when you do a make install. If you are working with a rpm, then the specfile that created the rpm can either use the default "make install" permissions or it can control the process with as much detail as it wants. ie. The specfile has a install section which is basically just some shell script logic. If you want to see some specfiles, one of the easiest places to look is the openSUSE build service. (OBS). Every package has a specfile and they are all readily read through. The hard part is actually finding a simple enough one that it is easily read. I wrote this one for a very simple package a while ago, so it is pretty easy to read: https://build.opensuse.org/package/view_file?file=open2300.spec&package=open... Note the "%defattr(644,root,root,755)" line. That is forcing some permissions, owners, etc. Greg
hi Greg, My question is I had a Linux kernel source code, do they have similar lines as
%defattr(644,root,root,755) to set permissions for the compiled binaries.
On Tue, Jan 18, 2011 at 12:49 AM, Greg Freemyer <greg.freemyer@gmail.com>wrote:
On Mon, Jan 17, 2011 at 5:41 AM, Pradeep Kumar <pradeepkernel@gmail.com> wrote:
HowTo set file permissions of files in /system/bin at compile time of kernel. example : the command reboot under system/bin has persmissions as lrwxr-xr-x -- reboot Is it done throught setting some Kconfig/config variables??
thanks in Advance Goudagunta Pradeep Kumar,
/sbin/reboot is part of the sysvinit package on my distro.
Why would the kernel build / install have anything to setting its permissions?
If you are working with a typical Makefile process, permissions are set when you do a make install.
If you are working with a rpm, then the specfile that created the rpm can either use the default "make install" permissions or it can control the process with as much detail as it wants. ie. The specfile has a install section which is basically just some shell script logic.
If you want to see some specfiles, one of the easiest places to look is the openSUSE build service. (OBS). Every package has a specfile and they are all readily read through.
The hard part is actually finding a simple enough one that it is easily read.
I wrote this one for a very simple package a while ago, so it is pretty easy to read:
https://build.opensuse.org/package/view_file?file=open2300.spec&package=open...
Note the "%defattr(644,root,root,755)" line. That is forcing some permissions, owners, etc.
Greg
On Wed, Jan 19, 2011 at 8:26 AM, Pradeep Kumar <pradeepkernel@gmail.com>wrote:
hi Greg, My question is I had a Linux kernel source code, do they have similar lines as
%defattr(644,root,root,755) to set permissions for the compiled binaries.
What do you mean by binaries? Kernel Build System creates modules and kernel image and ramdisk image. As per my understanding kernel image has default permisisons depending on sysem environment(CMIIW) initramfs is a generally a part of kernel image.
On Tue, Jan 18, 2011 at 12:49 AM, Greg Freemyer <greg.freemyer@gmail.com>wrote:
On Mon, Jan 17, 2011 at 5:41 AM, Pradeep Kumar <pradeepkernel@gmail.com> wrote:
HowTo set file permissions of files in /system/bin at compile time of kernel. example : the command reboot under system/bin has persmissions as lrwxr-xr-x -- reboot Is it done throught setting some Kconfig/config variables??
thanks in Advance Goudagunta Pradeep Kumar,
/sbin/reboot is part of the sysvinit package on my distro.
Why would the kernel build / install have anything to setting its permissions?
If you are working with a typical Makefile process, permissions are set when you do a make install.
If you are working with a rpm, then the specfile that created the rpm can either use the default "make install" permissions or it can control the process with as much detail as it wants. ie. The specfile has a install section which is basically just some shell script logic.
If you want to see some specfiles, one of the easiest places to look is the openSUSE build service. (OBS). Every package has a specfile and they are all readily read through.
The hard part is actually finding a simple enough one that it is easily read.
I wrote this one for a very simple package a while ago, so it is pretty easy to read:
https://build.opensuse.org/package/view_file?file=open2300.spec&package=open...
Note the "%defattr(644,root,root,755)" line. That is forcing some permissions, owners, etc.
Greg
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
participants (3)
-
Anuz Pratap Singh Tomar -
Greg Freemyer -
Pradeep Kumar