Ticket #808 (closed defect: worksforme)

Opened 12 years ago

Last modified 2 years ago

Nonexistent $HOME breaks stuff

Reported by: cwixon@… Owned by: willie_chen
Priority: high Milestone:
Component: sysinit Version: 2007.2
Severity: normal Keywords:
Cc: buglog@… Blocked By:
Blocking: Estimated Completion (week):
HasPatchForReview: no PatchReviewResult:


On my Neo1973 I have a MicroSD partition mounted at /home (which is analogous to
a pretty typical setup on a desktop Linux system), but the mmc device is brought
up AFTER some of the init scripts expect /home/root -- which is the default path
to the root user's HOME directory -- to already exist.

As a result, anything spawned by init or the gui finds that HOME=/


(1) Don't hardcode HOME=/home/root

I'm actually not entirely clear on the sequence of events here.

It's currently hardcoded in /etc/X11/Xinit -- oddly, as that script currently
stands, HOME is first set to /home/root, and then if that directory doesn't
exist and /root does, then HOME is set instead to /root. But if /home/root does
not exist and /root does not exist, the value of HOME is not changed. (It's not
clear to me whether Xinit is even run, though -- other variables set there don't
show up later.)

Also see /etc/init.d/mountall.sh -- which does sort of a manual version of the
getent | cut and attempts to make the root user's home if it doesn't exist --
though it does not use the HOME variable. It does this _after_ the mount -a but
for whatever reason, HOME still gets set to / on my device.

In the 2007.2 rootfs, /home/root does not exist at boot, and /root does not
exist at all by default, so HOME ends up as / and various configuration files
get stored there. It works, but it's not standard to put files there.

It would be preferable to use something like:

export HOME=getent passwd ${USER} | cut -f6 -d:

. . . but getent isn't available in the default rootfs and isn't in busybox.

And I would submit that Xinit isn't the right place for it. Perhaps something
in /etc/init.d that runs pretty early in the process would be a better candidate.

(2) As suggested by the Filesystem Hierarchy Standard, include a /root directory
in the rootfs images and use that as the default home directory for the root user.


This should go in the default rootfs /etc/passwd file so that it gets picked up
by the getent, above.

(3) Don't have the user run as root by default!

Yes, this is a known issue and I'm sure it will be rectified at some point, but
I include it here for completeness. Running this way is the root (ahem) of all

Change History

comment:1 Changed 12 years ago by cwixon@…

Curious behavior.

I had occasion to flash a new rootfs, and in so doing, I left /home on the
default filesystem.

Even when /home/root and /root both exist, I still get HOME=/ in the login shell
and not the value it's set to in /etc/passwd.

I can fix this by specifically extracting the value from /etc/passwd in a script
sourced by /etc/profile (e.g. in my case, /etc/profile.d/userprofile.sh):

export HOME="`cat /etc/passwd | grep $USER | awk

This is a successful workaround, but shouldn't this variable be set
automatically by the login process (/bin/tinylogin) based on the contents of

Finally, as a followup to my initial comment, section (1), I don't believe the
hardcoded value in Xinit is ever being set. The remaining comments stand.

comment:2 Changed 11 years ago by cwixon@…

I just checked on a brand new from-scratch image I built (2007-11-06), and $HOME
still isn't set correctly unless I set it myself in (e.g.)

Contrary to my initial post, I don't think this has anything to do with when
mounted partitions are brought up.

On a freshly flashed, freshly booted Neo, I open the terminal, type 'env', and
see that HOME=/

comment:3 Changed 11 years ago by nod_huang@…

  • Owner changed from buglog@… to michael@…

comment:4 Changed 11 years ago by john_lee@…

  • Owner changed from michael@… to willie_chen@…

reassign to willie

comment:5 Changed 11 years ago by roh

  • Owner changed from willie_chen@… to willie_chen

comment:6 Changed 10 years ago by john_lee

  • Status changed from new to closed
  • HasPatchForReview unset
  • Resolution set to worksforme

should be okay on the recent images.

comment:7 Changed 2 years ago by Chassmetly

Alternativa Natural Priligy <a href=http://cial5mg.xyz/cost-of-cialis.php>Cost Of Cialis</a> Viagra Online Us Pharmacy Cialis 20 <a href=http://cial5mg.xyz/purchase-cialis.php>Purchase Cialis</a> 50 Mg Amatriptyline Cheap Cipro Cheap Online <a href=http://zol1.xyz/zoloft-online-no.php>Zoloft Online No</a> Online Secure Progesterone Medicine No Prescription Needed Generic Propecia Price <a href=http://kama1.xyz/generic-kamagra-cheap.php>Generic Kamagra Cheap</a> How Safe Is Kamagra Pfizer Viagra From Canada <a href=http://cial5mg.xyz/cialis-price.php>Cialis Price</a> Purchasing Clonidine Precio Levitra 10 <a href=http://cial5mg.xyz/buy-cialis-cheap.php>Buy Cialis Cheap</a> Generic Viagra Best Prices Water Pills No Prescription Mexico <a href=http://cial1.xyz/can-i-buy-cialis-online.php>Can I Buy Cialis Online</a> Doxycycline Online India Acheter Cialis Generique En France <a href=http://accutane.ccrpdc.com/accutane-price-cvs.php>Accutane Price Cvs</a> Propecia Effects On Women Oral Cialis Bucodispersable <a href=http://kama1.xyz/prices-kamagra.php>Prices Kamagra</a> Want To Buy Dutasteride Ups Best Website Medicament Baclofene <a href=http://cial5mg.xyz/cialis-online-prices.php>Cialis Online Prices</a> Cialis Pas Chere Buy Viagra In Person <a href=http://kama1.xyz/buy-generic-kamagra-online.php>Buy Generic Kamagra Online</a> Levitra Valore Cialis Mode D'Emploi <a href=http://cialis.ccrpdc.com/cialis-price.php>Cialis Price</a> Buy Generic Accutane Uk Comprare Levitra 10 Mg <a href=http://cial1.xyz/generic-cialis-cheapest.php>Generic Cialis Cheapest</a> Cialis Comprar Contrareembolso Viagra Se Baja <a href=http://doxycycline.ccrpdc.com/cheap-vibramycin-on-line.php>Cheap Vibramycin On Line</a> What Are The Highest Mg Of Cialis Viagra Online Shop <a href=http://zol1.xyz/zoloft-no-prescription-fast.php>Zoloft No Prescription Fast</a> Amoxicillin Dosage For Domestic House Cat Cialis Viagra Effetti Collaterali <a href=http://cial5mg.xyz/cialis-online-usa.php>Cialis Online Usa</a> Buy Strattera Atomoxetine Usa Online Cialis Rezept Gunstig Kaufen <a href=http://cial1.xyz/viagra-cialis.php>Viagra Cialis</a> Comprar Cialis Barcelona Online Amoxicillin Rx <a href=http://cial1.xyz/prices-cialis.php>Prices Cialis</a> Buy Antabuse Disulfiram Online Priligy Temoignages <a href=http://accutane.ccrpdc.com/accutane-pills-online.php>Accutane Pills Online</a> Cialis Mecanismo De Accion Order Pharmaceuticals Online India <a href=http://cial1.xyz/cialis-viagra.php>Cialis Viagra</a> Misoprostol 200 Mg Buy Order Lassix Water Pills <a href=http://kama1.xyz/order-kamagra-gel.php>Order Kamagra Gel</a> Viagra 100 Mg 4 Comprimes Is 100 Mg Cialis Safe <a href=http://cial5mg.xyz/cialis-online-no.php>Cialis Online No</a> Keflex Diverticulitis Medication Cephalexin <a href=http://cial5mg.xyz/cheap-cialis-40mg.php>Cheap Cialis 40mg</a> Finasteride 1 Mg 5 Mg Comprar Propecia Canine Cephalexin Side Effects Abdominal Pain <a href=http://zol1.xyz/buy-sertraline-online-uk.php>Buy Sertraline Online Uk</a> Levitra In The Usa Today Ponstel <a href=http://cial5mg.xyz/cheap-cialis-and-viagra.php>Cheap Cialis And Viagra</a> Dilantin Amoxicillin Causes Rapid Heartbeat <a href=http://kama1.xyz/order-kamagra-gel.php>Order Kamagra Gel</a> Pharmacy Escrow Refills Priligy Experience <a href=http://zol1.xyz/buy-zoloft-cheap.php>Buy Zoloft Cheap</a> Viagra Or Cialis Cheap Prix Du Viagra Suisse <a href=http://kama1.xyz/kamagra-gel-oral.php>Kamagra Gel Oral</a> Cialis Bewertung Comprar Cialis Alicante <a href=http://viag1.xyz/order-viagra-pills.php>Order Viagra Pills</a> Farmacia Cialis Propecia Buying Pills Onlinr That Take Paypal <a href=http://zol1.xyz/ordina-zoloft-online.php>Ordina Zoloft Online</a> Cialis Ipertensione Arteriosa Propecia Obesidad <a href=http://zol1.xyz/zoloft-online-pharmacy.php>Zoloft Online Pharmacy</a> Buying Real Provera Cycrin Cialis Por Mayor <a href=http://zol1.xyz/best-zoloft-online.php>Best Zoloft Online</a> Levitra Come Funziona Amoxicillin To Treat Eye Cold <a href=http://zol1.xyz/purchase-generic-zoloft.php>Purchase Generic Zoloft</a> Achat Cialis Doctissimo Viagra Generika Gut <a href=http://antabuse.ccrpdc.com/generic-antabuse-buy.php>Generic Antabuse Buy</a> Viagra Pas De La Case Buy Generic Levitra <a href=http://accutane.ccrpdc.com/where-to-buy-accutane.php>Where To Buy Accutane</a> Polarmeds Levitra Effetti Collaterali <a href=http://kama1.xyz/online-pharmacy-kamagra.php>Online Pharmacy Kamagra</a> Que Es La Cialis Y Para Que Sirve Buy Wellbutrin 75 Mg <a href=http://cial1.xyz/can-i-buy-cialis-online.php>Can I Buy Cialis Online</a> Cialis Canadian Pahrmcy Levitra Nuovi Prezzi <a href=http://viag1.xyz/cheap-viagra-25mg.php>Cheap Viagra 25mg</a> Amoxicillin Claw Kamagra Costo <a href=http://kama1.xyz/generic-kamagra-buy.php>Generic Kamagra Buy</a> Amoxicillin And Std'S How To Get Zithromax <a href=http://cial1.xyz/order-cialis-tablets.php>Order Cialis Tablets</a> Viagra Tschechien Rezeptfrei Amoxicillin Works Bowel Bacteria <a href=http://zol1.xyz/buy-cheap-zoloft-pills.php>Buy Cheap Zoloft Pills</a> Buy Propecia Online Reviews Propecia 0.5mg <a href=http://viag1.xyz/viagra-online-blue.php>Viagra Online Blue</a> Levitra 10 Mg Prezzo In Farmacia Levitra Vs Viagra Comparison <a href=http://cial5mg.xyz/generic-for-cialis.php>Generic For Cialis</a> Acheter Du Viagra En Suisse With this type of loan there is a reasonable chance you will get into a cycle of paying one loan off to only need to get another one shortly thereafter. <a href=http://fastmoney365.com>bad credit loans</a> co.But what are the primary differences between these two types of loans And how do they affect you.Propecia Allattamento <a href=http://cial1.xyz/tadalafil-20mg.php>Tadalafil 20mg</a> Cialis Brand Name Buy Online Dutasteride Purchase Internet Windsor <a href=http://viag1.xyz/viagra-discount-sales.php>Viagra Discount Sales</a> Viagra 100mg 30 Cialis Mal De Tete <a href=http://viag1.xyz/how-much-is-viagra.php>How Much Is Viagra</a> Kamagra Gel Oral Farmacia Nebenwirkungen Viagra Alkohol <a href=http://zol1.xyz/implicane.php>Implicane</a> Effet Du Cialis Sur Les Femmes Maxalt <a href=http://doxycycline.ccrpdc.com/vibramycin-online-cheap.php>Vibramycin Online Cheap</a> Viagra Ersatz Nachnahme Clobetasol 30g Eczema Wolverhampton <a href=http://lasix.ccrpdc.com/how-to-order-lasix.php>How To Order Lasix</a> Propecia While On Ipledge

Note: See TracTickets for help on using tickets.