live-initramfs.diff discussion - fai package for Ubuntu 8.10 (both server and client)

Adrian Gibanel Lopez agibanel at alumnes.udl.cat
Wed Jan 14 21:33:55 CET 2009


> diff -urN original/hooks/live modificado/hooks/live
> --- original/hooks/live	2008-06-01 09:30:02.000000000 +0200
> +++ modificado/hooks/live	2008-12-20 20:34:38.000000000 +0100
> @@ -135,3 +135,6 @@
>  then
>  	copy_exec /usr/bin/wget /bin
>  fi
> +
> +# Program: wc
> +copy_exec /usr/bin/wc /bin
Somewhere in the FAI installation boot there were complaints about wc not
being found. I think that I did not only add these lines but I added the
dinamic version of wc command to the live-initramfs package (or was it the
initramfs-tools package? I do not remember).

> diff -urN original/scripts/live modificado/scripts/live
> --- original/scripts/live	2008-06-01 09:30:02.000000000 +0200
> +++ modificado/scripts/live	2008-12-30 19:40:43.000000000 +0100
> @@ -323,9 +323,9 @@
>  			url=*)
>  				location="${ARGUMENT#url=}"
>
> -				mount -n -o bind /sys /root/sys
> -				mount -n -o bind /proc /root/proc
> -				mount -n -o bind /dev /root/dev
> +				mount -n --bind /sys /root/sys || mount -n -o bind /sys /root/sys
> +				mount -n --bind /proc /root/proc || mount -n -o bind /proc /root/proc
> +				mount -n --bind /dev /root/dev || mount -n -o bind /dev /root/dev
--bind and --remount already explained in other emails.
>
>  				mkdir -p /root/var/run/network
>  				chroot /root dhclient eth0
> @@ -615,7 +615,7 @@
>  		cd "${copyto}"
>  		tar zxf "${copyfrom}/${LIVE_MEDIA_PATH}/$(basename ${FETCH})"
>  		rm -f "${copyfrom}/${LIVE_MEDIA_PATH}/$(basename ${FETCH})"
> -		mount -r -o move "${copyto}" "${rootmnt}"
> +		mount -r --move "${copyto}" "${rootmnt}" || mount -r -o move
"${copyto}" "${rootmnt}"
Idem.
>  		cd "${OLDPWD}"
>  	else
>  		if [ -n "${MODULETORAMFILE}" ]
> @@ -627,7 +627,7 @@
>
>  		livefs_root
>  		umount ${copyfrom}
> -		mount -r -o move ${copyto} ${copyfrom}
> +		mount -r --move ${copyto} ${copyfrom} || mount -r -o move ${copyto}
${copyfrom}
>  	fi
>
>  	rmdir ${copyto}
> @@ -1066,7 +1066,7 @@
>  		fi
>  		exposedrootfs=${rofslist%% }
>
> -		mount --bind ${exposedrootfs} ${rootmnt} || \
> +		mount --bind ${exposedrootfs} ${rootmnt} || mount -o bind
${exposedrootfs} ${rootmnt} || \
Idem.
>  			panic "bind mount of ${exposedrootfs} failed"
>
>  		cow_dirs='/var/tmp /var/lock /var/run /var/log /var/spool
> @@ -1084,6 +1084,11 @@
>  		mount -t ${UNIONTYPE} -o noatime,dirs=/cow=rw:${rofsstring} \
>  			${UNIONTYPE} "${rootmnt}" || panic "mount ${UNIONTYPE} on \
>  			${rootmnt} failed with option noatime,dirs=/cow=rw:${rofsstring}"
> +		/root/sbin/ldconfig.real
> +		chmod 600 /root/etc/fstab
> +		chmod 600 /root/etc/live.conf
> +		chmod 600 /root/etc/environment
> +		chmod 600 /root/etc/network/interfaces
The ldconfig.real call is because at this point the commands no longer
were looking at its libraries as it was set up in ld.so.conf. I suppose
that there is a problem of mount (I do not know if it is actually a bug or
not).
The Chmod 600 of these files is because some read-only errors happened at
boot. It is kind of a unionfs-hack.

Should I rewrite these chmods in a more elegant way?
Are there any other files that might needed this chmoding also?
>  	fi
>
>  	# tmpfs file systems
> @@ -1122,7 +1127,7 @@
>  					;;
>
>  				*)
> -					mount -o move "${d}" "${rootmnt}/live/${d##*/}"
> +					mount --move "${d}" "${rootmnt}/live/${d##*/}" || mount -o move
"${d}" "${rootmnt}/live/${d##*/}"
Already explained.
>  					;;
>  			esac
>  		done
> @@ -1130,7 +1135,7 @@
>
>  	# shows cow fs on /cow for use by live-snapshot
>  	mkdir -p "${rootmnt}/live/cow"
> -	mount -o move /cow "${rootmnt}/live/cow"
> +	mount --move /cow "${rootmnt}/live/cow" || mount -o move /cow
"${rootmnt}/live/cow"
Idem.
>  }
>
>  check_dev ()
> @@ -1152,7 +1157,7 @@
>
>  	if [ -d "${devname}" ]
>  	then
> -		mount -o bind "${devname}" $mountpoint || continue
> +		mount -o bind "${devname}" $mountpoint || mount --bind "${devname}"
$mountpoint || continue
Idem.
>
>  		if is_live_path $mountpoint
>  		then



-- 
Firma Automática 1:
---------------------
Adrian Gibanel Lopez
Estudiante de Ingenieria de Informatica de Sistemas en la Universitat de
LLeida.
Firma Automática 2:
---------------------
Participante en el III Concurso Universitario de Software Libre.
Proyecto: Desdeslin. http://desdeslin.wordpress.com


More information about the linux-fai mailing list