RetroBSD

2.11BSD operating system for microcontrollers
It is currently Wed Feb 19, 2020 11:19 pm

All times are UTC




Post new topic Reply to topic  [ 79 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
PostPosted: Sat Feb 21, 2015 9:11 am 
Committer
User avatar

Joined: Wed Oct 10, 2012 11:01 pm
Posts: 1081
Location: Sunnyvale, CA
majenko wrote:
I don't like the idea of doing things manually. I'd much rather spend two days writing scripts and things to generate a file that would take a few hours to create manually. It's more fun. :)

Well, if you can quickly sketch a parser for sys/proc.h, sys/user.h and sys/vmmeter.h, it will do the trick. :)


Top
 Profile  
 
PostPosted: Sat Feb 21, 2015 9:16 am 
Committer
User avatar

Joined: Wed Oct 10, 2012 11:01 pm
Posts: 1081
Location: Sunnyvale, CA
jaromir wrote:
I ignored the sed messages and subsequently made the fs image.

Seems I've fixed this issue. Sed script has been a bit outdated and not compatible with modern nroff output. Please, update your git snapshot (use "git pull").


Top
 Profile  
 
PostPosted: Sat Feb 21, 2015 9:20 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
@Jaromir - did you change the config stuff for your drawer hw??
That would be an another guide then :)

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Sat Feb 21, 2015 9:33 am 
User avatar

Joined: Mon Nov 12, 2012 3:17 pm
Posts: 164
Location: Bratislava, Slovakia
pito: no changes in litebsd config, for now I just wanted to test out the tools.
I'm rather sure that making it suit my hardware will be funny lesson number two.

_________________
http://jaromir.xf.cz/
https://hackaday.io/jaromir/


Top
 Profile  
 
PostPosted: Sat Feb 21, 2015 9:33 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
This comes out when I did bmake clean (after git pull):

Code:
6.ln ckuus7.ln ckuusx.ln ckuusy.ln ckcpro.ln ckcfns.ln ckcfn2.ln ckcfn3.ln ckuxla.ln ckucon.ln ckutio.ln ckufio.ln ckudia.ln ckuscr.ln ckcnet.ln 
clean ===> contrib/nvi
clean ===> contrib/nvi/common
bmake[3]: "/usr/share/mk/bsd.man.mk" line 175: Inconsistent operator for tags
bmake[3]: Fatal errors encountered -- cannot continue
bmake[3]: stopped in /home/pito/LiteBSD/contrib/nvi/common
*** Error code 1

Stop.
bmake[2]: stopped in /home/pito/LiteBSD/contrib/nvi
*** Error code 1

Stop.
bmake[1]: stopped in /home/pito/LiteBSD/contrib
*** Error code 1

Stop.
bmake: stopped in /home/pito/LiteBSD
pito@ubuntu:~/LiteBSD$


Then I tried to build:
Code:
pito@ubuntu:~/LiteBSD$ bmake build
bmake -Cetc install
mkdir -p /etc/namedb /dev /tmp
mkdir: cannot create directory ‘/etc/namedb’: Permission denied
*** Error code 1 (ignored)
mkdir -p /usr/lib /usr/src/sys /root
mkdir: cannot create directory ‘/usr/src/sys’: Permission denied
*** Error code 1 (ignored)
mkdir -p /var/log /var/run /var/spool/uucp
mkdir: cannot create directory ‘/var/spool/uucp’: Permission denied
*** Error code 1 (ignored)
cp master.passwd /etc/master.passwd
cp: cannot create regular file ‘/etc/master.passwd’: Permission denied
*** Error code 1

Stop.
bmake[1]: stopped in /home/pito/LiteBSD/etc
*** Error code 1

Stop.
bmake: stopped in /home/pito/LiteBSD


pito@ubuntu:~/LiteBSD$ sudo bmake build
[sudo] password for pito:
bmake -Cetc install
mkdir -p /etc/namedb /dev /tmp
mkdir -p /usr/lib /usr/src/sys /root
mkdir -p /var/log /var/run /var/spool/uucp
cp master.passwd /etc/master.passwd
cp group /etc/group
install -c -m 555 MAKEDEV.local etc.i686/MAKEDEV /dev
install: cannot stat ‘etc.i686/MAKEDEV’: No such file or directory
*** Error code 1

Stop.
bmake[1]: stopped in /home/pito/LiteBSD/etc
*** Error code 1

Stop.
bmake: stopped in /home/pito/LiteBSD
pito@ubuntu:~/LiteBSD$ bmake

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Sat Feb 21, 2015 9:44 am 
Committer
User avatar

Joined: Wed Oct 10, 2012 11:01 pm
Posts: 1081
Location: Sunnyvale, CA
Pito wrote:
clean ===> contrib/nvi/common
bmake[3]: "/usr/share/mk/bsd.man.mk" line 175: Inconsistent operator for tags

I cannot reproduce this bug. Strange that in uses /usr/share/mk path instead of MAKESYSPATH value.


Top
 Profile  
 
PostPosted: Sat Feb 21, 2015 9:46 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Do the exports done there still work after a new login into linux (shell)??
Code:
export BSDSRC=$HOME/LiteBSD

export MIPS_GCC_ROOT=/usr/local/mips-2014.05

export DESTDIR=$BSDSRC/DESTDIR

export MAKESYSPATH=$BSDSRC/share/mk-pic32


Answer: they do not, exports are lost, needs to be done again after a new login into the shell.. not good..
I've done exports again and it works now..

Need those env vars be stored in /etc/bash.bashrc or in /etc/environment or in /etc/profile.d/ or in profiles or in top Makefile??

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Sat Feb 21, 2015 10:42 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
There must be something wrong - after running a few cleans and builds my sudo stops working:
Code:
pito@ubuntu:~/LiteBSD$ bmake load
bmake -Csys/compile/WIFIRE.pic32
`vmunix.elf' is up to date.
sudo pic32prog -d /dev/ttyUSB0 sys/compile/WIFIRE.pic32/vmunix.hex
[sudo] password for pito:
pito is not in the sudoers file.  This incident will be reported.
*** Error code 1

Stop.
bmake: stopped in /home/pito/LiteBSD
pito@ubuntu:~/LiteBSD$

It happened yesterday too (I had to reinstall linux, as nothing worked to get sudoers back).
Maybe the missing exports are causing that, something gets corrupted.
I've reinstalled 6th time the linux, installed according the above guide and it works. I think when I logoff myself, login back and run bmake build without exporting the vars it crashes the sudo again..

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Sat Feb 21, 2015 11:55 am 
Committer
User avatar

Joined: Thu Oct 11, 2012 8:45 am
Posts: 1801
Location: Room 217, Floor 8, Arm 8, Wheel S7, Mars Base Alpha 3
Pito wrote:
Do the exports done there still work after a new login into linux (shell)??
Code:
export BSDSRC=$HOME/LiteBSD

export MIPS_GCC_ROOT=/usr/local/mips-2014.05

export DESTDIR=$BSDSRC/DESTDIR

export MAKESYSPATH=$BSDSRC/share/mk-pic32


Answer: they do not, exports are lost, needs to be done again after a new login into the shell.. not good..
I've done exports again and it works now..

Need those env vars be stored in /etc/bash.bashrc or in /etc/environment or in /etc/profile.d/ or in profiles or in top Makefile??


In your local .bashrc in your home directory.

_________________
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".


Top
 Profile  
 
PostPosted: Sat Feb 21, 2015 11:56 am 
Committer
User avatar

Joined: Thu Oct 11, 2012 8:45 am
Posts: 1801
Location: Room 217, Floor 8, Arm 8, Wheel S7, Mars Base Alpha 3
Pito wrote:
There must be something wrong - after running a few cleans and builds my sudo stops working:
Code:
pito@ubuntu:~/LiteBSD$ bmake load
bmake -Csys/compile/WIFIRE.pic32
`vmunix.elf' is up to date.
sudo pic32prog -d /dev/ttyUSB0 sys/compile/WIFIRE.pic32/vmunix.hex
[sudo] password for pito:
pito is not in the sudoers file.  This incident will be reported.
*** Error code 1

Stop.
bmake: stopped in /home/pito/LiteBSD
pito@ubuntu:~/LiteBSD$

It happened yesterday too (I had to reinstall linux, as nothing worked to get sudoers back).


There is no need to use sudo for pic32prog - as long as you have set up udev properly, and you have ensured your user is in the dialout group.

_________________
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".


Top
 Profile  
 
PostPosted: Sat Feb 21, 2015 12:02 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
But the issue above is with any sudo - it stops working, you are deleted from sudoers somehow!!

PS: I've updated the exports inclusion of the env vars into .bashrc and it seems it works now after a new login..

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Sat Feb 21, 2015 12:16 pm 
Committer
User avatar

Joined: Thu Oct 11, 2012 8:45 am
Posts: 1801
Location: Room 217, Floor 8, Arm 8, Wheel S7, Mars Base Alpha 3
That should never happen - unless you, or the build process, ran something it shouldn't have with sudo.

By removing the need to run sudo you'll remove the possibility of sudo corrupting / breaking.

Three things you should do:

1. Ensure you are in the "dialout" group:
Code:
$ sudo usermod -G dialout pito


2. Allow normal users access to your SD card:

- Create a file /etc/udev/rules.d/40-sdcard.rules
Code:
KERNEL=="sdg", SYMLINK+="mmcblk0", MODE="0666", GROUP="plugdev"
KERNEL=="sdg1", SYMLINK+="mmcblk0p1", MODE="0666", GROUP="plugdev"
KERNEL=="sdg2", SYMLINK+="mmcblk0p2", MODE="0666", GROUP="plugdev"
KERNEL=="sdg3", SYMLINK+="mmcblk0p3", MODE="0666", GROUP="plugdev"
KERNEL=="sdg4", SYMLINK+="mmcblk0p4", MODE="0666", GROUP="plugdev"

(replace "sdg" with the device name of your SD card). You can omit the SYMLINK section if you want - I have that in there for ARM development.

Then restart udev:
Code:
$ sudo /etc/init.d/udev restart


3. Create an emergency backup root password so you can get as root from the console:
Code:
$ sudo passwd root
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully

CTRL-ALT-F1 takes you to the console, where you can then log in as root - at that point you can fix whatever killed sudo if it happens again. ALT-F7 (or somewhere around there, it depends which virtual console it's running on) switches back to X again.

_________________
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".


Top
 Profile  
 
PostPosted: Sat Feb 21, 2015 12:23 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
I think the build process kills the sudo-something when the exports are not done properly. There is something copying passwords in the build process - see the log..

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Sat Feb 21, 2015 12:31 pm 
Committer
User avatar

Joined: Thu Oct 11, 2012 8:45 am
Posts: 1801
Location: Room 217, Floor 8, Arm 8, Wheel S7, Mars Base Alpha 3
Ah, well, if you run bmake as root without DESTDIR set then yes, it will completely clobber your Linux installation. It's not sudo that's been broken, it's your entire Linux system.

sudo is not a program to be used lightly - you should avoid it wherever possible. If you get messages about bad permissions, then you should be looking at where it is trying to access and think "is that the right place?" before you just go and blindly clobber it as root.

_________________
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".


Top
 Profile  
 
PostPosted: Sat Feb 21, 2015 12:37 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Quote:
Ah, well, if you run bmake as root without DESTDIR set then yes, it will completely clobber your Linux installation. It's not sudo that's been broken, it's your entire Linux system.

So that happened to me few times already :twisted:

How to arrange the stuff such it works safe for us beginners too??
Do we need a check on env vars settings put somewhere into makefiles????
:o

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Sat Feb 21, 2015 12:58 pm 
Committer
User avatar

Joined: Thu Oct 11, 2012 8:45 am
Posts: 1801
Location: Room 217, Floor 8, Arm 8, Wheel S7, Mars Base Alpha 3
Well The first thing to do is stop using sudo when you shouldn't.

_________________
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".


Top
 Profile  
 
PostPosted: Sat Feb 21, 2015 1:09 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
I've been playing with linux since ever and been using sudo since ever, and this is the first time I see I am put off the sudoers :)

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Sat Feb 21, 2015 2:10 pm 
Committer
User avatar

Joined: Thu Oct 11, 2012 8:45 am
Posts: 1801
Location: Room 217, Floor 8, Arm 8, Wheel S7, Mars Base Alpha 3
You weren't put off the sudoers. You were put off the entire computer.

Code:
cp group /etc/group

Bye bye groups!

No more access to anything like sudo based on your group. No admin group, no sudo group, no nuffink.

sudo comes with a very prominent warning, which you should heed:
Code:
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.


Especially point 2 - think before you type.

_________________
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".


Top
 Profile  
 
PostPosted: Sat Feb 21, 2015 2:49 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
So plz do clarify to me (noob):
When I install everything, using sudos where needed, and then I do logoff/login (and I will not make those exports, nor manualy, nor in .bashrc) and I do bmake build (no sudo done in the new session), my linux will not get destroyed?

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Sat Feb 21, 2015 3:00 pm 
Committer
User avatar

Joined: Thu Oct 11, 2012 8:45 am
Posts: 1801
Location: Room 217, Floor 8, Arm 8, Wheel S7, Mars Base Alpha 3
As long as you don't use sudo the OS is protected against silly things like that - a normal user has no write access to the system areas.

It was only through the use of sudo that you killed it.

_________________
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 79 posts ]  Go to page Previous  1, 2, 3, 4  Next

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron




Powered by phpBB® Forum Software © phpBB Group

BSD Daemon used with permission