Build scripts for small debian live images (similar to woof)

A home for all kinds of Puppy related projects
Message
Author
anikin
Posts: 994
Joined: Thu 10 May 2012, 06:16

#81 Post by anikin »

emil wrote:could you describe how nodm failed? From your post I see you are loged in as user - Do you have the old version of the hook, where the autologin is set to user in the /etc/default/nodm file?
Somewhere closer to the end of the build, there was a message like "no run level operations are allowed" - that must be nodm hook, I thought. The first boot was to user, I shutdown, unsquashed the build, set nodm to root, like I did the first time, resquashed ... and booted again to user.
emil wrote:I also wonder about packages failing to install. If they are in the repos of the sid distribution they should be found...
The packages are in the repo, I added geany via apt-get, version 1.23.1 - typing this in it.
emil wrote:I would be very curious about any new modifications and also about testing persistence with the modifications Toni suggested or setting full persistence with
Code:
/ union
.
in persistence.conf
I'm going to ask saintless for help via PM, as I don't quite understand this persistence stuff in Debian Live and don't want to sidetrack the threads. All I need is to run without a save file, remastering the main squashfs like I do in Puppy.
I will do some more builds, later on and will share the result.

User avatar
saintless
Posts: 3862
Joined: Sat 11 Jun 2011, 13:43
Location: Bulgaria

#82 Post by saintless »

emil wrote:I would be very curious about any new modifications and also about testing persistence with the modifications Toni suggested or setting full persistence with

Code: Select all

/ union
.
in persistence.conf
Hi, Emil, Anikin and anyone interested testing full persistence.

Here is archive with 1 Gb save file with lib_link symlink to /lib included and persistence.conf with the content from my example post:
http://www.smokey01.com/saintless/01-Gb ... ink.tar.gz
/lib_link symlink to /lib is inside the save file and will work.
Extract it and add persistence to kernel boot line.
Note it has to be extracted on different partition.The boot partition is mounted read-only and will not load persistence file from boot partition.
Test it with more than one squashfs module loaded. Install for example one program and create second module:

Code: Select all

mksquashfs /live/cow /live/image/live/02.squashfs
Then reboot with 01 and 02 squashfs modules in /live using persistence file.
If /var/lib/dpkg/status file has information for the new installed program in 02.squashfs after boot everything is ok.
You can check status file with text editor or with:

Code: Select all

apt-get purge my-new-installed-program-name
Then create file or folder in /lib and see if it is there after reboot. If it is full persistence is working.

Toni

emil
Posts: 633
Joined: Tue 10 Nov 2009, 08:36
Location: Austria
Contact:

#83 Post by emil »

Hi saintless,

you are helpful and resourceful as always. I will test it.
I saw a post from William at the Debian-light-wheezy thread, that it is possible to label the persistence file (-L persistence) and add a line to grub so that it will be entered in the partition table. This would allow to have the persistence file on the same partition than the frugal install (lib/live folder).
Code:

Code: Select all

title DebianDog on /dev/sda1
  partnew (hd0,3) 0x0 (hd0,2)/live-rw
  kernel (hd0,2)/live/vmlinuz1 boot=live config persistent quickreboot noprompt autologin
  initrd (hd0,2)/live/initrd1.img
This is noteworthy because it will work on NTFS partions too and I can remember sometimes ago we had endless debates about that 'frugal install on NTFS'.

It seems all a bit overcomplicated to me, also I quite don't understand how to completely change naming schemes (from live-rw, home-rw), but the debian live guys probably had their reasons and maybe we will find out how one could use all those new nifty features.
so sudo su, cats and dogs
emil

User avatar
saintless
Posts: 3862
Joined: Sat 11 Jun 2011, 13:43
Location: Bulgaria

#84 Post by saintless »

Hi, Emil.
Yes, I remeber the NTFS persistent file discussion :)
For me the best way if the computer have enough RAM is to use toram=01-filesystem.squashfs to copy the main module in RAM.
With RAM 512 Mb or more and squashfs module 100-200 Mb it is the best and save way to get persistent on NTFS partition.
William found different way to boot frugal from NTFS partition but it needs another partition to point to the NTFS one. This new partition can be very small or with no size from what I understood but second partition is needed. This makes esier to use another partition or toram option.

Toni

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

#85 Post by mcewanw »

saintless wrote: William found different way to boot frugal from NTFS partition but it needs another partition to point to the NTFS one. This new partition can be very small or with no size from what I understood.
Yes, it is zero size, because it is not really that you need another partition, just another free partition table entry (any free partition table entry will do).

Code: Select all

title DebianDog on /dev/sda1
  partnew (hd0,1) 0x0 (hd0,0)/mydebian-rw
  kernel (hd0,0)/live/vmlinuz1 boot=live config persistent quickreboot noprompt autologin
  initrd (hd0,0)/live/initrd1.img
In the above example, the live file is renamed mydebian-rw and it is stored on /dev/sda1. The second partition wasn't being used, so the partition table entry hd0,1 is being pointed to the live file mydebian-rw on hd0,0 (i.e. /dev/sda1).

Regarding the live file name, the trick here is however that the live file named mydebian-rw still has to be given the VOLUME LABEL "live-rw" when using saintless's cow type method or "persistence" when using Debian standard live Wheezy method. So with this partition 'redirection' method, you can store the live file on ntfs if you want and rename it to any file name you wish. If the file is ext2 type then you can change its volume label with e2label command. The volume label is essential when storing live file on ntfs or Debian can't find it anyway.

Notes: I actually created a zero sized partition to make sure I had that extra partition table entry - that may not be necessary (but it is very important you really aren't already using the partition for something). The ntfs disk I did this was completely allocated by its existing 3 partitions, so the 4th partition was purely a dummy one of no size. In practice, it is probably usually more sensible to use hd0,3 as the empty partition entry, since you might later want to use partition hd0,1 and hd0,2 for extra partitions. I haven't tested to see if logical/extended partition entry could be used though I see no reason why not.

Note that there is a mistake in title (mine) in the grub4dos menu.lst stanza emil quoted a few posts up for (hd0,2). In that example, I was booting from /dev/sda3 (not /dev/sda1), which I've now fixed in my original post. The new example, in this post, is for live file stored on /dev/sda1
github mcewanw

anikin
Posts: 994
Joined: Thu 10 May 2012, 06:16

#86 Post by anikin »

Hi emil,

I've come across this script (20nodm_sid.sh), that crunchbang uses for nodm:

Code: Select all

#!/bin/sh

# This is a hook for live-helper(7) to install nodm and remove gdm in squeeze/sid.
# To enable it, copy or symlink this hook into your config/chroot_local-hooks
# directory.

apt-get autoremove --yes gdm --purge
apt-get install --yes nodm --force-yes
Do you think it's a good idea to remove gdm, prior to installing nodm?
If yes, where exactly should I put this "apt-get autoremove --yes gdm --purge" line?

One more, this one is from CAT-scripts-0.41/modules/jwm:

Code: Select all

#!/bin/bash

#
#*****************************************************************************
#   Copyright (C) 2012 Thierry Monteil <sage-debian-live!lma.metelu.net>
#
#  Distributed under the terms of the GNU General Public License (GPL)
#  as published by the Free Software Foundation; either version 2 of
#  the License, or (at your option) any later version.
#                  http://www.gnu.org/licenses/
#*****************************************************************************
#
# This is a hook script allows to start nodm at startup.

sed -i 's/^NODM_ENABLED.*/NODM_ENABLED=true/g' /etc/default/nodm
sed -i 's/^NODM_USER.*/NODM_USER=user/g' /etc/default/nodm
shouldn't it be "NODM_USER=root"?

And the last one. I would like to use your original build scripts in the future, taking what I like from CAT and customize them to my needs. Am I correct in thinking, that the underlying code in both scripts has remained unchanged, you only added new modules to CAT?

Thank you in advance.

emil
Posts: 633
Joined: Tue 10 Nov 2009, 08:36
Location: Austria
Contact:

#87 Post by emil »

Hi anikin,
I think we dont need the line to remove gdm, because it is not installed by the scripts. We also don't need the install nodm line, because package installation is managed over the modules in the script.

If you want default root login, then replace user with root in the hook (or probably comment the line will also work). I havent tried to use graphical login managers, e.g. xdm instead of nodm. I think it would also work, and you get a a graphical login screen.

The scripts were not changed in principle between the 2 versions, if you copy modules from the 2nd version to the 1st it should mostly work, although be prepared to fix the occasional bug.
Last edited by emil on Wed 19 Feb 2014, 17:18, edited 1 time in total.

emil
Posts: 633
Joined: Tue 10 Nov 2009, 08:36
Location: Austria
Contact:

persistence

#88 Post by emil »

After some testing I found the configuration

Code: Select all

/ union
in persistence.conf works for me and the overlay then works similar to puppy savefile.
In my build the package pciutils is missing for configuration of wifi, I will include this in my next builds, however those will not happen in the near future. In the meantime I have a working system and I will do some slow testing.
Have fun 8)
emil

User avatar
wibble
Posts: 76
Joined: Thu 11 Jul 2013, 03:48

#89 Post by wibble »

can I ask how would I install this on a microsd? is there a command line option i can use from puppy/tool or will I need to use windows?

emil
Posts: 633
Joined: Tue 10 Nov 2009, 08:36
Location: Austria
Contact:

#90 Post by emil »

http://www.debian.org/releases/stable/i ... 03.html.en

might be as easy as to do

Code: Select all

cp debian.iso /dev/sdX
sync
this will overwrite contents on the card.

There are several other possibilities, like using programs like "unetbootin" or
maybe try the method described here:

http://www.murga-linux.com/puppy/viewto ... 105#411105
although this will need probably adaption to the debian live settings(folder live).

maybe post what worked for you, thanks in advance
emil

efgee
Posts: 34
Joined: Thu 08 Apr 2010, 19:56

#91 Post by efgee »

To add what emil said:
I have an sd card reader built into my laptop but it's not accessible during boot.
So I suppose the sd-card electronics are not hooked up (internally) over an usb interface but directly to another port.
This being said: Hope your hardware enables sd-card booting.

On a more important note:

GOOD JOB EMIL AND ALL OTHERS INVOLVED!!!

Was able to follow the read.me file and create two iso files.
One wheezy-32-bit and one wheezy-64-bit.
Both boot nicely as long the directory name stays "live".
Cannot change it to "live32" or "live64".
But other than that it's awesome what you achieved.

BTW: in order to make the 64 bit version I had to edit:
the config/default file:
change ARCHITECTURE='i386' to ARCHITECTURE='amd64'.
comment out all the LINUX_FLAVOURS.

Now edit the config/CAT file:
comment out LINUX_FLAVOURS='486' as it's not needed.

This have been all the changes I had to do.

Awesome... really stocked I am.

Live long and prosper :wink:

User avatar
saintless
Posts: 3862
Joined: Sat 11 Jun 2011, 13:43
Location: Bulgaria

#92 Post by saintless »

efgee wrote:Cannot change it to "live32" or "live64".
You can move /live inside /live32 and use something like this example:

Code: Select all

title Live32
  root (hd0,0)
  kernel /live32/live/vmlinuz boot=live config live-media-path=/live32/live quickreboot noprompt autologin
  initrd /live32/live/initrd.img 
Toni

User avatar
wibble
Posts: 76
Joined: Thu 11 Jul 2013, 03:48

#93 Post by wibble »

emil wrote:http://www.debian.org/releases/stable/i ... 03.html.en

might be as easy as to do

Code: Select all

cp debian.iso /dev/sdX
sync
this will overwrite contents on the card.

There are several other possibilities, like using programs like "unetbootin" or
maybe try the method described here:

http://www.murga-linux.com/puppy/viewto ... 105#411105
although this will need probably adaption to the debian live settings(folder live).

maybe post what worked for you, thanks in advance
emil
I tried the cp CAT-0.2.iso /dev/sde with sync

but when I look at the mnt/sde

its just a bunch of garbage and nothing is written.

what is wrong?

the iso image is fine, the card was fine before.

both the iso image and the card were mounted and I know that was the correct drive.

Perhaps I am missing the obvious but why is it so difficult to copy a iso image to a device?

Ok, I unmounted the devices, and when I remounted sde the iso image is there.... weird..
Attachments
grrrr.jpg
another robust and fault resistant command...
(163.1 KiB) Downloaded 635 times

User avatar
saintless
Posts: 3862
Joined: Sat 11 Jun 2011, 13:43
Location: Bulgaria

#94 Post by saintless »

wibble wrote:Perhaps I am missing the obvious but why is it so difficult to copy a iso image to a device?
From my experience the only 100% working way to copy bootable iso on bootable usb from linux is to use Unetbootin. Use Fat 32 formated sdcard - I don't know way but Fat32 works best this way for USB stick. Haven't test it with sdcard but it should work the same way. If you like to try here is an instruction with pictures:
http://foxyroxylinux.com/viewtopic.php?f=6&t=133
Or from Windows.
http://foxyroxylinux.com/viewtopic.php?f=6&t=110

I think Unetbootin has puppy linux pet package.

Toni

User avatar
wibble
Posts: 76
Joined: Thu 11 Jul 2013, 03:48

#95 Post by wibble »

hi
package manager said there is no package available.

downloaded it from the website and surprise surprise its broken. (or I should say my distro is broken.. am installing the dependency now so hopefully it should work after that.)

Thanks for the walk through - thats very helpful and explained alot.

Sometimes I wish in this time of cheap storage that there was a way to have a monolithic executable binary of applications so there would not be this constant stream of annoying broken packages.

Not to be critical but how is puppy linux a feasible desktop when you keep having to use windows to do simple things?

It just seems bizarre that there is not a way to do this from the terminal. I am guessing that unetbootin has to have some way of preparing the medium. as possibly I can't get the app to work properly.

User avatar
saintless
Posts: 3862
Joined: Sat 11 Jun 2011, 13:43
Location: Bulgaria

#96 Post by saintless »

You can try the suggetsed method from Sickgut here using dd command.
http://foxyroxylinux.com/viewtopic.php?f=6&t=133
It is not linux general problem having working package without troubles. If you can boot Cat-0.41, or Light-Wheezy, Or Porteus-Wheezy you just need to do:

Code: Select all

apt-get update
apt-get install unetbootin
Puppy package manager issue is the reason to have this debian-live projects here.

Toni

User avatar
wibble
Posts: 76
Joined: Thu 11 Jul 2013, 03:48

#97 Post by wibble »

saintless wrote:You can try the suggetsed method from Sickgut here using dd command.
http://foxyroxylinux.com/viewtopic.php?f=6&t=133
It is not linux general problem having working package without troubles. If you can boot Cat-0.41, or Light-Wheezy, Or Porteus-Wheezy you just need to do:

Code: Select all

apt-get update
apt-get install unetbootin
Puppy package manager issue is the reason to have this debian-live projects here.

Toni
Hi Toni, Thanks for the help - I got the unetbootin dependency's sorted and am downloading CAT-0.41.iso now.

It appears that mtools is the "secret sauce" that enables the creation of bootable usb/flash media in linux.

Found the only real 'safe' way to format was g parted. everything else resulted in totally random behaviors (I guess thats down to the closed nature of flash memory and lack of tools.)

Lol turned the walls blue a few times when I didn't realize that when finding my new flash drive only had 120-130megs that was unwritable. Luckly a few mins with gparted and it was all good to go. Now to try and install CAT 0.41 and see what happens.

hmmm unetbootin cannot see the flash memory. :roll: :cry:

So how am i suppose to create the bootable image? in windows? this is hardly a out of the box solution.

I been puppy powned.
Last edited by wibble on Fri 21 Feb 2014, 15:48, edited 1 time in total.

efgee
Posts: 34
Joined: Thu 08 Apr 2010, 19:56

#98 Post by efgee »

saintless wrote:
efgee wrote:Cannot change it to "live32" or "live64".
You can move /live inside /live32 and use something like this example:

Code: Select all

title Live32
  root (hd0,0)
  kernel /live32/live/vmlinuz boot=live config live-media-path=/live32/live quickreboot noprompt autologin
  initrd /live32/live/initrd.img 
Toni
Thank you, will try it out as soon as I can.

BTW: is there a possibility to store some settings permanetely?

User avatar
saintless
Posts: 3862
Joined: Sat 11 Jun 2011, 13:43
Location: Bulgaria

#99 Post by saintless »

wibble wrote:hmmm unetbootin cannot see the flash memory. :roll: :cry:

So how am i suppose to create the bootable image? in windows? this is hardly a out of the box solution.
Sorry it does not work for your hardware, Wibble.
I would suggest to try newer version of Unetbootin but it will be difficult in puppy.
I would suggest to install latest Unetbootin from Cat-o.41 but you can't boot it.
I do not use Windows and can not offer more than the link with instructions I posted.

Toni

User avatar
saintless
Posts: 3862
Joined: Sat 11 Jun 2011, 13:43
Location: Bulgaria

#100 Post by saintless »

efgee wrote:BTW: is there a possibility to store some settings permanetely?
You can create or use save file called persistence or just use 1Gb example save file from here:
http://smokey01.com/saintless/1Gb-persi ... ive-rw.zip
It is ready with configuration file with content / union for full persistence inside.
Just extract it but not on your boot partition. It has to be on top on another partition. If you read first page and the previous page of this thread you will see instructions how to create manual save file and some other suggestions how to use it on boot partition and with different content of configuration persistence file. The easiest way is to use the example archive.
Important not - use persistence option in kernel boot line otherwise it will not work.

Toni

Post Reply