Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8038511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T03:15:36+00:00 2026-06-05T03:15:36+00:00

I feel like this is a fairly common problem, but I cannot find the

  • 0

I feel like this is a fairly common problem, but I cannot find the answer in my specific situation anywhere. I have a target like so:

initfs.tar: $(INITFS_FILES)
    rm -f ./initfs.tar
    cd initfs_root
    tar --format ustar --exclude-vcs -cf ../initfs.tar ./

INITFS_FILES is defined:

INITFS_FILES:=$(shell find ./initfs_root/ -not -path '*/.*/*' -not -name '.*' -type f)

Every time I call make initfs.tar, this target is run. No files are being touched in the initfs_root directory (and all files are found using that find command). initfs.tar is, indeed, created.

Does anyone have any idea as to why this is happening? It doesn’t make sense, to me, and according to all other posts which I have come across on the internet and my current expertise, I have everything correct (although, obviously, my expertise is lacking in the Makefile area 😉

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T03:15:39+00:00Added an answer on June 5, 2026 at 3:15 am

    Every command in make is executed in a new subshell for each command line. This means that the commands

    cd initfs_root
    tar --format ustar --exclude-vcs -cf ../initfs.tar ./
    

    are executed in two different subshells. The tar command is therefore not executed with the initfs_root directory as its working directory.

    You can avoid this by combining the two into one commandline:

    cd initfs_root; tar --format ustar --exclude-vcs -cf ../initfs.tar ./
    

    By the way, be careful if any files you are trying to tar have spaces in their path or name. Those will be split into multiple names in the variable $INITFS_FILES and your mechanism will break.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question seems to have been asked before, but I feel like my situation
I feel like the answer to this question is probably very simple, but I'm
I feel like this one should be easy but after numerous searches and attempts
I feel like this should be really really simple, but I'm completely stuck! In
I feel like this is something I should already know, but I'm just not
I feel like this is easy but I am missing something... Using jQuery, I
I feel like this should be a no brainer, but clearly I'm missing something...
I feel like this is a stupid question, but I can't think of a
I feel like this should be obvious to me, but for some reason I
I feel like this is quite delicate, I have various folders whith projects I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.