[Angstrom-devel] Koen Kooi : narcissus: run image preparation under fakeroot as well

Angstrom Git Repos ang-git at xora.vm.bytemark.co.uk
Tue Jun 7 21:23:09 CEST 2011


Module: narcissus
Branch: master
Commit: c16205b98127ce5b43c34cda55c00afe52cc765a

Author: Koen Kooi <koen at dominion.thruhere.net>
Date:   Tue Jun  7 14:11:23 2011 +0200

narcissus: run image preparation under fakeroot as well

update README with note on static linking

Signed-off-by: root <root at dominion.thruhere.net>

---

 README                    |    9 ++++
 scripts/assemble-image.sh |  101 ++++++++++++++++++++++++--------------------
 2 files changed, 64 insertions(+), 46 deletions(-)

diff --git a/README b/README
index 9f59ed2..ff90a9b 100644
--- a/README
+++ b/README
@@ -10,6 +10,15 @@ To install this:
 * mkdir deploy/
 * Optional: allow 'www-data' user to write to conf/beagleboard/sd/ to cache sd images
 * Optional: add 'www-data' to the 'disk' group
+* Optional: install mkfs.ubifs and mkfs.jffs2, but don't statically link in libc, otherwise pseudo won't work:
+
+	20:56 <+fray> check mk.ubifs, is it statically linked, etc?
+	20:57 <+koen> bin/mkfs.ubifs: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, for GNU/Linux 2.6.8, not stripped
+	20:57 <+koen> aha!
+	20:57 <+fray> bingo
+	20:57 <+fray> statically linked won't run inside of the pseudo environment..
+	20:57 <+fray> rebuild it and dynamically link it to libc
+	20:58 <+fray> in WR Linux we statically link a bunch of things, but we -always- dynamically link the LIBC  (so pseudo will work)
 
 To add a new machine:
 
diff --git a/scripts/assemble-image.sh b/scripts/assemble-image.sh
index 7cfb09a..1c99fa4 100755
--- a/scripts/assemble-image.sh
+++ b/scripts/assemble-image.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+
 # Narcissus - Online image builder for the angstrom distribution
 # Copyright (C) 2008 - 2011 Koen Kooi
 # Copyright (C) 2010        Denys Dmytriyenko
@@ -35,6 +35,10 @@ echo "cleaning up stale files"
 find cache/ipk/ -atime +7 -delete
 
 echo "Fakeroot config: ${FAKEROOT}"
+export PSEUDO_DISABLED=0
+export PSEUDO_DEBUG=2
+#export PSEUDO_DEBUG_FILE=/tmp/pseudo.log
+export PSEUDO_NOSYMLINKEXP=0
 
 function do_sdimg() 
 {
@@ -178,8 +182,8 @@ function do_ubifs()
 	  echo vol_type=dynamic >> ubinize.cfg
 	  echo vol_name=${MACHINE}-rootfs >> ubinize.cfg
 	  echo vol_flags=autoresize >> ubinize.cfg
-	  echo "running: mkfs.ubifs -r ${IMAGE_ROOTFS} -o ${TARGET_DIR}/../${IMAGENAME}-${MACHINE}.ubifs ${MKUBIFS_ARGS} && ubinize -o ${TARGET_DIR}/../${IMAGENAME}-${MACHINE}.ubi ${UBINIZE_ARGS} ubinize.cfg"
-	  mkfs.ubifs -r ${IMAGE_ROOTFS} -o ${TARGET_DIR}/../${IMAGENAME}-${MACHINE}.ubifs ${MKUBIFS_ARGS} && ubinize -o ${TARGET_DIR}/../${IMAGENAME}-${MACHINE}.ubi ${UBINIZE_ARGS} ubinize.cfg )
+	  echo "running: ${FAKEROOT} mkfs.ubifs -r ${IMAGE_ROOTFS} -o ${TARGET_DIR}/../${IMAGENAME}-${MACHINE}.ubifs ${MKUBIFS_ARGS} && ubinize -o ${TARGET_DIR}/../${IMAGENAME}-${MACHINE}.ubi ${UBINIZE_ARGS} ubinize.cfg"
+	  ${FAKEROOT} mkfs.ubifs -r ${IMAGE_ROOTFS} -o ${TARGET_DIR}/../${IMAGENAME}-${MACHINE}.ubifs ${MKUBIFS_ARGS} && ubinize -o ${TARGET_DIR}/../${IMAGENAME}-${MACHINE}.ubi ${UBINIZE_ARGS} ubinize.cfg )
 }
 
 function do_jffs2()
@@ -340,63 +344,68 @@ function do_oeimage()
 	echo "inherit image" >> ${TARGET_DIR}.bb
 }
 
-if ! [ -e ${TARGET_DIR}/etc/opkg.conf ] ; then
-	echo "Initial filesystem not found, something went wrong in the configure step!"
-	exit 0
-fi
-
-echo "installing initial /dev directory"
-mkdir -p ${TARGET_DIR}/dev
-bin/makedevs -r ${TARGET_DIR} -D conf/devtable.txt
+function do_prepare_image() {
+	export PSEUDO_DISABLED=0
 
-if [ -e ${TARGET_DIR}/log.txt ] ; then
-	rm ${TARGET_DIR}/log.txt
-fi
+	if ! [ -e ${TARGET_DIR}/etc/opkg.conf ] ; then
+		echo "Initial filesystem not found, something went wrong in the configure step!"
+		exit 0
+	fi
 
-echo "Running preinsts"
+	echo "installing initial /dev directory"
+	mkdir -p ${TARGET_DIR}/dev
+	${FAKEROOT} bin/makedevs -r ${TARGET_DIR} -D conf/devtable.txt
 
-for i in ${TARGET_DIR}/usr/lib/opkg/info/*.preinst; do
-	#sh ${PWD}/scripts/sleep.sh
-	if [ -f $i ] && ! sh $i; then
-		echo "Running: opkg-cl -o ${TARGET_DIR} -f ${TARGET_DIR}/etc/opkg.conf -t ${OPKG_TMP_DIR} flag unpacked `basename $i .preinst`"
-		opkg-cl -o ${TARGET_DIR} -f ${TARGET_DIR}/etc/opkg.conf -t ${OPKG_TMP_DIR} flag unpacked `basename $i .preinst`
+	if [ -e ${TARGET_DIR}/log.txt ] ; then
+		rm ${TARGET_DIR}/log.txt
 	fi
-done 
 
-echo "Running postinsts"
+	echo "Running preinsts"
 
-for i in ${TARGET_DIR}/usr/lib/opkg/info/*.postinst; do
-	#sh ${PWD}/scripts/sleep.sh
-	if [ -f $i ] && ! sh $i configure; then
-		echo "Running: opkg-cl -o ${TARGET_DIR} -f ${TARGET_DIR}/etc/opkg.conf -t ${OPKG_TMP_DIR} flag unpacked `basename $i .postinst`"
-		opkg-cl -o ${TARGET_DIR} -f ${TARGET_DIR}/etc/opkg.conf -t ${OPKG_TMP_DIR} flag unpacked `basename $i .postinst`
-	fi
-done 
+	for i in ${TARGET_DIR}/usr/lib/opkg/info/*.preinst; do
+		if [ -f $i ] && ! ${FAKEROOT} sh $i; then
+			echo "Running: ${FAKEROOT} opkg-cl -o ${TARGET_DIR} -f ${TARGET_DIR}/etc/opkg.conf -t ${OPKG_TMP_DIR} flag unpacked `basename $i .preinst`"
+			opkg-cl -o ${TARGET_DIR} -f ${TARGET_DIR}/etc/opkg.conf -t ${OPKG_TMP_DIR} flag unpacked `basename $i .preinst`
+		fi
+	done 
 
-if [ "$MANIFEST" = "yes" ] ; then
-	do_manifest
-fi
+	echo "Running postinsts"
 
-echo "removing opkg index files"
-rm ${TARGET_DIR}/var/lib/opkg/* || true
-rm ${TARGET_DIR}/usr/lib/opkg/lists/* || true
-rm ${TARGET_DIR}/linuxrc || true
+	for i in ${TARGET_DIR}/usr/lib/opkg/info/*.postinst; do
+		if [ -f $i ] && ! ${FAKEROOT} sh $i configure; then
+			echo "Running: ${FAKEROOT} opkg-cl -o ${TARGET_DIR} -f ${TARGET_DIR}/etc/opkg.conf -t ${OPKG_TMP_DIR} flag unpacked `basename $i .postinst`"
+			opkg-cl -o ${TARGET_DIR} -f ${TARGET_DIR}/etc/opkg.conf -t ${OPKG_TMP_DIR} flag unpacked `basename $i .postinst`
+		fi
+	done 
 
-# Add timestamp
-date "+%m%d%H%M%Y" > ${TARGET_DIR}/etc/timestamp
+	if [ "$MANIFEST" = "yes" ] ; then
+		do_manifest
+	fi
 
-# Add opendns to resolv.conf
-rm -f ${TARGET_DIR}/etc/resolv.conf
-echo "nameserver 208.67.222.222" > ${TARGET_DIR}/etc/resolv.conf
-echo "nameserver 208.67.220.220" >> ${TARGET_DIR}/etc/resolv.conf
+	echo "removing opkg index files"
+	rm ${TARGET_DIR}/var/lib/opkg/* || true
+	rm ${TARGET_DIR}/usr/lib/opkg/lists/* || true
+	rm ${TARGET_DIR}/linuxrc || true
+	rm ${TARGET_DIR}/tmp/*
 
-echo "$(date -u +%s) ${MACHINE} $(du ${TARGET_DIR} -hs | awk '{print $1}')" >> ${WORKDIR}/deploy/stats.txt || true
+	# Add timestamp
+	${FAKEROOT} date "+%m%d%H%M%Y" > ${TARGET_DIR}/etc/timestamp
 
-echo "<div id=\"imgsize\">" $(du ${TARGET_DIR} -hs) "</div>\n"
+	# Add opendns to resolv.conf
+	rm -f ${TARGET_DIR}/etc/resolv.conf
+	${FAKEROOT} echo "nameserver 208.67.222.222" > ${TARGET_DIR}/etc/resolv.conf
+	${FAKEROOT} echo "nameserver 208.67.220.220" >> ${TARGET_DIR}/etc/resolv.conf
+
+	echo "$(date -u +%s) ${MACHINE} $(du ${TARGET_DIR} -hs | awk '{print $1}')" >> ${WORKDIR}/deploy/stats.txt || true
+
+	echo "<div id=\"imgsize\">" $(du ${TARGET_DIR} -hs) "</div>\n"
+}
 
-export PSEUDO_DISABLED=0
 
-${FAKEROOT} do_oeimage
+echo "do_prepare_image"
+do_prepare_image
+echo "do_oeimage"
+do_oeimage
 
 case ${IMAGETYPE} in
 	jffs2)




More information about the Angstrom-distro-devel mailing list