LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-16-2010, 06:04 PM   #1
hda7
Member
 
Registered: May 2009
Distribution: Debian wheezy
Posts: 252

Rep: Reputation: 31
pivot_root complains "Invalid argument"


I am in the process of creating my own distro, and it initially boots an initramfs. My init script then mounts a certain drive (usually the one you boot from) and mounts a cramfs image containing most of the files of the distro. After that it mounts a tmpfs filesystem in a folder, and then uses unionfs to layer that on top of the mounted cramfs image. It is supposed to pivot_root into this layered filesystem, but pivot_root fails with the error message: "pivot_root: : Invalid argument". There are no kernel message concerning this error (a message from unionfs is immediately followed by the login message). I am using the busybox v1.8.2 pivot_root with a 2.6.29.3 kernel. Any insight into this error would be appreciated.
 
Old 03-17-2010, 04:43 AM   #2
fotoguy
Senior Member
 
Registered: Mar 2003
Location: Brisbane Queensland Australia
Distribution: Custom Debian Live ISO's
Posts: 1,290

Rep: Reputation: 62
Could you post your init script, we might be able to get a better understanding of how it is booting.
 
Old 03-17-2010, 09:30 AM   #3
hda7
Member
 
Registered: May 2009
Distribution: Debian wheezy
Posts: 252

Original Poster
Rep: Reputation: 31
Here it is: (I hearby put this under the Gnu GPL, etc.)
Code:
#!/bin/sh
clear >/dev/console
echo  'System starting.' >/dev/console
echo -n 'Mounting system filesystems...' >/dev/console
mount -t proc none /proc
mount -t sysfs none /sys
mount -t devpts none /dev/pts
echo ' done.' >/dev/console
echo -n 'Setting up serial port...' >/dev/console
stty -F /dev/ttyS0 -raw -echo 38400
echo ' done.' >/dev/console
echo -n 'Starting loggers...' >/dev/console
syslogd
klogd
echo ' done.' >/dev/console
echo -n 'Loading modules...' >/dev/console
{
	cd /lib/modules/2.6.29.3/kernel/drivers/ata
	for module in *; do
		modprobe `basename $module .ko`
	done
}
echo ' done.' >/dev/console
modprobe scsi_wait_scan
sleep 5
echo -n 'Searching for home device...' >/dev/console
DEVS="`echo /dev/sd?` `echo /dev/sd??` `echo /dev/sr?`"
for dev in $DEVS; do
	if mount $dev /mnt/home >>/tmp/mnterrs 2>&1; then
		if [[ -e /mnt/home/uslinux.cfs ]]; then
			DEV="$dev"
			umount $dev
			break
		else
			umount $dev
		fi
	fi
done
echo " $DEV." >/dev/console
echo -n 'Working...' >/dev/console
mount $DEV /mnt/home
mount -o loop /mnt/home/uslinux.cfs /mnt/cramfs
mount -t tmpfs tmpfs /mnt/data
modprobe unionfs
mount -t unionfs -o dirs=/mnt/cramfs:/mnt/data unionfs /mnt/root
pivot_root /mnt/root /mnt/root/initrd
echo ' done.' >/dev/console
echo  'Executing init...' >/dev/console
exec /bin/busybox init
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
error: Error for wireless request "Set Mode" (8B06) : invalid argument "roaming" penguin chick Linux - Wireless Networking 5 08-22-2008 02:16 PM
": Invalid argument" ": success" who said??? sunnior Programming 9 05-15-2008 10:52 AM
pivot_root: Invalid argument -- trying to boot my own Gentoo LiveCD un_pilote Linux - General 2 04-20-2008 09:33 AM
Unable to "scanimage": "invalid argument” in Debian 4.0 sonichedgehog Linux - Newbie 3 12-02-2007 03:31 PM
"cp -p" fails with "cp: setting permissions for `/home/svbld/t': Invalid argument" mkhesin Red Hat 1 02-28-2007 01:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration