version 1.2, 2011/10/18 09:02:05
|
version 1.6.2.2, 2013/07/29 08:52:16
|
Line 43 clean_romfs()
|
Line 43 clean_romfs()
|
build_romfs() |
build_romfs() |
{ |
{ |
echo "+++ Build ELWIX RomFS directory ..." |
echo "+++ Build ELWIX RomFS directory ..." |
mkdir -p $ROMFS_USR | mkdir -p $ROMFS |
|
|
cd $ROMFS_USR | cd $ROMFS |
|
|
install -d bin; |
install -d bin; |
|
install -d boot; |
|
install -d boot/defaults; |
|
install -d boot/firmware; |
|
install -d boot/kernel; |
|
install -d boot/modules; |
|
install -d boot/zfs; |
|
install -d dev; |
|
install -d elwix; |
|
install -d elwix/etc; |
|
install -d elwix/exports; |
|
install -d elwix/home; |
|
install -d -m 0750 elwix/root; |
|
install -d -m 0750 elwix/root/.ssh; |
|
install -d elwix/system; |
|
install -d elwix/tftpboot; |
|
install -d elwix/var; |
|
ln -fs /elwix/etc etc; |
|
ln -fs /elwix/exports exports; |
|
ln -fs /elwix/home home; |
|
ln -fs /elwix/root root; |
|
ln -fs /elwix/system system; |
|
ln -fs /elwix/tftpboot tftpboot; |
|
install -d mnt; |
|
install -d -m 0555 proc; |
install -d sbin; |
install -d sbin; |
install -d lib; | install -d -m 1777 tmp; |
install -d lib/geom; | install -d usr; |
install -d libdata; | install -d usr/bin; |
install -d libexec; | install -d usr/lib; |
install -d share; | ln -fs /usr/lib lib; |
install -d share/misc; | install -d usr/lib/engines; |
install -d share/skel; | install -d usr/lib/geom; |
install -d share/zoneinfo; | install -d usr/lib32; |
| install -d usr/libdata; |
| install -d usr/libexec; |
| ln -fs /usr/libexec libexec; |
| install -d usr/local; |
| install -d usr/local/bin; |
| install -d usr/local/lib; |
| install -d usr/local/libexec; |
| install -d usr/local/libdata; |
| install -d usr/local/sbin; |
| install -d usr/sbin; |
| install -d usr/share; |
| install -d usr/share/misc; |
| install -d usr/share/skel; |
| install -d usr/share/zoneinfo; |
| install -d var; |
|
|
ln -s /elwix/local local; |
|
|
|
chown -hR root:wheel . |
chown -hR root:wheel . |
cd - |
cd - |
} |
} |
|
|
install_romfs() |
install_romfs() |
{ |
{ |
LIBS="${ROMFS_USR}/lib" | LIBS="${ROMFS}/usr/lib" |
LIBEXEC="${ROMFS_USR}/libexec" | LIBEXEC="${ROMFS}/usr/libexec" |
LIBDATA="${ROMFS_USR}/libdata" | LIBDATA="${ROMFS}/usr/libdata" |
SKEL="${ROMFS_USR}/share/skel" | BIN="${ROMFS}/bin" |
MISC="${ROMFS_USR}/share/misc" | UBIN="${ROMFS}/usr/bin" |
BIN="${ROMFS_USR}/bin" | SBIN="${ROMFS}/sbin" |
SBIN="${ROMFS_USR}/sbin" | USBIN="${ROMFS}/usr/sbin" |
| SHARE="${ROMFS}/usr/share" |
| SKEL="${SHARE}/skel" |
| MISC="${SHARE}/misc" |
|
|
echo "+++ Install ELWIX RomFS software ..." |
echo "+++ Install ELWIX RomFS software ..." |
if [ -r ${BSDSRC}/release/picobsd/mfs_tree/etc/termcap ]; then |
if [ -r ${BSDSRC}/release/picobsd/mfs_tree/etc/termcap ]; then |
Line 83 install_romfs()
|
Line 123 install_romfs()
|
install -v -m 644 ${BSDSRC}/etc/services $MISC; |
install -v -m 644 ${BSDSRC}/etc/services $MISC; |
fi |
fi |
|
|
install -v -m 0555 ${WORLD}/libexec/ld-elf.so.1 $LIBEXEC |
|
|
|
install -v ${CFGDIR}/root.skel/cshrc $SKEL/dot.cshrc; |
install -v ${CFGDIR}/root.skel/cshrc $SKEL/dot.cshrc; |
install -v ${CFGDIR}/root.skel/login $SKEL/dot.login; |
install -v ${CFGDIR}/root.skel/login $SKEL/dot.login; |
install -v ${CFGDIR}/root.skel/logout $SKEL/dot.logout; |
install -v ${CFGDIR}/root.skel/logout $SKEL/dot.logout; |
Line 95 install_romfs()
|
Line 133 install_romfs()
|
find ${WORLD}/lib -type f -name libalias_\*.so -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}/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.\* -exec install {} $LIBS \; |
|
find ${WORLD}/usr/lib/engines -type f -name \*.so -exec install {} $LIBS/engines \; |
|
|
InstallList ${ELWIX_ROMFS} ${WORLD} ${ROMFS} |
InstallList ${ELWIX_ROMFS} ${WORLD} ${ROMFS} |
|
|
InstallDir ${WORLD}/usr/local/bin $BIN | InstallDir ${WORLD}/usr/local/bin $UBIN |
InstallDir ${WORLD}/usr/local/sbin $SBIN | InstallDir ${WORLD}/usr/local/sbin $USBIN |
| InstallFiles \*.so\* ${WORLD}/usr/local/lib $LIBS |
InstallDir ${WORLD}/usr/local/libdata $LIBDATA |
InstallDir ${WORLD}/usr/local/libdata $LIBDATA |
|
|
|
chown -R root:wheel $SBIN $BIN $USBIN $UBIN $LIBDATA $LIBEXEC $LIBS |
|
} |
|
|
|
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} |
|
} |
|
|
|
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 |
InstallFiles \*.so\* ${PKG}/lib $LIBS |
|
StripFiles \* ${PKG}/libexec |
InstallFiles \* ${PKG}/libexec $LIBEXEC |
InstallFiles \* ${PKG}/libexec $LIBEXEC |
|
StripFiles \* ${PKG}/libdata |
InstallFiles \* ${PKG}/libdata $LIBDATA |
InstallFiles \* ${PKG}/libdata $LIBDATA |
|
StripFiles \* ${PKG}/bin |
InstallFiles \* ${PKG}/bin $BIN |
InstallFiles \* ${PKG}/bin $BIN |
|
StripFiles \* ${PKG}/sbin |
InstallFiles \* ${PKG}/sbin $SBIN |
InstallFiles \* ${PKG}/sbin $SBIN |
|
|
chown -R root:wheel $SBIN $BIN $LIBDATA $LIBEXEC $LIBS |
chown -R root:wheel $SBIN $BIN $LIBDATA $LIBEXEC $LIBS |
} |
} |
|
|
build_image() |
|
{ |
|
echo "+++ Build ELWIX Firmware image ..." |
|
makefs -ominfree=0,bsize=8192,fsize=1024,optimization=space -s${ROMFS_SIZE} \ |
|
${REL}/${ROMFS_IMG} ${ROMFS_USR} |
|
|
|
MDDEV=$(mdconfig -a -t vnode -f ${REL}/${ROMFS_IMG}); |
|
tunefs -L elwixFirmware /dev/$MDDEV; |
|
# mount /dev/$MDDEV /mnt |
|
# umount /mnt |
|
mdconfig -d -u $MDDEV; |
|
|
|
mkuzip -s 8192 -o ${REL}/${ROMFS_IMG}.uzip ${REL}/${ROMFS_IMG}; |
|
mv ${REL}/${ROMFS_IMG}.uzip ${REL}/${ROMFS_IMG} |
|
} |
|
|
|
### main() |
### main() |
if SnitVer ${WORLD}/elwix.ver; then | clean_romfs |
clean_romfs | build_romfs |
|
|
build_romfs | install_romfs |
install_romfs | |
|
|
build_image | install_romfs2 |
else | build_image2 |
echo "Skipped ELWIX RomFS build ..." | |
fi | |
|
|
echo "+++ Complete build ELWIX RomFS" |
echo "+++ Complete build ELWIX RomFS" |