--- elwix/build_fs.sh 2011/07/21 13:05:09 1.1.2.1 +++ elwix/build_fs.sh 2012/03/20 16:12:44 1.3.2.5 @@ -5,7 +5,7 @@ # (C) AITNET ltd - Sofia/Bulgaria # by Michael Pounov # -# $Id: build_fs.sh,v 1.1.2.1 2011/07/21 13:05:09 misho Exp $ +# $Id: build_fs.sh,v 1.3.2.5 2012/03/20 16:12:44 misho Exp $ # [ -r ./config/rc.elwix ] && . ./config/rc.elwix @@ -74,11 +74,6 @@ build_fsdir() install -d -g daemon altroot/var/spool/output/lpd; # boot install -d boot; - install -d boot/defaults; - install -d boot/firmware; - install -d boot/kernel; - install -d boot/modules; - install -d boot/zfs; # cf install -d cf; # etc @@ -89,8 +84,9 @@ build_fsdir() install -d home; # root install -d -m 0700 root; -# local - install -d local; +# pkg + install -d pkg; + install -d pkg/db; # tftpboot install -d tftpboot; @@ -104,8 +100,13 @@ mkboot() InstallDir ${WORLD}/boot $1/boot install -m 644 ${CFGDIR}/boot/boot.config $1; - install -m 644 ${CFGDIR}/boot/beastie.4th $1/boot; + install -m 444 ${CFGDIR}/boot/beastie.4th $1/boot; + install -m 444 ${CFGDIR}/boot/brand.4th $1/boot; + install -m 444 ${CFGDIR}/boot/menu.4th $1/boot; + + install -m 444 ${KERNDEVHINTS} $1/boot/device.hints; + if [ -r ${CFGDIR}/boot/loader_${TARGET_ARCH}.conf ]; then install -m 644 ${CFGDIR}/boot/loader_${TARGET_ARCH}.conf $1/boot/loader.conf; else @@ -179,6 +180,7 @@ mketc() chmod 0600 $1/etc/ssh/ssh_host_dsa_key; chmod 0600 $1/etc/ssh/ssh_host_key; chmod 0600 $1/etc/ssh/ssh_host_rsa_key; + chmod 0600 $1/etc/ssh/ssh_host_ecdsa_key; chmod 0440 $1/etc/sudoers; @@ -193,15 +195,21 @@ mketc() ln -sf /var/named/etc/namedb $1/etc/namedb; ln -sf /var/run/resolv.conf $1/etc/resolv.conf; + ln -sf /elwix/pkg/etc/mk.conf $1/etc/mk.conf; + echo ${TARGET_ARCH} >$1/etc/platform; create_etc_motd $1/etc/motd; create_etc_fstab $1/etc/fstab; + + echo "+++ ELWIX clean CVS tags ..." + CleanCVS ${FS} + CleanCVS ${FS}/etc } mkbackup() { - echo "+++ Build elwix fs backup factory default directory ..." + echo "+++ Build ELWIX FS backup factory default directory ..." mkdir -p $1/altroot/backup cd $1 @@ -209,7 +217,6 @@ mkbackup() cp -p etc/config.xml altroot/backup cd altroot tar -czf backup/.var.tgz var - cd $TOPDIR } mkhome() @@ -228,19 +235,16 @@ mkhome() install_fsdir() { - echo "+++ Install elwix fs in bundle OS install file ..." + echo "+++ Install ELWIX FS in bundle OS install file ..." - sed -nE -e 's/^ *([^ #]+) */\1/p' < $ELWIX_FS | tr ':' '\n' | - tar -C / -cvf - -T - | tar -C $FS -x -f - + install -v ${REL}/${ROOTFS_KERN} ${FS}/boot/kernel - install -v $REL/$ROOTFS_KERN $FS/boot/kernel + install -v ${REL}/${ROMFS_IMG} ${FS}/altroot/elwix-firmware-${VERSION}_${TARGET_ARCH} + ln ${FS}/altroot/elwix-firmware-${VERSION}_${TARGET_ARCH} ${FS}/altroot/${ROMFS_IMG} + ln -s /elwix/altroot/elwix-firmware-${VERSION}_${TARGET_ARCH} ${FS}/${ROMFS_IMG} - install -v $REL/$FW_IMG $FS/elwix-firmware_$VERSION - ln -s /elwix/elwix-firmware_$VERSION $FS/$FW_IMG - cd $FS - tar -czvf $REL/$OS . - cd $TOPDIR + tar -czvf ${REL}/${OS} . } ### main() @@ -260,9 +264,9 @@ mkboot ${FS} mkhome ${FS} mkvar ${FS} mketc ${FS} -#mkbackup $FS +mkbackup ${FS} -#install_fsdir +install_fsdir echo "+++ Complete build ELWIX FS" echo "ELWIX finish version ${VERSION}, Good luck!"