diff options
| author | Jonathan Bauer | 2012-12-11 15:11:41 +0100 |
|---|---|---|
| committer | Jonathan Bauer | 2012-12-11 15:11:41 +0100 |
| commit | d3bb9107163e622fe9f2702e1a6572746f149d36 (patch) | |
| tree | 0763b6d740d7365808496055493577ebc4faad90 /remote/tools/base | |
| parent | REQUIRED_FILES can be path or filename, searching accordingly. Added base too... (diff) | |
| download | tm-scripts-d3bb9107163e622fe9f2702e1a6572746f149d36.tar.gz tm-scripts-d3bb9107163e622fe9f2702e1a6572746f149d36.tar.xz tm-scripts-d3bb9107163e622fe9f2702e1a6572746f149d36.zip | |
reworked setup-tools, generation of base dir structure of stage3.2 with tool named base
Diffstat (limited to 'remote/tools/base')
| -rw-r--r-- | remote/tools/base/README | 3 | ||||
| -rw-r--r-- | remote/tools/base/base.build | 72 | ||||
| -rw-r--r-- | remote/tools/base/base.conf | 71 | ||||
| -rw-r--r-- | remote/tools/base/build.base | 34 |
4 files changed, 118 insertions, 62 deletions
diff --git a/remote/tools/base/README b/remote/tools/base/README index 44ce10a1..39d10af1 100644 --- a/remote/tools/base/README +++ b/remote/tools/base/README @@ -10,5 +10,6 @@ lib/i386-linux-gnu/libpam* lib/i386-linux-gnu/libutil* lib/i386-linux-gnu/security/* - Install libc6 package? + +Add debug-shell.service diff --git a/remote/tools/base/base.build b/remote/tools/base/base.build new file mode 100644 index 00000000..b694f13c --- /dev/null +++ b/remote/tools/base/base.build @@ -0,0 +1,72 @@ +install_dependencies() { + : +} + +fetch_source() { + : +} + +build() { + + BUILDDIR=$TOOL_DIR/$TOOL/build + [ ! -d $BUILDDIR ] && mkdir -p $BUILDDIR + + FILELIST="list_binaries_and_files" + [ -e $FILELIST ] && rm $FILELIST + + for BIN in $REQUIRED_BINARIES + do + echo $(which $BIN) >> $FILELIST + done + + for LIB in $REQUIRED_LIBRARIES + do + for LIB_LOCATION in $(locate $LIB|grep ^/lib/) + do + echo $LIB_LOCATION >> $FILELIST + done + done + + for FILE in $REQUIRED_DIRECTORIES + do + [ ! -f $FILE ] && echo $FILE >> $FILELIST + done + for FILE in $REQUIRED_FILES + do + [ ! -d $FILE ] && echo $FILE >> $FILELIST + done + + # copy needed files from libc6 + #for FILE in $(dpkg -L libc6|grep -v share/man) + #do + # [ ! -d $FILE ] && echo $FILE >> $FILELIST + #done + + tar -cpv $(cat $FILELIST) | tar -xpv -C $BUILDDIR &>/dev/null +} + +post_copy() { + + # make basic directory structure + mkdir -p $INIT_DIR/{bin,dev,proc,lib,etc,mnt,sys,var/run,var/lock,var/log,run/lock,run/shm} + + # copy devices from running system + cp -a /dev/{console,kmsg,mem,null,shm,tty,tty0,tty1,tty9,fb0,urandom,zero} \ + $INIT_DIR/dev + + # 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 pam modules, TODO: better way to find arch-dependant interfix... + tar -cpv $(dirname $(locate pam_unix.so|grep ^/lib/)) | tar -xpv -C $INIT_DIR &>/dev/null + + # link /etc/mtab, needed for systemd + ln -s /proc/self/mounts $INIT_DIR/etc/mtab + + # quick fix for missing group in /etc/group + echo "lock:x:128:" >> $INIT_DIR/etc/group + + # set root password + sed -i "s/root:.*/root:\$6\$QGcBjw6e\$sJvGXBfKuNd4Cx5\.aVxJT7PCq\/AWrP\/JLgvDHBGN164Rp2HRIENPQzieO\/2ctlQS7yRgWwaWTqJkZr7Uq37af1:15657:0:99999:7:::/g" $INIT_DIR/etc/shadow +} diff --git a/remote/tools/base/base.conf b/remote/tools/base/base.conf index 061418f8..fb4aebc3 100644 --- a/remote/tools/base/base.conf +++ b/remote/tools/base/base.conf @@ -1,27 +1,44 @@ -REQUIRED_BINARIES="bash -agetty -cat -false -loadkeys -setfont -login -sulogin -mount -umount -rm -ldd -strace" -REQUIRED_FILES="/etc/passwd -/etc/shadow -/etc/group -/etc/hostname -/etc/issue -/etc/localtime -/etc/mtab -/etc/nsswitch.conf -/etc/pam.* -/etc/securetty -/etc/security/* -/etc/systemd/* -/etc/default/locale -/etc/fstab" +REQUIRED_BINARIES=" bash + agetty + cat + false + loadkeys + setfont + login + sulogin + mount + umount + rm + ldd + strace" +REQUIRED_LIBRARIES=" libcap + libcidn + libcom_err + libcrypt + libcrypto + libnsl + libnss_compat + libnss_dns + libnss_files + libnss_hesiod + libnss_nis + libnss_nisplus + libpam + libutil + libtinfo" +REQUIRED_DIRECTORIES=" /etc/pam.d + /etc/security" +REQUIRED_FILES=" /etc/passwd + /etc/shadow + /etc/group + /etc/hostname + /etc/environment + /etc/pam.conf + /etc/issue + /etc/localtime + /etc/login.defs + /etc/nsswitch.conf + /etc/securetty + /etc/default/locale + /etc/fstab + /etc/mtab" diff --git a/remote/tools/base/build.base b/remote/tools/base/build.base deleted file mode 100644 index b6324d47..00000000 --- a/remote/tools/base/build.base +++ /dev/null @@ -1,34 +0,0 @@ -install_dependencies() { - : -} - -fetch_source() { - : -} - -build() { - if [ ! -e .built ]; then - [ ! -d $TOOL_DIR/$TOOL/build ] && mkdir -p $TOOL_DIR/$TOOL/build - FILELIST="filelist" - for bin in $REQUIRED_BINARIES - do - echo $(which $bin) >> $FILELIST - done - for file in $REQUIRED_FILES - do - echo $file >> $FILELIST - done - - touch .built - tar -cpv $(cat $FILELIST) | tar -xpv -C $TOOL_DIR/$TOOL/build &>/dev/null - - # quick fix for /etc/mtab - ln -s /proc/self/mounts $TOOL_DIR/$TOOL/build/etc/mtab - - # quick fix for missing group in /etc/group - echo "lock:x:128:" >> $TOOL_DIR/$TOOL/build/etc/group && echo "FIXED GROUP" - - sed -i.bak "s/root:.*/root:\$6\$QGcBjw6e\$sJvGXBfKuNd4Cx5\.aVxJT7PCq\/AWrP\/JLgvDHBGN164Rp2HRIENPQzieO\/2ctlQS7yRgWwaWTqJkZr7Uq37af1:15657:0:99999:7:::/g" $TOOL_DIR/$TOOL/build/etc/shadow - - fi -} |
