summaryrefslogtreecommitdiffstats
path: root/remote/tools/base
diff options
context:
space:
mode:
authorMichael Neves2013-02-27 19:37:04 +0100
committerMichael Neves2013-02-27 19:37:04 +0100
commit459c9c02adf020d3e85d809c902196e801085a65 (patch)
treeaeec9e371eb37ea0419c05870b4a9a699c331d70 /remote/tools/base
parentcopy modules/firmware to stage31, generate separate initramfs for squashfs (diff)
parenttihi (diff)
downloadtm-scripts-459c9c02adf020d3e85d809c902196e801085a65.tar.gz
tm-scripts-459c9c02adf020d3e85d809c902196e801085a65.tar.xz
tm-scripts-459c9c02adf020d3e85d809c902196e801085a65.zip
init and build_core merges
Diffstat (limited to 'remote/tools/base')
-rw-r--r--remote/tools/base/base.build25
-rw-r--r--remote/tools/base/base.conf7
2 files changed, 13 insertions, 19 deletions
diff --git a/remote/tools/base/base.build b/remote/tools/base/base.build
index 7087664b..805fbbda 100644
--- a/remote/tools/base/base.build
+++ b/remote/tools/base/base.build
@@ -9,11 +9,11 @@ fetch_source() {
build() {
- BUILDDIR=${TOOL_DIR}/${TOOL}/build
- mkdir -p ${BUILDDIR}
+ BUILDDIR="${TOOL_DIR}/${TOOL}/build"
+ mkdir -p "${BUILDDIR}"
FILELIST="list_binaries_and_files"
- [ -e ${FILELIST} ] && rm ${FILELIST}
+ [ -e "${FILELIST}" ] && rm "${FILELIST}"
for BIN in ${REQUIRED_BINARIES}
do
@@ -21,10 +21,7 @@ build() {
if [ ! -z ${BIN_LOCATION} -a -e ${BIN_LOCATION} ];
then
pdebug "Processing $BIN at $BIN_LOCATION ..."
- echo ${BIN_LOCATION} >> "${FILELIST}"
- [ -L "${BIN_LOCATION}" ] \
- && pdebug "${BIN_LOCATION} is a symbolic link, copying $(readlink -f "${BIN_LOCATION}")" \
- && echo $(readlink -f "${BIN_LOCATION}") >> "${FILELIST}"
+ get_link_chain ${BIN_LOCATION} >> "${FILELIST}"
else
perror "${BIN} not found on the system! Please install it."
fi
@@ -32,9 +29,9 @@ build() {
for LIB in ${REQUIRED_LIBRARIES}
do
- for LIB_LOCATION in $(locate ${LIB} | grep ^/lib/)
+ for LIB_LOCATION in $(find /lib/ -name "${LIB}.so*")
do
- echo ${LIB_LOCATION} >> "${FILELIST}"
+ get_link_chain "${LIB_LOCATION}" >> "${FILELIST}"
done
done
@@ -52,9 +49,7 @@ build() {
local NUMFILES=$(cat "${FILELIST}" | wc -l)
if [ "x$NUMFILES" != "x" -a "x$NUMFILES" != "x0" ]; then
pinfo "File list generated at ${BUILDDIR}/${FILELIST} ($NUMFILES entries)"
- tar -cp $(cat "${FILELIST}") | tar -xp -C "${BUILDDIR}"
- local RET=$?
- [ $RET -ne 0 ] && perror "tar-copy from '$FILELIST' to '$BUILDDIR' failed."
+ tarcopy "$(cat "${FILELIST}")" "${BUILDDIR}"
fi
}
@@ -65,14 +60,14 @@ post_copy() {
# copy devices from running system
cp -a /dev/{console,kmsg,mem,null,shm,tty,tty0,tty1,tty9,fb0,urandom,zero} \
- "${INIT_DIR}"/dev
+ "${INIT_DIR}"/dev || perror "Copying devices from running system failed."
# set /etc/environment to include /openslx/bin and /openslx/sbin
echo "PATH=\"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/openslx/sbin:/openslx/bin\"" \
> "${INIT_DIR}/etc/environment"
# copy static files
- cp -r "${TOOL_DIR}/${TOOL}/data/*" "${INIT_DIR}"
+ cp -r "${TOOL_DIR}/${TOOL}"/data/* "${INIT_DIR}" || perror "Copying static files from data/* failed."
# better: dirname $(ldd $SHELL|grep libc | awk -F " " '{print $3}')
# copy pam modules, TODO: better way to find arch-dependant interfix...
@@ -93,7 +88,7 @@ post_copy() {
# setup root accoun
USER=root PASSWORD='!r00t' add_user
- [ ! -d ${INIT_DIR}/root ] && mkdir ${INIT_DIR}/root
+ mkdir -p ${INIT_DIR}/root
echo "minilinux-$(hostname)" > "${INIT_DIR}/etc/hostname"
diff --git a/remote/tools/base/base.conf b/remote/tools/base/base.conf
index 85b638e6..6a95ab2c 100644
--- a/remote/tools/base/base.conf
+++ b/remote/tools/base/base.conf
@@ -9,7 +9,8 @@ REQUIRED_BINARIES=" bash
sulogin
mount
umount
- mount.nfs
+ mount.nfs4
+ umount.nfs4
mount.aufs
umount.aufs
rm
@@ -40,9 +41,7 @@ REQUIRED_LIBRARIES=" libcap
libau"
REQUIRED_DIRECTORIES=" /etc/pam.d
/etc/security"
-REQUIRED_FILES=" /sbin/mount.nfs4
- /sbin/umount.nfs4
- /etc/environment
+REQUIRED_FILES=" /etc/environment
/etc/pam.conf
/etc/issue
/etc/inputrc