Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 19 Sep 2019, 08:32
All times are UTC - 4
 Forum index » Taking the Puppy out for a walk » Misc
minibase
Moderators: Flash, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [15 Posts]  
Author Message
sc0ttman


Joined: 16 Sep 2009
Posts: 2700
Location: UK

PostPosted: Sun 27 Jan 2019, 17:31    Post subject:  minibase
Subject description: "an alternative base system / early userspace for Linux"
 

May be of interest to those who like small C programs, static binaries,
playing with the boot process or initrd (etc)...

https://github.com/arsv/minibase

Quote:
What is this project
~~~~~~~~~~~~~~~~~~~~
This is an alternative base system / early userspace for Linux.

The role of this project in a system is similar to that of busybox
in small custom distributions. Boot the system, load modules, mount
partitions, establish networking, provide basic services. It is aimed
more at personal devices running GUIs however, more like systemd.

The project builds into small statically-linked executables with no
external dependencies. There are no build-time library dependencies
either, not even libc. It can be built with any toolchain that can
build the kernel.

Supported targets: x86_64 arm aarch64 rv64 mips mips64 i386.
(anything else will not work even if toolchain is available)

This project should be mostly useful for people building their own
custom systems, distribution, or maybe even looking for tools to put
into initrd.


Project status
~~~~~~~~~~~~~~
The project is ONGOING but not yet complete or even stable.
Components currently included in the package:

* batch command runner / script interpreter (msh)
* early-stage boot utils (switchroot, modprobe, mount).
* non-encrypted block device locator (findblk).
* encrypted device locator and passphrase prompt (passblk).
* support tooling for disk encryption (dektool, dmcrypt).
- no fsck for any file system yet.

* process supervision suite (svhub, reboot).

* udev event monitor (udevmod).
* syslogd and related tools.
* non-privileged mount service (mountd, pmount).
* controlled privilege escalation service (suhub, sudo)

* VT/DRI/input multiplexer (vtmux)
* simple non-graphical greeter (ctrlvt).

* network interface monitor (ifmon)
* DHCP client (dhcp)
* Wi-Fi client and connection manager (wsupp) [WPA2-PSK only]
* manual interface setup tools (ip4cfg, ip4info) [incomplete]
- no sntpd yet.

* simple interactive shell (cmd).
* basic command line tools (cat, ls, du, df etc).
* small linux-specific tools (systime, sync, dmesg etc).

- no package manager / download tool yet.
- no audio tools of any kind.

With everything in place, the system should boot on kernel and minibase alone
to the point where it can run X or Wayland GUI, establish internet connection
and start downloading packages.

_________________
Pkg, mdsh, Woofy, Akita Linux, VLC-GTK
Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 14307
Location: Gatineau (Qc), Canada

PostPosted: Mon 28 Jan 2019, 17:57    Post subject:  

Hi, sc0ttman.

Interesting. Is this entirely your own work or have you been putting together
progs from other people?

The above is not meant negatively. IMO, "arrangers" should get as much
respect as "composers". (E.g. the name of jazzman Gil Evans comes to mind.)

Keep up the good work.

BFN.

_________________
musher0
~~~~~~~~~~
Je suis né pour aimer et non pas pour haïr. (Sophocle) /
I was born to love and not to hate. (Sophocles)
Back to top
View user's profile Send private message 
jamesbond

Joined: 26 Feb 2007
Posts: 3357
Location: The Blue Marble

PostPosted: Fri 01 Feb 2019, 10:01    Post subject:    

Good find Scott. Thanks.
_________________
Fatdog64, Slacko and Puppeee user. Puppy user since 2.13.
Contributed Fatdog64 packages thread.
Back to top
View user's profile Send private message 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 9017
Location: Perth, Western Australia

PostPosted: Sat 02 Feb 2019, 21:40    Post subject:  

sc0ttman,
Thanks from me too. Looks really interesting, have added it to my check-this-out list.

_________________
http://bkhome.org/news/
Back to top
View user's profile Send private message Visit poster's website 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 9017
Location: Perth, Western Australia

PostPosted: Fri 08 Feb 2019, 20:07    Post subject:  

I have started to check it out. Have got as far as setting up with the ethernet utilities:

http://bkhome.org/news/201902/basic-ethernet-setup-with-minibase.html

...a first go, might have to modify the scripts. But, looks real good.

_________________
http://bkhome.org/news/
Back to top
View user's profile Send private message Visit poster's website 
vovchik


Joined: 23 Oct 2006
Posts: 1504
Location: Ukraine

PostPosted: Sat 09 Feb 2019, 08:35    Post subject:  

Dear Scott,

What a nice find. Thanks. I am also looking at this and see potential.

With kind regards,
vovchik
Back to top
View user's profile Send private message 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 9017
Location: Perth, Western Australia

PostPosted: Wed 20 Feb 2019, 19:43    Post subject:  

The minibase network utilities are in the latest release of EasyOS, version 1.0.8, given the name "UltraSNS" (Ultra Simple Network Setup):

http://bkhome.org/news/201902/easyos-x8664-version-108-released.html

And I have written some notes if anyone feels motivated to port UltrsSNS to Puppy Linux, or a derivative:

http://bkhome.org/news/201902/notes-for-porting-ultrasns-to-puppy-linux.html

_________________
http://bkhome.org/news/
Back to top
View user's profile Send private message Visit poster's website 
Leon

Joined: 22 Jun 2005
Posts: 259

PostPosted: Thu 21 Feb 2019, 19:27    Post subject: Ultra Simple Network Setup for Quirky Beaver 8.7.1  

BarryK wrote:
The minibase network utilities are in the latest release of EasyOS, version 1.0.8, given the name "UltraSNS" (Ultra Simple Network Setup):

http://bkhome.org/news/201902/easyos-x8664-version-108-released.html

And I have written some notes if anyone feels motivated to port UltrsSNS to Puppy Linux, or a derivative:

http://bkhome.org/news/201902/notes-for-porting-ultrasns-to-puppy-linux.html

Congratulation an thank you for UltraSNS and the instructions.

I made a pet package to install UltraSNS in Quirky Beaver 8.7.1.

After installing the pet I successfully established a working wired and wireless internet connection by using UltraSNS.

I like the encrypted password for wireless connection.
UltraSNS-0.1-qb871.pet
Description  Ultra Simple Network Setup for Quirky Beaver 8.7.1
pet

 Download 
Filename  UltraSNS-0.1-qb871.pet 
Filesize  65.12 KB 
Downloaded  100 Time(s) 
Back to top
View user's profile Send private message 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 9017
Location: Perth, Western Australia

PostPosted: Fri 22 Feb 2019, 21:25    Post subject: Re: Ultra Simple Network Setup for Quirky Beaver 8.7.1  

[quote="Leon"]
BarryK wrote:
I made a pet package to install UltraSNS in Quirky Beaver 8.7.1.


Great!

I have received a pm, how can UltraSNS handle a static LAN? Fixed IP addresses.

I don't know, presume that /etc/net/mode-lan0 would have to be edited -- currently it just does this:

Code:
#!/bin/sh
echo "+++ mode-lan0 $1"
ifconfig $1 up
ifctl $1 auto-dhcp


...that last line causes dhcp, the DHCP client, to run. Which, effectively is just like we would do if using dhcpcd:

Code:
ifconfig $1 up
dhcpcd $1


...but, don't try to do this with USNS daemons running, as dhcp and dhcpcd will clash.

I have never setup a static LAN, and can't think of the steps, but the info could be found.

There is documentation on the minibase utilities:

http://distro.ibiblio.org/easyos/amd64/packages/pet/pet_packages-pyro/minibase-net_DOC-20190218-p1-amd64.pet

_________________
http://bkhome.org/news/
Back to top
View user's profile Send private message Visit poster's website 
rufwoof


Joined: 24 Feb 2014
Posts: 3440

PostPosted: Fri 22 Feb 2019, 22:59    Post subject: Re: Ultra Simple Network Setup for Quirky Beaver 8.7.1  

BarryK wrote:
I have never setup a static LAN, and can't think of the steps, but the info could be found.

I've used static ... taking your EasyOS 1.0.8 kernel and initrd, and editing init to leave the top bit (mounts etc.), striping out the middle bit (Easy stuff), and dropping changes at the bottom (instead of the switch-root parts). init content fully reproduced here, and where the static LAN parts might be used as a guide ...
Code:
export TEXTDOMAINDIR=/usr/share/locale
export TEXTDOMAIN=easyinitrd
export OUTPUT_CHARSET=UTF-8
export LC_COLLATE=C
export LC_CTYPE=en_US.UTF-8
mount -t proc none /proc
mount -t sysfs none /sys
mount -t rootfs -o remount,rw rootfs /
ln -s /proc/mounts /etc/mtab 2> /dev/null
export PATH="/bin:/sbin"

[ ! "$INIT_LANG" ] && INIT_LANG=C #precaution.
wkgLANG="${INIT_LANG}"
#this should match console font loaded in quicksetup...
case "${wkgLANG}" in
 C|en*)
  wkgLANG="C"
 ;;
 ar*|he*|iw*) #arabic, hebrew
  loadfont < /lib/consolefonts/LatArCyrHeb-16.psfu
 ;;
 *) #all european languages...
  #el|ru|uk|be|sr|tg|os|ba|ce|cv)
  loadfont < /lib/consolefonts/LatGrkCyr-8x16.psfu
 ;;
esac

export wkgLANG

gzip -d /lib/keymaps/uk.gz
loadkmap </lib/keymaps/uk

#170206 reintroducing aufs in the kernel:
if grep -qw aufs /proc/filesystems; then
 LAYERFS='aufs'
 RO='=ro'
else
 LAYERFS='overlay'
 RO=''
fi

echo "nameserver 192.168.1.2" >/etc/resolv.conf
echo "127.0.0.1 localhost EASYPC18131" >/etc/hosts
# /etc/network/interfaces
mkdir -p /etc/network
echo "auto lo" >/etc/network/interfaces
echo "iface lo inet loopback" >>/etc/network/interfaces
echo "#auto eth0" >>/etc/network/interfaces
echo "#iface eth0 inet dhcp" >>/etc/network/interfaces
echo "iface eth0 inet static" >>/etc/network/interfaces
echo "address 192.168.1.4" >>/etc/network/interfaces
echo "netmask 255.255.255.0" >>/etc/network/interfaces
echo "network 192.168.1.0" >>/etc/network/interfaces
echo "broadcast 0.0.0.0" >>/etc/network/interfaces
echo "gateway 192.168.1.2" >>/etc/network/interfaces
echo "dns-nameservers 192.168.1.4 192.168.1.2" >>/etc/network/interfaces

mkdir -p /var/run/network # needed by ifup
# dmesg on my system indicates sky2 for Ethernet
modprobe sky2
ifup eth0
/etc/net/dhcp-dns      # dns

localedef -f UTF-8 -i en_US en_US.UTF-8

export LANG=en_US.UTF-8
export LANGORG=en_US.UTF-8

# tmux requires pseudo terminal
mount -t devpts non /dev/pts -o ptmxmode=0666,newinstance

while :; do
   /bin/busybox sh
done

18MB combined initrd.gz (13MB) and vmlinuz (5MB) after stripping out pretty much all other firmware/modules/drivers to just leave my sky2 hardwired eth0. Messing around with that - creating html documents manually using mc editor, and viewing them using lynx. Tested the download speed and it pulled down a 350MB Bionicpup iso in 40 seconds, so reasonable enough. Has tmux (terminal multiplexor), mc (file manager/text editor), lynx (web browser), sc-im (spreadsheet), calcurse (calendar/diary/todo) installed and I've set tmux to load showing windows of calendar, weather (from wttr.in), file manager, browser, spreadsheet, top ... all ready to F12 step between them.

That's for dhcp using a static IP (my PC is set to a fixed IP (.4) in the ISP's router (.2 ... which I found by using peasy lan scanner set to port 80 i.e. the routers admin login html page. HardInfo menu option is another great tool for discovering things).

A interesting note is that setsid cttyhack sh could be used in the final while loop as that invokes a child shell that gets you out of the init (pid 0) shell and rids you of the "tty job control disabled" complaints that otherwise prevent running capsh. But I digress, the code above that is indicative of one way to set up a static connection. Not sure its the right way though (but it works for me).

_________________
( ͡° ͜ʖ ͡°) :wq
Fatdog multi-session usb

echo url|sed -e 's/^/(c/' -e 's/$/ hashbang.sh)/'|sh
Back to top
View user's profile Send private message 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 9017
Location: Perth, Western Australia

PostPosted: Mon 25 Feb 2019, 05:03    Post subject:  

rufwoof,
Yes, interesting what you are doing. Yesterday I recompiled busybox for the initrd, brought it down from over 1000KB to about 450KB, and I left in that 'cttyhack', coz, like you, I saw that it could be useful.

I also left in 'run-init', never knew about this before, it is like 'switch_root' but has an option to drop capabilities. So, this could be an alternative to containers, offer a menu, switch_root with full capabilities, or crippled-root, the former for development, the latter for when you just want safe browsing.

_________________
http://bkhome.org/news/
Back to top
View user's profile Send private message Visit poster's website 
rufwoof


Joined: 24 Feb 2014
Posts: 3440

PostPosted: Mon 25 Feb 2019, 05:22    Post subject:  

Never knew about run-init. Thanks.

In another earlier version what I was doing was to run through init, creating a /tmp/CHR file in the process and then running /sbin/init of the main system, but where I had added exit-chroot /tmp/CHR at the end of /etc/.profile (and where I modified exit-chroot to run /tmp/CHR) ... which initialised the main system as normal but landed back at init cli. Within /tmp/CHR I then re-ran the main system ... in the background, but with cap_sys_chroot dropped, so the /etc/profile's exit-chroot command subsequently fails. That way the main system (on Ctrl-alt-F4) can't break back out of its chroot, but access to the init cli is locally available on ctrl-alt-F1 (so conceptually the entire main system could be unloaded, and another alternative (or the same) main sfs loaded). Dropped chroot however does mean not being able to run containers from within the main system (but they can be launched from ctrl-alt-F1). I had the container setup to load to ctrl-alt-F3, so ctrl-alt-Fn type switching between initrd's cli, the easy container and the main desktop.

Currently I've dropped that and I'm just using my mini tmux type 'desktop', as that boots in <5 seconds and has calendar, weather ...etc. pretty much instantly available. My phone is good for 'normal' searching (using voice) and other google like activities. I boot Easy OS easy container for the rest (lynx is pretty much cripped nowadays due to https everywhere and common use of javascript etc., but still useful for documentation (create a text file of words, add in a few basic html tags and view using lynx).

_________________
( ͡° ͜ʖ ͡°) :wq
Fatdog multi-session usb

echo url|sed -e 's/^/(c/' -e 's/$/ hashbang.sh)/'|sh
Back to top
View user's profile Send private message 
rufwoof


Joined: 24 Feb 2014
Posts: 3440

PostPosted: Mon 25 Feb 2019, 16:12    Post subject:  

I've now merged my mini boot version with the main 1.0.8 EasyOS. With my mini boot init code at the top of init .. and the normal EasyOS init code at the bottom.

I've set the mini to boot directly to tmux, that has internet connected along with windows of a introduction (showing .. "either reboot, shutdown or tmux kill-session to boot full EasyOS"), calcurse (calendar), weather (from wttr.in), lynx browser, mc file manager, top and sc-im (spreadsheet).

That expands a gzip'd image of initrd by around 10MB in total, boots to the tmux session quickly, and if you exit tmux it continues with the usual 'Finding drives .." EasyOS boot up sequence.

Being net connected, the mini boot could conceptually pull down (download) the main easy.sfs from elsewhere. As I mentioned before on my connection link it took around 40 seconds to download a 350MB bionicpup iso

Presently I'm using the standard switch-root out of init into EasyOS (easy init code pretty much untouched/as-is), so that mini session is totally lost once EasyOS is booted, but with relatively minor tweaks it could use chroot, and potentially look back around to perhaps fully unload EasyOS and download/load a entirely different main sfs. But why would you want to do that Smile

_________________
( ͡° ͜ʖ ͡°) :wq
Fatdog multi-session usb

echo url|sed -e 's/^/(c/' -e 's/$/ hashbang.sh)/'|sh
Back to top
View user's profile Send private message 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 9017
Location: Perth, Western Australia

PostPosted: Mon 25 Feb 2019, 22:40    Post subject:  

BarryK wrote:
I also left in 'run-init', never knew about this before, it is like 'switch_root' but has an option to drop capabilities. So, this could be an alternative to containers, offer a menu, switch_root with full capabilities, or crippled-root, the former for development, the latter for when you just want safe browsing.


Didn't think that one through. To offer choice of normal or "crippled root" in the initrd, then use run-init, crippled option would have to setup network and sound while still in the initrd.

_________________
http://bkhome.org/news/
Back to top
View user's profile Send private message Visit poster's website 
sc0ttman


Joined: 16 Sep 2009
Posts: 2700
Location: UK

PostPosted: Sun 07 Apr 2019, 16:02    Post subject:  

Also see Finit: http://murga-linux.com/puppy/viewtopic.php?p=1024606#1024606
_________________
Pkg, mdsh, Woofy, Akita Linux, VLC-GTK
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [15 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Taking the Puppy out for a walk » Misc
Jump to:  

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 vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.2245s ][ Queries: 13 (0.0220s) ][ GZIP on ]