
+ [ -d "/etc/yum/" ] && installer=yum + [ -d "/etc/apt/" ] && installer=apt
how about use has_cmd
Good !
- "$pkg_installer" install -y "$pt" || die "cannot install pkg: $pt." + "$installer" install -y "$pt" || die "cannot install pkg: $pt."
--skip-broken
Good, but this is unnecessary here.
+rootfs_install_pkgs()
install_pkgs_for_rootfs
Good.
+{ + [ -n "$rootfs_install_pkgs" ] || return 0 + + local installer=$(get_pkg_installer) + + if [ "$installer" == "yum" ]; then + "$installer" install -y --installroot=${ROOTFS_DES_DIR} ${rootfs_install_pkgs//,/ }
--skip-broken
ok, it look more suitable here. -------- Thanks Yu Chuan
Thanks, Shenwei
+ elif [ "$installer" == "apt" ]; then + "$installer" install -y -o RootDir=${ROOTFS_DES_DIR} ${rootfs_install_pkgs//,/ } + fi +} + config_rootfs() { config_dns_resolver disable_selinux disable_fstab + + rootfs_install_pkgs }
############ test rootfs ############ -- 2.23.0