run apt-get update before installing packages in rootfs

This commit is contained in:
Michael Hudson-Doyle 2017-01-26 15:31:14 +13:00
parent 6290593857
commit 53adca4feb
1 changed files with 1 additions and 0 deletions

View File

@ -579,6 +579,7 @@ generate_img() {
# install mdadm/lvm2 into the target as it will start up system # install mdadm/lvm2 into the target as it will start up system
# daemons and prevent us from unmounting the target # daemons and prevent us from unmounting the target
packages=$(echo $packages | fmt -w1 | egrep -v "(mdadm|lvm2)") packages=$(echo $packages | fmt -w1 | egrep -v "(mdadm|lvm2)")
sudo chroot ${mnt} apt-get update
sudo chroot ${mnt} apt-get -y install $packages || { sudo chroot ${mnt} apt-get -y install $packages || {
log "Failed to install packages on rootfs"; log "Failed to install packages on rootfs";
return 1; return 1;