RC7 (STABLE) WeeDogLinux Arch 64 now released

A home for all kinds of Puppy related projects
Message
Author
wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

#31 Post by wiak »

NOTE: This post is now obsolete. Now using Void base-files template package to initialise /etc/passwd etc.

Version 0.0.2 of the build script uploaded to first post of this thread.

Changes:

includes code to make initial /etc/passwd and /etc/group files:

Code: Select all

echo "root:x:0:" >/etc/group
echo "root::0:0:FirstRib Admin:/root:/bin/sh" >/etc/passwd
and also prints version or help (point to github site) if requested, using simple code:

Code: Select all

case "$1" in
	'-v'|'--version') echo "FirstRib version 0.0.2";exit;;
	'-h'|'--help'|'-?') echo "For usage visit webpage: https://github.com/firstrib/firstrib";exit;;
esac
I've hoping to not have to add much more (if anything) to FirstRib module build script itself, since keeping as simple to understand as possible.

Additions to the system, such as an initramfs/initrd will be separate modules.

wiak
Last edited by wiak on Sun 04 Aug 2019, 12:03, edited 2 times in total.

wanderer
Posts: 1098
Joined: Sat 20 Oct 2007, 23:17

#32 Post by wanderer »

hi wiak

this is my report on firstrib on tinycore

i have been unable to build it
because tinycore 9
has become excessively picky and unreliable
about allowing the setting of passwds
and becoming global root

so for now its a no go
until i figure out the passwd-root issue

thats one thing i like about puppy
it runs by default as root
the only person a passwd has ever kept out of my system is me

will continue to experiment and report

wanderer

User avatar
rockedge
Posts: 1864
Joined: Wed 11 Apr 2012, 13:32
Location: Connecticut, United States
Contact:

#33 Post by rockedge »

I used the most recent script and again created a directory /mnt/sda1/FirstRib-2
I ran the 64 bit script from a Bionic64-v8 host

I installed bash, xorg-minimal xorg-fonts xf86-input-synaptics xf86-video-intel and then leafpad.....all of it works well.

also the terminal functions normally again

wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

#34 Post by wiak »

rockedge wrote: I installed bash, xorg-minimal xorg-fonts xf86-input-synaptics xf86-video-intel and then leafpad.....all of it works well.

also the terminal func
That's good news, rockedge, thanks. I presume you are using it from the chroot and not via some initramfs to boot it independently. If so, how are you sure that leafpad isn't just using the host's X window system, which is what would normally be the case?

wiak

wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

#35 Post by wiak »

EDIT: fix to backspace in bash at console was to install ncurses-base

Actually, I'm still having trouble with backspace after installing bash (history mechanism is working okay). It's strange, because I thought I tested that earlier and it was working - maybe I've done something daft this time round. Anyone else noticed backspace issue after installing bash and, if so, have you found fix?

I've been busy making simplest possible initramfs version of FirstRib today - just to show it can be booted on its own. That much has worked, though without pre-installing, for example, wifi components, the result is just a proof of concept since just running then in RAM with no internet (and not thus able to use xbps with that one). I'm just doing that simple version (where initial firstrib_rootfs is part of the initramfs), along with void linux kernel, to illustrate how initramfs works at its simplest. But the one I'm experimenting with doesn't, for example set up overlays for save persistence, so just showing the rootfs booting and running in RAM only. Later, I'll add the overlayfs extras and most likely do a switch_root to firstrib_rootfs itself (one that may have wifi and more components added or available via sfs layer).

I'd publish that quick initramfs soon except I want to fix that bash backspace issue if I can first, hence my hoping I'm just imagining it... or that someone else has solved the problem in the meantime.

EDIT: cursor key history mechanism working with bash but not backspace key (i.e. when /bin/sh -> bash). Backspace key working with dash, but not history mechanism (i.e. when /bin/sh -> dash). Both histroy mechanism and backspace key working when /bin/sh -> busybox. Maybe something to do with not using getty here, and no actual login, though busybox sh certainly works fine... Oh well. I haven't had time to study how these mechanisms work and I better publish my simplest initramfs notes some time tomorrow, if I get round to that, before I forget the details. Takes time to write the steps though, and alas I suddenly hit with heavy cold/flu so not feeling like it right now. But I'll come back to it soonish if not quick.

wiak
Last edited by wiak on Sun 04 Aug 2019, 12:04, edited 1 time in total.

wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

#36 Post by wiak »

watchdog wrote:I have been keeping experimenting with a precise chroot jail taking suggestions from this thread and rufwoof posts.

http://www.murga-linux.com/puppy/viewto ... 62#1018462

Here is a collection of scripts to run some software from every puppy in the jail:
Sorry for the delay in responding watchdog. I was a bit bogged down on varous matters. Thanks a lot - I'm sure these recipes will come in very useful at some stage.

wiak

s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

#37 Post by s243a »

The backspace key issue might just be due to differences between the host and guest system. I had a similar issue with TazPup64 in a chroot with Slacko64.6.9.9.9 as the host but the issue went away when I actually booted up TazPup64.
Find me on [url=https://www.minds.com/ns_tidder]minds[/url] and on [url=https://www.pearltrees.com/s243a/puppy-linux/id12399810]pearltrees[/url].

wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

#38 Post by wiak »

Thanks s243a. We'll find out eventually then.

wiak

User avatar
rockedge
Posts: 1864
Joined: Wed 11 Apr 2012, 13:32
Location: Connecticut, United States
Contact:

#39 Post by rockedge »

If so, how are you sure that leafpad isn't just using the host's X window system, which is what would normally be the case?
Yes.
I think there are 2 leafpad's. The FIrstRib version is in /bin and the host system is /usr/bin
Attachments
Screenshot(29).png
(63.8 KiB) Downloaded 965 times

s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

#40 Post by s243a »

rockedge wrote:
If so, how are you sure that leafpad isn't just using the host's X window system, which is what would normally be the case?
Yes.
I think there are 2 leafpad's. The FIrstRib version is in /bin and the host system is /usr/bin
I think the actual XServer comes from the host but maybe some Xorg libs that interface with the server need to be on the guest.
Find me on [url=https://www.minds.com/ns_tidder]minds[/url] and on [url=https://www.pearltrees.com/s243a/puppy-linux/id12399810]pearltrees[/url].

User avatar
rockedge
Posts: 1864
Joined: Wed 11 Apr 2012, 13:32
Location: Connecticut, United States
Contact:

#41 Post by rockedge »

@s243a

I think you are correct. The X server is probably running with components from both the host and the chroot'ed file system.
But without the Xorg stuff installed in FirstRib leafpad wouldn't run.

I used in the FirstRib shell -> export DISPLAY=:0.0
then in the host -> xhost +

back in the FirstRib terminal then started /bin/leafpad and then using the menu File->Open looked around......leafpad could not see the host system's files

User avatar
rockedge
Posts: 1864
Joined: Wed 11 Apr 2012, 13:32
Location: Connecticut, United States
Contact:

#42 Post by rockedge »

I have FirstRib running in a nested x-server using JWM
Attachments
Screenshot(33).png
(98.95 KiB) Downloaded 945 times

wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

#43 Post by wiak »

rockedge wrote: I think there are 2 leafpad's. The FIrstRib version is in /bin and the host system is /usr/bin
Yes that is correct. You only need to install leafpad and its dependencies though (including some fonts or menus won't show up correctly). There are a lot of X-related dependencies, including whole gtk+ needed by leafpad. Once chroot is entered that acts like a jail of course so leafpad will indeed not see files outside of firstrib_rootfs.

As for backspace key and bash... If, starting from scratch build you install base-system, which is pretty much the whole of void Linux commandline-related stuff you should find backspace then working in bash.

xbps-install -Su base-system

So need to find out why. Not easy... Maybe the file /etc/login.defs is read by bash. That file in base-system contains definition of backspace key as a code. I'm in bed cos of flu so haven't tried simply making copy of that in basic firstrib, might be more needed anyway.

wiak

wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

#44 Post by wiak »

Nested X server nice. Rufwoof also posted about that and also pflask somewhere.

EDIT, about pflask, here:

http://murga-linux.com/puppy/viewtopic. ... 78#1025478

But see my post immediately below regarding Void Linux's own lightweight container system implementation.
Last edited by wiak on Thu 30 May 2019, 08:18, edited 3 times in total.

wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

#45 Post by wiak »

Void Linux does provide its own lightweight container system - I think I posted link about that earlier or search void wiki/docs. As far as nesting X goes there is older xnest and also xephyr.

EDIT:
https://voidlinux.org/news/2017/12/adve ... iners.html
Last edited by wiak on Thu 30 May 2019, 08:06, edited 1 time in total.

User avatar
rockedge
Posts: 1864
Joined: Wed 11 Apr 2012, 13:32
Location: Connecticut, United States
Contact:

#46 Post by rockedge »

so far the system is very fast and here is a shot with ROX installed and running
Attachments
Screenshot(34).png
(107.38 KiB) Downloaded 861 times

wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

#47 Post by wiak »

rockedge wrote:so far the system is very fast and here is a shot with ROX installed and running
Very nice. I must try this with something like tinycore or Slitaz. I like the idea of running one of these very small distros but with the full power of Void Linux available easily and conveniently via FirstRib.

wiak

wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

#48 Post by wiak »

In build_firstroot script, I use the construct:

Code: Select all

cat << INSIDE_CHROOT | chroot firstrib_rootfs sh
...
...
INSIDECHROOT
to execute commands inside the chroot from my buildscript.

I came across that method at third post down here:

https://askubuntu.com/questions/551195/ ... oot-how-to

However, I have now remembered fredx181 suggesting how to run commands from menu of host via a shell script, which would be useful here, and after searching for that, discover it is the exact same method he was suggesting.

Anyway, here is a modified example of what fredx181 wrote for starting, say leafpad, from host system via this shell script, which you just need to make executable. You could even create a desktop file for it in the host system's /usr/share/applications directory. Note this assumes you have installed leafpad (and necessary X libs that requires) in your firstrib_rootfs installation. Note that sometimes it may also be necessary to allow the chroot apps access to the host Xserver as rockedge has recently been doing:

per fredx181's suggestion: http://www.murga-linux.com/puppy/viewto ... 304#963304

Code: Select all

#!/bin/sh
# firstrib_leafpad.sh, run firstrib leafpad in chroot and exit when finished using it

mount --bind /proc firstrib_rootfs/proc
mount --bind /tmp firstrib_rootfs/tmp
mount --bind /dev firstrib_rootfs/dev
mount --bind /sys firstrib_rootfs/sys
mount -t devpts devpts firstrib_rootfs/dev/pts
cp /etc/resolv.conf firstrib_rootfs/etc/resolv.conf

cat << EOF | chroot firstrib_rootfs sh
export LC_ALL=C

##### start doing stuff here #####
leafpad # run program, can be any, if installed in firstrib_rootfs
# do some more
##### end of doing stuff #####

EOF

umount firstrib_rootfs/tmp
umount firstrib_rootfs/proc
umount firstrib_rootfs/dev/pts
umount firstrib_rootfs/dev
umount firstrib_rootfs/sys 
Using the above technique, (which will work with commandline apps too) you don't need to bother using mount_chroot.sh and umount.chroot.sh since setting up mounts and cleaning them at the end is being done within the above script anyway. As I said, you can even arrange using this technique for firstrib_rootfs apps to be run straight from host system menu.

Regarding Xauthority and xhost related matter, please also see my follow up post here:

http://www.murga-linux.com/puppy/viewto ... 307#963307

wiak

AndresC2
Posts: 76
Joined: Sun 09 Jul 2017, 02:12

#49 Post by AndresC2 »

hola wiak and wanderer

you need install BASH in tinycore from appbrowser

and change in your script

!#/bin/sh for

!#/bin/bash

only test in /root folder and run fine.

suerte : ]

wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

#50 Post by wiak »

AndresC2 wrote:hola wiak and wanderer

you need install BASH in tinycore from appbrowser

and change in your script

!#/bin/sh for

!#/bin/bash

only test in /root folder and run fine.

suerte : ]
Ah, thankyou AndresC2. It is because I accidentally used the bashism:

Code: Select all

mkdir -p firstrib_rootfs/{boot/kernel,dev/pts,etc/{skel,xbps.d},home/void,media,mnt,opt,proc,root,run,sys,tmp,usr/{bin,include,lib/{firmware,modules},lib32,libexec,local/{bin,include,lib,sbin,share},share/xbps.d,source},var/log}
I've fixed that in version 0.0.3 and it runs fine in tinycore now (wanderer should be pleased) without installing bash or changing !#/bin/sh.

I'll upload version 0.0.3 in a little while, once I've double checked it. Instead of manually creating /etc/group and /etc/passwd I'm now installing base-files, which is only a couple of hundred kilobytes but sets up lots of txt config files. Also, manually creating these files creates other problems when loading other void linux templates.

wiak

Post Reply