Re: multiple reports of same bug-needs fixing

2012-06-02 Thread Ben Greear

On 06/01/2012 10:55 PM, Scott Kitterman wrote:

Jordon Bedwell  wrote:



It is a simple fact that if you want developers to participate on this list,
then it's up to you to make it a place they want to participate.  AFAICT, most
developers don't because they got tired of the tone from many (not all) non-
developers.


Developers could at least acknowledge the issue and indicate that
they are working on it (or not).  People can understand when things are
slow to be fixed, but just being ignored does not help.

Thanks,
Ben

--
Ben Greear 
Candela Technologies Inc  http://www.candelatech.com

--
Ubuntu-devel-discuss mailing list
Ubuntu-devel-discuss@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel-discuss


Re: Questions and patches related to casper.

2012-05-17 Thread Ben Greear

On 05/17/2012 09:32 AM, Ben Greear wrote:

On 05/16/2012 08:30 PM, Akkana Peck wrote:

Ben Greear writes:


I have been having issues trying to do a persistent-usb image for
Ubuntu 12.04.


I got it working once on Oneiric, but only on a multi-distro USB
stick using grub, with a separate partition for casper, like this:
http://shallowsky.com/blog/linux/install/ubuntu-persistent-live-cd.html
I've never had any luck on either O or P in getting a single-boot
USB stick to be persistent.

I'm currently setting up some USB sticks to use in a classroom/workshop
setting, with everybody booted from the same image. After wasting
most of a day trying to make persistence work, it occurred to me to
wonder why I was doing all that work: for a USB stick, why not just
install Ubuntu to the stick, and have a normal install that saves
whatever changes you make? No need for overlays like casper, just
install to a normal filesystem on the USB stick.


Using 'dd' on windows is a royal pain, so if I can just point the
users at some third-party pendrive tools and feed our modified .iso
image into that, that is the easiest I think. I also like that the
user can choose the amount of persistent storage based on their USB
stick size.

That said, if I can't find a way to cleanly un-mount the /cow
(or mount it (ro)) on shutdown, then I'm going to have to try
something else...


After some excellent help from the aufs maintainer and mailing
list denizens, I have this at least mostly working.  The /cow
is properly un-mounted on shutdown, and fsck properly runs
on startup (that part was working last time I posted).

I'm attaching the casper initrd file and the /etc/init.d/umountroot
scripts that I modifed.  It would be grand if someone with commit
privs would consider this for upstream inclusion.

Thanks,
Ben




And, I'm seeing ubiquity panel cores on startup of the live-cd
image, which is almost worse. I'm going to re-build the modified
cd image from scratch today in hope that that will somehow fix
the cores. They started after I removed /var/cache/* in an attempt
to make the cd image smaller...seems that might have been a bad
idea...

Thanks,
Ben





--
Ben Greear 
Candela Technologies Inc  http://www.candelatech.com

#! /bin/sh
### BEGIN INIT INFO
# Provides:  umountroot
# Required-Start:
# Required-Stop:
# Should-Stop:   halt reboot kexec
# Default-Start:
# Default-Stop:  0 6
# Short-Description: Mount the root filesystem read-only.
### END INIT INFO

PATH=/sbin:/bin:/usr/bin
. /lib/init/vars.sh

. /lib/lsb/init-functions

do_stop () {
[ "$VERBOSE" = no ] || log_action_begin_msg "Mounting root filesystem 
read-only"
# Ask init to re-exec itself before we go down if it has been
# upgraded this cycle.  It'll lose all its state, but at least
# it won't hold open files on the root filesystem (lp:#672177).
if [ -f /var/run/init.upgraded ]
then
old_map=$( cat /proc/1/maps )
map=$old_map
telinit u || :
i=0
timeout=5
while [ "$map" = "$old_map" ]
do
sleep 1
map=$( cat /proc/1/maps )
/usr/bin/logger "waiting for init to respawn"
i=$((i+1))
if [ $i -eq $timeout ] ; then
break
fi
done

if [ "$map" = "$old_map" ] ; then
/usr/bin/logger "FAIL: init failed to respawn in 
$timeout seconds - unmounting anyway"
else
/usr/bin/logger "SUCCESS: init respawned after $i 
seconds (within $timeout seconds timeout)"
fi
fi

# These directories must exist on the root filesystem as they are
# targets for system mountpoints.  We've just unmounted all other
# filesystems, so either they are mounted now (in which case the
# mount point exists) or we can make the mountpoint.
for dir in /proc /sys; do
mkdir -p $dir || true
done
# These must be turned into symlinks for the /run transition.  We
# can't do this at boot time because / is remounted read-write too
# late, so do it on shutdown instead.
if [ -d /var/run ]; then
umount -l /var/run || true
rm -rf /var/run
ln -nsf /run /var/run
fi
if [ -d /var/lock ]; then
umount -l /var/lock || true
rm -rf /var/lock
ln -nsf /run/lock /var/lock
fi
if [ -d /dev/shm ]; then
umount -l /dev/shm || true
rm -rf /dev/shm
ln -nsf /run/shm /de

Re: Questions and patches related to casper.

2012-05-17 Thread Ben Greear

On 05/16/2012 08:30 PM, Akkana Peck wrote:

Ben Greear writes:


I have been having issues trying to do a persistent-usb image for
Ubuntu 12.04.


I got it working once on Oneiric, but only on a multi-distro USB
stick using grub, with a separate partition for casper, like this:
http://shallowsky.com/blog/linux/install/ubuntu-persistent-live-cd.html
I've never had any luck on either O or P in getting a single-boot
USB stick to be persistent.

I'm currently setting up some USB sticks to use in a classroom/workshop
setting, with everybody booted from the same image. After wasting
most of a day trying to make persistence work, it occurred to me to
wonder why I was doing all that work: for a USB stick, why not just
install Ubuntu to the stick, and have a normal install that saves
whatever changes you make? No need for overlays like casper, just
install to a normal filesystem on the USB stick.


Using 'dd' on windows is a royal pain, so if I can just point the
users at some third-party pendrive tools and feed our modified .iso
image into that, that is the easiest I think.  I also like that the
user can choose the amount of persistent storage based on their USB
stick size.

That said, if I can't find a way to cleanly un-mount the /cow
(or mount it (ro)) on shutdown, then I'm going to have to try
something else...

And, I'm seeing ubiquity panel cores on startup of the live-cd
image, which is almost worse.  I'm going to re-build the modified
cd image from scratch today in hope that that will somehow fix
the cores.  They started after I removed /var/cache/* in an attempt
to make the cd image smaller...seems that might have been a bad
idea...

Thanks,
Ben


--
Ben Greear 
Candela Technologies Inc  http://www.candelatech.com


--
Ubuntu-devel-discuss mailing list
Ubuntu-devel-discuss@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel-discuss


Questions and patches related to casper.

2012-05-16 Thread Ben Greear


I have been having issues trying to do a persistent-usb image for
Ubuntu 12.04.

*  /cow is not checked with fsck on startup.  (casper patch to fix this 
attached)

* /cow is not visible in / by default.  I think this is required if
  we are ever to be able to unmount /cow cleanly.
  (fixed by attached casper patch).

* /cow cannot be cleanly un-mounted on shutdown

  I've made some attempts, but have not gotten this working.
  The attached '/etc/init.d/umountroot' contains my attempts.


I'd love to get this working cleanlyso please let me know if you
have any suggestions.

I'm not sure if Ubuntu uses 'signed-off-by' for this type
of thing, but if so, consider it:

Signed-off-by:  Ben Greear 

Thanks,
Ben

--
Ben Greear 
Candela Technologies Inc  http://www.candelatech.com

--- /home/greearb/casper.orig	2012-05-08 09:09:43.012658969 -0700
+++ casper	2012-05-16 15:10:04.310483151 -0700
@@ -17,6 +17,7 @@
 USERFULLNAME="Live session user"
 HOST=live
 BUILD_SYSTEM=Custom
+FSCKARG=-p
 
 mkdir -p $mountpoint
 tried=/tmp/tried
@@ -61,6 +62,10 @@
 export TORAM="Yes" ;;
 todisk=*)
 export TODISK="${x#todisk=}" ;;
+fscky)
+		FSCKARG=-y ;;
+casper-notquiet)
+		quiet=n ;;
 esac
 done
 if [ "${UNIONFS}" = "" ]; then
@@ -441,6 +446,24 @@
 fi
 fi
 
+if [ "_${cow_fstype}" = "_ext2" -o "_${cow_fstype}" = "_ext3" -o "_${cow_fstype}" = "_ext4" ]
+	then
+	[ "$quiet" != "y" ] && log_warning_msg "Running e2fsck on ${cowdevice}, fstype: ${cow_fstype}"
+	e2fsck ${FSCKARG} ${cowdevice}
+	EC2=$?
+	if [ $EC2 != "0" ]
+		then
+		if [ $EC2 = "1" ]
+			then
+			log_warning_msg "e2fsck automatically corrected errors on ${cowdevice}, fstype: ${cow_fstype}"
+		else
+			panic "ERROR: Possible file system corruption on ${cowdevice}: $EC2  Run: e2fsck ${cowdevice} or e2fsck -y ${cowdevice} and then exit"
+		fi
+	fi
+else
+	[ "$quiet" != "y" ] && log_warning_msg "Not running fsck on ${cowdevice}, only ext2/2/4 fsck supported: ${cow_fstype}"
+fi
+
 mount -t ${cow_fstype} -o ${cow_mountopt} ${cowdevice} /cow || panic "Can not mount $cowdevice on /cow"
 
 case ${UNIONFS} in
@@ -505,9 +528,17 @@
 ;;
 esac
 done
-# shows cow fs on /cow for use by casper-snapshot
-mkdir -p "${rootmnt}/cow"
-mount -o bind /cow "${rootmnt}/cow"
+fi
+
+# We always need to show cow so we can at least try to gracefully
+# unmount it on shutdown (or re-mount ro or whatever)
+
+# shows cow fs on /cow for use by casper-snapshot
+mkdir -p "${rootmnt}/cow"
+if [ "${UNIONFS}" = unionfs-fuse ]; then
+	mount -o bind /cow "${rootmnt}/cow"
+else
+	mount -o move /cow "${rootmnt}/cow"
 fi
 
 # move the first mount; no head in busybox-initramfs
#! /bin/sh
### BEGIN INIT INFO
# Provides:  umountroot
# Required-Start:
# Required-Stop:
# Should-Stop:   halt reboot kexec
# Default-Start:
# Default-Stop:  0 6
# Short-Description: Mount the root filesystem read-only.
### END INIT INFO

PATH=/sbin:/bin
. /lib/init/vars.sh

. /lib/lsb/init-functions

do_stop () {
[ "$VERBOSE" = no ] || log_action_begin_msg "Mounting root filesystem 
read-only"
# Ask init to re-exec itself before we go down if it has been
# upgraded this cycle.  It'll lose all its state, but at least
# it won't hold open files on the root filesystem (lp:#672177).
if [ -f /var/run/init.upgraded ]
then
old_map=$( cat /proc/1/maps )
map=$old_map
telinit u || :
i=0
timeout=5
while [ "$map" = "$old_map" ]
do
sleep 1
map=$( cat /proc/1/maps )
/usr/bin/logger "waiting for init to respawn"
i=$((i+1))
if [ $i -eq $timeout ] ; then
break
fi
done

if [ "$map" = "$old_map" ] ; then
/usr/bin/logger "FAIL: init failed to respawn in 
$timeout seconds - unmounting anyway"
else
/usr/bin/logger "SUCCESS: init respawned after $i 
seconds (within $timeout seconds timeout)"
fi
fi

# These directories must exist on the root filesystem as they are
# targets for system mountpoints.  We've just unmounted all other
  

Re: Rebuilding linux-ubuntu-modules and linux-restricted-modules?

2008-05-02 Thread Ben Greear
Matt Price wrote:
> i think this belongs with kernel-team?
> On Fri, 2008-05-02 at 21:54 -0400, Aubrey Eddleson wrote:
>   
>> Hey,
>>
>> I've looked high and low and nowhere can I find a workable method
>> of recompiling linux-ubuntu-modules and linux-restricted-modules for a
>> custom kernel.  Please forgive me for asking this here, but I don't
>> know anyone else to aks and I find more and more often that modules
>> that I know and appreciate are being absorbed by these two packages
>> (fglrx became part of l-r-m in Hardy).  Also, if there's any way to
>> modify the code to automatically compile under /usr/src/modules with
>> module-assistant as was more common previously, that would be wonderful!
>>
>> Thanks in advance for any help anyone can offer,
>>
>> Aubrey
>>
>> 
> all i can say isthat, back when i used to do this, i remember it was not
> straightforward.  and things have changed a lot since then, so i won't
> comment further, but maybe some of the kernel team members can help
> uout, especially now that hardy has been released.
> matt
>   
I have some notes for rebuilding a live image with a patched kernel.  I 
got the external modules
to compile once with something very like what is in the notes, but I was 
not able to do it a
second time.  I think there may be some soft/hard link loop somewhere.  
If you try these
steps, let me know how it works out.

Please ignore the stuff related to LANforge..that is my project that I 
am adding to the custom
live cd.

http://www.candelatech.com/oss/ubuntu-live-notes.txt

Thanks,
Ben

>
>
>   


-- 
Ben Greear <[EMAIL PROTECTED]> 
Candela Technologies Inc  http://www.candelatech.com



-- 
Ubuntu-devel-discuss mailing list
Ubuntu-devel-discuss@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel-discuss


Question on building custom kernels.

2008-04-11 Thread Ben Greear
My goal is to build a live ubuntu CD that has a patched kernel and my 
own applications
pre-installed on it.  I feel I am very close, but I can't get the kernel 
to work right.


I am using Ubuntu 7.10 desktop version.
At first, I was trying to use kernel 2.6.23.17 + my own hacks with a 
.config based off of
Fedora 8, and then with a .config from the ubuntu 2.6.22 kernel.  I then 
tried back-porting my patches
into the official 2.6.22.9 ubunto kernel-tree and using the default 
debian .config.  I changed the
.config slightly (disabled debugging symbols, support 16 cpus, 2/2G 
memory mapping, 1000

ticks per sec and enabled some modules relating to my own patch-set.)

In all cases, the live CD (booted under qemu) appears to start OK, but 
without any obvious

errors it goes to the initramfs prompt instead of booting into linux proper.

I am attaching the steps I am using to try to do all of this.  Once I 
run through these steps once,
I have been going into the chroot again to install new test kernels, and 
then run all of the
live-cd related commands after '#Clean up chroot"  I tried the steps 
w/out updating the
kernel and it booted fine, so it seems to be specifically related to the 
kernel.


Any ideas what I could be doing wrong or suggestions for ways to further 
debug this?


Thanks,
Ben

--
Ben Greear <[EMAIL PROTECTED]> 
Candela Technologies Inc  http://www.candelatech.com





Mostly just follow notes on this page:

http://www.debuntu.org/how-to-customize-your-ubuntu-live-cd-p2

Also remove openoffice, totem, rhythmbox, sound-juicer, old linux kernel
(after update)


# Should be able to copy & paste this on an Ubuntu machine to
# get desired results.

sudo apt-get install squashfs-tools
mkdir /tmp/livecd
sudo mount -o loop ~/Desktop/ubuntu-7.10-desktop-i386.iso /tmp/livecd
mkdir ~/livecd
mkdir ~/livecd/cd
rsync --exclude=/casper/filesystem.squashfs -a /tmp/livecd/ ~/livecd/cd
mkdir ~/livecd/squashfs
mkdir ~/livecd/custom
sudo modprobe squashfs
sudo mount -t squashfs -o loop /tmp/livecd/casper/filesystem.squashfs 
~/livecd/squashfs/
sudo cp -a ~/livecd/squashfs/* ~/livecd/custom
sudo cp /etc/resolv.conf /etc/hosts ~/livecd/custom/etc/

# Enter the chroot
sudo chroot ~/livecd/custom
mount -t proc none /proc/
mount -t sysfs none /sys/
export HOME=/root 

# Purge things we don't need.
echo Y|apt-get remove --purge gnome-games*
echo Y|apt-get remove --purge `dpkg-query -W --showformat='${Package}\n' | grep 
language-pack | egrep -v '\-en'` 
echo Y|apt-get remove --purge `dpkg-query -W --showformat='${Package}\n' | grep 
openoffice`
echo Y|apt-get remove --purge `dpkg-query -W --showformat='${Package}\n' | grep 
totem`
echo Y|apt-get remove --purge `dpkg-query -W --showformat='${Package}\n' | grep 
rhythmbox`
echo Y|apt-get remove --purge `dpkg-query -W --showformat='${Package}\n' | grep 
sound-juicer`
echo Y|apt-get remove --purge `dpkg-query -W --showformat='${Package}\n' | grep 
gimp`
echo Y|apt-get remove --purge `dpkg-query -W --showformat='${Package}\n' | grep 
evolution`
echo Y|apt-get remove --purge `dpkg-query -W --showformat='${Package}\n' | grep 
mono`

echo Y|apt-get install portmap nfs-common nfs-kernel-server
mkdir /mnt/d2
mount 192.168.100.3:/mnt/d2 /mnt/d2

echo deb file:/mnt/d2/pub/candela_cdrom.5.0.7/debs candela multiverse >> 
/etc/apt/sources.list
echo deb http://archive.ubuntu.com/ubuntu gutsy universe multiverse >> 
/etc/apt/sources.list
apt-get update

echo Y|apt-get dist-upgrade

echo Y|apt-get install wireshark traceroute dhcp bridge-utils ssh

# Install LANforge
adduser lanforge
echo y|apt-get install lanforge-gui
apt-get install lanforge-server
# apt-get install lanforge-xorp
apt-get install lanforge-server
apt-get install linux-image-2.6.23.17
update-initramfs -u -k 2.6.23.17

# Set root password
sudo passwd root

# Remove old kernel

# Clean up chroot
apt-get clean
rm -fr /tmp/*
umount /mnt/d2
umount nfsd
umount /proc
umount /sys
umount /proc
umount /sys
umount tmpfs
rm -f /etc/hosts /etc/resolv.conf

# Exit from chroot
exit

# Get ready to make the ISO
chmod +w ~/livecd/cd/casper/filesystem.manifest
sudo chroot ~/livecd/custom dpkg-query -W \
--showformat='${Package} ${Version}\n' > ~/livecd/cd/casper/filesystem.manifest
sudo cp ~/livecd/cd/casper/filesystem.manifest 
~/livecd/cd/casper/filesystem.manifest-desktop

# Copy new kernel into isolinux dir for the live cd
sudo cp /home/lanforge/livecd/custom/initrd.img 
/home/lanforge/livecd/cd/casper/initrd.gz
sudo cp /home/lanforge/livecd/custom/vmlinuz 
/home/lanforge/livecd/cd/casper/vmlinuz

# Make the squashfs file system
sudo rm ~/livecd/cd/casper/filesystem.squashfs
sudo mksquashfs ~/livecd/custom ~/livecd/cd/casper/filesystem.squashfs

# Edit ~/livecd/cd/README.diskdefines
sudo vi ~/livecd/cd/README.diskdefines

sudo rm ~/livecd/cd/md5sum.txt
sudo -s
(cd ~/livecd/cd &&am