diff options
author | luigi <luigi@FreeBSD.org> | 2002-03-11 05:54:22 +0000 |
---|---|---|
committer | luigi <luigi@FreeBSD.org> | 2002-03-11 05:54:22 +0000 |
commit | 145ec650e8c32e07c137a47c2dbaadd2e9768e6e (patch) | |
tree | 9528fc8ddc15b1e0845a2854470ea97a67d7401e | |
parent | 2f70b8739db17d40182c1c318134f19fc491a097 (diff) | |
download | FreeBSD-src-145ec650e8c32e07c137a47c2dbaadd2e9768e6e.zip FreeBSD-src-145ec650e8c32e07c137a47c2dbaadd2e9768e6e.tar.gz |
Fix detection of existing ssh host key, generate the new one
in floppy.tree instead of mfs_tree.
Do not cleanup ${BUILDDIR}/floppy.tree, it might be useful to look
at it after an image has been built.
-rwxr-xr-x | release/picobsd/build/picobsd | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/release/picobsd/build/picobsd b/release/picobsd/build/picobsd index cbfc2e1..573df42 100755 --- a/release/picobsd/build/picobsd +++ b/release/picobsd/build/picobsd @@ -162,13 +162,13 @@ create_includes_and_libraries() { INCOWN=`id -un` BINOWN=`id -un` DESTDIR=${SRC}/.. \ make -m ${SRC}/share/mk \ -DNOHTML -DNOINFO -DNOMAN -DNOSHARE -DNOFSCHG " - # need to 'make obj' in a few places. This is very - # version-specific... The following works for 5.0 + log "do a 'make obj' in a few places." + # This is very version-specific... The following works for 5.0 for i in lib secure/lib gnu/lib usr.sbin/pcvt/keycap \ gnu/usr.bin/perl usr.bin/lex usr.sbin/config ; do (cd ${i}; eval $e obj) done - # now make the static libraries + log "now make the static libraries" eval $e -DNOPROFILE -DNOPIC libraries (cd ${SRC}/usr.sbin/config eval $e # build binary @@ -376,7 +376,7 @@ this as small as possible. " 10 70 2> ${c_reply} \ { dialog --title "MFS bytes per inode:" --inputbox \ "Enter MFS bytes per inode (typically 4096..65536). \ A larger value means fewer inodes but more space on MFS" \ - 10 70 2> ${c_reply} && mfs_inodes=`cat ${c_reply}` ; } || true + 10 70 2> ${c_reply} && mfs_inodes=`cat ${c_reply}` ; } || true ;; U) @@ -494,6 +494,7 @@ populate_floppy_fs() { # OK else log "No site-specific floppy-tree" fi + # gzip returns an error if it fails to compress some file (cd $dst ; gzip -9 etc/* log "Compressed files in etc/ `echo; ls -l etc`" @@ -585,11 +586,14 @@ populate_mfs_tree() { ) || fail $? crunch if [ -f ${dst}/stand/sshd ] ; then - log "Creating host key for sshd" - if [ -f ${dst}/etc/ssh_host_key ] ; then + log "Setting up host key for sshd:" + if [ -f ${BUILDDIR}/floppy.tree/etc/ssh_host_key.gz ] ; then log "Using existing host key" else - ssh-keygen -f ${dst}/etc/ssh_host_key -N "" -C "root@picobsd" + log "Generating new host key" + ssh-keygen -f ${BUILDDIR}/floppy.tree/etc/ssh_host_key \ + -N "" -C "root@picobsd" + gzip -9 ${BUILDDIR}/floppy.tree/etc/ssh_host_key* || true fi fi @@ -598,7 +602,7 @@ populate_mfs_tree() { if [ -d ${MFS_TREE} ] ; then log "Copy ${MFS_TREE} ..." (cd ${MFS_TREE} ; tar -cf - --exclude CVS . ) | \ - (cd ${dst} ; tar x${o_tarv}f - ) + (cd ${dst} ; tar x${o_tarv}f - ) fi done @@ -769,7 +773,7 @@ fill_floppy_image() { log "Newfs floppy image" newfs -i ${fd_inodes} -m 0 -p 0 -o space -f 512 -b 4096 \ - /dev/${l_vndev}a > /dev/null + /dev/${l_vndev}a > /dev/null log "Mounting floppy image" mount /dev/${l_vndev}a ${dst} @@ -804,7 +808,7 @@ fi fi ) (log "Fixing permissions"; cd ${dst}; chown -R root *) - rm -rf ${BUILDDIR}/floppy.tree || true # cleanup + # rm -rf ${BUILDDIR}/floppy.tree || true # cleanup df -ik ${dst} | colrm 70 > .build.reply free_vnode |