Tiny Core Linux

Tiny Core Base => TCB Bugs => Topic started by: nassausky on October 09, 2013, 11:49:50 AM

Title: mkdir can't create directory /home/tc/.local permission denied
Post by: nassausky on October 09, 2013, 11:49:50 AM
Hi All...

I'm getting the following error which is delaying my boot by about a minute:
     mkdir can't create directory /home/tc/.local permission denied

This was after I made a change to the 2 files:
/mnt/sda1/opt/bootlocal.sh  by adding a single line sudo /usr/local/etc/init.d/cups start
and
/mnt/sda1/tce/boot/extlinux/extlinux.conf by adding to the APPEND line opt=sda1 home=sda1 norestore

Thanks for any input
 
Title: Re: mkdir can't create directory /home/tc/.local permission denied
Post by: gerald_clark on October 09, 2013, 11:57:18 AM
Don't use sudo in bootlocal.sh.  It is already running as root.
Check your permissions on /mnt/sda1/home/tc .
Title: Re: mkdir can't create directory /home/tc/.local permission denied
Post by: nassausky on October 09, 2013, 12:39:32 PM
OK I removed everything from the bootlocal.sh file so it doesn't seem to be the problem. 

Am I supposed to be looking at the permissions of the tc folder itself which is:
drwxrwxr-x

I tried changing it to 777 (drwxrwxrwx) to see if that helped but it didn't.  Does this mean I have to go inside the folder and change permissions of something?

Thanks for the quick response.
Title: Re: mkdir can't create directory /home/tc/.local permission denied
Post by: nassausky on October 09, 2013, 01:03:23 PM
EDIT: OK I thought I got it. 
After removing norestore boot option and changing the permissions to 777, it seemed to boot fine but it wasn't changing the permissions alone since I had to remove the norestore option. 

I tried a fresh install this time on a virtualbox and this time during the install I added those boot options like the wiki instructs to create a kiosk.  Again when booting after the initial install to the virtualbox hdd it gave the same error.  /home/tc/.local permission denied so I tried the same steps.  I dropped permissions to the tc folder and rebooted with norestore off (removed from boot args) and then I restored permissions to 775 and i boots now without the error but takes about a minute or 2 to display the GUI xwindow.

So something else is up.  Has anyone tried a tinycore install on a virtualbox with those 3 boot options opt=sda1 home=sda1 norestore and rebooted without an issue?
Title: Re: mkdir can't create directory /home/tc/.local permission denied
Post by: nassausky on October 09, 2013, 07:16:33 PM
OK still working on it.  This time I reinstalled tc with the same frugal install on the virtualbox drive and used no boot options.  It started fine.  As soon as I added opt=sda1 home=sda1 norestore, it gave the permission error.  To solve it I changed /mnt/sda1/home/tc to 777 and rebooted with norestore off. I rebooted twice (for sanity) and it booted fine.  Then I changed the permissions back to 775 for the tc folder and added norestore back as a boot argument. 

This seems like a bug or a problem with the wiki (http://wiki.tinycorelinux.net/wiki:install_hd (http://wiki.tinycorelinux.net/wiki:install_hd)) under the section "Run The Installer" where it says
Boot options. Type:
opt=sda1 home=sda1 norestore

Let me know if anyone tries this and has the same issue.
Thanks.

Title: Re: mkdir can't create directory /home/tc/.local permission denied
Post by: gerald_clark on October 09, 2013, 07:33:44 PM
I don't agree with everything in that article.
The boot options opt= and home= are advanced options.
These require changes to /opt/filetool.lst.
The norestore option breaks anything that requires config files not in /opt.
Removing the waitusb option saves NO time when it includes LABEL or UUID.
Title: Re: mkdir can't create directory /home/tc/.local permission denied
Post by: curaga on October 10, 2013, 01:51:20 AM
Another bug by the home code reorg. Thanks for reporting.
Title: mkdir can't create directory /home/tc/.local permission denied
Post by: coreplayer2 on October 10, 2013, 09:08:43 AM
So something else is up.  Has anyone tried a tinycore install on a virtualbox with those 3 boot options opt=sda1 home=sda1 norestore and rebooted without an issue?
Yes, I use virtualbox will multiple versions of tinycore with opt, home, & tce persistence and occasionally run with norestore for testing without issue
Title: Re: mkdir can't create directory /home/tc/.local permission denied
Post by: roberts on October 10, 2013, 10:02:08 AM
Found and fixed for soon to be 5.0.2.
Title: Re: mkdir can't create directory /home/tc/.local permission denied
Post by: nassausky on October 10, 2013, 11:39:17 AM
Thanks for using the bug swatter so swiftly!
Title: Re: mkdir can't create directory /home/tc/.local permission denied
Post by: ticorel on October 28, 2013, 11:51:25 AM
I am really new to Tiny Core.  Just installed from the 12 M iso and got this error upon reboot.  Tried again on another installation on another hard drive and got the same error.  Anyway for a newbie to correct this or should I try to do another install?
Title: Re: mkdir can't create directory /home/tc/.local permission denied
Post by: curaga on October 28, 2013, 12:54:48 PM
Please make sure you have 5.0.2 and not an older version.

The md5 is
1dd1935bd9f813926d3fba39d760255c  TinyCore-5.0.2.iso
Title: Re: mkdir can't create directory /home/tc/.local permission denied
Post by: ticorel on October 29, 2013, 07:41:27 AM
Thank you for your input. 5.0.2 worked well. I erred when I wrote the version of the iso I had used was 12MB. I had used 5.0.1. Thanks again for getting me up and running.
Title: Re: mkdir can't create directory /home/tc/.local permission denied
Post by: memartin on November 07, 2013, 06:22:55 AM
I am booting 5.0.2 via PXE and get the same error nevertheless.  Boot params 'base' and/or 'norestore' (via APPEND) do not seem to help.

I can also not install Apps rightaway, because /tmp/tce and /tmp/tce/optional are root-writable only (which might be a different problem at all).

Any ideas or hints? Thanks a lot!

Cheerz, Martin
Title: Re: mkdir can't create directory /home/tc/.local permission denied
Post by: gerald_clark on November 07, 2013, 06:29:57 AM
Where did you get the initrd? How you boot makes no difference.
Show the output of 'showbootcodes'.
Title: Re: mkdir can't create directory /home/tc/.local permission denied
Post by: memartin on November 07, 2013, 08:05:10 AM
core.gz and vmlinuz from the current ISO, md5sum verified (like above).

my syslinux menu.cfg looks like

Code: [Select]
label tinycore
  menu label Tiny Core Linux v5.0.2
  kernel http://bootserver.local/tinycore/vmlinuz
  initrd http://bootserver.local/tinycore/core.gz
  append base norestore httplist=bootserver.local/tinycore/extensions.php kmap=qwertz/de-latin1

The httplist Script is just a PHP snippet that does a listing of *.tcz in my tce dir on the boot server, generating relative links to the packages. These are also from the current ISO.

Nothing special I suppose. Updated today from 4.5.2 (IIRC), which worked fine before. Anything I am missing?

Thanks for putting up with this,

Martin
Title: Re: mkdir can't create directory /home/tc/.local permission denied
Post by: gerald_clark on November 07, 2013, 08:58:04 AM
httplist must be a file that contains a list of tczs, not a php script.
Title: Re: mkdir can't create directory /home/tc/.local permission denied
Post by: memartin on November 07, 2013, 02:56:57 PM
Nevermind, I am sure this is not the problem since the extensions get downloaded fine and the setup has been working for nearly two years now. Seen from tinycore the httplist script is just a text file, just that it's created dynamically from a directory listing. Here's the output:

Code: [Select]
# curl http://bootserver.local/tinycore/extensions.php
/tinycore/tce/Xlibs.tcz
/tinycore/tce/Xprogs.tcz
/tinycore/tce/Xvesa.tcz
/tinycore/tce/aterm.tcz
/tinycore/tce/fltk-1.1.10.tcz
/tinycore/tce/flwm_topside.tcz
/tinycore/tce/freetype.tcz
/tinycore/tce/imlib2-bin.tcz
/tinycore/tce/imlib2.tcz
/tinycore/tce/libICE.tcz
/tinycore/tce/libSM.tcz
/tinycore/tce/libX11.tcz
/tinycore/tce/libXau.tcz
/tinycore/tce/libXdmcp.tcz
/tinycore/tce/libXext.tcz
/tinycore/tce/libXfont.tcz
/tinycore/tce/libXi.tcz
/tinycore/tce/libXmu.tcz
/tinycore/tce/libXpm.tcz
/tinycore/tce/libXrandr.tcz
/tinycore/tce/libXrender.tcz
/tinycore/tce/libXt.tcz
/tinycore/tce/libfontenc.tcz
/tinycore/tce/libjpeg-turbo.tcz
/tinycore/tce/libpng.tcz
/tinycore/tce/libxcb.tcz
/tinycore/tce/wbar.tcz


The problem I am experiencing is the error message from the OP during boot, and a set of folders with strange permissions, mainly being not writeable by the 'tc' user or even belonging to 'root'. This includes /tmp/tce[/optional] and even /home/tc, so no user setting files can be written without correcting ownership/permissions beforehand. (Thinking about it, the mkdir error should be a consequence of /home/tc belonging to root.)

This is written from mind ATM, I can give more detail when I'm back at the office tomorrow.

Thanks again, Martin
Title: Re: mkdir can't create directory /home/tc/.local permission denied
Post by: gerald_clark on November 07, 2013, 06:09:45 PM
Try a fresh install.  If you updated from 4.5.2 you probably have some thing incompatible remaining from 4.5.2.
Title: Re: mkdir can't create directory /home/tc/.local permission denied
Post by: memartin on November 08, 2013, 02:55:35 PM
Sorry for the misunderstanding, but there is no install. I am booting the extracted core.gz and vmlinuz from the 5.0.2 ISO via PXE (see Syslinux menu.cfg entry above) and pulling the *.tzc extracted from the same ISO via HTTP List. A Setup that has been working for months, if not years. No local files on the client, nothing to install "fresh".

By "updated" I mean I exchanged the core.gz and vmlinuz as well as the tcz files with the new files from the ISO on the TFTP server. The same way I am doing this all the time. No legacy files from older TCs on the server side, averything is deleted then extracted anew.

But something might be strange on my side nevertheless. Today, without changes from yesterday, three of my preconfigured TinyCores do not boot into graphics mode anymore. showbootcodes yields an empty line, yesterday everything was fine there. So maybe there's something going on with my PXE stack after switching from gPXE to iPXE.

I'll look into it further and let you know if I can reproduce this permissions thing reliably. I'll be glad to provide some more detailed info then.

So thanks again for your feedback so far!

Cheerz, Martin
Title: Re: mkdir can't create directory /home/tc/.local permission denied
Post by: MSumulong on December 10, 2013, 10:46:51 AM
I have a pretty similar setup and I am having the same exact issue. I am booting tinycore 5.0.2 from iPXE and after booting up I get the same error message:

Code: [Select]
mkdir: can't create directory '/home/tc/.local/': Permission denied
showbootcodes outputs the following:

Code: [Select]
initrd=core.gz,customize.gz vga=792 BOOT_IMAGE=vmlinuz
What is trying to create this .local folder?
Title: Re: mkdir can't create directory /home/tc/.local permission denied
Post by: gerald_clark on December 10, 2013, 11:22:26 AM
The setupHone() function in tc-functions creates /home/"$USER"/.local/bin
I suspect you have something in customize.gz that is causing the mkdir to fail.
                                             
Title: Re: mkdir can't create directory /home/tc/.local permission denied
Post by: MSumulong on December 10, 2013, 11:38:21 AM
I do have a few scripts in /home/tc that are stored in customize.gz... I moved them to /usr/local and got rid of the /home/tc directory and it looks like that fixed the issue.
Title: Re: mkdir can't create directory /home/tc/.local permission denied
Post by: gerald_clark on December 10, 2013, 11:47:14 AM
You could have just ignored the message.
Title: Re: mkdir can't create directory /home/tc/.local permission denied
Post by: MSumulong on December 10, 2013, 11:55:11 AM
I suppose. But what about all the things created in setupHome()? I'm not exactly sure what is going on there...
Title: Re: mkdir can't create directory /home/tc/.local permission denied
Post by: gerald_clark on December 10, 2013, 11:59:22 AM
It is creating empty directories that are searched by the system for executables and startup scripts.
Title: Re: mkdir can't create directory /home/tc/.local permission denied
Post by: Blues_Wolf on January 10, 2014, 11:54:28 AM
Hi, I got the same cannot create folder error.

I'm PXE booting with the latest core.gz from the webpage unmodified, and loading the extensions via tftp at boot time with the following command.

append initrd=images/thinclient/core.gz tftplist=192.168.160.34:/pxe/images/thinclient/extensions/syt.lst

syt.lst is a plain text file with the extensions' tftp path (extensions load fine apparently)

Extensions are those in the TinyCore 15MB .iso image
So I've disabled all extensions and started enabling one at the time to see which one was causing the issue.
It turns out 2 extensions are the ones causing it.
Xlibs.tcz
wbar.tcz


I can enable all extensions, but as soon as I enable any of those 2, I get the error.

Are they supposed to be loaded in a specific order? Why is this happening when loading them remotely but don't if I boot the full .iso with them?

Thanks
Title: Re: mkdir can't create directory /home/tc/.local permission denied
Post by: Blues_Wolf on January 10, 2014, 01:04:53 PM
Update:
I've created a custom initrd image with just those 2 extensions and loaded the rest through tftp as before and it works without errors.

Somehow, those two extensions conflict with the boot process when loaded through tftp, I would like to found out why though :S

Here's my workaround:

Code: [Select]
# unsquashfs -f Xlibs.tcz
# unsquashfs -f wbar.tcz
# cd squashfs-root
# find | cpio -o -H newc | gzip -2 > images/thinclient/conflict.gz

Then used the following boot codes:

Code: [Select]
append initrd=images/thinclient/core.gz,images/thinclient/conflict.gz tftplist=192.168.160.34:/pxe/images/thinclient/extensions/syt.lst
Regards
Title: Re: mkdir can't create directory /home/tc/.local permission denied
Post by: gerald_clark on January 10, 2014, 01:16:11 PM
When you use tftp to load extensions, there is no dependency resolution.
Each exprension is installed as it is loaded.
TFTP should be used only to load the extensions necessary to provide a network based persistent tce directory.
Once the tce directory is mounted, the normal onboot.lst processing will work with proper dependency handling.
I suggest you setup an NFS share for normal operations.
If you do not want the clients to modify contents, export the share as read-write only to a single maintenance client and allow read-only access to the rest.
Title: Re: mkdir can't create directory /home/tc/.local permission denied
Post by: Blues_Wolf on July 24, 2014, 12:34:12 PM
Hi Again,

Now with TCL 5.3

Error seems to be cause by the tc folder ownership.
It's owned by root:root with no Write permissions for user tc

Now, after the MOTD one of the packages tries to create the .local folder with the tc credentials and it's unable to.

I'm gonna try as workaround to create a package that modifies the folder ownership to tc:staff when loaded, and load it before any other package.
I'm currently netbooting TCL5.3 using HTTP and an httplist bootcode, nothing more.

PS: I don't get this error when using TCL 4.x

EDIT: Workaround worked, Attached is the .tcz
But it will be great to find another way to fix it
Title: Re: mkdir can't create directory /home/tc/.local permission denied
Post by: memartin on January 09, 2015, 05:17:45 PM
Haven't got round to that sort of pasime for awhile, but have been enchanted to find news on this. Thanks, Wolf, for the great fix, works perfectly. (For those who wonder: You must be logged in to see the file and download it.)