Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 30 Oct 2014, 13:54
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
busybox extras
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 5 Posts_count   Goto page: 1, 2, 3, 4, 5 Next
Author Message
technosaurus


Joined: 18 May 2008
Posts: 4353

PostPosted: Sun 12 May 2013, 02:29    Post_subject:  busybox extras  

I have previously posted some busybox applets here in various spots, but I am starting this thread to consolidate them.

fbvnc - todo? add support for compression

It could also be a good place to discuss porting additional applets to busybox. What puppy utils _should_ be added to busybox?

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send_private_message 
jamesbond

Joined: 26 Feb 2007
Posts: 2230
Location: The Blue Marble

PostPosted: Mon 13 May 2013, 09:22    Post_subject:  

guess_fstype?
I have a patch that will make use of volume_id/* filesystem detection code to compile as a standalone guess_fstype.

_________________
Fatdog64, Slacko and Puppeee user. Puppy user since 2.13.
Contributed Fatdog64 packages thread
Back to top
View user's profile Send_private_message 
technosaurus


Joined: 18 May 2008
Posts: 4353

PostPosted: Mon 13 May 2013, 11:36    Post_subject:  

that is one of the ones I patch for busybox before, but since then they have changed a few things and I patched in support for new filesystems as did some other, so it needs to be redone - note that busybox already has blkid which does the same thing if configured, but is much slower because it does a read for each fs type instead of a single batch of sequential reads using a union of structs (excellent fast technique to use for guessing mime types too if someone had the time)
_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send_private_message 
goingnuts

Joined: 07 Dec 2008
Posts: 782

PostPosted: Mon 13 May 2013, 13:48    Post_subject:  

Some of the apps from mut2-src-1.3.2.1238 (mutd mutdaemon mutforeground mutclient probepart probedisk probedisk2 probepci drivelist guess_fstype mounts mediaplug)?
Back to top
View user's profile Send_private_message Visit_website 
Karl Godt


Joined: 20 Jun 2010
Posts: 3972
Location: Kiel,Germany

PostPosted: Mon 13 May 2013, 15:58    Post_subject:  

losetup should be patched to be able to use it as losetup-FULL .
ash should have ASH_ARGV and ASH_ARGC for to show in set output .

klibc-2.0.1/usr/kinit/fstype could be merged into guess_fstype .

I remember that you ported some kind of media player.
Perhaps start ffplay if dropping to initial ramdisk console as lollypop for new users Smile Would make the initrd.lz bigger . SneekyLinux videos come in mind.
Back to top
View user's profile Send_private_message Visit_website 
technosaurus


Joined: 18 May 2008
Posts: 4353

PostPosted: Mon 13 May 2013, 20:46    Post_subject:  

Karl Godt wrote:
losetup should be patched to be able to use it as losetup-FULL .
ash should have ASH_ARGV and ASH_ARGC for to show in set output .

klibc-2.0.1/usr/kinit/fstype could be merged into guess_fstype .

I remember that you ported some kind of media player.
Perhaps start ffplay if dropping to initial ramdisk console as lollypop for new users Smile Would make the initrd.lz bigger . SneekyLinux videos come in mind.

argc == $#
argv == $@
argv[1] == $1 ...

that was minimp3, but I'd like to do something with stb_vorbis to play ogg files

what parts of fstype are missing from guessfstype?

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send_private_message 
Karl Godt


Joined: 20 Jun 2010
Posts: 3972
Location: Kiel,Germany

PostPosted: Tue 14 May 2013, 02:05    Post_subject: ARGV  

in bash :
Code:
ARGV=`set | grep -m1 BASH_ARGV | sed 's%.*(\(.*\))%\1%'`
echo "ARGV=$ARGV"
ARGC=`set | grep -m1 BASH_ARGC | sed 's%.*"\(.*\)")%\1%'`
echo "ARGC=$ARGC"
c=$ARGC
while read p ; do
p=${p#*=}
p=${p/#\"/}
p=${p/%\"/}
P[$c]="$p"
(( c-- ))
done<<EOI
$(echo "$ARGV" | sed 's%" \[%"\n\[%g')
EOI
echo "${P[@]}"

to pass arguments with spaces
ie in mount script for mount-FULL "${P[@]}" .

For guess_fstype i am thinking of trying to use klibc fstype.c and main.c instead of that Puppy one ( cleaner, easier to work with ) :
Quote:
/*
* Note:
*
* Minix test needs to come after ext3/ext2, since it's possible for
* ext3/ext2 to look like minix by pure random chance.
*
* LVM comes after all other filesystems since it's possible
* that an old lvm signature is left on the disk if pvremove
* is not used before creating the new fs.
*
* The same goes for LUKS as for LVM.
*/
static struct imagetype images[] = {
{0, "gzip", gzip_image},
{0, "cramfs", cramfs_image},
{0, "romfs", romfs_image},
{0, "xfs", xfs_image},
{0, "squashfs", squashfs_image},
{1, "ext4dev", ext4dev_image},
{1, "ext4", ext4_image},
{1, "ext3", ext3_image},
{1, "ext2", ext2_image},
{1, "minix", minix_image},
{1, "nilfs2", nilfs2_image},
{2, "ocfs2", ocfs2_image},
{8, "reiserfs", reiserfs_image},
{64, "reiserfs", reiserfs_image},
{64, "reiser4", reiser4_image},
{64, "gfs2", gfs2_image},
{64, "btrfs", btrfs_image},
{32, "jfs", jfs_image},
{32, "iso9660", iso_image},
{0, "luks", luks_image},
{0, "lvm2", lvm2_image},
{1, "lvm2", lvm2_image},
{-1, "swap", swap_image},
{-1, "suspend", suspend_image},
{0, "", NULL}
};
Back to top
View user's profile Send_private_message Visit_website 
sunburnt


Joined: 08 Jun 2005
Posts: 5039
Location: Arizona, U.S.A.

PostPosted: Tue 14 May 2013, 03:41    Post_subject:  

guess_fstype reports unknown for Puppy SFS files.
Back to top
View user's profile Send_private_message 
technosaurus


Joined: 18 May 2008
Posts: 4353

PostPosted: Tue 14 May 2013, 20:49    Post_subject: Re: ARGV  

Karl Godt wrote:
in bash :...
in other words it should support arrays - it has been a requested feature for a while, I think Rob Landley has it stubbed out in the toybox shell. I use set to store an array as $@
for example
set --
set -- $@ `find .`
#now I have an "array" of all files/directories in the pwd
#downside is that it is only 1 at a time

@sunburnt - it shouldn't be too difficult to add squashfs support

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send_private_message 
jamesbond

Joined: 26 Feb 2007
Posts: 2230
Location: The Blue Marble

PostPosted: Tue 14 May 2013, 22:45    Post_subject: Re: ARGV  

Karl Godt wrote:
For guess_fstype i am thinking of trying to use klibc fstype.c and main.c instead of that Puppy one ( cleaner, easier to work with )
I was looking for this initially in klibc before I worked on busybox patch but somehow I missed it.
But now that you pointed this out to me, I see that it is missing important filesystems: fat, ntfs, udf, etc.

@sunburnt - I thought I already posted the squashfs patch for puppy's original guess_fstype, somewhere on the forum too?

_________________
Fatdog64, Slacko and Puppeee user. Puppy user since 2.13.
Contributed Fatdog64 packages thread
Back to top
View user's profile Send_private_message 
sunburnt


Joined: 08 Jun 2005
Posts: 5039
Location: Arizona, U.S.A.

PostPosted: Wed 15 May 2013, 00:24    Post_subject:  

jamesbond; Yes, but I thought it was important that it make it into the exec.
It seemed that technosaurus wasn`t aware of the failure.

technosaurus; Now it seems you`re unaware that guess_fstype use to work on squash files! Laughing
When the new compression was used in Puppy, guess_fstype quit working ( I think ).
.
Back to top
View user's profile Send_private_message 
jamesbond

Joined: 26 Feb 2007
Posts: 2230
Location: The Blue Marble

PostPosted: Wed 15 May 2013, 04:26    Post_subject:  

No worries sunburnt, busybox's filesystem probe already contains squashfs detection.

Attached is a patch that will make bb_guess_fstype (which can be renamed to guess_fstype) from plain vanilla busybox 1.21. Included in the patch is f2fs probe.

How to use:
1. Extract vanilla busybox 1.21 source
2. Apply the patch (gunzip first)
3. Go to the volume-id directory
4. Type "make"
5. You will end-up with a bb_guess_fstype which can be renamed to guess_fstype for proper use.

You can fine-tune which probes to be included by editing fake_libbb.h (removing the defines) as well as the Makefile (removing unused object code from being linked in).
From here to busybox applet shouldn't be too difficult, I suppose.

Enjoy.

EDIT: Attachment deleted as it was buggy. Please get it from this post instead: http://murga-linux.com/puppy/viewtopic.php?p=703895#703895.

_________________
Fatdog64, Slacko and Puppeee user. Puppy user since 2.13.
Contributed Fatdog64 packages thread

Edited_time_total
Back to top
View user's profile Send_private_message 
technosaurus


Joined: 18 May 2008
Posts: 4353

PostPosted: Wed 15 May 2013, 04:32    Post_subject:  

jamesbond wrote:
Attached is a patch that will make bb_guess_fstype
I bet Denys would accept it as a replacement for blkid if we added UUID and label - they are just at different offsets and most seem to already be documented in the source already.
_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send_private_message 
musher0


Joined: 04 Jan 2009
Posts: 4268
Location: Gatineau (Qc), Canada

PostPosted: Wed 15 May 2013, 11:31    Post_subject:  

To whom it may concern:

At least reintroduce the prompt function and the command function in busybox's less (-P and !<command> parameters).

Or remove less from busybox altogether. Because, as it is now, busybox's less is a joke.

It's a shame that such an excellent pager/reader with so many useful options be reduced to not even a workable skeleton of itself in busybox.

It's also misrepresentation, on an ethical level, but that is another subject.

musher0

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send_private_message Visit_website 
jamesbond

Joined: 26 Feb 2007
Posts: 2230
Location: The Blue Marble

PostPosted: Thu 16 May 2013, 13:29    Post_subject:  

technosaurus wrote:
jamesbond wrote:
Attached is a patch that will make bb_guess_fstype
I bet Denys would accept it as a replacement for blkid if we added UUID and label - they are just at different offsets and most seem to already be documented in the source already.
I'm not so sure, I thought that's what blkid is for. The code in volume_id is actually meant for blkid, and in all the filesystem probes they actually stores both the label and the UUID if available (in fact, some of the unused probes seem to work right but they don't have UUID and labels identified properly and my guess is that why Denys left them out atm). I would be happy to drop guess_fstype altogether if only busybox blkid can specify which device to probe (instead of probing all) - but alas they are not.

Anyway, as it is now, busybox guess_fstype takes 2.5 times the time of the original guess_fstype Shocked, but I'll take use it anyway because it is still in milliseconds range and it is more maintainable. I am re-posting the patch because the original one I posted was buggy (forgot to return pointer value in xzalloc Evil or Very Mad - but it worked previously as long as I didn't turn on optimisation ...).
bb_guess_fstype.patch.gz
Description  gunzip then patch.
gz

 Download 
Filename  bb_guess_fstype.patch.gz 
Filesize  4.35 KB 
Downloaded  264 Time(s) 

_________________
Fatdog64, Slacko and Puppeee user. Puppy user since 2.13.
Contributed Fatdog64 packages thread
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 5 Posts_count   Goto page: 1, 2, 3, 4, 5 Next
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Off-Topic Area » Programming
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0963s ][ Queries: 13 (0.0130s) ][ GZIP on ]