Light-Debian-Core-Live-CD-Wheezy + Porteus-Wheezy

For talk and support relating specifically to Puppy derivatives
Message
Author
User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#2086 Post by sunburnt »

# Trying to detect USB device type, H.D., CD-DVD, Flash, SD, etc.
It seems impossible to do this. It`s even very hard to detect if sdxx is removable or not.
dmesg and /var/log/messages is only way to detect a USB event. Difficult to parse them.
What a horrible mess Linux/Unix is... Getting info is a scattered and sketchy affair.
# Trying to write a USB installer for DebDog. Looks like it`s going to be ultra simple.


# Toni; Fixed I believe. Odd that only the e3 menu file caused it.
Attachments
debmenu2desktop.convert.zip
(11.36 KiB) Downloaded 149 times

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#2087 Post by sunburnt »

# Toni & Fred; Do we have a way to use a dir. for the live-rw.? How about a partition.?
I read that Fred had a live-rw dir. working in PorteusDog.

# If partition is just Deb/PorteusDog + live-rw dir., then the partition can be 1-2 GB in size.
And so a fsck of the partition is quick, and at the same time the O.S. files get checked too.

# Thinking of a USB setup like this:

| Windows FAT partition | Boot partition 1-2GB | Extra O.S. partitions 1-2GB | Swap |

Most USBs would only have 2 partitions, "Windows FAT", and "Boot + Deb-Live".
FAT for the main storage area is okay, it can hold anything except Linux files. Better than NTFS.
And FAT dosen`t care if it`s mounted while doing a fsck, making it easy to maintain.
Most USBs won`t have other O.S.s, and a swap file/partition on a Flash device is a bad idea.
If the PC is low on ram, then using a second "expendable" 1-2GB Flash drive is a good solution.
I`m guessing a "swap" Flash drive will last about 6 months of normal daily use. So a cheap one...
Sadly buying more ram for old PCs is just a bad idea, DDR-3 costs less than older ram does.
.

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

#2088 Post by saintless »

mcewanw wrote:Further info in Section 9.4.12 onwards of:

http://qref.sourceforge.net/Debian/refe ... ne.en.html

THE ABOVE LINK LOOKS PARTICULARLY USEFUL. Provides an alternative trick to run sudo gui commands from normal user login:
Thank you, William!
I will test this today.
I don't understand, Toni, how you were able to use su as a normal user and then run synaptics without this trick.
I see nothing strange since Debian Live Standard CD also doesn't need to use tricks like that. It has active user account and after installing X you get straight to X from login prompt. After sudo apt-get install synaptic all it needs is to type sudo synaptic and it starts. Nothing from your post above is needed.

The strange thing for me is XDM is the only Display manager that needs this operations to make Synaptic work.
LightDM and Slim does not need this to make Synaptic work for user.
EDIT: works using sudo from user's xterm anyway, but I seem to have missed something cos didn't work from JWM menu and I'm going out so can't test further just now.
The script which starts Synaptic from menu is /opt/bin/synaptic-start:

Code: Select all

#!/bin/bash

if [ "`whoami`" != "root" ]; then
xterm -e sudo synaptic
exit 0
fi

synaptic
It works for user when autologin is active and with LightDM and Slim without changing anything.
I guess the changes you posted make the user account to run direct the synaptic line in the script without sudo? Need to test this first to confirm.

Toni

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

#2089 Post by saintless »

# Trying to write a USB installer for DebDog. Looks like it`s going to be ultra simple.


# Toni; Fixed I believe. Odd that only the e3 menu file caused it.
Thank you, Terry!
sunburnt wrote:# Toni & Fred; Do we have a way to use a dir. for the live-rw.? How about a partition.?
We can use folder only if DebianDog boots with porteus-boot-initrd. It will be available boot option in the beta iso version.
With debian live-boot which we use now and is default for DebianDog we can not use folder but we can use save partition. Haven't tested this myself but I think all we need is to make ext partition and label it live-rw.
# Thinking of a USB setup like this:

| Windows FAT partition | Boot partition 1-2GB | Extra O.S. partitions 1-2GB | Swap |
I also think SWAP partition on flash drive is not needed.
Terry, the structure of DebianDog beta iso will be this one:
http://smokey01.com/saintless/Light-Whe ... g-test.iso
It has two initrd files and more files and folders in /live
It is needed to make it boot both ways - debian and porteus.
What about if the flash drive is only 1Gb or less? Will it be possible to install DebianDog on smaller flash drive?
DebianDog beta iso will be around 110 Mb with porteus-initrd and debian-initrd included.

Toni

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#2090 Post by sunburnt »

So I assume it`s a bit of code in Porteus initrd that does the alternate live-rw setup.

# Q... Will DebDog boot with Porteus initrd with Wheezy kernel.? Is there a Porteus kernel.?

I don`t know differences, but if Fred put up lots of effort, then the initrd has some advantages.
# Could make 2 partitions, 1 for DebDog and 1 for live-rw. But both in 1 has advantages.

Toni; Didn`t mention, if USB < 8GB, then 1 Linux partition. Why make small even smaller.?


# Here`s "drive-info", it`s for the USB installer.
You can see the USB removable "rem" drive:

Code: Select all

Part Type F/R Boot        Sizes            Drv.Label
=====================================================
sda1 ext3 fix boot 6.320-GiB 6786383872 
sda2 swap fix      1.953-GiB 2097152000 
sda3 ext3 fix      103.5-GiB 111148007424 
sdb1 vfat rem boot 7.216-GiB 7747895808 Red-8gb
# What a pain it was getting just this info., 5 different sources were needed.!
/proc/partitions, dmesg, disktype, fdisk, and blkid
The best part is that all this info can be gotten with the partition un-mounted.

# The parted tools can do all of this and make and manipulate partitions.

# Makes me think of having env variables to hold each line of this info.
$PART_SDA1, $PART_SDA3, $PART_SDB1, etc.
Then no files to read and very little parsing to get the needed info.
At the very least, we should have a system info. file to "source" to get info.

# I`ll post the whole installer when it`s ready.
# Please give a test try with USBs in & out and let me know...

### UPDATE: Now has "Boot" column added ( See output above )..
Attachments
drive-info.zip
Path: /opt/bin
(770 Bytes) Downloaded 140 times
Last edited by sunburnt on Mon 31 Mar 2014, 06:46, edited 6 times in total.

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

#2091 Post by mcewanw »

saintless wrote: The script which starts Synaptic from menu is /opt/bin/synaptic-start:

Code: Select all

#!/bin/bash

if [ "`whoami`" != "root" ]; then
xterm -e sudo synaptic
exit 0
fi

synaptic
It works for user when autologin is active and with LightDM and Slim without changing anything.
I guess the changes you posted make the user account to run direct the synaptic line in the script without sudo? Need to test this first to confirm.

Toni
Yes, I knew that was the script. I'm a bit confused about what the problem really is, but it works, if I also change the /opt/bin/synaptic-start script to:

Code: Select all

#!/bin/bash
if [ "`whoami`" != "root" ]; then
if [ -z "$XAUTHORITY" ]; then
XAUTHORITY=$HOME/.Xauthority
export XAUTHORITY
fi
xterm -e sudo synaptic
exit 0
fi

synaptic
So it seems the XAUTHORITY env variable wasn't being exported to that shell for some reason......
github mcewanw

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

#2092 Post by mcewanw »

saintless wrote:
sunburnt wrote:# Toni & Fred; Do we have a way to use a dir. for the live-rw.?...
We can use folder only if DebianDog boots with porteus-boot-initrd
I'm actually using DebianDog with Porteus-boot-initrd (after Toni explained to me how to set up that method) so that I can use dir for persistence. I really really like that method because I can manually edit the persistence directory anytime and the changes reflect that editing thereafter. So I can quickly modify and whiteout files and so on and then simply delete the changes and get back to where I was. It's great!
github mcewanw

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

#2093 Post by mcewanw »

saintless wrote: The strange thing for me is XDM is the only Display manager that needs this operations to make Synaptic work.
LightDM and Slim does not need this to make Synaptic work for user.
Yet that link I gave earlier includes the quote:

http://qref.sourceforge.net/Debian/refe ... ne.en.html
9.4.12 Getting root in X

If a GUI program needs to be run with root privilege, use the following procedures to display program output on a user's X server
And root can't access user's X server without Xauthority. Do these other display managers you mention not use Xauthority method perhaps? I imagine kdm and gdm would?
github mcewanw

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

#2094 Post by saintless »

sunburnt wrote:So I assume it`s a bit of code in Porteus initrd that does the alternate live-rw setup.

# Q... Will DebDog boot with Porteus initrd with Wheezy kernel.? Is there a Porteus kernel.?

I don`t know differences, but if Fred put up lots of effort, then the initrd has some advantages.
# Could make 2 partitions, 1 for DebDog and 1 for live-rw. But both in 1 has advantages.
Hi, Terry.
The reason to keep debian-boot way is to keep DebianDog 100% Debian Wheezy compatible.
The kernel is the same for porteus and debian boot.
For porteus boot we use different initrd file + small second module with porteus changes less than 1 Mb. The second module is active only if porteus-boot is choosen.
Using save folder is not the only difference between porteus and debian boot way. Porteus has many other save options that debian does not have.

# Here`s "drive-info", it`s for the USB installer.
# Please give a test try with USBs in & out and let me know...
Thank you, Terry!
I get missing disktype command message:

Code: Select all

root@debian:~# drive-info

Part Type F/R        Sizes             Drv.Label
=================================================
/opt/bin/drive-info: line 18: disktype: command not found
sda1  fix   
/opt/bin/drive-info: line 18: disktype: command not found
sdb1  rem   INTENSO

root@debian:~# 
Toni

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

#2095 Post by mcewanw »

Toni, SLiM and so on do use xauth but must export XAUTHORITY info whereas have to do that manually for xdm. That's what I think must happen anyway. The following link seems to suggest how that is done and also for LightDM, gdm and kdm:

http://blog.fox.geek.nz/

EDIT: I've since discovered in DebianDog that the MIT-MAGIC-COOKIE-1 key for xdm seems to be stored /var/lib/xdm/authdir/authfiles/A${DISPLAY}-* (which is similar to kdm location pointed out in the above blog). Using that it would be also possible to make a script per the method in that blog and store it in /root/.bash_profile. However, I think the methods I described above would do for now at least anyway.

I still don't understand how you were able to use su (rather than sudo) under xdm login with programs like synaptic. Didn't seem to work out of the box for me and also because needed the Xauthority exported.
Last edited by mcewanw on Mon 31 Mar 2014, 07:03, edited 1 time in total.
github mcewanw

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

#2096 Post by saintless »

Hi, William.
mcewanw wrote:

Code: Select all

#!/bin/bash
if [ "`whoami`" != "root" ]; then
if [ -z "$XAUTHORITY" ]; then
XAUTHORITY=$HOME/.Xauthority
export XAUTHORITY
fi
xterm -e sudo synaptic
exit 0
fi

synaptic
So it seems the XAUTHORITY env variable wasn't being exported to that shell for some reason......
We can use this code for synaptic till we find something better then.
9.4.12 Getting root in X If a GUI program needs to be run with root privilege, use the following procedures to display program output on a user's X server
And root can't access user's X server without Xauthority. Do these other display managers you mention not use Xauthority method perhaps? I imagine kdm and gdm would?
Maybe, but I doubt someone will ever install KDM or GDM on DebinaDog. It is better to use official debian since the small size is not possible with kdm and gdm.

The fact XDM is the first package that makes this problem for us means debian docs are not correct if not all login managers need to export xauthority.

Toni

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

#2097 Post by saintless »

mcewanw wrote:Toni, SLiM and so on do use xauth but must export XAUTHORITY info whereas have to do that manually for xdm. That's what I think must happen anyway. The following link seems to suggest how that is done and also for LightDM, gdm and kdm:

http://blog.fox.geek.nz/

I still don't understand how you were able to use su (rather than sudo) under xdm login with programs like synaptic. Didn't seem to work out of the box for me and also because needed the Xauthority exported.
William,
Synaptic, Gpatrted and other programs work for user without using XDM or SLIM and with Slim installed without the changes in .bachrc and startup files. It should be mirracle since it works for me only.
I never had the changes you posted in /root/.bashrc and startup files in $HOME/

SLIM and LightDM do not need to exportapaths different way. They just use /etc/profile for this like there is no login manager installed at all.

Toni

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#2098 Post by sunburnt »

Toni; Thanks, I kinda thought we did not have disktype.

What`s the installed Squash size of "parted".? I counted to over 1 MB and quit.
disktype is 40 KB in size. Needed for file system type and both sizes.

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

#2099 Post by mcewanw »

saintless wrote: William,
Synaptic, Gpatrted and other programs work for user without using XDM or SLIM and with Slim installed without the changes in .bachrc and startup files. It should be mirracle since it works for me only.
I never had the changes you posted in /root/.bashrc and startup files in $HOME/

SLIM and LightDM do not need to exportapaths different way. They just use /etc/profile for this like there is no login manager installed at all.

Toni
Sorry, I misunderstood a remark you made sometime earlier. I thought you were able to login via xdm to user puppy and then use su followed by calling up synaptic. That shouldn't work without Xauthority I think, but it seems you were talking about when you were not using xdm, which I understand. Note that the last link I provided above (from a blog) basically explains the difference with SLiM and LightDM and so on, compared to xdm - SLiM and LightDM seem to have an inbuilt auth mechanism which manages the provision of xauth to root on using sudo (that's what I infer anyway).

Like you suggest, we can just modify /opt/bin/synaptic-start for now and can always come back to this later if a better solution is found.
github mcewanw

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

#2100 Post by saintless »

mcewanw wrote:Sorry, I misunderstood a remark you made sometime earlier. I thought you were able to login via xdm to user puppy and then use su followed by calling up synaptic. That shouldn't work without Xauthority I think.
Sorry if I didn't make it clear enough, William.
I mean exactly that:
I login via XDM to puppy user account, but I do not start synaptic with su -c. I use su-to-root:

Code: Select all

puppy@debian:~$ su-to-root -c synaptic
About to execute synaptic.
This command needs root privileges to be executed.
Using su...
Enter root password at prompt.
Password:
And Synaptic works.

Toni

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

#2101 Post by fredx181 »

Terry wrote:# Trying to write a USB installer for DebDog. Looks like it`s going to be ultra simple.
That would be great!
I've had a look at grub4dosconfig for puppy from here:
http://www.murga-linux.com/puppy/viewtopic.php?t=51697
Of course it's specially for puppy but I thought maybe modify it but it's very complicated.
--------
Toni,I tried so change my system locale to my language but it worked only half.
I think there are files missing in /usr/share/locales.
For example, a reinstall of synaptic made it show in my language.
To much cleaning done maybe?

Fred

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

#2102 Post by saintless »

sunburnt wrote:Toni; Thanks, I kinda thought we did not have disktype.

What`s the installed Squash size of "parted".? I counted to over 1 MB and quit.
disktype is 40 KB in size. Needed for file system type and both sizes.
Terry, if I you mean the same parted it adds very little:

Code: Select all

root@debian:~# apt-get install parted  
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  parted-doc
The following NEW packages will be installed:
  parted
0 upgraded, 1 newly installed, 0 to remove and 23 not upgraded.
Need to get 159 kB of archives.
After this operation, 267 kB of additional disk space will be used.
I will add it if we need it. Since DebianDog has Gparted I thought it is not needed to add parted.

I will add disktype.

Toni

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

#2103 Post by saintless »

fredx181 wrote:To much cleaning done maybe?
Hi, Fred.
Yes, but I don't think it is too much.
Not everyone will change the locales so I plan to keep /usr/share/locales in separate squashfs module on the site. I think it will be over 40 Mb uncompressed at the moment inside the main module but I need to check the exact size. I will make a separate module when we stop adding more applications to the main one.

Toni

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

#2104 Post by mcewanw »

saintless wrote: Sorry if I didn't make it clear enough, William.
I mean exactly that:
I login via XDM to puppy user account, but I do not start synaptic with su -c. I use su-to-root:

Code: Select all

puppy@debian:~$ su-to-root -c synaptic
...
And Synaptic works.[/quote]

Ah... I think that's because su-to-root finds and uses ktsuss which runs su whilst preserving the environment (I presume, but don't know - hence /puppy/,Xauthority found and used okay when program running as root user needs to write to user X DISPLAY).

You should also be able to run it with:

su --preserve-environment -c  synaptic

But if the user puppy environment is okay, then you could probably simply use: sudo -E synaptic (for example in /opt/bin/synaptic-start)

EDIT: tried it. seems to work (at least the program pops up okay, but I haven't actually tried to install anything with it...EDIT: okay, I tried installing 'unrar' and it seems to do it, but maybe something not done right - I don't know).

However, some programs might need root environment rather than user environment? EDIT: For example, if you just preserve environment, maybe the PATH won't find necessary system binaries or other side-effects?
github mcewanw

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

#2105 Post by fredx181 »

saintless wrote:
fredx181 wrote:To much cleaning done maybe?
Hi, Fred.
Yes, but I don't think it is too much.
Not everyone will change the locales so I plan to keep /usr/share/locales in separate squashfs module on the site. I think it will be over 40 Mb uncompressed at the moment inside the main module but I need to check the exact size. I will make a separate module when we stop adding more applications to the main one.

Toni
Ok, that should do it then.
What's your way of collecting these missing locales?
I'd like to do simular maybe with Porteus-Wheezy.

Fred

Post Reply