The officially official Devuan Forum!

You are not logged in.

#1 2017-04-23 14:06:42

rufwoof
Member
Registered: 2017-04-23
Posts: 9

Devuan Frugal

Downloaded the 1.0 Devuan RC liveCD iso file
Mounted the iso and extracted the initrd, vmlinuz and /live/filesystem files from that
Starting from a empty /dev/sda1, formatted to ext3, set the boot flag on, gave the partition a label of 'persistence'
grub4dos bootloader installed (that creates grldr and menu.lst files) to that partitions MBR
Created a persistence.conf file containing

echo / union >persistence.conf
echo >>persistence.conf

Moved the iso extracted initrd and vmlinuz files to the / folder
Created a /live folder and moved the filesystem.squashfs file into that folder
Created a /live/jessieamd64xfce file for the bootloader to be able to 'find'

In effect that creates a HDD installed liveCD type setup, that can be booted. Its also the persistence partition that liveCD type boot can save changes to. The same single partition is a boot, save and main filesystem containing partition. If you create a file type swap file then it can even also be the "swap partition".

cd to the live folder and extracted its content
unsquashfs -f -d /mnt/sda1 filesystem.squashfs

Edited menu.lst to look like

# menu.lst
color white/blue black/cyan white/black cyan/black
#splashimage=/tempest.xpm
timeout 3
default 0

title Devuan PERSISTENCE RW
find --set-root /live/jessieamd64xfce
kernel /devuan/vmlinuz boot=live username=devuan rw showmounts persistence persistence-label=persistence persistence-storage=filesystem
initrd /devuan/initrd

title Devuan PERSISTENCE RO
find --set-root /live/jessieamd64xfce
kernel /devuan/vmlinuz boot=live username=devuan rw showmounts persistence persistence-read-only persistence-label=persistence persistence-storage=filesystem
initrd /devuan/initrd

title Devuan FILESYSTEM ONLY RO
find --set-root /live/jessieamd64xfce
kernel /devuan/vmlinuz boot=live username=devuan
initrd /devuan/initrd

With those three boot choices you can either boot the content of the filesystem.squashfs only (third one in the list) but where no changes will persist across reboots, which is handy if other files get corrupted. Or you can boot where all changes are preserved as they're made (first one in the list); Or boot where changes aren't preserved across reboots (second one in the list). 2 and 3 are very similar at first, but if you boot RW and make changes then they'll be stored in the persistence partition (i.e. in my case sda1 partition files), which might then be booted read-only (1) that sees those prior changes (that will make it different from if you'd booted the unchanged version i.e. (3) that uses filesystem.squashfs).

2 and 3 are great for trying things out, perhaps some changes, and then being able to reboot without those changes being preserved. 1 is good for booting up, making changes (perhaps updates) and then perhaps rebooting using 2 or 3 again so that no further changes are preserved.

You can take that a step further, and set it up to boot as though a full install. Just add a chain from the grub4dos menu.lst to Grub's menu.lst (or whatever). Handy for when a kernel update occurs as persistence type boots don't usually cater for such kernel updates.

I use that all the time. Mostly I only boot (1) style to initially set things up the way I like and then I use (2) style so that I boot the exact same factory fresh/pristine version each and every time. Then when updates are apparent I'll boot (1) again and apply those updates

apt-get update
apt-get upgrade

and then reboot back to (2) again

If things turn bad and there are problems, I'll boot (3) style (original setup).

If a kernel update is required I'll boot as though a full install and apply the updates before booting (2) again.

(2) is a pain in that no changes aren't preserved across reboots. So browser bookmarks, orage calendar entries ... etc changes are all lost. However if you move the HOME folder to another partition then any changes are to that folder tree are preserved (diary/calendar/bookmarks ...etc.).

You can recreate a new /live/filesystem.squashfs at any time. Boot using another linux and
cd to the /live folder and run something like

mksquashfs /mnt/sda1 filesystem.squashfs -e live

mksquashfs and unsquashfs requires that squashfs-tools to have been installed from the repository
(apt-get install squashfs-tools).

So far I've setup
Kodi (multimedia)
Skype (telephone calls)
MasterPDFEditor (pdf editor)
Openshot (along with blender and inkscape that are required for it to work properly) for video editing
Audacity for sound editing

along with the more usual Libre office suite already being installed ...etc

Tweaked the layout to how I like (pretty much a empty canvas (desktop) ready to have work files dropped into, and with the more common programs I use in the panel. pavucontrol installed ... and sound/images all working great (listen/watch youtube in firefox whilst playing radio station using kodi ...etc.)

image.png
clickable thumbnails
image.png

Last edited by rufwoof (2017-04-23 17:25:23)

Offline

#2 2017-04-23 14:19:26

rufwoof
Member
Registered: 2017-04-23
Posts: 9

Re: Devuan Frugal

You can take that type of installation further.
If you create a ext3 file filesystem
dd if=/dev/zero of=somefile bs=1M count=4096
to create a 4GB sized file filesystem. And then format it
mkfs.ext3 somefile
then you can mount that
mkdir mountpoint
mount somefile mountpoint
... and copy a similar sort of setup into that.
In Debian, with some mods to initrd you can even have that as being writeable within a NTFS partition.
Which means that you can have a small boot USB containing initrd, vmlinuz and a live folder with a empty filesystem.squashfs ... that boots and finds that larger filesystem file (that might for instance be in the root folder of a NTFS partition ... that boots up and runs nicely.

A easy form of first user type setup. Download a small USB image and burn that to a USB stick for bootup purposes. Download a compressed version of that 'somefile', uncompress it on their Windows box ... and boot up Devuan smile (They do have to hard shutdown windows and disable secure boot).

And all changes can be persistent ... as before (or not if you so desire).

Offline

#3 2017-09-12 10:38:25

tyder
Member
From: Oslo, Norway
Registered: 2016-12-19
Posts: 4

Re: Devuan Frugal

I very much appreciate your posts on this!
I have used a setup from a similar, but far from identical, approach with Knoppix and Debian Live as my basic computer configuration for about 10 years, and I have no intention to change that. One important feature, is that it provides a very clean way to do multi-booting.

It involves compressed images and a persistent (loop-mounted) store - which may well reside on a Windows partition without initrd (minirt) tweaks-  basically two files plus kernel and initrd, in addition to volumes that are mounted as needed.  Changes to the compressed store is routinely handled by overlays in Knoppix, but I prefer to recreate ("remaster") the compressed file. It is not very hard or resource-demanding. The whole process took ca 10 min for a new 3.7G squashfs image for Debian 9.1.0 the other day, including things like darktable and dia, mysql and mariadb, octave, R and wxmaxima - and VMware Workstation 12.5.  I use the old legacy-grub for booting.

I would like to do this with Devuan too, and from your posts, it seems to be possible even without tweaking the initrd. (Such tweaking was occasionally done with Knoppix, for instance in order to use squashfs instead of cloop, or creating a pure 64 bit version as a hybrid of Knoppix and Debian.)

I'll try it out w/Devuan 1 and report the results.  I may also try with different kernels, as the stock 3.16 in practice does not work with latest VMware Workstation, and is very hard to get working with several newer pieces of hardware, like the Intel 3165 wireless.

Last edited by tyder (2017-09-12 10:50:46)

Offline

#4 2017-09-13 05:52:34

tyder
Member
From: Oslo, Norway
Registered: 2016-12-19
Posts: 4

Re: Devuan Frugal

Can report that the first step of devuan for multi-boot went very smoothly.
I ceated a directory dev10 on /dev/sda1 (among other directories there are deb830, deb910, knx671_0 - you get it) and copied in the contents of the Devuan live directory.
Next, I created a directory dev100 on /dev/sda6, where legacy grub is installed, with all the boot-related files

-r--r--r-- 1 root root     2048 May 21 17:50 boot.cat
-r--r--r-- 1 root root   164096 May 21 17:45 hdt.c32
-r--r--r-- 1 root root 32720842 May 21 17:45 initrd.img
-r--r--r-- 1 root root    40960 May 21 17:45 isolinux.bin
-r--r--r-- 1 root root     1184 May 21 17:45 isolinux.cfg
-r--r--r-- 1 root root   116624 May 21 17:45 ldlinux.c32
-r--r--r-- 1 root root   182552 May 21 17:45 libcom32.c32
-r--r--r-- 1 root root    23480 May 21 17:45 libutil.c32
-r--r--r-- 1 root root    13459 Mar 31 16:45 splash.png
-r--r--r-- 1 root root    26188 May 21 17:45 vesamenu.c32
-r--r--r-- 1 root root  3128768 May 21 17:45 vmlinuz

The best practice for the kernel and initrd is, I think, to make vmlinuz and initrd.img symlinks to version-qualified file names.  This way, only those links have to be updated at system upgrades. The only reason I can't start checking out Devuan 1 as main working OS right away, is the 3.16 kernel.

Then I created a (first) boot stanza for Devuan in  boot/grub/menu.lst;

title Devuan 1.0.0  sda1 no persistence
kernel (hd0,5)/boot/dev100/vmlinuz bootfrom=/dev/sda1 live-media-path=dev10/live boot=live username=devuan keyboard-layouts=no  nomce  tz=localtime
initrd (hd0,5)/boot/dev100/initrd.img

(Running under Debian 9.1.0 as host, but the procedure would have been the same with other host OS). I just guessed I could use the same parameters as Debian live.
Testing with kvm:

sudo kvm /dev/sda -m 2046 &

And choosing Devuan from the boot menu - it worked at the first try, network and all, but the keyboard layout wasn't right.

Nest step, I will try to get persistence up and running. This is very promising, I think :-)

Last edited by tyder (2017-09-13 05:58:42)

Offline

#5 2017-09-13 17:34:16

tyder
Member
From: Oslo, Norway
Registered: 2016-12-19
Posts: 4

Re: Devuan Frugal

After preparing a persistence file the standard Debian way, and adding a typical Debian-type persistence boot stanza

title Devuan 1.0.0  sda1 persistence sda8
      kernel (hd0,5)/boot/dev100/vmlinuz bootfrom=/dev/sda1 live-media-path=dev10/live boot=live persistence persistence-path=dev10_0p  username=devuan keyboard-layouts=no  nomce  tz=localtime
      initrd (hd0,5)/boot/dev100/initrd.img

I booted the system from grub boot menu in kvm. Worked perfectly at the first try, so now I have Devuan Jessie with persistence installed. Right now, I can't boot Devuan natively without sacrificing wifi connection on this computer, but I may copy the system to an older machine, It's just three directories with a few files: live-directory with squashfs image, perssitence directory and boot-files directory.

And now I can add an ASCII image in exactly the same way. Backing up the persistence file, it is always siimple to revert if testing under kvm shows that something has gone wrong.  And when a number of components have been successfully integrated, i repack ("remaster") the system to a new squashfs file, set up a new persisitent image and continue.

Not everything belongs naturally in a compressed image, however. Files already compressed, like Java jar files, don't shrink much on compression, if at all. They are better stored on their own partition, or on their own loop-mounted image, if we want to handle as few files as possible.

I find that it is still efficient to conform to the 4GB filesize of FAT32 for such files -  larger files /file collections belong on separate storage partitions, I routinely use one, mounted on /store.

Offline

Board footer