DebianDog HowTo thread

How to do things, solutions, recipes, tutorials
Message
Author
backi
Posts: 1922
Joined: Sun 27 Feb 2011, 22:00
Location: GERMANY

#76 Post by backi »

Cool compendium fred !

But just one question
Maybe my question is a bit naive .........

but could this also be accomplished by extracting a Debian Dog Iso (or any Debian live Iso ) ...
and just copying the live Folder to the " persistence " labeled partition (or into an Folder on it ) ?

If not ...what makes the difference--- what would be wrong with this idea ?

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#77 Post by fredx181 »

backi wrote:Cool compendium fred !

But just one question
Maybe my question is a bit naive .........

but could this also be accomplished by extracting a Debian Dog Iso (or any Debian live Iso ) ...
and just copying the live Folder to the " persistence " labeled partition (or into an Folder on it ) ?

If not ...what makes the difference--- what would be wrong with this idea ?
Not sure I understand well, if you mean:
Instead using empty filesystem.squashfs, just use the original?
Yes that can be also, see at EDIT in DD64 howto about this subject:
http://murga-linux.com/puppy/viewtopic. ... 339#916339
(but still the vmlinuz and initrd files must be in /boot (to be found when upgrading kernel/initrd)

I'm sure if you'd like to try with it, rufwoof or I will help you.

Fred

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

#78 Post by rufwoof »

fredx181 wrote:Note:Doing a kernel upgrade when using DebianDog openbox_xfce version 2016-10-16 you'll lose LZ4 support (booting and mounting LZ4 compressed .squashfs modules).
(because the official Debian kernel doesn't have it built in)
Debian stable does include lzop (lzo) support. lzo level 1 compression is pretty close to lz4 in my experience for speed. You can use busybox version to compress files, see
busybox lzop --help. mksquashfs and unsquashfs supports lzo ... but don't cater for compression level setting (I think it uses level 6 or 7).

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

#79 Post by rufwoof »

backi wrote:could this also be accomplished by extracting a Debian Dog Iso (or any Debian live Iso ) ...
and just copying the live Folder to the " persistence " labeled partition (or into an Folder on it ) ?
That's the way I originally did it. Opened the ISO and copied the /live folder to the HDD 'persistence' labeled partition, I then extracted the filesystem squashfs content to the root / level. That involves two stages as you can't extract to a non empty folder, so I just
unsquashfs -d /t filesystem.squashfs
to extract all files to a folder /t
and then dragged/dropped (moved) all of that /t folder content up to the / level (and then deleted the then empty /t folder).

EDIT just noticed Fred used the -f unsquash switch/parameter to extract things directly to a non-empty / folder ... neat, avoids having to to the two stage extract and move operation that I was using.

Then with everything extracted from the main filesystem squashfs is in effect redundant so you can create a empty version of that
cd /live
rm filesystem.squashfs
mkdir t
mksquashfs t filesystem.squashfs

You also have to edit /etc/apt/sources.list to add additional repositories such as contrib and non-free, mine looks like

###### Debian Main Repos
deb http://ftp.uk.debian.org/debian/ jessie main contrib non-free

###### Security
deb http://security.debian.org/ jessie/updates main contrib non-free

I later installed grub2 and either boot that by chaining from my grub4dos bootloader, or boot the frugal style directly i.e. my menu.lst looks something like

# menu.lst
color white/blue black/cyan white/black cyan/black
timeout 2
default 1

title Debian FULL Install RW
find --set-root /debian-usb
configfile /boot/grub/menu.lst
commandline

title Debian Jessie Frugal RO only saves if run flush2disk
find --set-root /live/frugalboot
kernel /vmlinuz boot=live timezone=Europe/London xorg-resolution=1280x768 config nofastboot persistence persistence-read-only persistence-label=persistence quickreboot noprompt showmounts live-media-path=/live/ config rw
initrd /initrd.img

Note that I created empty content debian-usb and frugalboot files specifically for grub4dos to 'find'.

IIRC when I installed grub2 I believe I installed to the partition rather than the mbr, and it set it up as a legacy grub2 i.e. created another menu.lst in the /boot/grub folder rather than standard grub2 format. That boot menu offers standard boot, single user boot and memtest boot modes ... and boots as though a fully installed version (read write, all changes written to disk as they occur etc.).

Uses 4.7GB of disk space in total on my system, that has quite a few other things installed (Libre, skype ..etc). I originally allocated 16GB of space to the partition (8GB would perhaps have been more than enough, but I didn't know how much space was likely to be used beforehand).

More often you can install updates within the frugal booted session. Ensuring you run flush2disk (modified version of save2flash) afterwards. In some cases however updates might fail, such as kernel or main libc updates. If so just don't save after trying that failed update, and reboot into the full/read-write session and run the updates again. That's about the only time I boot the full read/write mode (mostly boot frugal and more usually don't bother saving). As part of that approach (tending to frugal boot and not save), I've sym linked a home folder to the persistent layer, so any changes in that folder are preserved no matter what i.e. sym linked a ~/documents-persistent link to /lib/live/mount/persistence/sda1/documents-persistent. I also sym linked .osmo folder in a similar manner, so all changes in the diary/calendar/notes persist across reboots.

IME it boots slower and initially runs slower than pure frugal where everything is in a squashfs (as its reading uncompressed data from disk instead). But once its been running for a while there's little apparent difference in speeds. i.e. once you've loaded say Libre Calc once, that tends to remain memory bound (cached) anyway, so second/subsequent loads are just as quick either way.

I don't bother with sfs's anymore. Find it just as easy if not easier to boot frugally and install anything I want from the repository using apt-get or synaptic and then not bother saving that session. I am on a relatively fast internet connection however, such that installing via the net is pretty quick (seconds). For things I use more often, I just boot, install and then save the session (flush2disk), so they become part of the core 'full install' (and frugal boot) for all subsequent reboots.

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

#80 Post by rufwoof »

fredx181 wrote: (but still the vmlinuz and initrd files must be in /boot (to be found when upgrading kernel/initrd)
I have initrd.img and vmlinuz files in the / folder, that are sym links to actual initrd and vmlinuz files in the /boot folder (that have longer file names that show the versions).

i.e.

/vmlinuz sym link to /boot/vmlinuz-3.16.0-4-amd64
/initrd.img sym link to /boot/initrd.img-3.16.0-4-amd64

So menu.lst (grub4dos) can just point to those root level vmlinuz and initrd.img files

Seems to be updating ok i.e.

user@debian:~$ uname -a
Linux debian 3.16.0-4-amd64 #1 SMP Debian 3.16.36-1+deb8u1 (2016-09-03) x86_64 GNU/Linux

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

#81 Post by rufwoof »

This is the flush2disk that I currently use.

Uses dialog so not tied into gtk2 or gtk3 or whatever (dialog is more generic, but not as pretty).
Attachments
flush2disk.gz
remove fake .gz suffix and install to /usr/local/bin and make executable
(9.86 KiB) Downloaded 214 times

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

#82 Post by rufwoof »

Coincidental! A day later and Debian have updated the kernel (I noticed this morning after booting frugally and running apt-get update; apt-get upgrade). Rebooted without saving. Booted full read/write style and applied the updates before rebooting back into frugal again.

Now :
user@debian:~$ uname -a
Linux debian 3.16.0-4-amd64 #1 SMP Debian 3.16.36-1+deb8u2 (2016-10-19) x86_64 GNU/Linux

Its a security fix/update

https://www.debian.org/security/2016/dsa-3696

Code: Select all

Several vulnerabilities have been discovered in the Linux kernel that may lead to a privilege escalation, denial of service or information leaks.

    CVE-2015-8956 It was discovered that missing input sanitising in RFCOMM Bluetooth socket handling may result in denial of service or information leak.

    CVE-2016-5195 It was discovered that a race condition in the memory management code can be used for local privilege escalation.

    CVE-2016-7042 Ondrej Kozina discovered that incorrect buffer allocation in the proc_keys_show() function may result in local denial of service.

    CVE-2016-7425 Marco Grassi discovered a buffer overflow in the arcmsr SCSI driver which may result in local denial of service, or potentially, arbitrary code execution.

    Additionally this update fixes a regression introduced in DSA-3616-1 causing iptables performance issues (cf. Debian Bug #831014).
CVE-2016-5195 fixes the "Dirty COW" vulnerability (researchers have discovered attack code that indicates the Dirty COW vulnerability is being actively exploited in the wild) which has been present in the Linux kernel since version 2.6.22 in 2007, and is also believed to be present in Android http://thehackernews.com/2016/10/linux- ... ploit.html

User avatar
mikeslr
Posts: 3890
Joined: Mon 16 Jun 2008, 21:20
Location: 500 seconds from Sol

USB-Key Frugal Install with Grub4Dos from a Linux OS

#83 Post by mikeslr »

Hi All,

Edit: This post has been substantially edited in response to rcrsn51’s advice and to take advantage of the package fredx181 provided. See the next couple of posts. The attached weeinst4XenialDog64.tar.gz package is identical to the package fredx181 provided on the dCoreDog thread, except that I’ve edited the included menu.lst to use with XenialDog64, and the readme file to discuss some possible considerations.

Perhaps other Linux bootloaders can manage a Frugal Install to a USB-Key. But I’m familiar with booting the DebianDogs and Puppies using grub4dos, and grub4dos poses a challenge when running another Linux. It isn’t to be found on their Repositories.

Either the attached weeinst4XenialDog64.tar.gz or fred’s package can be used with other DebianDog and most Puppies, and applied to Hard-drives. Such usage is explained after the recipe for installing XenialDog64 to a USB-Key.

The following is based on my experience using Peppermint Linux. My memory is except for using firefox to download files, everything else had to be done as root/Administrator. [As I had previously preformed steps 1 thru 11 running Peppermint, the "weeinst..." package was tested by deleting gldr from the Key, then copying weeinst’s included files to it and performing Step 13 below].

Running peppermint linux, or any Ubuntu or debian [adjust as needed for your Linux of Choice]

1. Open synaptic and install gparted.
2. Plug in the USB-Key and start gparted.
3. Format the Key to Ext3 (or 4 and probably not 2). [2 is more easily corrupted, and 4 may be overkill]. Exit gparted.
4. Using your web-browser (peppermint’s default is firefox) download the attached weeinst4XenialDog.tar.gz. [By default under peppermint, firefox downloads stuff to your Downloads folder. That location will be assumed in the following Steps].
5. Using your web-browser download XenialDog64’s ISO.
6. Open the Linux Archive Manager, Select XenialDog64’s ISO, and extract the folder named casper to the Download folder.
7. Open the Linux Archive Manager, select weeinst4XenialDog64.tar.gz, and extract all the following files: grldr, menu.lst, readme, weeinst, wee.mbr. [Depending on your Archiver, these files may appear in the Download folder itself, or in a folder named weeinst4XenialDog64xxx in the Download folder].
8. Open the readme file and the menu.lst in a text editor and read them. Decide if you want to continue and/or make any changes to menu.lst. Make any such changes.
9. Close any “user
Attachments
weeinst4XenialDog64.tar.gz
Package to install mbr, grldr and menu.lst with instructions. See included readme and above to use with other Dogs and Puppies
(136.62 KiB) Downloaded 176 times
Last edited by mikeslr on Thu 06 Apr 2017, 01:19, edited 13 times in total.

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#84 Post by fredx181 »

Thanks Mike,

Just one other thing is also required and you didn't mention (but I may be wrong or have missed something):
The MBR needs to be installed also, otherwise it won't boot.
Here's a simple way that does it all :
http://murga-linux.com/puppy/viewtopic. ... 504#947504
(but it has dcore-xenial entry in included menu.lst, just replace that by any other, DebianDog, Xenialdog, Puppy etc..)

Fred

User avatar
mikeslr
Posts: 3890
Joined: Mon 16 Jun 2008, 21:20
Location: 500 seconds from Sol

Not sure MBR was necessary

#85 Post by mikeslr »

Thanks fred,

I'm not sure installation of mbr is necessary. My recipe left out trial and error steps I thought unnecessary. What actually happened was that when I opened my browser to the 'Lin n' Win' site (for the first time in years) I discovered it now offered instructions for Windows 7. Figuring those might use a more recent version of grldr, I followed them to the page which offered grldr for Windows 7. On that page was also a link to download grldr.mbr. So I downloaded and copied both to the root of the USB-Key,

That, however, didn't produce a bootable key, So IIRC, I ran gparted again and started from scratch resulting in the recipe in the previous post. But, maybe I didn't run gparted and only installed grldr from the XP instruction page.

Will examine the key to see if mbr is present. But, even if it isn't, the addition of mbr can't hurt and may be necessary for some computers.

Edit: A visual examination did not disclose grldr.mbr's presence. The Key, however, had originally been factory set as Fat32 and bootable. Examination of Key visually and via pfind shows nothing concerning it. But, that would be expected if mbr exists at the machine level. See the following posts, especially rcrsn51's.

As soon as I can, I'll revise my "recipe" to make use of the package fredx181 provided on the dcore thread.

mikesLr
Last edited by mikeslr on Mon 03 Apr 2017, 16:40, edited 2 times in total.

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

#86 Post by rufwoof »

I have managed to install grub4dosconfig from the DebianDog repository into a purer Debian installation and IIRC it worked other than leaving some kind of dialog (likely because of the lack of a required interface library (again IIRC dialog had been installed, so it wasn't that)). Not far off perhaps from being apt2sfs'd but using a more generic grub4dosconfig - so others could just activate it as a sfs in their Linux.

Currently I've been trying to get a image of a small usb boot loader that's grub4dos based. i.e. usb with grub4dos mbr installed, menu.lst, grldr ... and a initrd.img and vmlinuz of my choosing (in particular a initrd that's been modified to load up NTFS in read/write mode).

So far it works, but I used a 16GB USB to create a 64MB USB partition and dd copying that and dd writing back again results in 2 partitions/USB drives being shown (sdb1 and sdb2 of which sdb2 is inaccessible). Perhaps because I used dd of 80MB (bs=1M count=80) to copy the image.

What I'm looking at is to have a small (64MB) bootable USB image that can be downloaded and written to a USB, along with a main file filesystem (in my case a debian livecd type system single file) that can be downloaded onto either a ext or ntfs partition ... that the usb boots ... that provides two boot choices of either a read only session (no changes preserved), or a read/write session (all changes preserved). Other than the 2 usb partitions it seems to be working ok at present. Single large file of main filesystem, that can be moved between ext and ntfs and still boots ok. As and when I get that sorted that would be yet another method to more generally get a copy of a grub4dos type bootloader ... i.e. perhaps via a grub4dos sfs, or a small usb image.

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#87 Post by rcrsn51 »

fredx181 wrote:The MBR needs to be installed also, otherwise it won't boot.
Exactly. All GRUB bootloader variants have two parts. Stage1 is the boot code written into the Master Boot Record at the start of the drive. This can be done various ways - dd, bootlace.com, etc. It over-writes the standard MS-DOS boot code.

Stage2 is the set of auxiliary boot files. In Grub4Dos, that's grldr and menu.lst.

Lin'nWin had an alternative. It kept the MS-DOS boot code, but modified the Windows "stage2" configuration to load grldr.

If your flash drive already has the Grub4Dos stage1 on its MBR from a previous setup, then you can get it to boot from a Debian setup, if you provide grldr. If the drive still contains the MS-DOS code in its MBR, it won't boot.

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

#88 Post by mcewanw »

Note to forum moderator.

This thread should remain unlocked since it is the main HowTo resource for the DebianDog/XenialDog projects and is incomplete awaiting new additions.

As far as Toni's (saintless) request to delete his account on Puppy Linux: Clearly Toni is under stress and it would be completely unfair and wrong and ridiculous to delete the Puppy login account of the main creator of the original DebianDog project at this time. It would frankly be disgraceful for any forum moderator to do that (in the Dog world that would be like deleting the login account of BarryK).

William
github mcewanw

backi
Posts: 1922
Joined: Sun 27 Feb 2011, 22:00
Location: GERMANY

#89 Post by backi »

Hi mcewanw !
Clearly Toni is under stress and it would be completely unfair and wrong and ridiculous to delete the Puppy login account of the main creator of the original DebianDog project at this time. It would frankly be disgraceful for any forum moderator to do that (in the Dog world that would be like deleting the login account of BarryK)
I am glad about your wise interference ( send from heaven? ) once more......so i will hereby join your request/petition .

Greetings !
Last edited by backi on Sun 18 Jun 2017, 15:14, edited 1 time in total.

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#90 Post by fredx181 »

Note to forum moderator.

This thread should remain unlocked since it is the main HowTo resource for the DebianDog/XenialDog projects and is incomplete awaiting new additions.

As far as Toni's (saintless) request to delete his account on Puppy Linux: Clearly Toni is under stress and it would be completely unfair and wrong and ridiculous to delete the Puppy login account of the main creator of the original DebianDog project at this time. It would frankly be disgraceful for any forum moderator to do that (in the Dog world that would be like deleting the login account of BarryK).

William
+1

Fred

backi
Posts: 1922
Joined: Sun 27 Feb 2011, 22:00
Location: GERMANY

#91 Post by backi »

Have to admit.....having a bad conscience....i am sorry Toni.......

I am just a funny guy ..

https://www.youtube.com/watch?v=wwfZXxRe9eQ

backi
Posts: 1922
Joined: Sun 27 Feb 2011, 22:00
Location: GERMANY

#92 Post by backi »

Could be Off-topic but somehow related to Debian (9)
Found this comment about Debian 9 on Distrowatch Readers Comment
21 • Debian 9 bugged (by LorenzoC on 2017-06-19 16:17:38 GMT from Italy)
I tried to upgrade from Debian 8 and making a "clean" install, there are tons of bugs in Debian 9, like USB dongles not working while the kernel spits cryptic and useless errors, CDs that cannot be unmounted either accessed, weird Networkmanager behavior and so on.

So much for an "extra-stable" distro, years of development and testing for this?.
Regression translates in depression.
https://distrowatch.com/weekly.php?issu ... 9#comments

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

#93 Post by mcewanw »

mcewanw wrote:
backi wrote:Could be Off-topic but somehow related to Debian (9)
Found this comment about Debian 9 on Distrowatch Readers Comment
21 • Debian 9 bugged (by LorenzoC on 2017-06-19 16:17:38 GMT from Italy)
I tried to upgrade from Debian 8 and making a "clean" install, there are tons of bugs in Debian 9, like USB dongles not working while the kernel spits cryptic and useless errors, CDs that cannot be unmounted either accessed, weird Networkmanager behavior and so on.

So much for an "extra-stable" distro, years of development and testing for this?.
Regression translates in depression.
https://distrowatch.com/weekly.php?issu ... 9#comments
Yeah, slightly off-topic I suppose, but we do need a thread somewhere, I feel, to allow the deb/Ubuntu dogs some presence here - the github website is unlikely to create much discussion on it's own, I think. Without a continuing active presence on the projects subtopic area the dogs will gradually drop from view, notice, and interest. I don't want to open a new thread myself but someone should consider that as a continued forum presence actively pointing to the off-forum dog website. The dogs are all reasonably stable as is but discussions on maintenance/future upgrades continue to be important even if no new isos are planned.

William

EDIT: post was previously sent via a small screen android and I made a hash of the quote tags...
github mcewanw

backi
Posts: 1922
Joined: Sun 27 Feb 2011, 22:00
Location: GERMANY

#94 Post by backi »

Hi !

Regarding " bad news " about Debian 9 Stretch....seems i became victim of some false information.

Belham2 wrote :
Ignore those posts from the Fedora and OpenSUSE gang (I recognize a couple).....they always do that (leave nasty comments) every time Debian does something new. And what's even funnier: like Fedora and OpenSUSE have never had problems---good Lord, they both are magnitudes worse (even to this day) than what Debian does and is doing
Was not aware about those nasty games.....good to know.
Going to stop spreading these " bad news " about Debian 9 Stretch.
But my main intention was to keep the discussion going on this thread .

Greetings !

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#95 Post by fredx181 »

William wrote:.....
Without a continuing active presence on the projects subtopic area the dogs will gradually drop from view, notice, and interest. I don't want to open a new thread myself but someone should consider that as a continued forum presence actively pointing to the off-forum dog website. The dogs are all reasonably stable as is but discussions on maintenance/future upgrades continue to be important even if no new isos are planned.
I agree and me neither want to open such a new thread, but let's keep this thread only for how-to purpose.

Fred

Post Reply