[PATCH] Add support for default env and mounting /boot to BeagleBoard

Robert P. J. Day rpjday at crashcourse.ca
Thu Feb 9 11:35:49 EST 2012


On Thu, 9 Feb 2012, Premi, Sanjeev wrote:

> >  /******************** Board Boot Time *******************/
> >
> > @@ -317,3 +320,30 @@ static int beagle_devices_init(void)
> >  	return 0;
> >  }
> >  device_initcall(beagle_devices_init);
> > +
> > +#ifdef CONFIG_DEFAULT_ENVIRONMENT
> > +static int beagle_env_init(void)
> > +{
> > +	struct stat s;
> > +	char *diskdev = "/dev/disk0.0";
> > +	int ret;
> > +
> > +	ret = stat(diskdev, &s);
> > +	if (ret) {
> > +		printf("no %s. using default env\n", diskdev);
> > +		return 0;
> > +	}
> > +
> > +	mkdir ("/boot", 0666);
> > +	ret = mount(diskdev, "fat", "/boot");
> > +	if (ret) {
> > +		printf("failed to mount %s\n", diskdev);
> > +		return 0;
> > +	}
> > +
> > +	default_environment_path = "/boot/bareboxenv";
> > +
> > +	return 0;
> > +}
> > +late_initcall(beagle_env_init);
> > +#endif
>
> Keeping this sequence, in init scripts makes things more & easily configurable.

  i agree, it was a bad idea of mine.  so moving it *out* of the panda
code would make sense as well, yes?

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================



More information about the barebox mailing list