--- elwix/build_romfs.sh 2013/01/28 10:42:47 1.5 +++ elwix/build_romfs.sh 2021/07/16 18:35:50 1.11 @@ -5,7 +5,7 @@ # (C) AITNET ltd - Sofia/Bulgaria # by Michael Pounov # -# $Id: build_romfs.sh,v 1.5 2013/01/28 10:42:47 misho Exp $ +# $Id: build_romfs.sh,v 1.11 2021/07/16 18:35:50 misho Exp $ # [ -r ./config/rc.elwix ] && . ./config/rc.elwix @@ -32,7 +32,7 @@ fi clean_romfs() { - echo "+++ Clean ELWIX RomFS firmware ..." + echo "+++ Clean ELWIX RomFS firmware ... $ROMFS" chflags -Rf noschg $ROMFS rm -rf $ROMFS @@ -42,7 +42,7 @@ clean_romfs() build_romfs() { - echo "+++ Build ELWIX RomFS directory ..." + echo "+++ Build ELWIX RomFS directory ... $ROMFS_USR" mkdir -p $ROMFS_USR cd $ROMFS_USR @@ -53,19 +53,20 @@ build_romfs() install -d lib/geom; install -d libdata; install -d libexec; - install -d local; - install -d local/bin; - install -d local/lib; - install -d local/libexec; - install -d local/libdata; - install -d local/sbin; install -d share; + install -d share/keys; install -d share/misc; install -d share/skel; install -d share/zoneinfo; + ln -s /elwix/local local; ln -s /elwix/pkg pkg; + # special patch to ensuring properly working of passwd!!! + ln -s /sbin/pwd_mkdb sbin; + # special patch to ensuring properly working of atrun!!! + ln -s /usr/pkg/sbin/mini_sendmail sbin/sendmail; + chown -hR root:wheel . cd - } @@ -81,10 +82,10 @@ install_romfs() SKEL="${SHARE}/skel" MISC="${SHARE}/misc" - echo "+++ Install ELWIX RomFS software ..." - if [ -r ${BSDSRC}/release/picobsd/mfs_tree/etc/termcap ]; then - install -v -m 644 ${BSDSRC}/release/picobsd/mfs_tree/etc/termcap $MISC; - install -v -m 644 ${BSDSRC}/release/picobsd/mfs_tree/etc/services $MISC; + echo "+++ Install ELWIX RomFS software ... $ROMFS_USR" + if [ -r files/etc/termcap ]; then + install -v -m 644 files/etc/termcap $MISC; + install -v -m 644 files/etc/services $MISC; else install -v -m 644 ${BSDSRC}/etc/termcap.small $MISC/termcap; install -v -m 644 ${BSDSRC}/etc/services $MISC; @@ -96,10 +97,11 @@ install_romfs() install -v ${CFGDIR}/root.skel/profile $SKEL/dot.profile; install -v ${CFGDIR}/root.skel/vimrc $SKEL/dot.vimrc; - find ${WORLD}/lib -type f -name \*.so.\* -exec install {} $LIBS \; + find ${WORLD}/lib -type f -name \*.so.\* ! -name \*.debug -exec install {} $LIBS \; find ${WORLD}/lib -type f -name libalias_\*.so -exec install {} $LIBS \; find ${WORLD}/lib/geom -type f -name \*.so -exec install {} $LIBS/geom \; - find ${WORLD}/usr/lib -type f -name \*.so.\* -exec install {} $LIBS \; + find ${WORLD}/usr/lib -type f -name \*.so.\* ! -name \*.debug -exec install {} $LIBS \; + find ${WORLD}/usr/lib/engines -type f -name \*.so -exec install {} $LIBS/engines \; InstallList ${ELWIX_ROMFS} ${WORLD} ${ROMFS} @@ -109,11 +111,12 @@ install_romfs() InstallDir ${WORLD}/usr/local/libdata $LIBDATA chown -R root:wheel $SBIN $BIN $LIBDATA $LIBEXEC $LIBS + echo "+++ Completed ELWIX RomFS software ... $ROMFS_USR" } build_image() { - echo "+++ Build ELWIX Firmware system image ..." + echo "+++ Build ELWIX Firmware system image ... $ROMFS_USR --> ${REL}/${ROMFS_IMG}" cd ${ROMFS_USR} pax -w -z -v -f${REL}/${ROMFS_IMG} . @@ -129,65 +132,15 @@ build_image() # mkuzip -s 8192 -o ${REL}/${ROMFS_IMG}.uzip ${REL}/${ROMFS_IMG}; # mv ${REL}/${ROMFS_IMG}.uzip ${REL}/${ROMFS_IMG} -} -build_image2() -{ - echo "+++ Build ELWIX Firmware secondary image ..." - - cd ${ROMFS_USR2} - pax -w -z -v -f${REL}/${ROMFS_IMG2} . - cd - - -# Stop using uzip fs -# makefs -ominfree=0,bsize=8192,fsize=1024,optimization=space -s${ROMFS_SIZE2} \ -# ${REL}/${ROMFS_IMG2} ${ROMFS_USR2} - -# MDDEV=$(mdconfig -a -t vnode -f ${REL}/${ROMFS_IMG2}); -# tunefs -L elwixFirmware2 /dev/$MDDEV; -# mdconfig -d -u $MDDEV; - -# mkuzip -s 8192 -o ${REL}/${ROMFS_IMG2}.uzip ${REL}/${ROMFS_IMG2}; -# mv ${REL}/${ROMFS_IMG2}.uzip ${REL}/${ROMFS_IMG2} + echo "+++ Completed ELWIX Firmware system image ... $ROMFS_USR --> ${REL}/${ROMFS_IMG}" } -install_romfs2() -{ - LIBS="${ROMFS_USR2}/lib" - LIBEXEC="${ROMFS_USR2}/libexec" - LIBDATA="${ROMFS_USR2}/libdata" - BIN="${ROMFS_USR2}/bin" - SBIN="${ROMFS_USR2}/sbin" - - echo "+++ Install ELWIX RomFS secondary software ..." - - install -d ${PKGDIR}/bin -# InstallDir ${PKGDIR}/bin $BIN - install -d ${PKGDIR}/sbin - InstallDir ${PKGDIR}/sbin $SBIN - - StripFiles \*.so\* ${PKG}/lib - InstallFiles \*.so\* ${PKG}/lib $LIBS - StripFiles \* ${PKG}/libexec - InstallFiles \* ${PKG}/libexec $LIBEXEC - StripFiles \* ${PKG}/libdata - InstallFiles \* ${PKG}/libdata $LIBDATA - StripFiles \* ${PKG}/bin - InstallFiles \* ${PKG}/bin $BIN - StripFiles \* ${PKG}/sbin - InstallFiles \* ${PKG}/sbin $SBIN - - chown -R root:wheel $SBIN $BIN $LIBDATA $LIBEXEC $LIBS -} - ### main() -clean_romfs -build_romfs +clean_romfs || exit 1 +build_romfs || exit 1 -install_romfs -build_image - -install_romfs2 -build_image2 +install_romfs || exit 1 +build_image || exit 1 echo "+++ Complete build ELWIX RomFS"