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

#281 Post by wiak »

Sorry, in my haste I forgot I had moved "mount from" mountpoint after the overlay merge, so modules_remove plugin won't work yet, though the else code above should work for USB devices anyway. I'll fix the plugin code later today.

I'll be looking into this module remove issue more thoroughly over the coming week, but in the meantime should be able to address most issues via plugin 'fix' (once that plugin code is fixed...)


wiak

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

build_firstrib_initramfs04_s102.sh uploaded

#282 Post by wiak »

build_firstrib_initramfs04_s102.sh uploaded to first post of this thread.

Changes:

****NEW (in Revision 1.0.2):

The trim modules code in the initramfs/init (i.e. modprobe -r etc...) now force keeps ehci, xhci, and sdhci modules to ensure boot ability of usb-connected devices (i.e. previously could get kernel panic on kernel unable to switch_root to /sbin/init).

Can now externally change that trim modules code section via plugin modules_remove.plug. If empty file of that name put in /mnt/bootpartition/bootdir, the modules will not be trimmed at all. Alternatively, any code placed in that plugin will be used instead of the default initramfs/init modules trim code (allowing easy fix of any such issues). That is:

/mnt/bootpartition/bootdir/modules_remove.plug should now be sourced if it exists as a regular file. If you simply create modules_remove.plug as an empty file then initramfs/init will not attempt to auto-remove modules that are not in use - that may prove helpful for systems that fail to switch_root because they cannot find /sbin/init

Alternatively, /mnt/bootpartition/bootdir/modules_remove.plug can be used to provide alternative modules remove code inside initramfs04/init - that will allow on-boot modifications to that part of the code without having to decompress the initramfs04 first.

This code really all needs tested on variety of different hardware. I only have a couple of different computer models to test it on, which over the next week I shall do as thoroughly as I can.

However, external testing will speed up the process of finding universal fix if current build initramfs04 script produces initramfs04.gz that fails on some hardware; such failures could be addressed via specially tailored modules_remove.plug once I know about them and can ascertain what being-removed-module needs to instead be kept.

Anyway, please let me know details of any tests results. If reports of failure, please also find out exact details of the boot media device involved so we can track down any missing module requirements.

wiak

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

#283 Post by rockedge »

completed install of s101 successfully to a usb connected HDD
53 megs initramfs.gz
boots to void-login and so far have not tried the /rc.local trick with startx
connects to network and detects the wlan eth0 and lo and with ip link set eth0 up and ip link set lo up then udhcpc -i eth0

using Void kernel and here is the firstrib00.plug

Code: Select all

xbps-install -y base-minimal mc
xbps-install -y ncurses-base linux4.19 linux-firmware-network wifi-firmware shadow
pwconv # set up passwd system
grpconv
echo -e "root\nroot" | passwd >/dev/null 2>&1 # Quietly set default root passwd to "root" 
# you can add as many valid commandlines as you want in here
xbps-install -y xorg jwm rox bash xterm lxterminal geany adwaita-icon-theme
I would like to test if the firstrib00.plug can run the commands to rename the symlink /bin/sh from dash to bash and uncomment the en_US.UTF-8 UTF-8 in the /etc/default/glibc-locales and run

Code: Select all

xbps-reconfigure -f glibc-locales

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

#284 Post by rockedge »

I just started to work on s101..... now I will try s102...it takes me a few minutes to set up the systems! I will test s102 next. with those changes added to firstrib00.plug

then again it only takes minutes to run the scripts and have a working system and with a few more minutes it is quite easy to modify the OS into many desktop forms and shapes and how complex or simple as one desires.

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

#285 Post by rockedge »

Successful build of s102 32 bit is completed and booted.

running from a usb HDD using 55 megs of RAM and the initramfs.gz is 53 megs

DELL INSPIRON E1505 dual core 2gigs RAM

firstrib00.plug

Code: Select all

xbps-install -y base-minimal mc
xbps-install -y ncurses-base linux4.19 linux-firmware-network wifi-firmware shadow
pwconv # set up passwd system
grpconv
echo -e "root\nroot" | passwd >/dev/null 2>&1 # Quietly set default root passwd to "root"
# you can add as many valid commandlines as you want in here
xbps-install -y xorg jwm rox bash xterm lxterminal geany adwaita-icon-theme squashfs-tools
changed the /usr/bin/sh symlink from dash to bash


modified /etc/X11/xinit/xinitrc to this version (Note only the bottom lines have changed) ->

Code: Select all

#!/bin/sh

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap

# merge in defaults and keymaps

if [ -f $sysresources ]; then







    xrdb -merge $sysresources

fi

if [ -f $sysmodmap ]; then
    xmodmap $sysmodmap
fi

if [ -f "$userresources" ]; then







    xrdb -merge "$userresources"

fi

if [ -f "$usermodmap" ]; then
    xmodmap "$usermodmap"
fi

# start some nice programs

if [ -d /etc/X11/xinit/xinitrc.d ] ; then
 for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
  [ -x "$f" ] && . "$f"
 done
 unset f
fi

jwm &
rox -p default &
#xclock -geometry 50x50-1+1 &
#xterm -geometry 80x50+494+51 &
#xterm -geometry 80x20+494-0 &
exec xterm -geometry 80x66+0+0 -name login
then ran the script to build the initramfs.gz

all of it took under 15 minutes to finsh

_

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

#286 Post by wiak »

Great to hear s012 revision release is working on your system rockedge. Just want to check: is that with kernel=void?

wiak

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

#287 Post by rockedge »

yes it is with kernel=void

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#288 Post by rufwoof »

Code: Select all

./build_firstrib_rootfs_x86_64_008.sh;./build_firstrib_initramfs04_s102.sh kernel=void
with firstrib00.plug content of

Code: Select all

xbps-install -y linux4.19 base-system shadow xorg xinit xbitmaps terminus-font squashfs-tools alsa-utils pulseaudio pavucontrol jwm chromium tilda mtpaint mc galculator

# Root password
pwconv
grpconv
echo -e "root\nroot" | passwd >/dev/null 2>&1

# set root to use /bin/bash
usermod --shell /bin/bash root

# Network (wireless where ifconfig shows my device as wlp2s0)
echo "network={" >>/etc/wpa_supplicant/wpa_supplicant.conf
echo "  ssid=\"VM123456-2G\"" >>/etc/wpa_supplicant/wpa_supplicant.conf
echo "  psk=\"abcd1234\"" >>/etc/wpa_supplicant/wpa_supplicant.conf
echo "}" >>/etc/wpa_supplicant/wpa_supplicant.conf

# Prepare a /root/connect script we can run to network connect
echo "wpa_supplicant -i wlp2s0 -c /etc/wpa_supplicant/wpa_supplicant.conf -B" >/root/connect
echo "dhcpcd" >>/root/connect
echo "pulseaudio --start" >>/root/connect
chmod +x /root/connect
loadkeys uk
# So tilda continually runs
echo "#!/bin/sh" >/root/tilda.sh
echo "while :;do" >>/root/tilda.sh
echo "   tilda" >>/root/tilda.sh
echo "done" >>/root/tilda.sh
chmod +x /root/tilda.sh
echo "FONT=ter-i28b" >>/etc/rc.conf
echo "TIMEZONE=\"Europe/London\"" >>/etc/rc.conf
echo "KEYMAP=\"uk\"" >>/etc/rc.conf
echo "/root/tilda.sh &" >/root/.xinitrc
echo "setxkbmap -layout gb" >>/root/.xinitrc
echo "pavucontrol &" >>/root/.xinitrc
echo "chromium --no-sandbox &" >>/root/.xinitrc
echo "exec jwm" >>/root/.xinitrc
# Set dpi
echo "Xft.dpi: 144" >/root/.Xdefaults
ln -s /root/.Xdefaults /root/.Xresources
# Set locale
sed -i 's/#en_GB.UTF-8 UTF-8/en_GB.UTF-8 UTF-8/' /etc/default/libc-locales
xbps-reconfigure -f glibc-locales
# Change jwm tray clock to show date as well as time
sed -i 's/<Clock format="%H:%M">/<Clock format="%a %d %b %H:%M">/' /etc/system.jwmrc
# Add a MENU label to jwm tray
sed -i 's/TrayButton icon="jwm-blue"/TrayButton label="MENU" icon="jwm-blue"/' /etc/system.jwmrc

# Stop scroll wheel on jwm root window from scrolling through desktops
sed -i 's/<\/JWM>/<RootMenu onroot="4"\/>\
<RootMenu onroot="5"\/>\
<\/JWM>/' /etc/system.jwmrc

# Get Steven Blacks /etc/hosts file (form of ad-block)
rm /etc/hosts;wget -O /etc/hosts https://github.com/StevenBlack/hosts/blob/master/hosts?raw=true
I did change build_firstrib_initramfs04_s102.sh to add -comp lz4 to the mksquashfs line (faster compression, but larger filesize)

8m46s build time
01firstrib_rootfs.sfs 1.1GB filesize
initramfs04.gz 68MB filesize
vmlinuz-4.19.66_1 7MB filesize

Installed to HDD, booted using grub4dos with menu.lst entry of

title FirstRib (Void Linux Flavour)
root (hd0,0)
kernel /VOID/vmlinuz-4.19.66_1 bootfrom=/mnt/sda1/VOID
initrd /VOID/initramfs04.gz

Booting and running fine.
[size=75]( ͡° ͜ʖ ͡°) :wq[/size]
[url=http://murga-linux.com/puppy/viewtopic.php?p=1028256#1028256][size=75]Fatdog multi-session usb[/url][/size]
[size=75][url=https://hashbang.sh]echo url|sed -e 's/^/(c/' -e 's/$/ hashbang.sh)/'|sh[/url][/size]

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

#289 Post by wiak »

Thanks rockedge and rufwoof. Useful reports.

I successfully tried build using rufwoof's firstrib00.plug onto usb flash stick, and on 4GB laptop, booted that entirely into RAM (using kernel-line options changes=RAM copy2ram) followed by umount /mnt/sdb1 (i.e. unmounted and then removed usb flash stick); grub4dos menu.lst:

Code: Select all

title FirstRib WeeDog (void flavour)
 uuid beda5956-551f-429d-8f42-6d1fd1ad13ac
 kernel /firstrib5/vmlinuz usbwait=12 bootfrom=/mnt/sdb1/firstrib5 changes=RAM copy2ram
 initrd /firstrib5/initramfs04.gz

# where uuid was for my usb flash stick per command blkid report
wiak

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#290 Post by rufwoof »

wiak wrote:...and on 4GB laptop, booted that entirely into RAM (using kernel-line options changes=RAM copy2ram)...
I hadn't realised it was that easy to run in ram, thanks. Currently booted using HDD based copies of the vmlinuz, initrd and main sfs, also on a 4GB laptop.

Added libreoffice to the xbps-install line of my firstrib00.plug. With the build...initramfs script mksquashfs line extended to use lz4 compression (-comp lz4) that build in 15 minutes. But creates a near 2GB sfs filesize that wont boot entirely in ram on a 4GB ram system. Dropping the menu.lst copy2ram parameter however to leave just changes=RAM and it boots/runs fine, with all changes being lost on shutdown or reboot - which is the way I like it to run (reboot the exact same clean/pristine system each/every time). Obviously in the case of a usb based boot you wouldn't be able to umount/unplug the usb, so potentially the mbr/bootloader/vmlinuz ..etc. are open to be modified by a cracker, but its relatively easy to run a crude/simple intrusion detection test at each bootup to validate their integrity - something like http://murga-linux.com/puppy/viewtopic. ... 56#1021156
[size=75]( ͡° ͜ʖ ͡°) :wq[/size]
[url=http://murga-linux.com/puppy/viewtopic.php?p=1028256#1028256][size=75]Fatdog multi-session usb[/url][/size]
[size=75][url=https://hashbang.sh]echo url|sed -e 's/^/(c/' -e 's/$/ hashbang.sh)/'|sh[/url][/size]

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

#291 Post by wiak »

rufwoof wrote:But creates a near 2GB sfs filesize that wont boot entirely in ram on a 4GB ram system
Perhaps after installing/configuring zram?

https://wiki.voidlinux.org/Zram

wiak

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#292 Post by rufwoof »

Yes zram is one option. I however have a swap hdd partition configured, so thinking of setting that up as a encrypted swap, so that 'ram' is only limited by the size of that swap partition.

I've modified my firstrib00.plug script to also include installation of adwaita-icon-theme as some icons were missing (such as in pavucontrol). I've also added in the creation of a voiduser userid that can alternatively be logged into so that chromimum can be run without having to include the --no-sandbox switch i.e. chromium runs sandboxed that way. Additionally set it to auto net connect on bootup. So my firstrib00.plug now looks like ...

Code: Select all

xbps-install -y linux4.19 base-system shadow xorg xinit xbitmaps terminus-font squashfs-tools alsa-utils pulseaudio pavucontrol jwm chromium tilda mtpaint mc galculator adwaita-icon-theme libreoffice

# Root password
pwconv
grpconv
echo -e "root\nroot" | passwd >/dev/null 2>&1

# set root to use /bin/bash
usermod --shell /bin/bash root

# Network (wireless where ifconfig shows my device as wlp2s0)
echo "network={" >>/etc/wpa_supplicant/wpa_supplicant.conf
echo "  ssid=\"VM123456-2G\"" >>/etc/wpa_supplicant/wpa_supplicant.conf
echo "  psk=\"abcd1234\"" >>/etc/wpa_supplicant/wpa_supplicant.conf
echo "}" >>/etc/wpa_supplicant/wpa_supplicant.conf

# Prepare a /usr/local/bin/connect script we can run to network connect
echo "wpa_supplicant -i wlp2s0 -c /etc/wpa_supplicant/wpa_supplicant.conf -B" >/usr/local/bin/connect
echo "dhcpcd" >>/usr/local/bin/connect
#echo "pulseaudio --start" >>/usr/local/bin/connect
chmod +x /usr/local/bin/connect
loadkeys uk
# So tilda continually runs
echo "#!/bin/sh" >/root/tilda.sh
echo "while :;do" >>/root/tilda.sh
echo "   tilda" >>/root/tilda.sh
echo "done" >>/root/tilda.sh
chmod +x /root/tilda.sh
echo "FONT=ter-i28b" >>/etc/rc.conf
echo "TIMEZONE=\"Europe/London\"" >>/etc/rc.conf
echo "KEYMAP=\"uk\"" >>/etc/rc.conf
echo "/root/tilda.sh &" >/root/.xinitrc
echo "setxkbmap -layout gb" >>/root/.xinitrc
echo "pavucontrol &" >>/root/.xinitrc
echo "chromium --no-sandbox &" >>/root/.xinitrc
echo "exec jwm" >>/root/.xinitrc
echo "Xft.dpi: 144" >/root/.Xdefaults
ln -s /root/.Xdefaults /root/.Xresources

# Set system to run our connection script on bootup
echo "/usr/local/bin/connect" >>/etc/rc.local

# Set locale
sed -i 's/#en_GB.UTF-8 UTF-8/en_GB.UTF-8 UTF-8/' /etc/default/libc-locales
xbps-reconfigure -f glibc-locales

# Change jwm clock to also show date
sed -i 's/<Clock format="%H:%M">/<Clock format="%a %d %b %H:%M">/' /etc/system.jwmrc

# Show MENU in jwm tray
sed -i 's/TrayButton icon="jwm-blue"/TrayButton label="MENU" icon="jwm-blue"/' /etc/system.jwmrc

# Trap scrollwheel on jwm root window from scrolling through desktops
sed -i 's/<\/JWM>/    <RootMenu onroot="4"\/>\
    <RootMenu onroot="5"\/>\
<\/JWM>/' /etc/system.jwmrc

# Revise default jwm menu that include things we don't have installed by default
# ... comment out terminal and utilities menu items
sed -i 's/<Program icon="terminal.png"/<!-- <Program icon="terminal.png"/' /etc/system.jwmrc
sed -i 's/<Menu icon="folder.png" label="Utilities">/-->\
       <Menu icon="folder.png" label="Utilities">/' /etc/system.jwmrc
# ... comment out lock menu item
sed -i 's/<Program icon="lock.png" label="Lock">/<!--\
       <Program icon="lock.png" label="Lock">/' /etc/system.jwmrc
sed -i 's/<Restart label="Restart" icon="restart.png"\/>/-->\
       <Restart label="Restart" icon="restart.png"\/>/' /etc/system.jwmrc

# Get Steven Black's /etc/hosts file (form of ad-block)
rm /etc/hosts;wget -O /etc/hosts https://github.com/StevenBlack/hosts/blob/master/hosts?raw=true

# Set up voiduser userid (so we can login and run chromium within its sandbox)
useradd -m -s /bin/bash -U -G wheel,users,audio,video,cdrom,input voiduser
echo -e "voiduser\nvoiduser" | passwd voiduser >/dev/null 2>&1
cp /root/.xinitrc /home/voiduser/.xinitrc
cp /root/.Xdefaults /home/voiduser/.Xdefaults
ln -s /home/voiduser/.Xdefaults /home/voiduser/.Xresources
# voiduser doesn't need the --no-sandbox chromium parameter
sed -i 's/chromium --no-sandbox/chromium/' /home/voiduser/.xinitrc
chown voiduser:voiduser /home/voiduser/.Xdefaults
chown voiduser:voiduser /home/voiduser/.xinitrc

# SAL_USE_VCLPLUGIN env variable required for libreoffice menubar to be visible
echo "SAL_USE_VCLPLUGIN=gen export SAL_USE_VCLPLUGIN" >>/etc/profile
Last edited by rufwoof on Mon 19 Aug 2019, 12:40, edited 1 time in total.
[size=75]( ͡° ͜ʖ ͡°) :wq[/size]
[url=http://murga-linux.com/puppy/viewtopic.php?p=1028256#1028256][size=75]Fatdog multi-session usb[/url][/size]
[size=75][url=https://hashbang.sh]echo url|sed -e 's/^/(c/' -e 's/$/ hashbang.sh)/'|sh[/url][/size]

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#293 Post by rufwoof »

Libreoffice isn't showing the menu bar. Libre's suggestion, navigate to Tools, Options ...etc. .... Totally dumb as there's no menubar showing that you can select the Tools option from !!! LOL

EDIT:

Code: Select all

echo "SAL_USE_VCLPLUGIN=gen export SAL_USE_VCLPLUGIN">>/etc/profile
resolves the menubar not being visible

(edited the post immediately before this one to reflect that change)
Last edited by rufwoof on Mon 19 Aug 2019, 12:41, edited 2 times in total.
[size=75]( ͡° ͜ʖ ͡°) :wq[/size]
[url=http://murga-linux.com/puppy/viewtopic.php?p=1028256#1028256][size=75]Fatdog multi-session usb[/url][/size]
[size=75][url=https://hashbang.sh]echo url|sed -e 's/^/(c/' -e 's/$/ hashbang.sh)/'|sh[/url][/size]

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

#294 Post by wiak »

rufwoof wrote:Yes zram is one option.
I use zram for swap on my same laptop with XenialDog setup. However, it can also be used simply as a block device so am thinking of having a kernel-line option to provide for optional zram use for the /mnt/layer/RAM overlay layer. I'll experiment with both along with your firstrib00.plug build.

The other thing is, at s101 line 130 or so, I currently simply have:

Code: Select all

mount -o mode=1777,nosuid,nodev -n -t tmpfs inram /mnt/layers/RAM # might prefer size limit
which accepts tmpfs default size limit, which is 50% of available RAM. Next version will include a kernel-line option to allow setting that to some other value (e.g. 80%):

For example,

Code: Select all

mount -o mode=1777,nosuid,nodev,size=80% -n -t tmpfs inram /mnt/layers/RAM # might prefer size limit
wiak

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#295 Post by rufwoof »

Just to validate things work as expected (when running a kernel=void booted system), running

Code: Select all

mount -t tmpfs -o "remount,size=100%" tmpfs /mnt/layers/RAM
and my 4GB laptop system expands the size to 3.3GB

If I create and activate a 10GB swapfile on hdd

Code: Select all

touch /mnt/sda1/swapfile
chmod 600 /mnt/swapfile
dd if=/dev/zero of=/mnt/sda1/swapfile bs=1024K count=10000
mkswap /mnt/sda1/swapfile
swapon /mnt/sda1/swapfile
and run

Code: Select all

mount -o remount,size=13G /mnt/layers/RAM
then ...

Code: Select all

bash-5.0# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1       447G   45G  380G  11% /mnt/sda1
inram            13G   68M   13G   1% /mnt/layers/RAM
overlay_result   13G   68M   13G   1% /
run             1.7G  680K  1.7G   1% /run
dev             1.7G  4.0K  1.7G   1% /dev
shm             1.7G   32M  1.7G   2% /dev/shm
cgroup          1.7G     0  1.7G   0% /sys/fs/cgroup
tmpfs           1.7G   60K  1.7G   1% /tmp
and I can create a 10GB file in /root with that changes=ram booted session.
[size=75]( ͡° ͜ʖ ͡°) :wq[/size]
[url=http://murga-linux.com/puppy/viewtopic.php?p=1028256#1028256][size=75]Fatdog multi-session usb[/url][/size]
[size=75][url=https://hashbang.sh]echo url|sed -e 's/^/(c/' -e 's/$/ hashbang.sh)/'|sh[/url][/size]

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

#296 Post by wiak »

rufwoof wrote:Just to validate things work as expected (when running a kernel=void booted system), running

Code: Select all

mount -t tmpfs -o "remount,size=100%" tmpfs /mnt/layers/RAM
and my 4GB laptop system expands the size to 3.3GB
Ah, that's good to know. I might release script update tomorrow or next day just with option to set /mnt/layers/RAM tmpfs size from grub menu.lst kernel-line. Leaving optional zram implementation till later, after more experimenting/testing since there are several possiblities including as block device or swap or in addition to uncompressed tmpfs (which uses swap when becoming full).

Haven't done much today at all in practice - kind of a waste of a day, though last couple of hours did assemble some zram-related notes.

As it happens, throughout FirstRib development I use "cherrytree notes" to enhance my thought processes and planning more generally (all in a rather disorganised manner unfortunately - just a quick scratchpad with no hierarchical or logical arrangement at all most of the time, since that takes too much thinking to arrange; but cherrytree "search all nodes" helps a lot to substitute for my limited memory). In the past I used to rely on my memory and tons of notes on paper - I'm surprised that ever worked, but cherrytree works well (mainly just cut and pasted webpage extracts and url links proving sufficient to keep me on track, with ideas together, most of the time).

wiak
Last edited by wiak on Mon 19 Aug 2019, 12:20, edited 1 time in total.

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#297 Post by rufwoof »

... so I changed build_firstrib_initramfs04_s102.sh to mount that swap and resize /mnt/layers/RAM ... code snippet ...

Code: Select all

# Create tmpfs in RAM should grub kernel line request copy2ram or changes=RAM
if [ \$copy2ram -eq 0 ] || [ "\$changes" == "RAM" ]; then
        mkdir -p /mnt/layers/RAM
        mount -o mode=1777,nosuid,nodev -n -t tmpfs inram /mnt/layers/RAM # might prefer size limit
# Rufwoof
mkdir /mnt/sda1
mount /dev/sda1 /mnt/sda1
swapon /mnt/sda1/swapfile
mount -o remount,size=10G /mnt/layers/RAM
# /Rufwoof
fi
==========================
(EDIT: also tested with a swap partition, had 461GB of unused hdd space so installed gparted and formatted that to linux-swap (/dev/sda3) and used

Code: Select all

swapon /dev/sda3
mount -o remount,size=461G /mnt/layers/RAM
instead in the above snippet, booted that and umounted /mnt/sda1 (where I frugally boot from) and successfully created a 10GB file under /root).
==========================

Rebooted with changes=RAM copy2ram boot parameters and whilst it complained about /mnt/sda1 already being used (as I'm booting from hdd frugal installed), it otherwise booted fine.

Code: Select all

[voiduser@void-live sda1]$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1       447G   43G  382G  11% /mnt/sda1
inram            10G  1.9G  8.2G  19% /mnt/layers/RAM
overlay_result   10G  1.9G  8.2G  19% /
run             1.7G  680K  1.7G   1% /run
dev             1.7G  4.0K  1.7G   1% /dev
shm             1.7G   15M  1.7G   1% /dev/shm
cgroup          1.7G     0  1.7G   0% /sys/fs/cgroup
tmpfs           1.7G   12K  1.7G   1% /tmp
[voiduser@void-live sda1]$ free -m
              total        used        free      shared  buff/cache   available
Mem:           3408         362         122        1886        2922         929
Swap:          9999           0        9999
That's with a largish sfs (nearly 2GB)

Code: Select all

[voiduser@void-live VOID]$ ls -lart
total 1965912
-rw-r--r--  1 root root    6973312 Aug 11 21:25 vmlinuz-4.19.66_1
-rwxr-xr-x  1  502  502       8482 Aug 18 01:18 build_firstrib_rootfs_x86_64_008.sh
-rwxr-xr-x  1 root root        266 Aug 18 11:14 doit.sh
-rwxr-xr-x  1 root root       1692 Aug 18 16:58 t
-rw-r--r--  1 root root       3815 Aug 19 12:04 firstrib00.plug
drwxr-xr-x 25 root  500       4096 Aug 19 12:56 ..
-rwxr-xr-x  1  502  502      20051 Aug 19 13:31 build_firstrib_initramfs04_s102.sh
drwx------ 16 1003 1003       4096 Aug 19 13:32 firstrib_rootfs
drwxr-xr-x 16 root root       4096 Aug 19 13:48 firstrib_rootfs_for_initramfs_sNNN
-rw-r--r--  1 root root 1935458304 Aug 19 13:52 01firstrib_rootfs.sfs
drwxr-xr-x  4 root root       4096 Aug 19 13:52 .
-rw-r--r--  1 root root   68612495 Aug 19 13:52 initramfs04.gz
[voiduser@void-live VOID]$
i.e. that includes chromium, libreoffice ...etc. and where the sfs is built with -comp lz4 compression (so quite light compression/larger file size).

Creating a large file just to check things are working ok

Code: Select all

[voiduser@void-live VOID]$ cd
[voiduser@void-live ~]$ dd if=/dev/zero of=bigfile bs=1024K count=7000
7000+0 records in
7000+0 records out
7340032000 bytes (7.3 GB, 6.8 GiB) copied, 61.352 s, 120 MB/s
[voiduser@void-live ~]$ ls -l bigfile
-rw-r--r-- 1 voiduser voiduser 7340032000 Aug 19 14:06 bigfile
[voiduser@void-live ~]$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1       447G   43G  382G  11% /mnt/sda1
inram            10G  8.7G  1.4G  87% /mnt/layers/RAM
overlay_result   10G  8.7G  1.4G  87% /
run             1.7G  680K  1.7G   1% /run
dev             1.7G  4.0K  1.7G   1% /dev
shm             1.7G  5.9M  1.7G   1% /dev/shm
cgroup          1.7G     0  1.7G   0% /sys/fs/cgroup
tmpfs           1.7G   12K  1.7G   1% /tmp
[voiduser@void-live ~]$ 

Code: Select all

[voiduser@void-live voiduser]$ pwd
/mnt/layers/RAM/upper_changes/home/voiduser
[voiduser@void-live voiduser]$ ls -lart
total 7168008
drwxr-xr-x 3 root     root             60 Aug 19 13:48 ..
-rw------- 1 voiduser voiduser         54 Aug 19 13:58 .Xauthority
drwxr-xr-x 3 voiduser voiduser         60 Aug 19 13:58 .local
drwxr-xr-x 6 voiduser voiduser        120 Aug 19 13:58 .cache
drwx------ 3 voiduser voiduser         60 Aug 19 13:58 .pki
-rw-r--r-- 1 voiduser voiduser 7340032000 Aug 19 14:06 bigfile
-rw------- 1 voiduser voiduser         20 Aug 19 14:06 .bash_history
drwx------ 6 voiduser voiduser        180 Aug 19 14:06 .
drwx------ 8 voiduser voiduser        160 Aug 19 14:11 .config
[voiduser@void-live voiduser]$ 
Conjecture that if booted from USB using a similar setup, with swap on HDD (or a swap partition), then the usb could be unplugged once booted. And that also opens up the potential to boot a system into 'ram' (plus swap) on more ram limited hardware. With the OS taking care of what's swapped in/out then main ram might be just loaded with 'what is necessary' and the rest being stored in swap such that the system might still run reasonably quickly.
Last edited by rufwoof on Mon 19 Aug 2019, 16:51, edited 3 times in total.
[size=75]( ͡° ͜ʖ ͡°) :wq[/size]
[url=http://murga-linux.com/puppy/viewtopic.php?p=1028256#1028256][size=75]Fatdog multi-session usb[/url][/size]
[size=75][url=https://hashbang.sh]echo url|sed -e 's/^/(c/' -e 's/$/ hashbang.sh)/'|sh[/url][/size]

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#298 Post by rufwoof »

A nice feature about ram booted is that you can use the current Void running version to build another version. For instance I cd to /mnt/sda1/VOID where I've frugally booted void from and (as root) run the doit.sh script I've created

Code: Select all

[voiduser@void-live voiduser]$ cd /mnt/sda1/VOID
[voiduser@void-live VOID]$ cat doit.sh
#!/bin/bash
rm 01firstrib_rootfs.sfs
rm -rf firstrib_rootfs
rm -rf firstrib_rootfs_for_initramfs_sNNN
rm initramfs04.gz
rm -rf upper_changes
rm vmlinuz-4.19.66_1
rm -rf work
sync
./build_firstrib_rootfs_x86_64_008.sh
./build_firstrib_initramfs04_s102.sh kernel=void
[voiduser@void-live VOID]$ 
and once that completes its ready to be re-booted into that new version.
[size=75]( ͡° ͜ʖ ͡°) :wq[/size]
[url=http://murga-linux.com/puppy/viewtopic.php?p=1028256#1028256][size=75]Fatdog multi-session usb[/url][/size]
[size=75][url=https://hashbang.sh]echo url|sed -e 's/^/(c/' -e 's/$/ hashbang.sh)/'|sh[/url][/size]

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#299 Post by rufwoof »

Both skippy-xd and xlunch are available in the xbps-install repo's.

I've set a top left hot corner to show skippy-xd (first picture below, where you can click on one of the windows to switch to that window), and bottom left corner to show xlunch (list of programs)
Attachments
b.png
(44.17 KiB) Downloaded 488 times
a.png
(13.82 KiB) Downloaded 440 times
Last edited by rufwoof on Tue 20 Aug 2019, 00:22, edited 1 time in total.
[size=75]( ͡° ͜ʖ ͡°) :wq[/size]
[url=http://murga-linux.com/puppy/viewtopic.php?p=1028256#1028256][size=75]Fatdog multi-session usb[/url][/size]
[size=75][url=https://hashbang.sh]echo url|sed -e 's/^/(c/' -e 's/$/ hashbang.sh)/'|sh[/url][/size]

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

#300 Post by wiak »

rufwoof wrote:Conjecture that if booted from USB using a similar setup, with swap on HDD (or a swap partition), then the usb could be unplugged once booted. And that also opens up the potential to boot a system into 'ram' (plus swap) on more ram limited hardware. With the OS taking care of what's swapped in/out then main ram might be just loaded with 'what is necessary' and the rest being stored in swap such that the system might still run reasonably quickly.
Yes, also with zram for swap in RAM, the swap size can be (reasonably) up to around twice the actual physical RAM. And uncompressed tmpfs starts swapping (into say that zram swap) once it is under pressure. My plan is to provide the options via grub kernel line and then allow the user to set which facility and how much (size) of each part they want since nice to allow flexibility. Later can put in a boot menu that is user configurable. So many possibilities it sometimes makes my head spin - I'm taking it slow at the moment since needing a rest. So very happy to watch all the progress, which also tests the current system for reliability before further small but significant additions/upgrades.

wiak

Post Reply