Skip to content

Commit

Permalink
Automatically update /etc/fstab with given part scheme
Browse files Browse the repository at this point in the history
  • Loading branch information
ayufan committed Apr 7, 2020
1 parent cb1d3a3 commit 98016fd
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions rootfs/make-rootfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,22 @@ EOF

cat > "$DEST/etc/fstab" <<EOF
LABEL=linux-root / ext4 defaults 0 1
LABEL=linux-boot /boot ext4 defaults 0 1
LABEL=boot-efi /boot/efi vfat defaults,sync 0 1
EOF

# Detect `/boot`
if findmnt "$DEST/boot"; then
cat >> "$DEST/etc/fstab" <<EOF
LABEL=linux-boot /boot ext4 defaults 0 1" >> "$DEST/etc/fstab"
EOF
fi

# Detect `/boot/efi`
if findmnt "$DEST/boot/efi"; then
cat > "$DEST/etc/fstab" <<EOF
LABEL=boot-efi /boot/efi vfat defaults,sync 0 1" >> "$DEST/etc/fstab
EOF
fi

cat > "$DEST/etc/hosts" <<EOF
127.0.0.1 localhost
127.0.1.1 $MODEL
Expand Down

0 comments on commit 98016fd

Please sign in to comment.