Technical issues/questions of an intermediate or advanced nature.
-
Ed_P
- Contributor
- Posts: 8369
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Post#16
by Ed_P » 21 Jul 2016, 19:59
Bogomips wrote:Fill with whatever Rubbish you want
Rubbish!! How about something that helps circumvent the 3.2 rc4 save.dat login problem? Namely the changes script I've made to manually save my changes as a mod.
mkmodchanges.sh
Code: Select all
#!/bin/bash
# Save 3.2 changes as a mod file
# Color definitions
txtbld=$(tput bold) # Bold
txtred=${txtbld}$(tput setaf 1) # Red
rst=$(tput sgr0) # Reset
function redpswd() {
echo -e "$1" $txtred
}
if [ `whoami` != "root" ]; then
redpswd "Enter root's password"
su -c "sh $0 $1"
exit
fi
echo $rst
if [ "$1" == "x" ]; then
echo 'find /mnt/live/memory/changes -iname "*" -mmin -3'
find /mnt/live/memory/changes -iname "*" -mmin -3
echo
exit
fi
if [ -d /tmp/mod/ ]; then
rm -rf /tmp/mod
fi
mkdir -p /tmp/mod
# copy modified files
cp -a --parents /home/guest/.config/nemo/* /tmp/mod/
cp -a --parents /home/guest/.config/gtk-3.0/* /tmp/mod/
cp -a --parents /home/guest/.config/dconf/* /tmp/mod/
cp -a --parents /home/guest/.cache/dconf/* /tmp/mod/
cp -a --parents /home/guest/* /tmp/mod/
cp -a --parents /home/guest/.mozilla/firefox/profiles.ini /tmp/mod/
cp -a --parents /home/guest/.mozilla/firefox/dxsqumip.default/places.sqlite /tmp/mod/
cp -a --parents /home/guest/.mozilla/firefox/dxsqumip.default/prefs.js /tmp/mod/
cp -a --parents /home/guest/.mozilla/firefox/dxsqumip.default/xulstore.json /tmp/mod/
cp -a --parents /home/guest/.cinnamon/configs/panel-launchers@cinnamon.org/* /tmp/mod/
cp -a --parents /etc/NetworkManager/system-connections/* /tmp/mod/
cp -a --parents /etc/usm/* /tmp/mod/
cp -a --parents /var/usm/ /tmp/mod/
du -h /tmp/mod/
echo
echo Press Enter to create module, Ctrl+C to end.
read
dir2xzm /tmp/mod /tmp/mychanges.xzm && rm -rf /tmp/mod
echo
ls -sh /tmp/*.xzm
echo
As you can see it's evolving.
If I recall you boot ISOs, so how do you save your changes?
Ed
Ed_P
-
Bogomips
- Full of knowledge
- Posts: 2564
- Joined: 25 Jun 2014, 15:21
- Distribution: 3.2.2 Cinnamon & KDE5
- Location: London
Post#17
by Bogomips » 21 Jul 2016, 20:50
Ed_P wrote:If I recall you boot ISOs, so how do you save your changes?
Manually.
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB
Bogomips
-
Ed_P
- Contributor
- Posts: 8369
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Post#18
by Ed_P » 22 Jul 2016, 02:08
^ Similar to what I am doing?
Ed
Ed_P
-
Bogomips
- Full of knowledge
- Posts: 2564
- Joined: 25 Jun 2014, 15:21
- Distribution: 3.2.2 Cinnamon & KDE5
- Location: London
Post#19
by Bogomips » 22 Jul 2016, 15:35
Proof of the Pudding
- Extramod
Code: Select all
guest@porteus:~$ cat /proc/cmdline
quiet from=/dev/sda10/tmp/iso/rc4/i586/Porteus-CINNAMON-v3.2rc4-i586.iso copy2ram ramsize=30% noauto rootcopy=/dev/sda4/cin_rcp guiexec=Prolog/pmx.sh cliexec=mount~--bind~/home/guest/p9/tmp~/tmp extramod=/dev/sda10/tmp/tst
guest@porteus:~$ df -h .
Filesystem Size Used Avail Use% Mounted on
aufs 265M 6.3M 258M 3% /
guest@porteus:~$ free -m
total used free shared buff/cache available
Mem: 880 331 72 254 476 137
Swap: 644 32 612
- Memory Modules
Code: Select all
guest@porteus:~$ cat /var/log/porteus-livedbg
# Recognized devices:
...
/dev/sdb1: UUID="23B9-F6C2" TYPE="vfat"
/dev/sdb2: UUID="3cedaa92-6cfd-4f71-8994-54ab948be7cc" TYPE="ext2"
# Booting device:
/mnt/isoloop
# Porteus data found in:
/mnt/isoloop/porteus
# Changes are stored in:
memory
# Non standard /rootcopy dir:
/dev/sda4/cin_rcp
# Modules activated during boot time:
/memory/copy2ram/000-kernel.xzm
/memory/copy2ram/001-core.xzm
/memory/copy2ram/002-xorg.xzm
/memory/copy2ram/003-cinnamon.xzm
/memory/copy2ram/Eds.xzm
ISO=/mnt/sda10/tmp/iso/rc4/i586/Porteus-CINNAMON-v3.2rc4-i586.iso
- Loops
Code: Select all
guest@porteus:~$ /sbin/blkid
...
/dev/sdb1: UUID="23B9-F6C2" TYPE="vfat" PARTUUID="2476153f-01"
/dev/sdb2: UUID="3cedaa92-6cfd-4f71-8994-54ab948be7cc" TYPE="ext2" PARTUUID="2476153f-02"
/dev/loop0: LABEL="Porteus" TYPE="iso9660"
/dev/loop1: TYPE="squashfs"
/dev/loop2: TYPE="squashfs"
/dev/loop3: TYPE="squashfs"
/dev/loop4: TYPE="squashfs"
/dev/loop5: UUID="ae83c3fb-dcb1-4a13-b2da-6e0cf2c71201" TYPE="ext2"
- Live
Code: Select all
guest@porteus:~$ ls -1 /mnt/live/memory/images/
000-kernel.xzm/
001-core.xzm/
002-xorg.xzm/
003-cinnamon.xzm/
Eds.xzm/
flashplayer-plugin-11.2.202.621-i386-1alien.xzm/
geany-1.25-i486-bundle.xzm/
gecko-mediaplayer-1.0.9.i686-pkg-1.xzm/
qtl.xzm/
terminator-0.97-i486-1_slack.xzm/
guest@porteus:~$ which super
/usr/bin/super
guest@porteus:~$ file Eds.xzm
Eds.xzm: Linux rev 1.0 ext2 filesystem data, UUID=ae83c3fb-dcb1-4a13-b2da-6e0cf2c71201 (large files)
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB
Bogomips
-
Ed_P
- Contributor
- Posts: 8369
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Post#20
by Ed_P » 22 Jul 2016, 17:44
Do you make your Eds.xzm module by copying /mnt/live/memory/changes to it or do you pick directories to copy to it?
Also, when booting from an ISO the ISO gets mounted as a loop, so do you need to use copy2ram?
Ed
Ed_P
-
Bogomips
- Full of knowledge
- Posts: 2564
- Joined: 25 Jun 2014, 15:21
- Distribution: 3.2.2 Cinnamon & KDE5
- Location: London
Post#21
by Bogomips » 22 Jul 2016, 21:16
Ed_P wrote:Do you make your Eds.xzm module by copying /mnt/live/memory/changes to it or do you pick directories to copy to it?
This was the item
Get some files here
http://forum.porteus.org/viewtopic.php? ... 069#p47371. A test example, taking files of super.xzm exploded into a directory and using them to populate Eds.xzm.
Ed_P wrote:Also, when booting from an ISO the ISO gets mounted as a loop, so do you need to use copy2ram?
Good question. You will see from above example that
copy2ram was used, but ISO still on loop, But I suppose as long as it's not hurting anyone, no cause for alarm. It's just one loop lost out of possible several hundred.
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB
Bogomips
-
Bogomips
- Full of knowledge
- Posts: 2564
- Joined: 25 Jun 2014, 15:21
- Distribution: 3.2.2 Cinnamon & KDE5
- Location: London
Post#22
by Bogomips » 25 Jul 2016, 14:29
- Obtain Connection to ISO file
Code: Select all
guest@porteus:~$ mkdir u
root@porteus:/home/guest# httpfs2 http://repo.ukdw.ac.id/slackware-live/latest/slackware-live-xfce-14.2.iso u
file name: slackware-live-xfce-14.2.iso
host name: repo.ukdw.ac.id
port number: 80
protocol: http
request path: /slackware-live/latest/slackware-live-xfce-14.2.iso
auth data: (null)
file size: 732954624
guest@porteus:~$ sudo ls u
slackware-live-xfce-14.2.iso
root@porteus:/home/guest# ls -l u
total 0
-r--r--r-- 1 root root 732954624 Jul 5 13:27 slackware-live-xfce-14.2.iso
- Mount the ISO file
Code: Select all
root@porteus:/home/guest# mkdir v; mount u/slackware-live-xfce-14.2.iso v
root@porteus:/home/guest# ls v
boot/ liveslak/
root@porteus:/home/guest# ls v/boot
generic initrd.img memtest syslinux/
root@porteus:/home/guest# ls v/liveslak
addons/ optional/ rootcopy/ system/
root@porteus:/home/guest# ls v/liveslak/rootcopy
root@porteus:/home/guest# ls v/liveslak/optional/
- Modules of the ISO
Code: Select all
root@porteus:/home/guest# ls -lh v/liveslak/system/
total 678M
-rw-r--r-- 1 root root 4.1M Jul 5 13:26 0000-slackware_boot-14.2-i586.sxz
-rw-r--r-- 1 root root 232M Jul 5 12:49 0020-slackware_min-14.2-i586.sxz
-rw-r--r-- 1 root root 121M Jul 5 13:23 0020-slackware_xapbase-14.2-i586.sxz
-rw-r--r-- 1 root root 306M Jul 5 13:18 0020-slackware_xbase-14.2-i586.sxz
-rw-r--r-- 1 root root 12M Jul 5 13:24 0020-slackware_xfcebase-14.2-i586.sxz
-rw-r--r-- 1 root root 4.4M Jul 5 13:25 0099-slackware_zzzconf-14.2-i586.sxz
root@porteus:/home/guest# ls -lh v/liveslak/addons/
total 0
root@porteus:/home/guest# umount v
root@porteus:/home/guest# umount u
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB
Bogomips
-
Ed_P
- Contributor
- Posts: 8369
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Post#23
by Ed_P » 25 Jul 2016, 16:44
Bogomips wrote:- Obtain Connection to ISO file
Code: Select all
guest@porteus:~$ mkdir u
root@porteus:/home/guest# httpfs2 http://repo.ukdw.ac.id/slackware-live/latest/slackware-live-xfce-14.2.iso u
httpfs2
How do you find these commands??
Ed
Ed_P
-
Bogomips
- Full of knowledge
- Posts: 2564
- Joined: 25 Jun 2014, 15:21
- Distribution: 3.2.2 Cinnamon & KDE5
- Location: London
Post#24
by Bogomips » 25 Jul 2016, 21:04
Ed_P wrote:httpfs2
How do you find these commands??
By reading
/opt/porteus-scripts/mloop and
http://man.cx/httpfs2
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB
Bogomips
-
Jack
- Contributor
- Posts: 1857
- Joined: 09 Aug 2013, 14:25
- Distribution: Porteus and Nemesis
- Location: USA
Post#25
by Jack » 25 Jul 2016, 21:46
Bogomips wrote:Ed_P wrote:httpfs2
How do you find these commands??
By reading
/opt/porteus-scripts/mloop and
http://man.cx/httpfs2
To bad you can't download them or in a PDF format.
I just like Slackware because I think it teach you about Linux to build packages where Ubuntu is like Windows you just install programs you want.
Jack
-
Ed_P
- Contributor
- Posts: 8369
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Post#26
by Ed_P » 26 Jul 2016, 05:18
Ok, someplace there was talk of creating a warning when the save.dat file got too full. I can't find where that talk took place but here is my response to it.
savedatspaceck.sh
Code: Select all
#!/bin/sh
# Add to /etc/rc.d/rc.local_shutdown. And make rc.local_shutdown executable.
# Color definitions
txtbld=$(tput bold) # Bold
txtred=${txtbld}$(tput setaf 1) # Red
rst=$(tput sgr0) # Reset
function redwarning() {
echo -e $txtred "$1" $rst
}
if [ -a /mnt/live/memory/images/changes ]; then
SDspace=$(df -h /mnt/live/memory/images/changes)
if [ "${SDspace:83:2}" -gt "85" ]; then
echo
redwarning "Warning! save.dat space: Used/Free - ${SDspace:70:17}"
echo
else
echo "save.dat space: Used/Free - ${SDspace:70:17}"
fi
fi
Plus an add to /etc/rc.d/rc.local_shutdown:
Code: Select all
#!/bin/sh
#
# rc.local_shutdown
#
# This script is executed at shutdown (rc0) and reboot (rc6).
# You need to make it executable before using.
#
# Example:
# /etc/rc.d/rc.samba stop
#
/home/guest/chromecache.sh
/home/guest/savedatspaceck.sh
For me this works but I suspect it won't for people with save.dat files larger than 999MB. Any suggestion how to handle larger files?
Ed
Ed_P
-
Bogomips
- Full of knowledge
- Posts: 2564
- Joined: 25 Jun 2014, 15:21
- Distribution: 3.2.2 Cinnamon & KDE5
- Location: London
Post#27
by Bogomips » 26 Jul 2016, 23:55
Jack wrote:Bogomips wrote:Ed_P wrote:httpfs2
How do you find these commands??
By reading
/opt/porteus-scripts/mloop and
http://man.cx/httpfs2
To bad you can't download them or in a PDF format.
Think need do full 14.2 Install after which gather up all man pages into a man page module. Iso itself 2.6 G:
http://mirrors.slackware.com/. From old alienbob live disk able to get some of the manpgaes, which have been using. However proper job IMHO to get all from full slackware installation.
Ed_P wrote:For me this works but I suspect it won't for people with save.dat files larger than 999MB. Any suggestion how to handle larger files?
Capitalising on experience of trying to make save.dat on ext2 filesystem, think this might also work with the xfs filesystem in save.dat. As saving changes on exit, this would be run on start up.
- Space Commands
Code: Select all
guest@porteus:~$ file p10/tmp/tst/Eds.xzm
p10/tmp/tst/Eds.xzm: Linux rev 1.0 ext2 filesystem data, UUID=ae83c3fb-dcb1-4a13-b2da-6e0cf2c71201 (large files)
guest@porteus:~$ ls --block-size=M -l p10/tmp/tst/Eds.xzm
-rw-r--r-- 1 guest users 16M Jul 26 22:24 p10/tmp/tst/Eds.xzm
guest@porteus:~$ ls -s --block-size=M p10/tmp/tst/Eds.xzm
9M p10/tmp/tst/Eds.xzm
- Size
Code: Select all
guest@porteus:~$ ls --block-size=M -l p10/tmp/tst/Eds.xzm
-rw-r--r-- 1 guest users 16M Jul 26 22:24 p10/tmp/tst/Eds.xzm
guest@porteus:~$ z=$(ls --block-size=M -l p10/tmp/tst/Eds.xzm)
-rw-r--r-- 1 guest users 16M Jul 26 22:24 p10/tmp/tst/Eds.xzm
guest@porteus:~$ z=${z%%M*}; echo $z
-rw-r--r-- 1 guest users 16
guest@porteus:~$ z=${z##* }; echo $z
16
- Allocated
Code: Select all
guest@porteus:~$ ls -s --block-size=M p10/tmp/tst/Eds.xzm
9M p10/tmp/tst/Eds.xzm
guest@porteus:~$ a=$(ls -s --block-size=M p10/tmp/tst/Eds.xzm)
guest@porteus:~$ a=${a%%M*}; echo $a
9
- Space Remaining and Estimated 8M for next lot of Changes
Code: Select all
guest@porteus:~$ let s=z-a; echo $s
7
guest@porteus:~$ c=8; # Expected max taken up by next changes
guest@porteus:~$ [[ c -gt s ]] && echo Could run out of space!
Could run out of space!
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB
Bogomips
-
Jack
- Contributor
- Posts: 1857
- Joined: 09 Aug 2013, 14:25
- Distribution: Porteus and Nemesis
- Location: USA
Post#28
by Jack » 27 Jul 2016, 02:49
Bogomips wrote:Think need do full 14.2 Install after which gather up all man pages into a man page module. Iso itself 2.6 G:
http://mirrors.slackware.com/. From old alienbob live disk able to get some of the manpgaes, which have been using. However proper job IMHO to get all from full slackware installation.
I didn't think of that but I will give it a try when I can.
I just like Slackware because I think it teach you about Linux to build packages where Ubuntu is like Windows you just install programs you want.
Jack
-
Ed_P
- Contributor
- Posts: 8369
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Post#29
by Ed_P » 27 Jul 2016, 03:56
Bogomips wrote:- Space Commands
Code: Select all
guest@porteus:~$ file p10/tmp/tst/Eds.xzm
p10/tmp/tst/Eds.xzm: Linux rev 1.0 ext2 filesystem data, UUID=ae83c3fb-dcb1-4a13-b2da-6e0cf2c71201 (large files)
guest@porteus:~$ ls --block-size=M -l p10/tmp/tst/Eds.xzm
-rw-r--r-- 1 guest users 16M Jul 26 22:24 p10/tmp/tst/Eds.xzm
guest@porteus:~$ ls -s --block-size=M p10/tmp/tst/Eds.xzm
9M p10/tmp/tst/Eds.xzm
I'm not seeing what you're seeing with these commands.
Code: Select all
guest@porteus:~$ ls -s --block-size=M /mnt/sda5/porteus3.0/changes/porteussave.dat
512M /mnt/sda5/porteus3.0/changes/porteussave.dat*
guest@porteus:~$ ls --block-size=M -s /mnt/sda5/porteus3.0/changes/porteussave.dat
512M /mnt/sda5/porteus3.0/changes/porteussave.dat*
guest@porteus:~$ ls -l --block-size=M /mnt/sda5/porteus3.0/changes/porteussave.dat
-rwxrwxrwx 2 root root 512M Jul 25 15:19 /mnt/sda5/porteus3.0/changes/porteussave.dat*
guest@porteus:~$ ls --block-size=M -l /mnt/sda5/porteus3.0/changes/porteussave.dat
-rwxrwxrwx 2 root root 512M Jul 25 15:19 /mnt/sda5/porteus3.0/changes/porteussave.dat*
guest@porteus:~$
ls -s and ls -l are both showing the file's allocated size not used size.
Ed
Ed_P
-
Bogomips
- Full of knowledge
- Posts: 2564
- Joined: 25 Jun 2014, 15:21
- Distribution: 3.2.2 Cinnamon & KDE5
- Location: London
Post#30
by Bogomips » 27 Jul 2016, 11:22
Jack wrote:I didn't think of that but I will give it a try when I can.
Would do it myself, but don't have space for a full installation
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB
Bogomips