initrd + busybox

New features which should be implemented in Porteus; suggestions are welcome. All questions or problems with testing releases (alpha, beta, or rc) should go in their relevant thread here, rather than the Bug Reports section.
Post Reply
User avatar
fanthom
Site Admin
Site Admin
Posts: 4625
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland, currently - Cork, IE
Contact:

initrd + busybox

Post#1 by fanthom » 29 Dec 2010, 05:29

initrd and busybox are very important part of live distros as live system is "assembled" from modules at initrd booting stage. there is still a room for improvements in busybox configuration (the heart of initrd micro cosmos) and libs/drivers/firmware provided in the ram disk. if you want to share your experience with initrd or ask about something - please use this topic.
Please add [Solved] to your thread title if the solution was found.

User avatar
jcas1411
White ninja
White ninja
Posts: 26
Joined: 28 Dec 2010, 19:14
Location: Virginia, USA
Contact:

Re: initrd + busybox

Post#2 by jcas1411 » 30 Dec 2010, 19:32

how do I tell which version of busybox I'm using?

User avatar
fanthom
Site Admin
Site Admin
Posts: 4625
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland, currently - Cork, IE
Contact:

Re: initrd + busybox

Post#3 by fanthom » 30 Dec 2010, 21:51

start slax and run /mnt/live/bin/busybox
you will see the version then
Please add [Solved] to your thread title if the solution was found.

User avatar
Mithrandil
Power user
Power user
Posts: 29
Joined: 28 Dec 2010, 16:02
Distribution: Gentoo, PixieLive
Location: IT
Contact:

Re: initrd + busybox

Post#4 by Mithrandil » 08 Jan 2011, 10:15

are those config lines in the new busybox-1.18.1:

Code: Select all

#
# Filesystem/Volume identification
#
CONFIG_FEATURE_VOLUMEID_EXT=y
# CONFIG_FEATURE_VOLUMEID_BTRFS is not set
CONFIG_FEATURE_VOLUMEID_REISERFS=y
CONFIG_FEATURE_VOLUMEID_FAT=y
CONFIG_FEATURE_VOLUMEID_HFS=y
CONFIG_FEATURE_VOLUMEID_JFS=y
CONFIG_FEATURE_VOLUMEID_XFS=y
CONFIG_FEATURE_VOLUMEID_NTFS=y
CONFIG_FEATURE_VOLUMEID_ISO9660=y
CONFIG_FEATURE_VOLUMEID_UDF=y
CONFIG_FEATURE_VOLUMEID_LUKS=y
CONFIG_FEATURE_VOLUMEID_LINUXSWAP=y
CONFIG_FEATURE_VOLUMEID_CRAMFS=y
CONFIG_FEATURE_VOLUMEID_ROMFS=y
CONFIG_FEATURE_VOLUMEID_SYSV=y
CONFIG_FEATURE_VOLUMEID_OCFS2=y
CONFIG_FEATURE_VOLUMEID_LINUXRAID=y
related to /dev/disk/by-id ?
if yes, it's and interesting feature, you could force linuxrc to boot from a specific device (from=/dev/disk/by-id/$ID/$DISTRONAME)
PixieLive developer www.pixielive.org

User avatar
fanthom
Site Admin
Site Admin
Posts: 4625
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland, currently - Cork, IE
Contact:

Re: initrd + busybox

Post#5 by fanthom » 08 Jan 2011, 11:03

@Mithrandil
compiled busybox-1.18.1 with blkid support (and VOLUMEID support) but it still shows:

Code: Select all

/dev/sda3: UUID="7af60ce6-35c3-44d7-96b1-98ca04d20b8d"
while i need:

Code: Select all

/dev/sda3: UUID="7af60ce6-35c3-44d7-96b1-98ca04d20b8d" TYPE="reiserfs"
(i need TYPE= for filling up fstab with proper fs type)
here is my config:
http://pastebin.com/U69Ty4qA

Any clues?
Please add [Solved] to your thread title if the solution was found.

User avatar
Mithrandil
Power user
Power user
Posts: 29
Joined: 28 Dec 2010, 16:02
Distribution: Gentoo, PixieLive
Location: IT
Contact:

Re: initrd + busybox

Post#6 by Mithrandil » 08 Jan 2011, 12:18

i'm getting

Code: Select all

pixielive@pixielive ~ $ cat /mnt/live/var/log/blkid.log 
/dev/loop0: TYPE="squashfs" 
/dev/loop1: TYPE="squashfs" 
/dev/sda1: UUID="EE64B80564B7CF19" TYPE="ntfs" 
/dev/sda3: LABEL="PE" UUID="CCED-990E" TYPE="vfat" 
/dev/sda5: UUID="7f3ecb12-74a1-44ae-9759-5c2f6953f518" TYPE="ext4" 
/dev/sda6: UUID="a61a7282-e11a-40c7-ba6b-60c986a124bc" TYPE="ext3" 
/dev/sda7: UUID="10568c28-85ea-44a2-92a3-a3d7ec158571" TYPE="swap" 
/dev/sda8: UUID="0125cfaf-9d6b-4569-b3a4-0b062cca4c6b" TYPE="ext4" 
/dev/sdb1: UUID="1992-085B" TYPE="vfat" 
/dev/sdc1: UUID="A5E7-7246" TYPE="vfat" 
with both 1.17.4 and 1.18.1 http://pastebin.com/qqzsr98G
PixieLive developer www.pixielive.org

User avatar
fanthom
Site Admin
Site Admin
Posts: 4625
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland, currently - Cork, IE
Contact:

Re: initrd + busybox

Post#7 by fanthom » 08 Jan 2011, 12:44

are you sure that your output comes from blkid which is built into busybox and not /mnt/live/bin/blkid binary?
show me the output of:
"/mnt/live/bin/busybox blkid"
Please add [Solved] to your thread title if the solution was found.

User avatar
Mithrandil
Power user
Power user
Posts: 29
Joined: 28 Dec 2010, 16:02
Distribution: Gentoo, PixieLive
Location: IT
Contact:

Re: initrd + busybox

Post#8 by Mithrandil » 08 Jan 2011, 12:52

fanthom wrote:are you sure that your output comes from blkid which is built into busybox and not /mnt/live/bin/blkid binary?
show me the output of:
"/mnt/live/bin/busybox blkid"
ehm... i didn't compile blkid into the busybox... it's from /mnt/live/bin/blkid
PixieLive developer www.pixielive.org

User avatar
Quax
Full of knowledge
Full of knowledge
Posts: 21
Joined: 29 Dec 2010, 21:28
Distribution: FluxFlux (ARM + x86), Slax7
Location: Muelheim an der Ruhr, Germany
Contact:

Re: initrd + busybox

Post#9 by Quax » 21 Jan 2011, 18:37

Hi Fanthom,

you should use busybox 1.0.19 from git:

Code: Select all

root@fluxflux: /mnt/sdb4/busybox # ./busybox --help
BusyBox v1.19.0.git (2011-01-21 19:23:25 CET) multi-call binary.
Copyright (C) 1998-2009 Erik Andersen, Rob Landley, Denys Vlasenko
and others. Licensed under GPLv2.
See source distribution for full notice.

Usage: busybox [function] [arguments]...
   or: busybox --list[-full]
   or: function [arguments]...

	BusyBox is a multi-call binary that combines many common Unix
	utilities into a single executable.  Most people will create a
	link to busybox for each function they wish to use and BusyBox
	will act like whatever it was invoked as.

Currently defined functions:
	[, [[, ash, blkid, cat, chmod, chroot, cp, cut, df, dmesg, egrep,
	fgrep, find, free, grep, halt, head, ifconfig, kill, killall, killall5,
	ln, losetup, ls, lsmod, mdev, mkdir, mknod, modprobe, mount, mv, pidof,
	ping, pivot_root, poweroff, ps, pstree, reboot, rm, rmdir, rmmod,
	route, sed, sh, sleep, sort, sync, tail, test, touch, udhcpc, umount,
	uname, vi

root@fluxflux: /mnt/sdb4/busybox # ln -s busybox blkid
root@fluxflux: /mnt/sdb4/busybox # ./blkid /dev/sda1
/dev/sda1: LABEL="FF-System" UUID="b30e1bc7-ef64-4220-81b0-a370458fb073" TYPE="ext2"
root@fluxflux: /mnt/sdb4/busybox # 
You can use the binary appended to this thread ;)

Regards, Quax

btw: Could you please post your version of live-scripts somewhere?
Erfahrung bedeutet gar nichts - man kann Dinge auch 15 Jahre lang falsch machen...

Experience means nothing - one could have done things wrong for the last 15 years...

User avatar
fanthom
Site Admin
Site Admin
Posts: 4625
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland, currently - Cork, IE
Contact:

Re: initrd + busybox

Post#10 by fanthom » 21 Jan 2011, 22:32

Tanks a lot Quax!
just compiled busybox from git, updated linuxrc, got rid of /bin/blkid + /lib/libuuid + /lib/libblkid and works!
200KB removed from initrd :)

I dont have standard version of LLS, all what i have is included in initrd.lz (linuxrc, fatal, cleanup):
http://ponce.cc/porteus/i486/current/clean_initrd.lz
You wont be able to use it to build live system automatically.
With little tweaks you should be able to get it to work with fluxflux-sl. My version doesn't load any kernel module during boot (except for nls and network drivers for PXE boot). Everything is build into porteus kernel: aufs, squashfs, fuse, usb drivers, etc
Also - it doesn't create /dev/console and /dev/null inside the union (they are provided inside 001-core).

this is list of updated cheatcodes (some were added/removed/renamed):
http://pastebin.com/zYQ5RNFv

if you decide to go with my version then i'll be glad to help you with required tweaks. please dont hesitate to ask about anything.

EDIT:\\
spoke little bit too soon: libblkid and libuuid are required for porteus 'fsck' feature. Also - blkid included in busybox doesn't recognize ext4 properly and btrfs at all. Hopefully they will fix it for final release.
Please add [Solved] to your thread title if the solution was found.

Post Reply